EMP消息推送介绍
因为硬件的特殊性和接入方的业务需求及便利性,平台还提供了硬件事件消息推送能力。针对硬件主动触发的事件,如:硬件进出围栏、硬件低电量、硬件轨迹上报、硬件上线、硬件测量体温、硬件考勤等。
由EMP系统主动推向接入方,接入方被动接收EMP消息。极大便利了接入方的业务灵活性和提高了开发效率。
兔盯云企业后台推送地址配置指南
步骤概述
登录兔盯云企业后台。
导航至 应用管理。
在 新增/修改 页面录入推送地址。
样例介绍
根据你选择的推送方式(HTTP 或 RabbitMQ),请按照以下格式填写推送地址及相关信息。
1. HTTP
2. RabbitMQ 推送地址
收到 EMP 推送消息后的回复指南
在接收到 EMP 系统推送的消息后,请根据你使用的推送方式(HTTP 或 RabbitMQ)按照以下格式进行回复。
1. HTTP 方式
请求方法
请求体格式
使用 JSON 格式的请求体进行回复。请确保 Content-Type 头设置为 application/json。
{
"status": 0,
"message": "ok"
}
2. RabbitMQ 方式
在处理完 RabbitMQ 消息后,请返回一个布尔值 true,以确认消息已被成功处理。
return true
EMP消息推送数据体如下
睡眠
{
"data":{
"created":"数据上报时间",
"end_time":"睡眠结束时间",
"imei_sn":"设备号",
"sleep_time":"124-353",
"sleep_type":4,//1 深度睡眠,2 浅睡眠,3 醒来时长, 4:深睡与浅睡 = sleeptime = 深睡-浅睡
"start_time":"睡眠开始时间",
"uuid":"设备uuid"
},
"router":"device.sleep"
}
考勤
{
"data":{
"imei_sn": "设备号",
"attence_sn": "2.4G考勤号",
"code": "0-进校,上车; 1-离校,下车;2-进校(卡电量低);3-离校(卡电量低)",
"gatebrake": "考勤机的设备号",
"created": "考勤时间",
"uuid":"设备uuid"
},
"router":"attence.create"
}
血压
{
"data":{
"imei_sn": "设备号",
"blood_rate": "低压-高压",
"uuid": "设备UUID",
"created": "测量时间",
},
"router":"device.blood"
}
心率
{
"data":{
"imei_sn": "设备号",
"heart_rate": "心率",
"created": "测量时间",
"uuid":"设备uuid"
},
"router":"device.heart"
}
低电量告警
低电量告警规则
当设备电量低于20%时判定为低电量,告警一次
当设备电量低于10%时,判定为低电量,告警一次
当设备电量低于5%时,判定为低电量,告警一次
满三次告警,不再告警。
{
"data":{
"imei_sn": "设备号",
"uuid":"设备uuid",
"power_rate": "电量",
"power_time": "时间",
},
"router":"device.lowpower"
}
SOS
{
"data":{
"imei_sn": "设备号",
"uuid":"设备uuid",
"lat": "纬度",
"lng": "经度",
"province_id": "省ID",
"city_id": "市ID",
"discrict_id": "区/县ID",
"locate_type": "定位模式 1:GPS 2:BTS(基站) 3:WIFI 4:未知",
"locate_time": "定位时间",
"address": "sos告警所在地",
"sos_time": "sos告警时间",
},
"router":"device.sos"
}
//注:当产生sos告警时未获取到位置时则无相关位置信息
{
"data":{
"imei_sn": "设备号",
"uuid":"设备uuid",
"sos_time": "sos告警时间",
},
"router":"device.sos"
}
计步
{
"data":{
"imei_sn": "设备号",
"step_rate": "步数",
"uuid": "设备UUID",
"created": "时间"
},
"router":"device.step"
}
体温
{
"data":{
"temperature": "体温",
"imei_sn": "设备号",
"uuid": "设备UUID",
"appkey": "设备所属的APPKEY",
"created": "测量时间",
},
"router":"device.temperature"
}
微聊
{
"data":{
"imei_sn": "设备号",
"uuid":"设备uuid",
"wchat_audio_uri": "微聊音频文件url",
"duration": "音频文件时长",
"created": "发送时间",
},
"router":"device.wchat"
}
围栏
{
"data":{
"imei_sn":"设备号",
"uuid":"设备uuid",
"lat":"纬度",
"lng":"经度",
"locate_time": "最新一次的定位时间",
"locate_type": "定位模式 1:GPS 2:BTS(基站) 3:WIFI 4:未知",
"address": "所在地址",
"radius":"",
"direction":"in:进入围栏,out:离开围栏",
"fence_id":0,//围栏ID
"fence_truename":"围栏名称"
},
"router":"fence.warning"
}
当前有效轨迹(当前位置)
{
"data":{
"imei_sn": "设备号",
"uuid": "设备uuid",
"province_id": 0,
"city_id": 0,
"district_id": 0,
"lat": "纬度",
"lng": "经度",
"radius": "",
"direction": "地址",
"address": "地址",
"speed": "",
"locate_lrd": ""
"locate_type": "定位模式 1:GPS 2:BTS(基站) 3:WIFI",
"locate_time": "定位时间"
},
"router":"track.create"
}
运动数据
{
"data":{
"anaerobic_duration": 0,/* 无氧 单位秒 没有默认传0*/
"appkey": 1000,
"av_heart_rate": 75, /* 平均心率 没有默认传0*/
"av_speed": 1.49,/* 平均速度 */
"calorie": 65,/* 消耗卡路里 千卡 int 没有默认传0*/
"consume_duration": 0,/* 消耗脂肪时长 单位秒 没有默认传0*/
"created": "2026-01-08 14:16:41",
"danger_duration": 0,/* 危险 单位秒 没有默认传0*/
"date": "2025-12-30",/*运动日期 date格式 示例:‘2024-04-25’*/
"duration": 2333,/* 运动时长,秒 int*/
"end_time": "2025-12-30 18:19:51",/* 运动结束时间 时间戳格式,秒*/
"frequency": 0,/* 步频 步/分,没有默认传0*/
"gps_exercise": { //gps运动数据
"gps_exercise_point": [
{
"ispause": false,//是否为暂停点
"lat": 34.7523,//纬度
"lng": 113.734604,//经度
"locatetime": "2025-12-30 17:42:35" // 定位时间
},
{
"ispause": false,
"lat": 34.752361,
"lng": 113.734496,
"locatetime": "2025-12-30 17:42:40"
},
{
"ispause": false,
"lat": 34.752386,
"lng": 113.734123,
"locatetime": "2025-12-30 17:42:45"
}
]
},
"heart_lung_duration": 0,/* 心肺提高 单位秒 没有默认传0*/
"high_speed": "00’17”",/* 最高速度 */
"id": "ccd4de39655e330e4710d1f374524bb1",
"imei_sn": "9621354498",
"low_speed": "04’32”",/* 最低速度 */
"max_heart_rate": 100, /* 最大心率 没有默认传0*/
"mileage": 9.39, /* 里程 KM 没有默认传0*/
"min_heart_rate": 62,/* 最小心率 没有默认传0*/
"pace": 0, /* 步幅 单位厘米,没有默认传0*/
"partner_id": 0,
"peisu": "00’40”",/* 运动配速 */
"single_lap_distance": 0,/* 单圈距离 没有默认传0*/
"single_lap_duration": 0,/* 单圈时长 单位秒 没有默认传0*/
"single_lap_speed": "00:00:00",/* 单圈配速 单位秒 没有默认传0*/
"speed": 0,/* 速度 没有默认传0*/
"sport_laps": 0, /* 运动圈数 没有默认传0*/
"start_time": "2025-12-30 17:40:57",/* 运动开始时间,时间戳格式,秒 */
"step": 0,/* 步数 没有默认传0*/
"type": 4, /* 运动类型,0-未知,1-户外跑步,2-室内跑步,3-户外健走,4-户外骑行,5-室内骑行,6-瑜伽,7-健身操 */
"uuid": "",
"warm_up_duration": 0/* 热身时长 单位秒 没有默认传0*/
},
"router":"device.exercise"
}
运动目标配置
{
"data":[
{
"target_time": 5, //目标时长,单位分钟,(5-240分钟)int类型
"target_distance": 0.5, //运动距离目标,单位公里,(0-100公里)int类型
"target_calorie": 200, //消耗热量,单位千卡,(100-5000千卡)int类型
"target_step": 0, //运动步数,单位千步,(1-100千步)int类型
"type": 2 //运动类型 0-未知,1-户外跑步,2-室内跑步,3-户外健走,4-户外骑行,5-室内骑行,6-瑜伽,7-健身操
},
{ "target_time": 15, "target_distance": 0, "target_calorie": 300, "target_step": 0, "type": 5 },
{ "target_time": 5, "target_distance": 0.5, "target_calorie": 0, "target_step": 0, "type": 1 },
{ "target_time": 5, "target_distance": 1, "target_calorie": 200, "target_step": 0, "type": 4 },
{ "target_time": 0, "target_distance": 0, "target_calorie": 0, "target_step": 0, "type": 7 },
{ "target_time": 5, "target_distance": 0.5, "target_calorie": 0, "target_step": 1, "type": 3 }
],
"router":"device.exercise.target"
}