AI事件

最近更新时间:2026-03-19 18:16:28

用户在回调模板中配置AI事件通知回调URL,并将该回调模板绑定至设备,智能视图服务将实时推送AI告警信息,如人员布控、烟雾明火、入侵检测等AI算法告警。

说明:用户需创建AI应用绑定至设备并启用,当该设备画面触发AI告警事件时,智能视图服务将推送AI告警信息至用户配置的AI事件通知回调URL。

回调消息参数

参数类型描述下级对象
EventTypeIntegerAI事件类型。 取值:5。
ExpiresInteger回调消息的失效时间点,1970 年 1 月 1 日以来的秒数。 说明:来自天翼云的消息通知默认过期时间是10分钟,如果一条消息通知中的Expires值所指定的时间已经过期,则可以判定这条通知无效,进而可以防止网络重放攻击。
SignatureString回调消息的安全签名,Signature=MD5(CallbackKey+Expires)。 说明:天翼云把CallbackKey和Expires进行字符串拼接后通过MD5计算得出Signature值,并将其放在回调消息里,您的后台服务器在收到通知消息后可以根据同样的算法确认Signature是否正确,进而确认消息是否来自天翼云。
DeviceIdString设备ID。
GbIdString设备国标ID。
DeviceNameString设备名称。
AITypeIntegerAI算法类型。 取值: 5:吸烟检测 7:安全帽反光服检测 8:行人检测 9:危险区域检测 10:烟雾明火检测 12:人体属性检测 17:车牌识别 19:入侵检测 23:电动车检测 24:车辆违停检测 25:车辆拥堵检测 26:人群感应检测 27:实时在岗检测 31:跌倒检测 34:人脸识别 37:城市治理
DataObjectAI告警信息,不同的AIType,Data内容不同,参考下面的表格详情。Data
ImageUrlStringAI告警图片Url,可以下载。
EventTimeInteger事件消息产生的时间戳,单位秒。

表 Data

吸烟检测

参数类型描述下级对象
DetectBoxesArray of Integers返回检测矩形框,矩形框坐标是box=[left, top,width, height]。如有多个矩形框则返回[box0, box1]。
DetectScoresArray of Floats返回检测框的置信度,范围是0-1。
DetectClsesArray of Integers返回目标类别。0 :未吸烟,1:吸烟。

安全帽反光服检测

参数类型描述下级对象
DetectBoxesArray of Integers返回行人检测矩形框,矩形框坐标是box =[left,top,width, height]。如有多个矩形框则返回[box0,box1]。
DetectScoresArray of Floats返回检测框的置信度分数,范围是0-1。
DetectClsesArray of Integers返回检测框的类别。0:穿反光服,1:未穿反光服,2:未戴安全帽,3:戴安全帽。

行人检测

参数类型描述下级对象
DetectBoxesArray of Integers返回目标检测矩形框,矩形框坐标是box =[left, top, width, height]。如有多个矩形框则返回[box0, box1]。
DetectScoresArray of Floats返回目标框的置信度,范围是 0-1。
DetectClsesArray of Integers返回目标框的类别。0:行人。

危险区域检测

参数类型描述下级对象
DetectBoxesArray of Integers返回行人检测矩形框,矩形框坐标是 box =[left,top,width, height]。如有多个矩形框则返回[box0,box1]。
DetectScoresArray of Floats返回目标框的置信度,范围是 0-1。
DetectClsesArray of Integers返回目标框的类别。0:行人。

烟雾明火检测

参数类型描述下级对象
DetectBoxesArray of Integers返回检测矩形框,矩形框坐标是 box =[left,top,width, height]。如有多个矩形框则返回[box0,box1]。
DetectScoresArray of Floats返回目标框的置信度,范围是 0-1。
DetectClsesArray of Integers返回目标框的类别。1:明火,2:烟雾。

车牌识别

参数类型描述下级对象
BoxesArray of Integers返回检测的车牌矩形框坐标,矩形框坐标是顺时针左上、右上、右下、左下。
TextsArray of Strings返回检测的车牌号码。

入侵检测

参数类型描述下级对象
FaceCountInteger返回检测的人脸个数。
FaceRectanglesArray of Integers返回人脸矩形框,分别是[left, top, width, height]。如有多个人脸,则按顺序返回矩形框。例如有两个人脸则返回[left1, top1, width1, height1, left2, top2, width2, height2]。
MatchListArray of Objects返回匹配的结果列表,如果输入图像中有多个人脸,则会返回多个人脸数据。FaceItemData

表 FaceItemData

参数类型描述下级对象
LocationObject返回人脸坐标信息。Locate
FaceItemsArray of Objects返回匹配的人脸数据列表。FaceInfo

表 FaceInfo

参数类型描述下级对象
DbNameString返回匹配到的人脸库名称。
FaceIdString返回人脸ID。
EntityIdString返回实体 ID,用来标识用户的唯一性。
ScoreFloat返回人脸相似度得分,取值范围 0-100,数值越大相似度越高。
ExtraDataString返回其他信息。
LabelsString返回人员标签,包括人员姓名等。

表 Locate

参数类型描述下级对象
HeightInteger高度,单位像素。
WidthInteger宽度,单位像素。
XInteger左上角x坐标。
YInteger左上角y坐标。

电动车检测

参数类型描述下级对象
DetectBoxesArray of Integers返回检测矩形框,矩形框坐标是box=[left, top,width, height]。如有多个矩形框则返回[box0,box1]。
DetectScoresArray of Floats返回目标框的置信度,范围是0-1。
DetectClsesArray of Integers返回目标框的类别。1:电动车。

人脸识别

参数类型描述下级对象
IdInteger人员ID。
NameString姓名。
NumberString人员编号。
MatchPicUrlString返回人脸库中匹配到的人脸图片URL。
MatchFaceCropUrlString返回人脸库中人脸图片的抠图URL。
MatchPicRectanglesArray of Integers返回人脸库中人脸的坐标box,矩形框坐标是box =[left, top,width, height]。
FaceRectanglesArray of Integers返回截图中人脸的坐标,矩形框坐标是box =[left, top,width, height]。
ScoreFloat返回截图人脸与人脸库中人脸的匹配度。

回调消息示例

吸烟检测

{
    "EventType":5,
    "Expires":1545030873,
    "Signature":"ca3e25e5dc17a6f9909a9ae7281e300d",
    "DeviceId":"29942114322219022",
    "GbId":"34082400011188226858",
    "DeviceName":"***",
    "AIType":5,
    "EventTime":1545047000,
    "ImageUrl":"https://",
     "Data":{
        "DetectBoxes":[
            987,
            312,
            216,
            759,
            832,
            278,
            185,
            620
        ],
        "DetectScores":[
            0.9033203125,
            0.62158203125
        ],
        "DetectClses":[
            1,
            1
        ]
    }
}

安全帽反光服检测

{
    "EventType":5,
    "Expires":1545030873,
    "Signature":"ca3e25e5dc17a6f9909a9ae7281e300d",
    "DeviceId":"29942114322219022",
    "GbId":"34082400011188226858",
    "DeviceName":"***",
    "AIType":7,
    "EventTime":1545047000,
    "ImageUrl":"https://",
     "Data":{
        "DetectBoxes":[
            987,
            312,
            216,
            759,
            832,
            278,
            185,
            620
        ],
        "DetectScores":[
            0.9033203125,
            0.62158203125
        ],
        "DetectClses":[
            0,
            3
        ]
    }
}

行人检测

{
    "EventType":5,
    "Expires":1545030873,
    "Signature":"ca3e25e5dc17a6f9909a9ae7281e300d",
    "DeviceId":"29942114322219022",
    "GbId":"34082400011188226858",
    "DeviceName":"***",
    "AIType":8,
    "EventTime":1545047000,
    "ImageUrl":"https://",
     "Data":{
        "DetectBoxes":[
            987,
            312,
            216,
            759,
            832,
            278,
            185,
            620
        ],
        "DetectScores":[
            0.9033203125,
            0.62158203125
        ],
        "DetectClses":[
            0,
            0
        ]
    }
}

危险区域检测

{
    "EventType":5,
    "Expires":1545030873,
    "Signature":"ca3e25e5dc17a6f9909a9ae7281e300d",
    "DeviceId":"29942114322219022",
    "GbId":"34082400011188226858",
    "DeviceName":"***",
    "AIType":9,
    "EventTime":1545047000,
    "ImageUrl":"https://",
     "Data":{
        "DetectBoxes":[
            987,
            312,
            216,
            759,
            832,
            278,
            185,
            620
        ],
        "DetectScores":[
            0.9033203125,
            0.62158203125
        ],
        "DetectClses":[
            0,
            0
        ]
    }
}

烟雾明火检测

{
    "EventType":5,
    "Expires":1545030873,
    "Signature":"ca3e25e5dc17a6f9909a9ae7281e300d",
    "DeviceId":"29942114322219022",
    "GbId":"34082400011188226858",
    "DeviceName":"***",
    "AIType":10,
    "EventTime":1545047000,
    "ImageUrl":"https://",
     "Data":{
        "DetectBoxes":[
            987,
            312,
            216,
            759,
            832,
            278,
            185,
            620
        ],
        "DetectScores":[
            0.9033203125,
            0.62158203125
        ],
        "DetectClses":[
            0,
            0
        ]
    }
}

车牌识别

{
    "EventType":5,
    "Expires":1545030873,
    "Signature":"ca3e25e5dc17a6f9909a9ae7281e300d",
    "DeviceId":"29942114322219022",
    "GbId":"34082400011188226858",
    "DeviceName":"***",
    "AIType":17,
    "EventTime":1545047000,
    "ImageUrl":"https://",
     "Data":{
        "Boxes":[
            [
                [
                    782,
                    1393
                ],
                [
                    921,
                    1376
                ],
                [
                    926,
                    1419
                ],
                [
                    787,
                    1438
                ]
            ],
            [
                [
                    1706,
                    913
                ],
                [
                    1807,
                    906
                ],
                [
                    1810,
                    940
                ],
                [
                    1709,
                    947
                ]
            ]
        ],
        "Texts":[
            "青E73***",
            "青BB3***"
        ]
    }
}

入侵检测

{
    "EventType":5,
    "Expires":1545030873,
    "Signature":"ca3e25e5dc17a6f9909a9ae7281e300d",
    "DeviceId":"29942114322219022",
    "GbId":"34082400011188226858",
    "DeviceName":"***",
    "AIType":19,
    "EventTime":1545047000,
    "ImageUrl":"https://",
    "Data":{
        "FaceCount":1,
        "FaceRectangles":[
            529,
            219,
            43,
            53
        ],
        "MatchList":[
            {
                "Location":{
                    "X":529,
                    "Y":219,
                    "Width":43,
                    "Height":53
                },
                "FaceItems":[
                    {
                        "EntityId":"289575371019796480",
                        "Score":81.70854814532174,
                        "DbName":"289502451065044992",
                        "Labels":"{\"name\":\"小明\",\"cardId\":null,\"description\":null}"
                    },
                    {
                        "EntityId":"289601072104095744",
                        "Score":28.600664596359827,
                        "DbName":"289502451065044992",
                        "Labels":"{\"name\":\"小李\",\"cardId\":null,\"description\":null}"
                    }
                ]
            }
        ]
    }
}

电动车检测

{
    "EventType":5,
    "Expires":1545030873,
    "Signature":"ca3e25e5dc17a6f9909a9ae7281e300d",
    "DeviceId":"29942114322219022",
    "GbId":"34082400011188226858",
    "DeviceName":"***",
    "AIType":23,
    "EventTime":1545047000,
    "ImageUrl":"https://",
     "Data":{
        "DetectBoxes":[
            987,
            312,
            216,
            759,
            832,
            278,
            185,
            620
        ],
        "DetectScores":[
            0.9033203125,
            0.62158203125
        ],
        "DetectClses":[
            1,
            1
        ]
    }
}

人脸识别

{
  "EventType": 5,
  "Expires": 1545030873,
  "Signature": "ca3e25e5dc17a6f9909a9ae7281e300d",
  "DeviceId": "29942114322219022",
  "GbId": "34082400011188226858",
  "DeviceName": "***",
  "AIType": 34,
  "EventTime": 1545047000,
  "ImageUrl": "https://",
  "Data": {
    "Id": 40223,
    "Name": "吴",
    "Number": "1234",
    "MatchPicUrl": "https://",
    "MatchFaceCropUr":"https://",
    "MatchPicRectangles": "[766,687,1664,2327]",
    "Score": 0.6068044,
    "FaceRectangles": "[1188,661,119,134]"
  }
}