README.md 9.9 KB
Newer Older
S
1.xxx  
shi.zeyuan 已提交
1

S
shi.zeyuan 已提交
2
##AI足球大数据爬虫分析一体化GO项目
S
1.xxx  
shi.zeyuan 已提交
3

M
monomania 已提交
4
## 项目地址
M
monomania 已提交
5
* [https://gitee.com/aoe5188/foot](https://gitee.com/aoe5188/foot)
M
monomania 已提交
6

M
monomania 已提交
7
## 项目介绍
S
1.xxx  
shi.zeyuan 已提交
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
```
热衷于足球多年,之余也会去研究一下,时间久了,都会有自己的心得.
但不可能每次都那么费劲的自己人工去看盘分析,
所以结合所学,就有这个项目.
```

```
foot-parent 是一个集足球数据采集器,简单分析,同步到微信及其他发布平台一体化的项目.
程序采用go语言开发,项目结构清晰完整,非常容易入手并进行二次开发分析.
```

## 项目为什么开源?
~~~
让有编程能力的朋友,同样爱好足球的朋友,也可以参与进来.

大家购彩多年,都有自己购彩的心得.
如果大家将这些心得,集中起来,形成一个模型习惯算法库.进行持续优化.
再交给机器来对之前的大数据量的比赛进行复盘学习,学习过程中对各种模型习惯进行加权重加评分.
是否是一个比较有价值的预测东西,,,或只是个人妄想而已.哈哈 
~~~

##如该项目对你有帮助,请给一个star,谢谢!

S
1.xx  
shi.zeyuan 已提交
31 32
## 公众号演示
 * 公众号: AI球探(ai00268)
加钱居士.'s avatar
加钱居士. 已提交
33
 >> ![](https://images.gitee.com/uploads/images/2020/0413/190211_5a77af19_1880617.jpeg "go mod")
S
1.xx  
shi.zeyuan 已提交
34
## 战绩截图
加钱居士.'s avatar
加钱居士. 已提交
35 36
<img src="https://images.gitee.com/uploads/images/2020/0413/190211_4c4104ef_1880617.png" width="180px">
<img src="https://images.gitee.com/uploads/images/2020/0413/190211_3e625fe9_1880617.png" width="180px">
S
1.xx  
shi.zeyuan 已提交
37

S
1.xxx  
shi.zeyuan 已提交
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
##目前程序已经完成了对很多足球相关数据荐的收集,包括且不仅限于:
* 所有的联赛信息,
* 球队信息,
* 今日比赛列表,
* 自动更新比赛结果,
* 所有亚指的数据,
* 所有的亚指的变化数据,
* 部分欧指数据,(可配置)
* 部分欧指数据的变化过程(可配置),
* 对阵双方的积分榜收集,
* 对阵双方的对战历史,
* 对阵双方的近30场战绩,
* 对阵双方的未来三场赛事.

##项目中同时也提供一些分析示例,都是个人及一些网友的忙得,且在持续更新中:
###模型说明
* A1模型  
  >> A1模型分析算法,以亚指指数为校验基准,为亚欧盘联动变化过程不符合模型设定值时,产生.
* A2模型  
  >> A2模型分析算法,以亚指指数为校验基准,比较复杂,开发实现中...
* C1模型  
  >> C1模型分析算法,以亚指指数为校验基准,纯基本面分析.
  >> 通过基本面计算出让球(BF让球),与盘口让球对比是否在合理范畴内
* E1模型  
  >> E1模型分析算法,以亚指指数为校验基准,比较复杂,暂无说明.
* E2模型  
  >> E2模型分析算法,以胜平负为校验基准,由于是单边防平双选,因此结果非对即错.
  >> 为公众号主推模型,望大家长期关注,对比历史查看.
* Q1模型  
  >> Q1模型分析算法,以亚指指数为校验基准,由网友(强)提供,逻辑简单有效,经长测表现稳定.
  >> 分析算法逻辑,对比计算对竞彩官方与***波菜的即时盘赔率得出预测结果.
  >> 目前只可在待选池中可查看,未加入到推荐列表中.

M
monomania 已提交
71 72 73 74 75

## 技术选型
* [xorm](https://github.com/go-xorm/xorm)
* [go_spider](https://github.com/hu17889/go_spider)
* [beego](https://github.com/astaxie/beego)
M
monomania 已提交
76
* [walk](https://github.com/lxn/walk)
M
monomania 已提交
77
* [go版wechat sdk](https://github.com/chanxuehong/wechat)
M
monomania 已提交
78

S
1.xx  
shi.zeyuan 已提交
79

M
monomania 已提交
80 81
## 项目结构
~~~
S
1.xxx  
shi.zeyuan 已提交
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
|-- assets 素材文件夹
|   |-- common
|   |   `-- template
|   |       `-- analycontent 主要用于生成推荐文字说明内容
|   |-- leisu
|   |   `-- html 
|   `-- wechat
|       |-- html  发布公众号使用到的素材html
|       `-- img   发布公众号使用到的素材图片
|-- bin     一键打包的存放目录
|   |-- assets
|   |   |-- common
|   |   |   `-- template
|   |   |       `-- analycontent
|   |   |-- leisu
|   |   |   `-- html
|   |   `-- wechat
|   |       |-- html
|   |       `-- img
|   `-- conf
|-- conf    配置文件夹
|-- foot-api  实体类项目,用于存放模块的载体类
|   |-- common
|   |   `-- base
|   |       `-- pojo
|   `-- module
|       |-- analy
|       |   |-- pojo
|       |   `-- vo
|       |-- core
|       |   `-- pojo
|       |-- elem
|       |   `-- pojo
|       |-- match
|       |   `-- pojo
|       |-- odds
|       |   `-- pojo
|       `-- suggest
|           |-- enums
|           |-- pojo
|           `-- vo
|-- foot-core  核心库,用于提供数据库CRUD的功能,及对接第三方网络的功能
|   |-- common 通用库
|   |   |-- base 
|   |   |   |-- controller
|   |   |   `-- service
|   |   |       `-- mysql
|   |   |-- fliters
|   |   |-- routers
|   |   `-- utils
|   |-- launch
|   |-- module
|   |   |-- analy  分析模型模块
|   |   |   |-- constants
|   |   |   `-- service
|   |   |-- check
|   |   |   `-- sql
|   |   |-- core
|   |   |   `-- service
|   |   |-- elem
|   |   |   `-- service
|   |   |-- index
|   |   |   `-- controller
|   |   |-- leisu
|   |   |   |-- constants
|   |   |   |-- controller
|   |   |   |-- service
|   |   |   |-- utils
|   |   |   `-- vo
|   |   |-- match 提供赛事的相关数据库操作
|   |   |   |-- controller
|   |   |   `-- service
|   |   |-- odds  提供指数的相关数据库操作
|   |   |   `-- service
|   |   |-- spider
|   |   |   `-- constants
|   |   |-- suggest  用于获取推荐的比赛列表
|   |   |   `-- service
|   |   |-- tesou  无用
|   |   |   |-- constants
|   |   |   |-- service
|   |   |   |-- utils
|   |   |   `-- vo
|   |   `-- wechat  微信发布相关
|   |       |-- constants
|   |       |-- controller
|   |       `-- service
|   `-- test
|       `-- bson
|-- foot-gui
|   `-- handler
|-- foot-robot
|   `-- helper
|-- foot-spider 足球相关赛事指数数据的爬虫模块
|   |-- common
|   |   `-- base
|   |       `-- down
|   |-- launch
|   `-- module
|       `-- win007
|           |-- down
|           |-- proc
|           `-- vo
|-- foot-web
`-- logs

M
monomania 已提交
188 189 190 191 192
~~~
## 模块依赖
  
  | 模块名    |  依赖模块     |
  | --------    | :----:   |
S
1.xxx  
shi.zeyuan 已提交
193 194 195
  | foot-api      |无|
  | foot-core    |foot-api|
  | foot-gui     |foot-core|
M
monomania 已提交
196
  | foot-spider  |foot-core|
S
1.xxx  
shi.zeyuan 已提交
197
  | foot-web     |暂无|
M
monomania 已提交
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
   
## 使用教程

* 配置环境
  * 安装 go
    * 配置GOPATH
  * 环境变量
    
  | 变量名称=值    |  说明     |
  | --------    | :----:   |
  | GO111MODULE=on  |开启go mod模块支持|
  | GOPROXY=https://goproxy.cn,direct     |依赖包下载代理地址|
  | GOSUMDB=sum.golang.google.cn     |包的哈希值校验地址|
  
* 导入项目到[JetBrains GoLand](https://www.jetbrains.com/go/)并启用go mod
加钱居士.'s avatar
加钱居士. 已提交
213
  >> ![](https://images.gitee.com/uploads/images/2020/0413/190211_94a51eee_1880617.png "go mod")
M
monomania 已提交
214 215
* 下载资源包
    ```
216 217
      cd ./foot-api && go mod tidy
      cd ../foot-core && go mod tidy
M
monomania 已提交
218
      cd ../foot-gui && go mod tidy
219 220
      cd ../foot-spider && go mod tidy
      cd ../foot-web && go mod tidy
M
monomania 已提交
221 222 223 224 225
    ```
* 手动创建数据库
  
  数据库名为: foot 
* 配置数据库连接
M
monomania 已提交
226 227 228
  * conf文件修改配置
    * ./conf/app.ini
     >>>> 详情看配置文件内的说明
M
monomania 已提交
229
* 同步数据库表
M
monomania 已提交
230
     * FC001DBInitApplication.go 
M
monomania 已提交
231
      
S
1.xxx  
shi.zeyuan 已提交
232
## 主要入口
M
monomania 已提交
233 234 235 236 237 238 239 240
  *  build_linux.bat            一键打包linux发布程序
  *  build_windows.bat          一键打包windows发布程序
  *  FC000Application.go        运行beego
  *  FC001DBInitApplication.go  数据库表同步初始化
  *  FC002AnalyApplication.go   运行结果分析    
  *  FOOT000.go                 linux入口(主要使用)
  *  FOOT000CmdApplication.go   windows入口(主要使用)
  *  FS000Application.go        运行数据爬虫
M
monomania 已提交
241

S
1.xxx  
shi.zeyuan 已提交
242 243 244 245
## 本地调试运行
~~~
1. 创建数据库foot
2. FC001DBInitApplication.go  同步数据库表
S
shi.zeyuan 已提交
246
3. FS000Application.go 运行数据爬虫
S
1.xxx  
shi.zeyuan 已提交
247 248 249 250 251 252 253
4. FC002AnalyApplication 分析得出推荐列表
~~~
## 打包部署
~~~
1.运行build_linux.bat 进行打包
2.FOOT000 auto        启动
~~~
M
monomania 已提交
254

加钱居士.'s avatar
加钱居士. 已提交
255
## 历年足球数据下载
M
monomania 已提交
256 257 258 259 260 261 262 263
~~~
足球历年数据,数据的年份范围为:2010-2020. 10年间的数据.没有杯赛,友谊赛,联赛次级的数据.
包含澳门,bet365,威廉,立博等多菠菜公司的欧赔数据.
当前数据提供的有
csv文件,可自行转excel.
sql文件,可自行导入自己的mysql库中.
~~~

加钱居士.'s avatar
加钱居士. 已提交
264
## $ Mysql 文件
M
monomania 已提交
265 266 267
* 链接:[https://pan.baidu.com/s/1DSva_tkTB433iRtmbg7q0w ](https://pan.baidu.com/s/1DSva_tkTB433iRtmbg7q0w ) 
* 提取码:wmwl

加钱居士.'s avatar
加钱居士. 已提交
268
## $ Mysql 表说明
M
monomania 已提交
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289
  | 	表名  | 	数据行数| 	表说明	   | 
  | ----------- | :--------------:| ---------------------| 
  | 	t_asia_track	| 	2702052	| 	亚赔变化表	| 
  | 	t_euro_his	| 	2186160	| 	欧赔历史表(只有各家初即数据)	| 
  | 	t_asia_his	| 	2039445	| 	亚赔历史表(只有各家初即数据)	| 
  | 	t_b_f_score	| 	1485341	| 	积分榜数据表	| 
  | 	t_b_f_future_event	| 	1000137	| 	未来赛事表	| 
  | 	t_euro_track	| 	917214	| 	欧赔变化表(部分历史比赛己无法获取)	| 
  | 	t_b_f_jin	| 	497977	| 	近期战绩表	| 
  | 	t_match_his	| 	397253	| 	比赛数据表	| 
  | 	t_b_f_battle	| 	356232	| 	主客队对战历史表	| 
  | 	t_analy_result	| 	123793	| 	分析预测结果表	| 
  | 	t_league_sub	| 	23953	| 	联赛次级表	| 
  | 	t_league_season	| 	9550	| 	联赛赛季表	| 
  | 	t_match_last	| 	3056	| 	比赛临时表	| 
  | 	t_league	| 	1149	| 	联赛表	| 
  | 	t_asia_last	| 	155	| 	亚赔临时表	| 
  | 	t_comp	| 	40	| 	波菜公司表	| 
  | 	t_euro_last	| 	36	| 	欧赔临时表	| 
  | 	t_pub	| 	0	| 	无用	| 

加钱居士.'s avatar
加钱居士. 已提交
290 291 292 293 294 295
## $ Mysql 数据截图
> 1. <img src="https://images.gitee.com/uploads/images/2020/0413/190211_64977560_1880617.png" width="180px">
> 2. <img src="https://images.gitee.com/uploads/images/2020/0413/190211_33ff97ee_1880617.png" width="180px">
> 3. <img src="https://images.gitee.com/uploads/images/2020/0413/190211_3863d3cc_1880617.png" width="180px">

## $ CSV 20W行版本
M
monomania 已提交
296 297 298
* 链接:[https://pan.baidu.com/s/1t8RtDtlk38MxZzsnNmrRlg](https://pan.baidu.com/s/1t8RtDtlk38MxZzsnNmrRlg) 
* 提取码:a0kw

加钱居士.'s avatar
加钱居士. 已提交
299
## $ CSV 4W行版本
M
monomania 已提交
300 301
* 链接:[https://pan.baidu.com/s/1-70U-_gm26s2RcjWNooebg](https://pan.baidu.com/s/1-70U-_gm26s2RcjWNooebg) 
* 提取码:2fdm
M
monomania 已提交
302