1. 告警信息
- topic功能描述:订阅告警信息;
- topic:ks/proxy/alert/+(表示订阅所有设备的告警信息)或者ks/proxy/alert/device_id(表示订阅指定device_id的设备的告警信息);
- 对应平台位置:【数字大屏】右侧【实时监测】模块
- 响应示例。
项目 | 详情 |
---|---|
报文格式 | JSON |
报文内容 | { "msg_id": "uuid", "msg_type": "alert", "time": "发送时间", "data": { "alert_time": "时间戳", "device_id": "设备ID", "device_name": "设备名称", "device_desc": "设备描述", "source_id": "摄像头ID,对应新增摄像头的ID", "source_ipv4": "摄像头IP", "source_desc": "摄像头描述", "alg_name": "算法英文名称", "alg_ch_name": "算法中文名称", "image": "图片路径,访问需要加上代理http://云平台IP:9192/staticdata+图片路径", "reserved_data": "人脸告警才有数据", "hazard_level": "危害等级", "status": "摄像头状态"// 1: 启用,-1:停用 } } |
reserved_data | { group:{ "id": "666825ae5dc58a319bb9c1e8", "name": "分组名称", }, face:[{ "id": "6594e027522e4bbbcfe12194(唯一ID)", "name": "姓名", "age": "年龄", "sex": "性别", "desc": "描述", "update_time": "时间戳", "lib_image": "底库人脸图片", "cap_image": "抓拍人脸图片", "conf": "比对置信度" } ] } |
2. 实时结果
获取实时检测结果可视化代码(点击此处跳转)
- topic功能描述:订阅实时分析结果(播放流时产生MQTT消息);
- topic:ks/proxy/result/+(表示订阅所有设备的实时分析结果)或者ks/proxy/result/device_id(表示订阅指定device_id的设备的实时分析结果);
- 对应平台位置:【数字大屏】
- 响应示例。
项目 | 详情 |
---|---|
报文格式 | JSON |
报文内容 | { "msg_id": "uuid", "msg_type": "result", "time": "2024-01-23 10:25:36.216528", "data": { "time": "1705976735.391402", "hit": false, "hazard_level": "", //危险等级 "source": { "id": "摄像头id", "ipv4": "摄像头ip", "desc": "摄像头描述" }, "device": { "id": "设备id", "name": "设备名称", "desc": "设备描述" }, "alg": { "name": "算法英文名称", "ch_name": "算法中文名称", }, "reserved_data": { "bbox": { "rectangles": [{ "xyxy": [680, 198, 1178, 696], //左上角、右下角坐标 "color": [0, 0, 255], //BGR颜色 "conf": 0.91, //置信度 "label": "未佩戴安全帽", //标签 "ext": {} //扩展字段 } ] //矩形数组 "polygons": { "xxxxxx": { //多边形id "name": "离岗检测", //多边形名称 "color": [0, 0, 255], //BGR颜色 "polygon": [ //顶点坐标 [568, 205], [920, 140], [843, 471], [576, 471] ], "ext": {} //扩展字段 } } //多边形对象 "lines": { "xxxxxx": { //线段id "name": "线段1", //线段名称 "line": [[680, 198, ], [1178, 696]], //顶点坐标 "color": [0, 0, 255], //BGR颜色 "ext": {} //扩展字段 } } //线段对象 } } } } |
3. 平台状态
- topic功能描述:订阅平台发送的各类状态消息,这些消息包括:设备上下线、平台联网状态、设备数据源信息(当设备的数据源发生变更时);
- topic:ks/proxy/message;
- 响应示例。
项目 | 详情 |
---|---|
报文格式 | JSON |
设备上下线报文内容 | { "msg_id": "uuid", "msg_type": "device_status", "time": "发送时间", "data": { "device_id":"d847a577-3e04-42bd-8cb9-c630b5dfbfc8", "status":0 // 0离线 1在线 } } |
平台联网状态报文内容 | { "msg_id": "uuid", "msg_type": "network", "time": "发送时间", "data": 1 //1:联网 0:未联网 } |
设备数据源信息报文内容 | { "msg_id": "66ea9fb7ca6e4ec3e826b23d", "msg_type": "source", "time": "2024-09-18 17:39:03.912016", "data": { "c69f6f13-097c-4c32-acb5-2355b2495b54": { "66e242085dc58a0964fab88b": { "index": 1, "ipv4": "", "desc": "1", "type": "stream", "encoding": "h264", "info": { "rtsp_transport": "tcp" }, "stream": "rtmp://192.168.1.170/live/wangying", "infer_size": 640, "draw_size": [1280, 720], "alg": {}, "video_record": 0, "status": -1 }, "66e2b3af5dc58a0964fab959": { "index": 1, "ipv4": "192.168.1.33", "desc": "37", "type": "camera", "encoding": "h264", "info": { "protocol": "rtsp", "rtsptype": "gen", "brand": "2", "stream": ":554/h264/ch1/main/av_stream", "username": "admin", "password": "Admin123", "rtsp_transport": "tcp" }, "stream": "rtsp://admin:Admin123@192.168.1.33:554/h264/ch1/main/av\_stream", "infer_size": 640, "draw_size": [1280, 720], "alg": { "person_intrusion": { "reserved_args": { "ch_name": "区域入侵", "sound_text": "区域入侵告警", "strategy": "bottom" }, "alert_window": { "type": "interval_threshold_window", "interval": 5, "length": 5, "threshold": 3 }, "bbox": { "polygons": [{ "id": "polygon_4f64cfe3-7edd-4fc3-9ddd-758cf94ce36f", "name": "", "polygon": [[445, 286], [828, 270], [870, 558], [486, 583]] } ], "lines": [] }, "plan": { "1": [[0, 86399]], "2": [[0, 86399]], "3": [[0, 86399]], "4": [[0, 86399]], "5": [[0, 86399]], "6": [[0, 86399]], "7": [[0, 86399]] }, "hazard_level": "", "alg_type": "general", "model_args": { "person": { "conf_thres": 0.45 } } }, "person_counting": { "reserved_args": { "ch_name": "人员计数", "sound_text": "人员计数告警", "strategy": "center" }, "alert_window": { "type": "threshold_window", "length": 1, "threshold": 1 }, "bbox": { "polygons": [], "lines": [{ "id": "line_f7275717-0fb4-45ce-bc04-27fe2a45728d", "name": "", "line": [[725, 146], [388, 640]], "direction": "r+", "action": { "count": "统计", "increase": "进入", "decrease": "离开", "delta": "统计" } } ] }, "plan": { "1": [[0, 86399]], "2": [[0, 86399]], "3": [[0, 86399]], "4": [[0, 86399]], "5": [[0, 86399]], "6": [[0, 86399]], "7": [[0, 86399]] }, "hazard_level": "", "alg_type": "cross_line_counting", "model_args": { "person": { "conf_thres": 0.4 } } }, "person_departure": { "reserved_args": { "ch_name": "离岗检测", "sound_text": "离岗检测告警", "strategy": "center", "threshold": 0 }, "alert_window": { "type": "interval_duration_window", "duration": 300, "interval": 5 }, "bbox": { "polygons": [{ "id": "polygon_b9eb7dfb-86a2-4a71-803d-6a506a1ec0ea", "name": "", "polygon": [[436, 228], [868, 255], [868, 510], [428, 548]] } ], "lines": [] }, "plan": { "1": [[0, 86399]], "2": [[0, 86399]], "3": [[0, 86399]], "4": [[0, 86399]], "5": [[0, 86399]], "6": [[0, 86399]], "7": [[0, 86399]] }, "hazard_level": "", "alg_type": "general", "model_args": { "person": { "conf_thres": 0.45 } } }, "person_gathering": { "reserved_args": { "ch_name": "人员聚集", "sound_text": "人员聚集告警", "threshold": 12, "strategy": "bottom" }, "alert_window": { "type": "interval_threshold_window", "interval": 5, "length": 5, "threshold": 3 }, "bbox": { "polygons": [{ "id": "polygon_0a1cde13-06a1-4d2e-8569-3f5f3a3be44a", "name": "", "polygon": [[253, 246], [710, 213], [656, 475], [263, 565]] } ], "lines": [] }, "plan": { "1": [[0, 86399]], "2": [[0, 86399]], "3": [[0, 86399]], "4": [[0, 86399]], "5": [[0, 86399]], "6": [[0, 86399]], "7": [[0, 86399]] }, "hazard_level": "", "alg_type": "counting", "model_args": { "person": { "conf_thres": 0.6 } } }, "fire": { "reserved_args": { "ch_name": "明火检测", "sound_text": "明火检测告警", "iou": 0.7 }, "alert_window": { "type": "interval_threshold_window", "interval": 5, "length": 3, "threshold": 2 }, "bbox": { "polygons": [], "lines": [] }, "plan": { "1": [[0, 86399]], "2": [[0, 86399]], "3": [[0, 86399]], "4": [[0, 86399]], "5": [[0, 86399]], "6": [[0, 86399]], "7": [[0, 86399]] }, "hazard_level": "", "alg_type": "general", "model_args": { "fire": { "conf_thres": 0.5 }, "fire_classify": { "conf_thres": 0.5 } } } }, "video_record": 0, "status": 1 }, "66e243e65dc58a0964fab8a8": { "index": 2, "ipv4": "", "desc": "vivie", "type": "stream", "encoding": "h264", "info": { "rtsp_transport": "tcp" }, "stream": "rtmp://192.168.1.68/live/vivie", "infer_size": 640, "draw_size": [1280, 720], "alg": {}, "video_record": 0, "status": -1 }, "66ea749d5dc58afc4cbfe156": { "index": 4, "ipv4": "", "desc": "2", "type": "stream", "encoding": "h264", "info": { "rtsp_transport": "tcp" }, "stream": "rtmp://192.168.1.170/live/wangying", "infer_size": 640, "draw_size": [1280, 720], "alg": {}, "video_record": 0, "status": -1 }, "66e03f045dc58a69a819898e": { "index": 3, "ipv4": "", "desc": "test", "type": "stream", "encoding": "h265", "info": { "rtsp_transport": "tcp" }, "stream": "rtsp://admin:Zql147258369@192.168.1.175:554/Streaming/Channels/101", "infer_size": 640, "draw_size": [1280, 720], "alg": { "car_counting": { "reserved_args": { "ch_name": "车辆计数", "sound_text": "车辆计数告警", "strategy": "center" }, "alert_window": { "type": "threshold_window", "length": 1, "threshold": 1 }, "bbox": { "polygons": [{ "id": "polygon_08fdf3a7-101a-4241-9036-4aa8dd65e233", "name": "", "polygon": [[1008, 45], [198, 638], [1153, 671]] } ], "lines": [{ "id": "line_4bf5a9e0-043f-45c6-a63c-640740f6e3fb", "name": "", "line": [[990, 186], [450, 555]], "direction": "r+", "action": { "count": "统计", "increase": "进入", "decrease": "离开", "delta": "统计" } } ] }, "plan": { "1": [[0, 86399]], "2": [[0, 86399]], "3": [[0, 86399]], "4": [[0, 86399]], "5": [[0, 86399]], "6": [[0, 86399]], "7": [[0, 86399]] }, "hazard_level": "", "alg_type": "cross_line_counting", "model_args": { "common": { "conf_thres": 0.5 } } } }, "video_record": 0, "status": -1 } } } } |
真诚点赞 诚不我欺
回复