事件订阅引导
  • 事件订阅接口:API文档-事件中心-事件订阅
    • 支持设备报警、业务事件(子系统定义)、设备状态事件、感知类事件(车载设备、单兵设备、动环设备)
  • 事件类型(报警、业务、设备状态、感知类)参考:附录-事件类型
    • 开放平台会定时维护报警类型
    • 推荐参考ICC平台的报警类型菜单
  • 消息体格式参考:附录-事件列表下具体模块说明
  • 指定子系统消息订阅参考附录-事件列表下的对应模块即可
事件订阅流程说明
  • 三方调事件订阅接口(订阅成功不代表能推送成功
    • 监听地址必须在ICC服务器上能telnet通
  • 设备/子系统触发事件
  • 事件中心校验监听地址是否通
  • 推送信息给三方平台(监听地址)





事件订阅接口注意事项
  • 订阅监听地址(字段:monitor)必须得在ICC服务器上能telnet通
    • 非本地访问,是在ICC服务器上访问
    • ICC服务器的网络配置可能与三方本地网络有隔离
  • 订阅哪个事件大类(字段:category)?
    • 设备报警统一订阅category为alarm事件
    • 子系统定义报警参考附录-事件列表对应模块中的事件大类(字段:category)与报警类型(字段:alarm)
    • 子系统定义业务参考附录-事件列表对应模块中的事件大类(字段:category)与业务类型(字段:method)
    • 设备/通道在离线参考事件大类(字段:category=state)
    • GPS坐标信息、动环数据参考事件大类(字段:category=perception)
  • 订阅哪些事件列表(字段:types)
    • category=alarm,参考附录-事件类型-报警类型或ICC平台上报警类型菜单的报警编号
    • category=business,参考附录-事件类型-业务类型或附录-事件列表对应模块下的事件的method
  • 订阅者ip端口(字段:magic)定义
    • magic字段必须与监听地址(字段:monitor)中的ip与端口一致,用下划线拼接,例如:10.35.111.10_8010
  • 订阅者名称(字段:name),需唯一,name相同会覆盖之前订阅name
    • name如果没有特殊需求,建议与magic字段保持一致,例如:10.35.111.10_8010
    • 若有实际业务,例如订阅停车场业务事件,区分其他事件,可定义为:10.35.111.10_8010_ipms
订阅示例
  • 按照示例仅需改下name、magic、monitor、types字段可满足大部分功能需求
  • 如需根据组织或通道订阅,设置orgs或nodeCodes即可
  • 订阅所有(不根据types过滤),authorities字段定义为{}
订阅组织下设备报警:区域入侵、绊线入侵报警订阅

根据组织权限过滤orgs设置下,nodeCodes必须送空数组,不能不送,具体参考示例

反之指定设备订阅报警,设置nodeCodes,且orgs必须送空数组,不能不送

orgs与nodeCodes是并集,不是交集

{
    "param": {
        "monitors": [
            {
                "monitor": "http://10.35.111.10:8010/eventReceiveMsg/save",
                "monitorType": "url",
                "events": [
                    {
                        "category": "alarm",
                        "subscribeAll": 1,
                        "domainSubscribe": 2,
                        "authorities": [
                            {
                                "types": [
                                    "1000000"
                                ],
                                "orgs": [
                                    "001001",
                                    "001003"
                                ],
                                "nodeCodes": [
                                ]
                            }
                        ]
                    }
                ]
            }
        ],
        "subsystem": {
            "subsystemType": 0,
            "name": "10.35.111.10_8010",
            "magic": "10.35.111.10_8010"
        }
    }
}
区域入侵、绊线入侵报警订阅
{
    "param": {
        "monitors": [
            {
                "monitor": "http://10.35.111.10:8010/eventReceiveMsg/save",
                "monitorType": "url",
                "events": [
                    {
                        "category": "alarm",
                        "subscribeAll": 1,
                        "domainSubscribe": 2,
                        "authorities": [
                            {
                                "types": [
                                    "303","964","965","302","962","963"
                                ]
                            }
                        ]
                    }
                ]
            }
        ],
        "subsystem": {
            "subsystemType": 0,
            "name": "10.35.111.10_8010",
            "magic": "10.35.111.10_8010"
        }
    }
}
停车场过车记录订阅
{
    "param": {
        "monitors": [
            {
                "monitor": "http://10.35.111.10:8010/eventReceiveMsg/save",
                "monitorType": "url",
                "events": [
                    {
                        "category": "business",
                        "subscribeAll": 1,
                        "domainSubscribe": 2,
                        "authorities": [
                            {
                                "types": [
                                    "car.capture"
                                ]
                            }
                        ]
                    }
                ]
            }
        ],
        "subsystem": {
            "subsystemType": 0,
            "name": "10.35.111.10_8010",
            "magic": "10.35.111.10_8010"
        }
    }
}
门禁刷卡/刷脸记录订阅

开门类型type=51,代表合法刷开门、type=61,人脸合法开门; 如果需要其他开门类型,具体参考附录-数据字典-门禁开门类型

示例如下

{
    "param": {
        "monitors": [
            {
                "monitor": "http://10.35.111.10:8010/eventReceiveMsg/save",
                "monitorType": "url",
                "events": [
                    {
                        "category": "alarm",
                        "subscribeAll": 1,
                        "domainSubscribe": 2,
                        "authorities": [
                            {
                                "types": [
                                    "51",
                                    "61"
                                ]
                            }
                        ]
                    }
                ]
            }
        ],
        "subsystem": {
            "subsystemType": 0,
            "name": "10.35.111.10_8010",
            "magic": "10.35.111.10_8010"
        }
    }
}
同时订阅停车场过车记录与门禁刷卡记录订阅
{
    "param": {
        "monitors": [
            {
                "monitor": "http://10.35.111.10:8010/eventReceiveMsg/save",
                "monitorType": "url",
                "events": [
                    {
                        "category": "alarm",
                        "subscribeAll": 1,
                        "domainSubscribe": 2,
                        "authorities": [
                            {
                                "types": [
                                    "51",
                                    "61"
                                ]
                            }
                        ]
                    },
                    {
                        "category": "business",
                        "subscribeAll": 1,
                        "domainSubscribe": 2,
                        "authorities": [
                            {
                                "types": [
                                    "car.capture"
                                ]
                            }
                        ]
                    }
                ]
            }
        ],
        "subsystem": {
            "subsystemType": 0,
            "name": "10.35.111.10_8010",
            "magic": "10.35.111.10_8010"
        }
    }
}
设备/通道状态订阅
{
	"param": {
		"monitors": [{
			"monitor": "http://10.35.111.10:8010/eventReceiveMsg/save",
			"monitorType": "url",
			"events": [{
				"category": "state",
				"subscribeAll": 1,
				"domainSubscribe": 2,
				"authorities": [{
					"nodeCodes": [
						"1000001",
						"1000002$1$0$1"
					],
					"orgs": []
				}]
			}]
		}],
		"subsystem": {
			"subsystemType": 0,
			"name": "10.35.111.10_8010",
			"magic": "10.35.111.10_8010"
		}
	}
}
GPS坐标信息/动环数据订阅
{
    "param": {
        "monitors": [
            {
                "monitor": "http://10.35.111.10:8010/eventReceiveMsg/save",
                "monitorType": "url",
                "events": [
					{
                        "category": "perception",
                        "subscribeAll": 1,
                        "domainSubscribe":2,
                        "authorities":[
                            {
                                "types":[
                                               "pmms.perception.msg",
                                               "reportGPSInfo"
                                     ]
                            }
                        ]
                    }
                ]
            }
        ],
        "subsystem": {
            "subsystemType": 0,
            "name": "10.35.111.10_8010",
            "magic": "10.35.111.10_8010"
        }
    }
}
回调消息如何解析

回调三方接口消息体通用协议说明参考API文档-事件中心-事件订阅-通用事件回调消息体格式说明

报警的扩展信息(extend对象)需提供报警类型(alarmType)联系在线客服提供

业务信息(info对象)由各个业务子系统自定义,字段不统一,具体参考附录-事件列表-xxx模块定义的协议说明