接收识别数据推荐使用MQTT协议实时订阅接收数据,而不是通过定时任务去定时查询设备的识别数据,mqtt接收数据的文档地址 http://47.99.190.254:8014/zh-cn/docs/introduction/introduction.html 。一个是设备上报的时间加上数据处理的耗时可能会比设置的时间有延迟,还有一个原因是如果定时任务请求过于频繁的话会被服务进行限制。
API前缀:详见简介
Path: /data/v1/data/dataTypeId
Method: GET
接口描述:
Query
参数名称 | 是否必须 | 示例 | 备注 |
---|---|---|---|
productKey | 是 | 产品key(二级目录) | |
deviceName | 否 | 设备名(UUID序列号) | |
dataTypeIdList | 是 | 162 | dataTypeId,列表详见 dataTypeId分类 |
startTimeStamp | 是 | 1540000000 | 开始时间戳,精确到秒,10位数字 |
endTimeStamp | 是 | 1590126304 | 开始时间戳,精确到秒,10位数字 |
currentPage | 是 | 1 | 当前页 |
pageSize | 是 | 20 | 每页大小 |
access_token | 是 | 访问令牌,获取步骤详见 获取或者刷新token |
这里的时间戳参数请严格按照时间戳格式提交,对时间戳不了解的可以参考 在线时间戳 。
{
"code": 200,
"msg": "OK",
"data": {
"content": [
{
"isGeneratePic": 0,
"periodId": "3d7f3b86-1738-436a-b022-225cfe0fd3c1",
"deviceName": "30839856d5d0",
"productKey": "UCe7yRmOxHo",
"deviceSecret": null,
"eventId": 1,
"dataTypeId": 162,
"deviceTypeCode": 8449,
"companyId": 1,
"applicationId": 1,
"applicationName": "app",
"version": null,
"networkType": 15,
"timeStamp": 1640681817,
"useCode": null,
"location": {
"description": null,
"longitude": null,
"latitude": null
},
"dataFrom": 0,
"meterNumber": null,
"unitList": [],
"magnificationList": [
1.0
],
"requestId": "53667ba2-46ec-4852-8793-3facc7fa58e8",
"messageId": null,
"createTime": "2021-12-28 16:56:57",
"data": {
"filetype": "video",
"path": "/video/UCe7yRmOxHo/30839856d5d0/2021/12/28/1640681817.mp4",
"meterPayloadCount": 0,
"meterDataCount": 3,
"electricity": "99.99",
"meterDataList": [
{
"afterPointCount": 2,
"value": 5,
"timestamp": 1640681817
},
{
"afterPointCount": 2,
"value": 4,
"timestamp": 1640681817
},
{
"afterPointCount": 2,
"value": 4,
"timestamp": 1640681817
}
]
},
"reserve": null,
"id": "61cad1598b37b9445a00a9bb"
}
],
"pageable": {
"sort": {
"sorted": true,
"unsorted": false,
"empty": false
},
"pageNumber": 0,
"pageSize": 1,
"offset": 0,
"paged": true,
"unpaged": false
},
"totalElements": 11089,
"totalPages": 11089,
"last": false,
"size": 1,
"number": 0,
"sort": {
"sorted": true,
"unsorted": false,
"empty": false
},
"numberOfElements": 1,
"first": true,
"empty": false
}
}
filetype
为文件类型,video
为视频,image
为图片,path
为文件路径,需要添加前缀
meterDataList
多值 依次代表最大值,最小值,平均值