@JeromeLiee
2019-10-15T16:29:35.000000Z
字数 8175
阅读 543
用于展示直播中心对抗赛的比赛数据统计
/dataAnalysis
字段 | 名称 | 类型 | 是否可为空 | 备注 |
---|---|---|---|---|
status | 比赛状态 | Integer | 否 | 0,1,分别表示赛前、非赛前(包括赛中和赛后) |
matchId | 比赛Id | Long | 否 | |
eventType | 返回的事件类型 | String | 可 | 默认为"1,2,3,12,4,5,6,7,9" (配合status=1时使用) 详见附1比赛事件值列表 |
flag | 比赛数据类型 | String | 可 | 默认为"7,11,4,1,10,14,9,6,13,12,2" (配合status=1时使用) 详见附2比赛数据类型对应表 |
{
"code": 0,
"msg": "Success",
"data": {
"info": {
"homeTeamName": "霍芬海姆",
"homeTeamLogo": "http://image.suning.cn/uimg/SDSP/team/285.png?v=1498717894170",
"homeTeamId": 285,
"homeTeamScore": 1,
"guestTeamName": "勒沃库森",
"guestTeamLogo": "http://image.suning.cn/uimg/SDSP/team/288.png?v=1498717892874",
"guestTeamId": 288,
"guestTeamScore": 2,
"matchAreaName": "本特戈蒂球场",
"playDuration": 39
},
"lineup": {
"homeTeamId": 123,
"guestTeamId": 321,
"homeFormation": "3-5-2",
"guestFormation": "4-4-2",
"players": [
{
"playerIcon": "http://image.suning.cn/uimg/SDSP/player/15052.jpeg?v=1498717991417",
"playerId": 15052,
"playerName": "施蒂利克",
"playerNum": "10",
"playerType": 3,
"position": "A2",
"teamId": 133,
"positionType": 1
"events":[
{
"eventTimeMinSec": "2:46",
"eventPlayerName": "鲁文·佩雷斯",
"relatePlayerName": "",
"relatePlayerId": "",
"teamFlg": "1",
"eventTimeStamp": "1551729831",
"eventPlayerNum": "21",
"eventTimeExtra": "0",
"teamId": "231",
"externalId": "1382575",
"eventPlayerId": "5162",
"relatePlayerNum": "",
"halfCode": "1",
"event": "22",
"sec": "46",
"updateDttm": "2019-03-05 06:58:56",
"eventName": "犯规",
"eventTime": "3"
},
{
"eventTimeMinSec": "3:36",
"eventPlayerName": "维佐",
"relatePlayerName": "",
"relatePlayerId": "",
"teamFlg": "2",
"eventTimeStamp": "1551729880",
"eventPlayerNum": "14",
"eventTimeExtra": "0",
"teamId": "1216",
"externalId": "1382593",
"eventPlayerId": "4739",
"relatePlayerNum": "",
"halfCode": "1",
"event": "26",
"sec": "36",
"updateDttm": "2019-03-05 06:58:57",
"eventName": "抢断成功",
"eventTime": "4"
}
]
},
{
"playerIcon": "http://image.suning.cn/uimg/SDSP/player/2789.jpeg?v=1498717980998",
"playerId": 2789,
"playerName": "杜佳",
"playerNum": "1",
"playerType": 1,
"position": "A6",
"teamId": 133,
"positionType": 1
"events":[
{
"eventTimeMinSec": "2:46",
"eventPlayerName": "鲁文·佩雷斯",
"relatePlayerName": "",
"relatePlayerId": "",
"teamFlg": "1",
"eventTimeStamp": "1551729831",
"eventPlayerNum": "21",
"eventTimeExtra": "0",
"teamId": "231",
"externalId": "1382575",
"eventPlayerId": "5162",
"relatePlayerNum": "",
"halfCode": "1",
"event": "22",
"sec": "46",
"updateDttm": "2019-03-05 06:58:56",
"eventName": "犯规",
"eventTime": "3"
},
{
"eventTimeMinSec": "3:36",
"eventPlayerName": "维佐",
"relatePlayerName": "",
"relatePlayerId": "",
"teamFlg": "2",
"eventTimeStamp": "1551729880",
"eventPlayerNum": "14",
"eventTimeExtra": "0",
"teamId": "1216",
"externalId": "1382593",
"eventPlayerId": "4739",
"relatePlayerNum": "",
"halfCode": "1",
"event": "26",
"sec": "36",
"updateDttm": "2019-03-05 06:58:57",
"eventName": "抢断成功",
"eventTime": "4"
}
]
}
]
},
"scoreAnalysis": [
{
"homeData": 43,
"guestData": 57,
"homeAverageData": 42,
"guestAverageData": 52,
"title": "控球率",
"flag": 1
},
{
"homeData": 1,
"guestData": 2,
"homeAverageData": 2,
"guestAverageData": 2,
"title": "进球",
"flag": 2
},
{
"homeData": 110,
"guestData": 120,
"homeAverageData": 142,
"guestAverageData": 152,
"title": "传球",
"flag": 9
}
],
"rankData": {
"home": {
"win": 0,
"draw": 0,
"lose": 2,
"score": 1,
"ranking": 13
},
"guest": {
"win": 0,
"draw": 0,
"lose": 2,
"score": 1,
"ranking": 13
}
},
"pkData": {
"draw": 0,
"guestTeamId": "137",
"homeTeamId": "133",
"lose": 4,
"win": 1
}
}
}
比赛基础信息,该接口涉及到的中台接口mock地址为比赛基础信息
"info": {
"homeTeamName": "霍芬海姆",
"homeTeamLogo": "http://image.suning.cn/uimg/SDSP/team/285.png?v=1498717894170",
"homeTeamId": 285,
"homeTeamScore": 1,
"guestTeamName": "勒沃库森",
"guestTeamLogo": "http://image.suning.cn/uimg/SDSP/team/288.png?v=1498717892874",
"guestTeamId": 288,
"guestTeamScore": 2,
"matchAreaName": "本特戈蒂球场",
"playDuration": 39
}
字段 | 名称 | 类型 | 对应中台接口的字段名称 |
---|---|---|---|
homeTeamName | 主队名称 | String | homeTeamName |
homeTeamLogo | 主队logo | String | homeTeamLogo |
homeTeamId | 主队id | Long | homeTeamId |
homeTeamScore | 主队比分 | Long | homeTeamScore |
guestTeamName | 客队名称 | String | guestTeamName |
guestTeamLogo | 客队logo | String | guestTeamLogo |
guestTeamId | 客队id | Long | guestTeamId |
guestTeamScore | 客队比分 | Long | guestTeamScore |
matchAreaName | 球场 | String | matchVenue对象中的areaNameCn字段(文档中未添加) |
playDuration | 比赛进度 | Long | 通过matchExtraInfo对象获取(文档中未添加,获取逻辑同信息接口) 详见附3数据JOSN及获取进度 |
阵容数据,当请求参数status=0时,该阵容为预测阵容,对应中台mock地址为预测阵容;当请求参数status=1时,对应中台mock地址为本场数据,以及比赛事件
"lineup": {
"homeTeamId": 123,
"guestTeamId": 321,
"homeFormation": "3-5-2",
"guestFormation": "4-4-2",
"players": []
}
字段 | 名称 | 类型 | 对应中台接口的字段名称 |
---|---|---|---|
homeTeamId | 主队id | Long | lineUpList对象homeTeamId字段 |
guestTeamId | 客队id | Long | lineUpList对象guestTeamId字段 |
homeFormation | 主队阵容 | String | lineUpList对象homeFormation字段 |
guestFormation | 主队阵容 | String | lineUpList对象guestFormation字段 |
players | 阵容人员列表 | Array | playList集合,详见Player对象 |
play对象
{
"playerIcon": "http://image.suning.cn/uimg/SDSP/player/15052.jpeg?v=1498717991417",
"playerId": 15052,
"playerName": "施蒂利克",
"playerNum": "0",
"playerType": 3,
"position": "A2",
"teamId": 133,
"events":[]
}
字段 | 名称 | 类型 | 对应中台接口的字段名称 |
---|---|---|---|
playerIcon | 球员头像 | String | playList集合中Player对象playerIcon字段 |
playerId | 球员id | Long | playList集合中Player对象playerId字段 |
playerName | 球员名称 | String | playList集合中Player对象playerName字段 |
playerNum | 球员号码 | String | playList集合中Player对象playerNum字段 |
playerType | 球员类型 | Long | playList集合中Player对象playerType字段 |
position | 球员位置 | String | playList集合中Player对象position字段 |
teamId | 球队id | Long | playList集合中Player对象teamId字段 |
positionType | 球员位置类型 | String | playList集合中Player对象positionType字段(1前锋2中场3后卫4门将) |
events | 事件集合 | Array | 比赛事件接口返回数据中的eventList集合,只返回该球员指定的事件,指定事件由参数eventType决定 |
数据统计,赛前只获取"场均数据",赛中及赛后需要结合"本场数据"和"场均数据",该接口涉及到的中台接口mock地址为本场数据和场均数据
{
"homeData": "43",
"guestData": "57",
"homeAverageData": "42",
"guestAverageData": "52",
"title": "控球率",
"flag": "1"
}
字段 | 名称 | 类型 | 对应本场数据中台字段 | 对应场均数据中台字段 |
---|---|---|---|---|
homeData | 主队数值 | String | 需要根据flag来判断 | 无 |
guestData | 客队数值 | String | 需要根据flag来判断 | 无 |
homeAverageData | 主队平均数值 | String | 无 | 需要根据flag来判断 |
guestAverageData | 客队平均数值 | String | 无 | 需要根据flag来判断 |
title | 数据名称 | String | guestTeamName | 详见附2比赛数据类型对应表 |
flag | 数据标记 | String | guestTeamLogo | 详见附2比赛数据类型对应表 |
队伍排名,中台接口mock地址为球队排名
"rankData": {
"home": {
"win": 0,
"draw": 0,
"lose": 2,
"score": 1,
"ranking": 13
},
"guest": {
"win": 0,
"draw": 0,
"lose": 2,
"score": 1,
"ranking": 13
}
}
主客队javabean相同
字段 | 名称 | 类型 | 对应中台字段 |
---|---|---|---|
win | 胜 | Long | 取对应主客队中的stat集合中type为0(全场)的data对象中winNum字段 |
draw | 平 | Long | 取对应主客队中的stat集合中type为0(全场)的data对象中drawNum字段 |
lose | 负 | Long | 取对应主客队中的stat集合中type为0(全场)的data对象中loseNum字段 |
score | 得分 | String | 取对应主客队中的stat集合中type为0(全场)的data对象中score字段 |
ranking | 排名 | String | 取对应主客队中的stat集合中type为0(全场)的data对象中ranking字段 |
主客队pk数据,中台mock地址为历史5场数据中homePkGuestList集合。
"pkData": {
"draw": 0,
"guestTeamId": 137,
"homeTeamId": 133,
"lose": 4,
"win": 1
}
附1.比赛事件值列表
1.进球 2.点球进球 3.乌龙球 4.换上 5.黄牌 6.红牌 7.两黄变一红 8.点球未进 9.换下 10.助攻 12.点球大战进球 13.点球大战未进 14.射门 15.角球 16.头球 17.任意球 18.扑救 19.手球 20.争议 21.越位 22.犯规 23.判罚点球 24.盘带突破 25.花式技巧 26.抢断成功 27.VAR介入 28.伤退
附2.比赛数据类型对应表
比赛数据类型flag | 对应本场数据接口字段 | 对应场均数据flag |
---|---|---|
1 射门 | shotsNum | 111 射门均值 |
2 黄牌 | yellowCardsNum | 117 黄牌均值 |
3 封堵 | blockedNum | 110 封堵均值 |
4 传球 | passNum | 114 传球均值 |
5 红牌 | redCardsNum | 118 红牌均值 |
6 抢断 | wonTackle | 115 抢断均值 |
7 控球率 | possessionRate | 1 控球率 |
8 点球 | penaltiesNum | 122 场均点球 |
9 任意球 | freeKicksNum | 123 场均任意球 |
10 射正 | shotsTargetNum | 112 射正均值 |
11 进球 | goalNum | 113 进球场均 |
12 犯规 | foulsNum | 119 犯规均值 |
13 越位 | offsidesNum | 120 场均越位 |
14 角球 | cornersNum | 121 场均角球 |
15 传球成功率 | passPossession | 27 传球成功率 |
场均数据接口flag列表:
1.控球率 2.进球次数 3.助攻次数 4.封堵次数 5.黄牌次数 6.红牌次数 7.射门次数 8.射正次数 9.传球次数 10.关键传球次数 11.传球成功数 12.越位次数 13.拦截次数 14.抢断次数 15.解围次数 16.犯规次数 17.被犯规次数 18.扑救次数 19.获得点球数 20.获得任意球数 21.角球数 22.被判点球数 23.被判任意球数 24.传中成功率(25/24计算) 25.击中门框次数 26.进球次数 27.传球成功率 45.失球数 110.封堵均值 111.射门均值 112.射正均值 113.进球均值 114.传球均值 115.抢断均值 116.解围均值 117.黄牌均值 118.红牌均值 119.犯规均值 120.场均越位 121.场均角球 122.场均点球 123.场均任意球 107.球队平均年龄
附3.数据JOSN及获取进度表
matchExtraInfo对象json
// fh 上半场
// sh 下半场
// efh 补时上半场
// esh 补时下半场
"matchExtraInfo": {
"updater": "JOB_RUNNER",
"efhMinLength": 0,
"shSecLength": 2,
"shEndTime": 1553633934000,
"createDttm": 1553627052000,
"fhStartTime": 1553627027000,
"eshMinLength": 0,
"fhSecLength": 2,
"shMinLength": 49,
"efhSecLength": 0,
"creator": "JOB_RUNNER",
"eshSecLength": 0,
"fhEndTime": 1553629909000,
"shStartTime": 1553630992000,
"updateDttm": 1553637536000,
"matchId": 263696,
"fhMinLength": 48
}
// 获取比赛进度,上半场不超过45分钟,全场不超过90分钟
public long getPlayDuration(){
long playDuration = 0;
// 为0则表示下半场未开始
if (matchExtraInfo.getShStartTime() == 0) {
// 上半场开始时间也为0,则返回0
if (matchExtraInfo.getFhStartTime() == 0) {
return playDuration;
}
playDuration = (System.currentTimeMillis() - matchExtraInfo.getFhStartTime()) / 1000 / 60;
// 上半场的时间进度为1~45分钟
playDuration = playDuration == 0 ? 1 : playDuration;
playDuration = playDuration > 45 ? 45 : playDuration;
} else {
playDuration = 45 + (System.currentTimeMillis() - matchExtraInfo.getShStartTime()) / 1000 / 60;
// 下半场的时间进度为46~90分钟
playDuration = playDuration == 45 ? 46 : playDuration;
playDuration = playDuration > 90 ? 90 : playDuration;
}
return playDuration;
}