Skip to content

广州车牌摇号小助手,帮助你查询摇号结果,每个月帮你延期摇号申请,中签后自动停止服务。Automatic License Plate Lottery (ALPL) is a license plate lottery assistant for Guangzhou. It can help you check the lottery results, extend the lottery application every 3 months, and automatically stop the service after winning the lottery.

License

Notifications You must be signed in to change notification settings

PaRaD1SE98/OpenALPL

Repository files navigation

广州车牌摇号小助手

2021.12.2更新:由于官网操作延期申请添加了手机验证码步骤,本工具目前不再支持自动延期,但是仍然支持每月自动查询和邮件通知

本文均用CentOS7部署,建议使用相同系统增加部署成功率

1.基本用法,直接使用python运行

安装虚拟环境和依赖

venv

python -m venv venv

source venv/bin/activate

pip install -r requirements/base.txt

配置账号

_credentials.sample后缀改为.py并填入相关值

尝试运行定时任务

运行schedule.py

跑起来后配置账号里填写的邮箱会收到服务启动邮件

部署到linux服务器,用supervisor后台托管

安装supervisor

pip3 install supervisor

创建目录

mkdir -p ~/etc/supervisor/conf.d
mkdir -p ~/etc/supervisor/var/log

生成 supervisor 配置文件

cd ~/etc
echo_supervisord_conf > supervisord.conf

修改配置文件 supervisor.conf

[unix_http_server]
file=/home/parad1se/etc/supervisor/var/supervisor.sock   ; the path to the socket file

[supervisord]
logfile=/home/parad1se/etc/supervisor/var/log/supervisord.log ; main log file; default $CWD/supervisord.log
pidfile=/home/parad1se/etc/supervisor/var/supervisord.pid ; supervisord pidfile; default supervisord.pid
user=parad1se            ; setuid to this UNIX account at startup; recommended if root```

[supervisorctl]
serverurl=unix:///home/parad1se/etc/supervisor/var/supervisor.sock ; use a unix:// URL  for a unix socket

[include]
files = /home/parad1se/etc/supervisor/conf.d/*.ini

创建GZCPYHXZS项目配置文件

注意将路径改为符合自己系统的

cd /home/parad1se/etc/supervisor/conf.d
sudo vim GZCPYHXZS.ini

粘贴并保存

[program:GZCPYHXZS]
command=python schedule.py
directory=/home/parad1se/apps/GZCPYHXZS
environment= PATH="/home/parad1se/apps/GZCPYHXZS/venv/bin/"
autostart=true
autorestart=unexpected
user=parad1se
stdout_logfile=/home/parad1se/etc/supervisor/var/log/GZCPYHXZS-stdout.log
stderr_logfile=/home/parad1se/etc/supervisor/var/log/GZCPYHXZS-stderr.log
启动supervisor
supervisord -c ~/etc/supervisord.conf
进入supervisor控制台
supervisorctl -c ~/etc/supervisord.conf
在控制台内运行
supervisor>
supervisor> update
supervisor> 

2.使用docker部署并使用tensorflow-serving

为了提高运行效率和稳定性,同时也为增加部署成功率,使用docker部署本项目

安装docker和docker-compose,将当前用户添加到docker组,启动docker服务

$ sudo yum install -y docker docker-compose
$ sudo usermod -aG docker ${USER}
$ sudo systemctl start docker

退出并重新连接服务器(这一步很重要)

项目设置

如果没有配置账号,请先配置账号

settings.py中添加或更改ENABLE_TF_SERVING = True

supervisor设置

使用前面supervisor安装设置方法安装并配置, 将配置文件修改为

[program:GZCPYHXZS]
command=docker-compose -f production.yml up --build  
directory=/home/parad1se/apps/GZCPYHXZS
autostart=true
autorestart=unexpected
user=parad1se
stdout_logfile=/home/parad1se/etc/supervisor/var/log/GZCPYHXZS-stdout.log
stderr_logfile=/home/parad1se/etc/supervisor/var/log/GZCPYHXZS-stderr.log

如果你已经用基本用法部署好了,现在改为docker部署,需要执行rereadupdate使配置生效

$ supervisorctl -c ~/etc/supervisord.conf
supervisor> reread
supervisor> update

如果容器不能启动,可以尝试重启服务器

重启后记得执行下面的命令启动docker和supervisor进程

$ sudo systemctl start docker
$ supervisord -c ~/etc/supervisord.conf

再执行下面的命令查看进程运行情况

$ supervisorctl -c ~/etc/supervisord.conf
supervisor> status

也可以进入supervisor设置里的stdout和stderr文件查看日志

vim /home/parad1se/etc/supervisor/var/log/GZCPYHXZS-stdout.log

额外功能

训练自己的验证码识别器

安装开发依赖pip install -r requirements/dev.txt

将获取到的验证码按命名格式2AHN_20210504-171258.JPEG放在src/success_image

运行python train_my_model.py

生成的logs文件夹可用tensorboard打开,评估训练结果 tensorboard --logdir logs

About

广州车牌摇号小助手,帮助你查询摇号结果,每个月帮你延期摇号申请,中签后自动停止服务。Automatic License Plate Lottery (ALPL) is a license plate lottery assistant for Guangzhou. It can help you check the lottery results, extend the lottery application every 3 months, and automatically stop the service after winning the lottery.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published