添加typeName

This commit is contained in:
quantulr
2024-03-18 16:59:31 +08:00
parent f061366606
commit 9e03e6edcc
11 changed files with 5 additions and 2379 deletions

View File

@ -1 +0,0 @@
{'data': {'channelID': 1, 'channelName': 'B西~', 'dataProcInterval': '24', 'dataType': 'behavioralAnalysis', 'dateTime': '2024-02-01T11:23:54.000+08:00', 'eventDescription': 'fielddetection', 'eventType': 'fielddetection', 'ipAddress': '192.168.1.11', 'picUploadInterval': '20', 'portNo': 8000, 'recvTime': '2024-02-01T11:23:57.711+08:00', 'sendTime': '2024-02-01T11:23:57.735+08:00', 'userIds': ['fsdf34324', 'dsffee879'], '_detectionResult': [{'detectionTarget': 1, 'duration': 1, 'imageUrl': 'http://192.168.1.250:6120/pic?0d44=de54ida-=o6018p66ea906d-63599cbbb*562s=**113==tp*7417=6807757*3861=6l9*0814=fo916-12*le1-od2620224252', 'rate': 0, 'rectType': 'others', 'regionCoordinatesList': [{'positionX': 0, 'positionY': 0.5210000276565552}, {'positionX': 0.9929999709129332, 'positionY': 0.8059999942779541}, {'positionX': 0.9929999709129332, 'positionY': 0.02500000037252903}, {'positionX': 0.006000000052154064, 'positionY': 0}], 'sensitivityLevel': 4, 'targetAttrs': {'cameraIndexCode': 'c08f3b8317a743069ac18fc1f9d3dfc3', 'deviceIndexCode': '9c6ed401392e454984c8002bdd96c255', 'imageServerCode': '53a3b8cb-b3e6-45ff-ae95-65ab3a157551', 'picServerIndexCode': '53a3b8cb-b3e6-45ff-ae95-65ab3a157551'}, 'targetRect': {'height': 0.4860000014305115, 'positionX': 0.02400000020861626, 'positionY': 0.4329999983310699, 'width': 0.09200000017881392}, 'taskInfo': {'ruleCustomName': '1', 'ruleID': 0, 'ruleName': '1'}}]}, 'eventId': '00091540-B916-8546-8C42-8582BD2F66F3', 'eventType': '', 'happenTime': '2024-02-01T11:23:54.000+08:00', 'srcIndex': 'c08f3b8317a743069ac18fc1f9d3dfc3', 'srcName': 'B西~', 'srcParentIndex': '9c6ed401392e454984c8002bdd96c255', 'srcType': 'camera', 'status': 0, 'timeout': 0}

View File

@ -63,8 +63,7 @@ async def read_event():
src_index = event_detail["srcIndex"]
device_name = device_map.get(src_index, "未知设备")
event_detail["deviceName"] = device_name
# 添加regionName和typeName
event_detail["typeName"] = event_type_str
# 添加regionName
if "srcName" in event_detail:
event_detail["regionName"] = event_detail["srcName"]
else:
@ -96,6 +95,7 @@ async def read_event():
event_detail["data"]["_detectionResult"] = (
event_detail["data"].pop(detection_field_name)
)
event_detail["data"]["_detectionResult"]["typeName"] = event_type_str
if isinstance(
event_detail["data"]["_detectionResult"], list
) and len(event_detail["data"]["_detectionResult"]):
@ -125,8 +125,7 @@ async def read_event():
# 添加设备名称
src_index = event["srcIndex"]
device_name = device_map.get(src_index, "未知设备")
# 添加regionName和typeName
event["typeName"] = event_type_str
# 添加regionName
if "srcName" in event:
event["regionName"] = event["srcName"]
else:
@ -159,6 +158,7 @@ async def read_event():
event["data"]["_detectionResult"] = event["data"].pop(
detection_field_name
)
event["data"]["_detectionResult"]["typeName"] = event_type_str
if isinstance(
event["data"]["_detectionResult"], list
) and len(event["data"]["_detectionResult"]):

View File

@ -1,45 +0,0 @@
{
"eventTypes": [
131588,
131585,
131586,
131587,
131590,
131593,
131592,
131591,
131594,
131595,
131664,
131665,
131596,
131603,
131605,
131597,
131666,
131609,
131598,
131599,
131600,
131601,
131602,
131604,
131606,
131607,
131611,
192518,
192517,
192516,
192515,
192514,
192513,
254234,
254235,
254011,
930335,
327681,
327946
],
"eventDest": "http://127.0.0.1:8000/eventRcv",
"subType": 0
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

View File

@ -1,121 +0,0 @@
{
"eventDetails": [
{
"ability": "event_vss",
"data": {
"AIOPResultData": {
"confidence": 770,
"height": "1080",
"id": 10013,
"imageUrl": "http://192.168.1.250:6120/pic?0d44=de54ida-=o1018p02ea976d-63599cbbb*162s=**118==tp*7618=6201040*6020=7l1*0026=fo966-14*le1-od2620224252",
"modelID": "00012023050501005hms3classDet00",
"realArea": 0,
"realHeight": 0,
"realVolume": 0,
"realWidth": 0,
"rect": {
"h": "0.107890",
"w": "0.067804",
"x": "0.305665",
"y": "0.303932"
},
"region": {
"rect": {
"h": "0.107890",
"w": "0.067804",
"x": "0.305665",
"y": "0.303932"
}
},
"ruleId": 2,
"ruleName": [
"打电话"
],
"targetAttrs": {
"cameraIndexCode": "f3e4a7ff9123414e8654735a6346c709",
"deviceIndexCode": "efa6aa29eaea4464aa5c3dd847f2c9c3",
"imageServerCode": "d74f089c-4888-4d36-b829-926e6f7c3c3c",
"picServerIndexCode": "d74f089c-4888-4d36-b829-926e6f7c3c3c"
},
"taskID": "86ff37c70e9e42f98f636ee866619e00",
"taskType": "AIOP_Video",
"triggerType": 1073758209,
"type": 3,
"typeName": "打电话",
"url": None,
"valid": 1,
"visible": 1,
"width": "1920"
},
"aiopMsgType": 2,
"channelID": 33,
"channelName": "T2变电所",
"dataProcInterval": "28",
"dataType": "AIOPDetection",
"dateTime": "2024-02-02T10:33:44.430+08:00",
"eventDescription": "AI Open Platform Video Detection",
"eventType": "AIOPResultData",
"ipAddress": "192.168.1.10",
"picUploadInterval": "13",
"portNo": 8000,
"presetIndex": 0,
"recvTime": "2024-02-02T10:34:20.589+08:00",
"sendTime": "2024-02-02T10:34:20.617+08:00",
"targetAttrs": {
"cameraIndexCode": "f3e4a7ff9123414e8654735a6346c709",
"deviceIndexCode": "efa6aa29eaea4464aa5c3dd847f2c9c3",
"imageServerCode": "d74f089c-4888-4d36-b829-926e6f7c3c3c",
"picServerIndexCode": "d74f089c-4888-4d36-b829-926e6f7c3c3c"
},
"taskID": "86ff37c70e9e42f98f636ee866619e00",
"url": "http://192.168.1.250:6120/pic?0d44=de54ida-=o1018p02ea976d-63599cbbb*162s=**118==tp*7618=6201040*6020=7l1*0026=fo966-14*le1-od2620224252"
},
"eventOriginalId": "578B384C-78AB-7743-A2E5-CDE3BD0E19E2",
"eventType": 422400002,
"locationIndexCode": ", "locationName": ",
"regionIndexCode": "2bc4f74e-4a96-4a67-b67f-4037724b0a46",
"regionName": "江淮 汽车发动机公司/行为分析监控",
"srcIndex": "f3e4a7ff9123414e8654735a6346c709",
"srcName": "T2变电所",
"srcType": "camera"
}
],
"eventId": "894A9D9761D84FAB96BD0D292DA219BC",
"eventLvl": 2,
"eventName": "有人抽烟或打电话",
"eventOldId": "578B384C-78AB-7743-A2E5-CDE3BD0E19E2",
"eventType": "未知事件类型",
"happenTime": "2024-02-02T10:33:44.430+08:00",
"linkageAcion": [
{
"content": "[{"cameraIndexCode":"f3e4a7ff9123414e8654735a6346c709","cameraName":"T2","cameraType":"0","cascadeCode":"","decodeTag":"hikvision","recordType":"1","treatyType":"1"}]\n",
"linkageType": "popUpLiveViewOnClient"
},
{
"content": "[{"cameraIndexCode":"f3e4a7ff9123414e8654735a6346c709","cameraName":"T2","cameraType":"0","cascadeCode":"","decodeTag":"hikvision","recordType":"1","treatyType":"1"}]\n",
"linkageType": "popUpPlayBackOnClient"
},
{
"content": "{"bPopupEventPicture":true}",
"linkageType": "popUpPictureOnClient"
},
{
"content": "{"alertTimes":1,"soundText":" /T2"}\n",
"linkageType": "alertByEventInfo"
},
{
"content": "{"wordsOverlayTxt":"/T2"}\n",
"linkageType": "overlayTextOnPopUp"
}
],
"remark": ", "ruleDescription": ",
"srcIndex": "03c96cdd994d4fda9dbc935be58af195",
"srcName": "有人抽烟或打电 话",
"srcParentIndex": "efa6aa29eaea4464aa5c3dd847f2c9c3",
"srcType": "eventRule",
"status": 0,
"stopTime": "2024-02-02T10:33:44.430+08:00",
"timeout": 0,
"deviceName": "未知设备",
"userIds": []
}