Traffic event processing method and device, computer device, and storage medium
Patent Information
- Application Number
- CN202310343761.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2043-03-31
AI Technical Summary
但是,考虑到现实中存在的各种异常情形,如网络状况不佳导致丢包、某个点位遇到故障需要重启或者因上游调试需要对数据源进行了切换等情况下,上述处理方式很容易陷入错误的逻辑状态,导致交通事件处理的结果错误,且难以恢复和排查,使得得到的交通事件的处理结果的准确性较差
[0010]上述交通事件的处理方法、装置、计算机设备、存储介质和计算机程序产品,通过接收各个边缘设备发送的目标对象的目标消息和事件消息;基于目标消息对目标登记表进行更新,得到更新后的目标登记表;根据事件消息对事件登记表进行更新,得到更新后的事件登记表;当接收到新事件消息中的事件动作处于开始状态、且更新后的事件登记表中记录的新事件消息对应的交通事件处于结束状态或未开始状态时,依据更新后的目标登记表中的目标信息检测交通事件的冗余性;根据冗余性,将新事件消息转发至业务平台,或根据新事件消息对更新后的事件登记表进行更新。由于在服务器中分别维护了一个目标登记表和一个事件登记表,故在接收到各个边缘设备发送的目标对象的目标消息和事件消息之后,可以基于目标消息和事件消息分别对目标登记表、事件登记表进行更新,得到更新后的目标登记表和更新后的事件登记表,并且,当接收到新事件消息中的事件动作处于开始状态、且更新后的事件登记表中记录的新事件消息对应的交通事件处于结束状态或未开始状态时,可以依据更新后的目标登记表中的目标信息检测交通事件的冗余性,即通过动态维护事件登记表中的变量,能够实现正确的状态转移以及探知异常数据流,能够全面覆盖现实中可能出现的异常情形,保证整个处理流程不会因为异常情形而崩溃或输出错误结果,同时通过检测交通事件的冗余性,可以自动判断交通事件在时间和空间维度上是否冗余,即可以根据交通事件的冗余性来确定是否将新事件消息转发至业务平台,从而增强结果的可用性,有效提高了交通事件的处理结果的准确性。
Smart Images

Figure CN118733600B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, computer equipment, storage medium, and computer program product for handling traffic incidents. Background Technology
[0002] With the development of computer and internet technologies, more and more real-time traffic incident aggregation systems are emerging. Currently, these systems are mainly used to automatically detect traffic incidents deployed at multiple locations along a long highway and aggregate the detected information to the data center and business platform in real time. This helps traffic controllers and law enforcement personnel to accurately, comprehensively, and efficiently identify traffic incidents and take appropriate measures in a timely manner.
[0003] However, current traffic incident handling methods require each location to transmit its traffic incident detection results to a central computer when aggregating the results from multiple locations. The central computer then aggregates the data and sends the aggregated results to the business platform. However, considering various abnormal situations in reality, such as packet loss due to poor network conditions, a location experiencing a failure requiring a restart, or a data source switch due to upstream debugging, this method is prone to logical errors, leading to incorrect traffic incident handling results that are difficult to recover from and investigate, resulting in poor accuracy of the traffic incident handling outcomes. Summary of the Invention
[0004] Therefore, it is necessary to provide a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for handling traffic incidents that can effectively improve the accuracy of the handling results, in response to the above-mentioned technical problems.
[0005] Firstly, this application provides a method for handling traffic incidents. The method includes: receiving target messages and event messages from various edge devices; updating a target registration table based on the target messages to obtain an updated target registration table; updating an event registration table according to the event messages to obtain an updated event registration table; when a new event message is received where the event action is in a starting state, and the traffic incident corresponding to the new event message recorded in the updated event registration table is in a finished state or not yet started state, detecting the redundancy of the traffic incident based on the target information in the updated target registration table; and, based on the redundancy, forwarding the new event message to the business platform, or updating the updated event registration table according to the new event message.
[0006] Secondly, this application also provides a traffic incident processing apparatus. The apparatus includes: a receiving module, configured to receive target messages and event messages of target objects sent by various edge devices; an updating module, configured to update a target registration table based on the target messages to obtain an updated target registration table; and to update an event registration table based on the event messages to obtain an updated event registration table; a detection module, configured to detect the redundancy of the traffic incident based on the target information in the updated target registration table when the event action in a newly received event message is in a starting state and the traffic incident corresponding to the new event message recorded in the updated event registration table is in a finished state or not started state; a forwarding module, configured to forward the new event message to the business platform based on the redundancy; and the updating module is further configured to update the updated event registration table based on the new event messages.
[0007] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor. The memory stores a computer program, and the processor, when executing the computer program, performs the following steps: receiving target messages and event messages of target objects sent by various edge devices; updating a target registration table based on the target messages to obtain an updated target registration table; updating an event registration table according to the event messages to obtain an updated event registration table; when a new event message is received and the event action is in a starting state, and the traffic event corresponding to the new event message recorded in the updated event registration table is in a finished state or not started state, detecting the redundancy of the traffic event based on the target information in the updated target registration table; and, based on the redundancy, forwarding the new event message to the business platform, or updating the updated event registration table according to the new event message.
[0008] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps: receiving target messages and event messages of target objects sent by various edge devices; updating a target registration table based on the target messages to obtain an updated target registration table; updating an event registration table according to the event messages to obtain an updated event registration table; when a new event message is received and the event action is in a starting state, and the traffic event corresponding to the new event message recorded in the updated event registration table is in a finished state or not started state, detecting the redundancy of the traffic event based on the target information in the updated target registration table; and forwarding the new event message to the business platform according to the redundancy, or updating the updated event registration table according to the new event message.
[0009] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps: receiving target messages and event messages of target objects sent by various edge devices; updating a target registration table based on the target messages to obtain an updated target registration table; updating an event registration table according to the event messages to obtain an updated event registration table; when a new event message is received and the event action is in a starting state, and the traffic event corresponding to the new event message recorded in the updated event registration table is in a finished state or not started state, detecting the redundancy of the traffic event based on the target information in the updated target registration table; and, based on the redundancy, forwarding the new event message to the business platform, or updating the updated event registration table according to the new event message.
[0010] The aforementioned traffic incident handling method, apparatus, computer equipment, storage medium, and computer program product receive target messages and event messages from various edge devices; update the target registration table based on the target messages to obtain an updated target registration table; update the event registration table based on the event messages to obtain an updated event registration table; when a new event message is received in a starting state and the traffic incident corresponding to the new event message recorded in the updated event registration table is in a finished state or not started state, the redundancy of the traffic incident is detected based on the target information in the updated target registration table; based on the redundancy, the new event message is forwarded to the business platform, or the updated event registration table is updated based on the new event message. Since a target registration table and an event registration table are maintained separately on the server, after receiving target messages and event messages from various edge devices, the target registration table and event registration table can be updated based on the target messages and event messages respectively, resulting in updated target registration tables and updated event registration tables. Furthermore, when the event action in a new event message is in the start state, and the traffic event corresponding to the new event message recorded in the updated event registration table is in the end state or not started state, the redundancy of the traffic event can be detected based on the target information in the updated target registration table. That is, by dynamically maintaining the variables in the event registration table, correct state transitions and abnormal data flows can be achieved, which can comprehensively cover possible abnormal situations in reality, ensuring that the entire processing flow will not crash or output incorrect results due to abnormal situations. At the same time, by detecting the redundancy of traffic events, it is possible to automatically determine whether the traffic events are redundant in the time and space dimensions. That is, based on the redundancy of traffic events, it can determine whether to forward new event messages to the business platform, thereby enhancing the availability of results and effectively improving the accuracy of traffic event processing results. Attached Figure Description
[0011] Figure 1 This is a diagram illustrating the application environment of a traffic incident handling method in one embodiment.
[0012] Figure 2 This is a flowchart illustrating a traffic incident handling method in one embodiment;
[0013] Figure 3 This is a schematic diagram of the target information registration form data structure in one embodiment;
[0014] Figure 4 This is a flowchart of the target information processing module in one embodiment;
[0015] Figure 5 This is a schematic diagram of the event information registration table data structure in one embodiment;
[0016] Figure 6 This is a flowchart of the event information processing module in one embodiment;
[0017] Figure 7 This is a schematic diagram of an event stream representation in one embodiment;
[0018] Figure 8 This is a flowchart of an event initiation action processing module in one embodiment;
[0019] Figure 9 This is a flowchart of an event persistence action processing module in one embodiment;
[0020] Figure 10 This is a flowchart of the event end action processing module in one embodiment;
[0021] Figure 11 This is a structural block diagram of a traffic incident processing device in one embodiment;
[0022] Figure 12 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0024] Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or local area network to achieve data computing, storage, processing, and sharing.
[0025] Cloud technology is a collective term for network technologies, information technologies, integration technologies, management platform technologies, and application technologies applied to the cloud computing business model. It can form resource pools, providing flexible and convenient on-demand access. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to backend systems for logical processing. Data at different levels will be processed separately, and various industry data will all require robust system support, which can only be achieved through cloud computing.
[0026] Cloud storage is a new concept that extends and develops from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as a storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of storage devices of various types (storage devices are also called storage nodes) in the network to work together through application software or application interfaces to provide data storage and business access functions to the outside world.
[0027] With the research and advancement of artificial intelligence (AI) technology, AI is being studied and applied in various fields, such as smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, autonomous driving, drones, robots, smart healthcare, smart customer service, vehicle networking, and intelligent transportation. It is believed that with the development of technology, AI will be applied in more fields and play an increasingly important role.
[0028] It should be noted that in the following description, the terms "first, second, and third" are used only to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, and third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0029] The traffic incident handling method provided in this application embodiment can be applied to, for example, Figure 1In the application environment shown, edge device 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed in the cloud or on another network server. Server 104 receives target messages and event messages from various edge devices 102; server 104 updates the target registration table based on the target messages to obtain an updated target registration table; server 104 updates the event registration table based on the event messages to obtain an updated event registration table; when server 104 receives a new event message where the event action is in the start state, and the traffic event corresponding to the new event message recorded in the updated event registration table is in the end state or not yet started state, server 104 detects the redundancy of the traffic event based on the target information in the updated target registration table; server 104 forwards the new event message to the business platform based on the redundancy, or updates the updated event registration table based on the new event message.
[0030] The edge device 102 can be a terminal, including but not limited to smartphones, tablets, laptops, desktop computers, IoT devices, and portable wearable devices. IoT devices can be smart in-vehicle devices, etc. Portable wearable devices can be smartwatches, smart bracelets, head-mounted devices, etc.
[0031] Server 104 can be an independent physical server or a service node in a blockchain system. The service nodes in the blockchain system form a peer-to-peer (P2P) network. The P2P protocol is an application layer protocol that runs on top of the Transmission Control Protocol (TCP).
[0032] In addition, server 104 can also be a server cluster consisting of multiple physical servers, which can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0033] The edge device 102 and the server 104 can be connected via Bluetooth, USB (Universal Serial Bus) or network communication, and this application does not impose any restrictions on this.
[0034] In one embodiment, such as Figure 2As shown, a method for handling traffic incidents is provided. This method can be executed by a server or a terminal alone, or by both a server and a terminal. This method can be applied to... Figure 1 Taking the server in the example, the following steps are included:
[0035] Step 202: Receive target messages and event messages of the target objects sent by each edge device.
[0036] In this context, "edge device" refers to an edge computing device. For example, the edge device in this application can be a terminal. The edge device in this application is used to process and compute the received data to obtain traffic event detection results. For instance, a camera, radar, or other sensor installed at a certain location transmits the collected data to the edge computing device at that location. The edge computing device then uses its built-in program to process and compute the received data to obtain traffic event detection results. These results may include whether a traffic event has occurred at that location, what the target object is, and what type of traffic event has occurred.
[0037] The target message of a target object refers to the target message corresponding to a certain target object. In some cases, the target object in this application can also be called a target. The target message in this application refers to a message containing various parameters of the target object. For example, the target message in this application may contain the following fields:
[0038] 1. Timestamp, i.e., the local time at the time of sending;
[0039] 2. Location number;
[0040] 3. Target number;
[0041] 4. Position vector; for example, let the east-west direction be the x-axis and the north-south direction be the y-axis, and we get a two-dimensional position vector;
[0042] 5. Velocity vector; for example, if we set the east-west direction as the x-axis and the north-south direction as the y-axis, we get a two-dimensional velocity vector;
[0043] 6. Target type can be divided into three main categories: pedestrians, motorcycles, and non-motorized vehicles, which are automatically provided during target detection. Non-motorized vehicles are further divided into small vehicles (such as sedans), medium-sized vehicles (such as vans), and large vehicles (such as trucks), and the target type can be estimated by a trained convolutional neural network.
[0044] 7. Target dimensions (length, width, height) are only present in non-motorized vehicles and can also be estimated by a trained convolutional neural network.
[0045] 8. The target color, represented using the RGB three-channel method, can be estimated by a trained convolutional neural network;
[0046] 9. The length, width, and offset of the target rectangle bounding box relative to the top left corner of the image, used when displayed on the business platform.
[0047] An event message is a message corresponding to a specific event. In this application, an event message refers to a message that contains various parameters of the event. For example, an event message in this application may contain the following fields:
[0048] 1. Timestamp, i.e., the local time at the time of sending;
[0049] 2. Location number;
[0050] 3. Target number;
[0051] 4. Incident types include pedestrians on highways, motorcycles on highways, speeding, slow driving, parking, occupying emergency lanes, and driving against traffic.
[0052] 5. Event number;
[0053] 6. Event start time;
[0054] 7. Event actions, including start, duration, and end. In this embodiment, a streaming representation of events is used: in the frame where the event begins, the event action is set to start; in several consecutive frames where the event continues, the event action is set to duration; in the frame where the event ends, the event action is set to end.
[0055] The definitions of some traffic events in this application are as follows:
[0056] 1. Pedestrians on the highway: A pedestrian appears on the highway for a duration that reaches a preset detection time threshold;
[0057] 2. Motorcycle on the highway: A motorcycle appears on the highway and remains there for a preset detection time threshold.
[0058] 3. Speeding: The vehicle speed exceeds the speed limit (e.g., 100 km / h) for a duration that reaches the preset detection time threshold;
[0059] 4. Low speed: The vehicle speed is less than the low speed threshold (e.g., 70 km / h) and greater than the stopping speed threshold (e.g., 5 km / h), and the duration reaches the preset detection time threshold;
[0060] 5. Parking: The vehicle speed is less than the parking speed threshold (e.g., 5 km / h) for a duration that reaches the preset detection time threshold;
[0061] 6. Occupying the emergency lane: The vehicle is in the emergency lane for a period of time that reaches the preset detection time threshold;
[0062] 7. Driving in the wrong direction: The vehicle is traveling in the opposite direction to the normal direction of travel in its lane for a period of time that reaches the preset detection time threshold.
[0063] Specifically, let's take a highway traffic incident as an example. For instance, at a certain location on the highway, two cameras facing opposite directions are set up to continuously acquire image sequences at a certain frequency (e.g., 10Hz or 20Hz). These acquired image sequences are then sent in real-time to an edge computing device at that location for further processing. The edge computing device performs target object detection on the image sequences, obtaining the bounding box of the target object (e.g., vehicle, pedestrian) in each frame. Furthermore, the edge computing device can perform target search on the detected target objects, obtaining the location trajectory and target number of each target object in the image sequence. The target number is assigned when the target is first detected, and the assignment rule is to increment sequentially, resetting to 1 after exceeding a certain limit.
[0064] Edge computing devices can calculate the location trajectory of each target in the real world through coordinate system transformation, and then calculate the corresponding speed. Based on pre-defined traffic events, edge computing devices can automatically analyze target behavior to identify a series of traffic events. Specifically, edge computing devices perform event identification based on the calculated location trajectory and target number, obtaining the corresponding traffic event identification result. Each traffic event also has a unique number, assigned at the start of the event, with the number incrementing sequentially and reset to 1 after exceeding a certain limit.
[0065] After the edge computing devices process and calculate the received data using built-in programs to obtain traffic event detection results, each location can transmit its traffic event detection results to the central computer, i.e., the server. In other words, the edge computing devices corresponding to each location can report the processed traffic event detection results to the server, and the server can receive target messages and event messages from each edge computing device.
[0066] For example, after the edge computing device has finished analyzing each frame of image, that is, after completing target detection, target search and traffic event detection, the edge computing device will send useful information to the server in real time. The information sent to the server includes target messages containing various parameters of the target, event messages containing various parameters of the event, and compressed images.
[0067] Step 204: Update the target registration table based on the target message to obtain the updated target registration table.
[0068] The target registration table is used to store the target messages reported by each point. In some cases, the target registration table in this application can also be called the target information registration table. For example, the data structure of the target information registration table in this application can be a tree data structure, such as storing the target messages in a balanced binary tree data structure.
[0069] It is understood that the data structure of the target information registration table in this application includes, but is not limited to, the tree-like data structure mentioned above, and may also be a linked list or other data structures, without specific limitations here.
[0070] Specifically, after the server receives the target messages and event messages of the target objects sent by various edge computing devices, the server can enter or update the parameters of each target in the target information registration table based on the received target messages, and reclaim the memory released by expired targets after the targets leave the perception range.
[0071] For example, let's illustrate this by using a target registration table that stores target information in a tree-like data structure. Figure 3 The image shown is a schematic diagram of the data structure of the target information registration form. Figure 3 As shown, the target information registration table consists of a two-level balanced binary tree and basic storage units. The key of the first-level balanced binary tree is the point number, and the value is the address of the second-level balanced binary tree in memory. The key of the second-level balanced binary tree is the target number, and the value is the address of the basic storage unit in memory. The basic storage unit stores the following fields: position vector, velocity vector, target type, target size, target color, target bounding box parameters, last update time, etc.
[0072] like Figure 4 The diagram shows a flowchart of the target information processing module. The server maintains a target information registration table and an event information registration table. When the server receives target messages and event messages from various edge devices, the target information processing module can initialize the target information registration table based on the target messages sent by the edge computing devices. After the target information processing module starts, it first initializes the target information registration table; that is, the target information processing module can process messages such as... Figure 3 The first-level balanced binary tree in the target information registration table shown is set to an empty tree, and then proceeds as follows: Figure 4 The main loop flow is shown below. In, as... Figure 4 In the flowchart of the target information processing module shown, after the server receives the target message from the edge computing device, the target information processing module in the server checks whether the target in the target message already exists in the target information registration table. If not, it indicates that the target in the target message is a new target, and the server can allocate a memory address for the target message in the target information registration table.
[0073] Furthermore, after the target information processing module in the server allocates memory for the corresponding basic storage unit for the target in the target message, the server can access and modify the target based on the memory address corresponding to the target in the returned target message. That is, the target information processing module in the server can fill the position vector, velocity vector, target type, target size, target color, and bounding box information from the target message into the corresponding fields in the basic storage unit to complete the input or update of target information and save the last update time. It can be understood that this target information stored in this storage unit is also readily accessible to the event information processing module and other downstream modules; only the point number and target number to be queried need to be provided.
[0074] In addition, the server will automatically reclaim memory released by expired targets from the target information registry every so often, for example, using Figure 3 The example shown is a target information registration table that stores target information in a tree-like data structure. The server first traverses the table as follows: Figure 3 For each basic storage unit in the target information registration table shown, the difference between the last update time and the current time of each basic storage unit is checked. If the difference is greater than a threshold, it indicates that the target has not been observed for a long time. Therefore, the server releases the memory of this basic storage unit and deletes the node pointing to this basic storage unit in the second-level balanced binary tree corresponding to this basic storage unit. Further, the server continues to traverse as follows... Figure 3 For each second-level balanced binary tree in the target information registration table shown, check if each second-level balanced binary tree in the target information registration table is an empty tree. If it is, the server releases the memory of this second-level balanced binary tree, and at the same time, the server deletes the node pointing to this second-level balanced binary tree from the first-level balanced binary tree.
[0075] Step 206: Update the event registration form according to the event message to obtain the updated event registration form.
[0076] The event registration table is used to store event messages reported by each point. In some cases, the event registration table in this application can also be called the event information registration table. For example, the data structure of the event information registration table in this application can be a tree data structure, such as storing event messages in a balanced binary tree data structure.
[0077] It is understood that the data structure of the event information registration table in this application includes, but is not limited to, the tree-like data structure mentioned above, and may also be a linked list or other data structures, without any specific limitation here.
[0078] Specifically, after the server receives the target message and event message of the target object sent by each edge computing device, the server can enter or update the parameters of each event in the event information registration table based on the received event message, and reclaim the memory released by the ended event after a period of time.
[0079] For example, let's illustrate this by using an event registry table that stores event information in a tree-like data structure. Figure 5 The image shown is a schematic diagram of the data structure of the event information registration form. Figure 5 As shown, the event information registration table consists of a three-level balanced binary tree and basic storage units. The key of the first-level balanced binary tree is the point number, and the value is the address of the second-level balanced binary tree in memory. The key of the second-level balanced binary tree is the target number, and the value is the address of the third-level balanced binary tree in memory. The key of the third-level balanced binary tree is the event type, and the value is the address of the basic storage unit in memory.
[0080] like Figure 6 The diagram shows a flowchart of the event information processing module. The server maintains a target information registration table and an event information registration table. When the server receives target messages and event messages from various edge devices, the event information processing module can initialize the event information registration table based on the event messages sent by the edge computing devices. After the event information processing module starts, it first initializes the event information registration table; that is, the event information processing module can... Figure 5 The first-level balanced binary tree in the event information registration table shown is set to an empty tree, and then proceeds as follows: Figure 6 The main loop flow is shown below. In, as... Figure 6 In the flowchart of the event information processing module shown, after the server receives an event message from the edge computing device, the event information processing module in the server checks whether the basic storage unit corresponding to the point number, target number, and event type in the event message already exists. Figure 5 If not, the server needs to allocate a memory address for the event message in the event information registration table shown.
[0081] After the event information processing module in the server allocates memory for the corresponding basic storage units for the point number, target number, and event type in the event message, the server can access and modify these memory locations based on the memory addresses corresponding to the point number, target number, and event type in the returned event message. Furthermore, the server can run the corresponding event action processing module based on the event actions in the event message. In such cases... Figure 6In the flowchart of the event information processing module shown, if the event action in the event message is "start", the server runs the event start action processing module to process it; if the event action in the event message is "continue", the server runs the event continue action processing module to process it; if the event action in the event message is "end", the server runs the event end action processing module to process it.
[0082] In addition, the server will automatically reclaim memory released by expired events from the event information registry every so often, for example, Figure 5 The example shown is an event information registration table that stores event information in a tree-like data structure. The server first traverses the table as follows: Figure 5 For each third-level balanced binary tree in the event information registration table shown, check if the target corresponding to each third-level balanced binary tree exists in the target information registration table. If not, the server releases the memory of this third-level balanced binary tree and the basic storage units derived from it, and simultaneously deletes the node pointing to this third-level balanced binary tree in the second-level balanced binary tree corresponding to it. Further, the server continues to traverse... Figure 5 For each second-level balanced binary tree in the event information registration table shown, check if each second-level balanced binary tree in the event information registration table is an empty tree. If it is, the server releases the memory of this second-level balanced binary tree and deletes the node pointing to this second-level balanced binary tree from the first-level balanced binary tree.
[0083] Step 208: When the event action in the new event message is in the start state and the traffic event corresponding to the new event message recorded in the updated event registration table is in the end state or not started state, the redundancy of the traffic event is detected based on the target information in the updated target registration table.
[0084] In this context, a new event message refers to a newly received event message. The terms "event message" and "new event message" in this application are used only to distinguish between different event messages. For example, if the server receives event message 1 from a certain location at 11:42, and then receives event message 2 from another location 2 two minutes later at 11:44, event message 2 can be considered a new event message.
[0085] An event action refers to the state of an event within an image frame. For example, the event actions in this application include start, duration, and end. That is, the streaming representation of events is adopted in the embodiments of this application: in the frame where the event begins, the event action is set to start; in several consecutive frames where the event continues, the event action is set to duration; and in the frame where the event ends, the event action is set to end.
[0086] The event action being in the starting state means that the event action has begun, that is, the event action is in the frame where the event begins.
[0087] The traffic events corresponding to new event messages refer to different types of traffic events identified based on the parameters contained in the new event message. For example, when the server determines, based on the parameters in the new event message, that the vehicle speed in the new event message exceeds the speed limit threshold (e.g., 100 km / h) and the duration reaches a preset detection time threshold, the server can determine that the traffic event corresponding to the new event message is a vehicle speeding event.
[0088] The term "end status" or "not started status" refers to the progress status of a traffic event. For example, in this application, the progress status of a traffic event includes "not started," "in progress," "finished," or "finished," with the default being "not started status."
[0089] Redundancy of traffic incidents refers to whether a traffic incident is redundant or whether it is a redundant event. For example, in this application, the redundancy of traffic incidents includes two situations: a traffic incident is a redundant event and a traffic incident is not a redundant event.
[0090] Specifically, such as Figure 7 The diagram shown illustrates the streaming representation of events. Specifically, the streaming representation of events used in this embodiment is as follows: Figure 7 As shown: in the frame where the event begins, the event action is set to start; in the consecutive frames where the event continues, the event action is set to continue; in the frame where the event ends, the event action is set to end.
[0091] In the embodiments of this application, the terms "target message" or "event message" specifically refer to messages sent from an edge computing device to a server in the format described above. Figure 7 As shown, target 1 is a motorcycle, target 2 is a small car, and target 3 is a large vehicle, which were detected sequentially. Target 1 triggered a motorcycle entering the highway event, target 2 triggered two speeding events, and target 3 triggered a parking event and an emergency lane occupation event (which overlapped in time). The event numbers match the order of the event start times. It should be noted that "event start" here means the event has begun entering the server system's record lookup process, not the initial time the event occurred. For example, when the camera frequency is 10Hz, the speeding threshold is 100km / h, and the speeding detection time threshold is 2 seconds, the speeding event "start" means that the vehicle's speed has been greater than 100km / h for the previous 2 seconds (i.e., in the most recent 20 frames), meaning the violation has occurred and continued for some time.
[0092] The server updates the event registry table based on the event messages. After obtaining the updated event registry table, when the server receives a new event message, it can check the location number, target number, and event type that match the new event message in the updated event registry table to obtain the detection result. When the detection result indicates that at least one of the location number, target number, and event type is empty, the server can allocate the corresponding memory address for the new event message in the event registry table. After allocating the corresponding memory address for the new event message in the event registry table, the server can determine which processing module to run based on the event action in the new event message. That is, the server runs the corresponding event action processing module based on the event action in the new event message. If the event action in the event message is in a start state, the event start action processing module is run; if the event action in the event message is in a continuous state, the event continuous action processing module is run; if the event action in the event message is in a finish state, the event finish action processing module is run.
[0093] For example, when the event action in the new event message is in the "start" state, the server can run the event start action processing module to process it. This module can sequentially search the event information registration table for the location number, target number, and event type in the new event message to obtain the corresponding traffic event's progress status, most recent event number, most recent start time, and most recent end time. If the traffic event corresponding to the new event message is in the "finished" or "not started" state, the server can call the event redundancy judgment module to determine whether the traffic event corresponding to the new event message is redundant. This module will judge the redundancy of the new event message from both the time and spatial dimensions. To determine whether a traffic event corresponding to a message is redundant, for example, in the time dimension, if the traffic event is in a completed state and the difference between the most recent completion time and the timestamp of this event message is less than the preset redundancy time threshold for this type of event, then the traffic event is determined to be redundant. In the spatial dimension, the server can calculate the distinguishability between the target in the traffic event and each target of the same type of traffic event occurring at adjacent points. If the distinguishability is less than the threshold, then the traffic event is determined to be redundant. That is, when the server calls the event redundancy judgment module to determine whether the traffic event corresponding to the new event message to be processed is redundant, for example, in the spatial dimension, the server can detect the redundancy of the traffic event based on the target information in the updated target registration table.
[0094] Furthermore, if the traffic event corresponding to the new event message is in progress, it indicates that the previous traffic event of the same type lacked a message containing the ending action, and may also lack some messages containing the continuing action. Since the current event has already started before the previous similar event has ended, the two may constitute redundancy. Moreover, the previous similar event has already been reported to the business platform. Therefore, when the traffic event corresponding to the new event message is in progress, the server decides not to report the current event to the business platform, which also means not forwarding this event message. Furthermore, to correctly handle any non-redundant events that may be received in the future, the server can update the traffic event's progress status to completed, update the most recent end time to the timestamp of this event message, and inform the business platform that events that have not ended properly have been terminated by the server system.
[0095] Step 210: Based on redundancy, forward the new event message to the business platform, or update the updated event registration form based on the new event message.
[0096] The business platform refers to software hosted on a server or other machine for displaying traffic events. For example, the business platform in this application could be a third-party application used to display traffic events. For each location, the business platform provides real-time video of that location, marking the target of the traffic event with a rectangle and indicating the event type and other information with text. For each event, the business platform can provide a replay video of the event. This video is generated by the edge computing device at the start of the event based on its cached images and target information. The length is determined by a preset detection time threshold for that type of event, and then pushed to the central computer, i.e., the server.
[0097] Specifically, when the server receives a new event message in which the event action is in the start state, and the traffic event corresponding to the new event message recorded in the updated event registration table is in the end state or not started state, the server detects the redundancy of the traffic event based on the target information in the updated target registration table. The server can then forward the new event message to the business platform based on the redundancy of the traffic event, or update the updated event registration table based on the new event message. When the traffic event is redundant in the time or space dimension, i.e., the traffic event is a redundant event, the server does not forward this event message to the business platform, does not modify the maintained event information registration table, and records the redundancy of the traffic event in the log for verification when necessary.
[0098] When a traffic event is not redundant in terms of time or space, i.e., when the traffic event is not a redundant event, the server can forward this event message to the business platform, update the status of the traffic event to "in progress", update the most recent event number to the event number of this event message, and update the most recent start time to the event start time of this event message.
[0099] In addition, if a logical conflict occurs due to incomplete event messages, and the server ultimately decides not to forward the event message, the server can record the logical conflict and possible causes in the log and report it to upstream personnel for investigation.
[0100] In this embodiment, target messages and event messages of target objects sent by various edge devices are received; the target registration table is updated based on the target messages to obtain an updated target registration table; the event registration table is updated based on the event messages to obtain an updated event registration table; when the event action in the new event message is in the start state and the traffic event corresponding to the new event message recorded in the updated event registration table is in the end state or not in the start state, the redundancy of the traffic event is detected based on the target information in the updated target registration table; based on the redundancy, the new event message is forwarded to the business platform, or the updated event registration table is updated based on the new event message. Since a target registration table and an event registration table are maintained separately on the server, after receiving target messages and event messages from various edge devices, the target registration table and event registration table can be updated based on the target messages and event messages respectively, resulting in updated target registration tables and updated event registration tables. Furthermore, when the event action in a new event message is in the start state, and the traffic event corresponding to the new event message recorded in the updated event registration table is in the end state or not started state, the redundancy of the traffic event can be detected based on the target information in the updated target registration table. That is, by dynamically maintaining the variables in the event registration table, correct state transitions and abnormal data flows can be achieved, which can comprehensively cover possible abnormal situations in reality, ensuring that the entire processing flow will not crash or output incorrect results due to abnormal situations. At the same time, by detecting the redundancy of traffic events, it is possible to automatically determine whether the traffic events are redundant in the time and space dimensions. That is, based on the redundancy of traffic events, it can determine whether to forward new event messages to the business platform, thereby enhancing the availability of results and effectively improving the accuracy of traffic event processing results.
[0101] In one embodiment, the target message in this application is obtained by each edge device performing target object detection on the image sequence acquired from the received point and searching for the detected target object; the target message includes the position trajectory of the target object in the image sequence and the target number; wherein, the target number is assigned when the target object is first detected; the event message is obtained by event recognition based on the position trajectory and the target number.
[0102] Specifically, let's take a highway traffic incident as an example. For instance, at a certain location on the highway, two cameras facing opposite directions are set up to continuously acquire image sequences at a certain frequency (e.g., 10Hz or 20Hz). These acquired image sequences are then sent in real-time to an edge computing device at that location for further processing. The edge computing device performs target object detection on the image sequences, obtaining the bounding box of the target object (e.g., vehicle, pedestrian) in each frame. Furthermore, the edge computing device can perform target search on the detected target objects, obtaining the location trajectory and target number of each target object in the image sequence. The target number is assigned when the target is first detected, and the assignment rule is to increment sequentially, resetting to 1 after exceeding a certain limit.
[0103] Edge computing devices can calculate the location trajectory of each target object in the real world through coordinate system transformation, and then calculate the corresponding speed. Based on pre-defined traffic events, edge computing devices can automatically analyze the behavior of target objects to identify a series of traffic events. Specifically, edge computing devices perform event identification based on the calculated location trajectory and target number, obtaining the corresponding traffic event identification result. Each traffic event also has a unique number, assigned at the start of the event, with the number incrementing sequentially and reset to 1 after exceeding a certain limit.
[0104] After the edge computing devices process and calculate the received data using built-in programs to obtain traffic event detection results, each location can transmit its traffic event detection results to the central computer, i.e., the server. In other words, the edge computing devices corresponding to each location can report the processed traffic event detection results to the server, and the server can receive target messages and event messages from each edge computing device.
[0105] For example, after the edge computing device has finished analyzing each frame of image, that is, after completing target detection, target search and traffic event detection, the edge computing device will send useful information to the server in real time. The information sent to the server includes target messages containing various parameters of the target, event messages containing various parameters of the event, and compressed images.
[0106] In this embodiment, by maintaining separate target registration tables and event registration tables, correct state transitions and detection of abnormal data flows can be achieved, comprehensively covering possible abnormal situations in reality. This ensures that the system will not crash or output incorrect results due to these abnormal situations, and can automatically analyze possible causes, providing feedback to maintenance personnel for targeted troubleshooting, thereby improving the work efficiency of maintenance personnel. Simultaneously, by detecting the redundancy of traffic events, it can automatically determine whether the current event is redundant in the time and space dimensions, filtering out redundant events and thus enhancing the usability of the results.
[0107] In one embodiment, the target registration form stores target information in a tree-like data structure; the method further includes:
[0108] If the target object in the target message exists in the target registration table, execute the step of updating the target registration table based on the target message;
[0109] If the target object in the target message does not exist in the target registry table, allocate the corresponding memory address for the target message in the target registry table.
[0110] Specifically, let's take the example of a target registration table storing target information in a tree-like data structure for illustration. For example... Figure 4 The diagram shows a flowchart of the target information processing module. The server maintains a target information registration table and an event information registration table. When the server receives target messages and event messages from various edge devices, the target information processing module can initialize the target information registration table based on the target messages sent by the edge computing devices. In other words, after the target information processing module starts, it first initializes the target information registration table. Figure 3 The first-level balanced binary tree in the target information registration table shown is set to an empty tree, and then proceeds as follows: Figure 4 The main loop processing flow is shown below. In, as... Figure 4 In the flowchart of the target information processing module shown, after the server receives a target message from the edge computing device, the target information processing module in the server checks whether the target object in the target message already exists in the target information registration table. Figure 3 When the target object in the target registration table shown is found, the server is triggered to perform the step of updating the target registration table based on the target message; when the target object in the target message does not exist in the target registration table as shown... Figure 3 When the target is shown in the target registration table, it indicates that the target in the target message is a new target, and the server can, as shown in the example... Figure 3 The target registration table shown assigns a corresponding memory address to the target message.
[0111] It is understandable that among the various implementations of balanced binary trees, the target registration table in this embodiment can be a red-black tree, meaning the target registration table stores target information using a red-black tree data structure. Since the target information registration table in this application requires a large number of query operations, insertion operations, and periodic deletion operations, a balanced binary tree is an efficient data structure. Its query, insertion, and deletion operations all have a time complexity of O(log n), where n is the number of elements in the tree. If other data structures are used, the time complexity of at least one operation will typically increase significantly. For example, although a linked list can achieve the same functionality, its query operation has a time complexity of O(n). When n is large, the linked list-based solution will be much slower than the balanced binary tree-based solution. Therefore, a balanced binary tree is a superior data structure in this scenario. Balanced binary trees can include red-black trees, AVL trees, etc. The time complexity of various operations of red-black trees and AVL trees is the same. Theoretically, AVL trees can also be used. However, in scenarios with many insertion or deletion operations (for example, in the scenario of this application), the overall performance of red-black trees is better than that of AVL trees.
[0112] In this embodiment, by dynamically maintaining the target registration table and event registration table, correct state transitions and detection of abnormal data flows can be achieved, comprehensively covering possible abnormal situations in reality. This ensures that the system will not crash or output incorrect results due to these abnormal situations, and can automatically analyze possible causes, providing feedback to maintenance personnel for targeted troubleshooting, thereby improving the work efficiency of maintenance personnel. Simultaneously, by detecting the redundancy of traffic events, it can automatically determine whether the current event is redundant in the time and space dimensions, filtering out redundant events and thus enhancing the usability of the results.
[0113] In one embodiment, the step of updating the target registration table based on the target message to obtain the updated target registration table includes:
[0114] Write the parameters contained in the target message into the corresponding fields of the memory addresses in the target registration table in sequence to obtain the updated target registration table;
[0115] The method further includes: periodically reclaiming memory released after target messages expire;
[0116] Remove the memory address corresponding to the freed memory from the target registry table.
[0117] Specifically, such as Figure 4The diagram shows a flowchart of the target information processing module. The server maintains a target information registration table and an event information registration table. When the server receives target messages and event messages from various edge devices, the target information processing module can initialize the target information registration table based on the target messages sent by the edge computing devices. After the target information processing module starts, it first initializes the target information registration table; that is, the target information processing module can process messages such as... Figure 3 The first-level balanced binary tree in the target information registration table shown is set to an empty tree, and then proceeds as follows: Figure 4 The main loop processing flow is shown below. In, as... Figure 4 In the flowchart of the target information processing module shown, after the server receives a target message from the edge computing device, the target information processing module in the server checks whether the target in the target message already exists in the target information registration table. If so, the server can enter or update the parameters of each target in the target information registration table based on the received target message, and reclaim the released memory after the target leaves the perception range. That is, the target information processing module in the server can fill the position vector, velocity vector, target type, target size, target color, and rectangular bounding box information in the target message into the corresponding fields in the basic storage unit to complete the entry or update of target information, and save the last update time. It can be understood that this target information stored in the basic storage unit is also available for access by the event information processing module and other downstream modules at any time, only requiring the location number and target number to be queried.
[0118] Furthermore, the server can periodically reclaim memory released after target messages expire and delete the memory address corresponding to the released memory from the target registry table, for example, using Figure 3 The example shown is a target information registration table that stores target information in a tree-like data structure. The server first traverses the table as follows: Figure 3 For each basic storage unit in the target information registration table shown, the difference between the last update time and the current time of each basic storage unit is checked. If the difference is greater than a threshold, it indicates that the target has not been observed for a long time. Therefore, the server releases the memory of this basic storage unit and deletes the node pointing to this basic storage unit in the second-level balanced binary tree corresponding to this basic storage unit. Further, the server continues to traverse as follows... Figure 3The server checks each second-level balanced binary tree in the target information registration table to see if it is empty. If so, the server releases the memory of that second-level balanced binary tree and deletes the node pointing to it from the first-level balanced binary tree. Thus, by dynamically maintaining the target registration table and event registration table, correct state transitions and detection of abnormal data flows can be achieved, comprehensively covering possible abnormal situations in reality. This ensures that the system will not crash or output incorrect results due to these abnormal situations, effectively improving the accuracy of traffic incident handling results. Furthermore, it can automatically analyze possible causes and provide feedback to maintenance personnel for targeted troubleshooting, improving the work efficiency of maintenance personnel.
[0119] In one embodiment, the step of allocating a corresponding memory address for a target message in the target registration table includes:
[0120] If the location number in the target message is not found in the key set of the first-level structure tree, insert a first node with the location number as the key into the first-level structure tree; the value of the first node is the memory address corresponding to the second-level structure tree.
[0121] When the target number in the target message does not exist in the key set of the second-level structure tree, a second node with the target number as the key is inserted into the second-level structure tree; the value of the second node is the memory address corresponding to the basic storage unit.
[0122] Use the memory address corresponding to the basic storage unit as the memory address corresponding to the target message.
[0123] Specifically, let's take the example of a target registration table storing target information in a tree-like data structure for illustration. For example... Figure 3 The image shown is a schematic diagram of the data structure of the target information registration form. Figure 3 As shown, the target information registration table consists of a two-level balanced binary tree and basic storage units. The key of the first-level balanced binary tree is the point number, and the value is the address of the second-level balanced binary tree in memory. The key of the second-level balanced binary tree is the target number, and the value is the address of the basic storage unit in memory. The basic storage unit stores the following fields: position vector, velocity vector, target type, target size, target color, target bounding box parameters, last update time, etc.
[0124] In such Figure 4 In the flowchart of the target information processing module shown, after the server receives a target message from the edge computing device, the target information processing module in the server checks whether the target object in the target message already exists in the target information registration table. If the target object in the target message does not exist in the target information registration table, the module will process the target information. Figure 3 In the target registration table shown, the server can, for example, Figure 3 The target registration table shown assigns a corresponding memory address to the target message. The specific steps are as follows:
[0125] 1. When Figure 3 When the key set of the first-level balanced binary tree in the target registration table does not contain the location number in the target message, the server can, as shown, Figure 3 Insert a first node with the location number in the target message as the key into the first-level balanced binary tree in the target registration table shown, and request an empty second-level balanced binary tree. The server can set the value of the newly inserted first node to the memory address of the empty second-level balanced binary tree.
[0126] 2. Furthermore, the server can query, for example... Figure 3 The first node in the first-level balanced binary tree of the target registration table, whose key is the location number in the target message, is used to obtain the memory address of the second-level balanced binary tree;
[0127] 3. When Figure 3 When the target number in the target message does not exist in the key set of the second-level balanced binary tree in the target registration table shown, the server inserts a second node with the target number in the target message as the key in the second-level balanced binary tree, requests an empty basic storage unit, and sets the value of the newly inserted second node to the address of the empty basic storage unit in memory.
[0128] 4. Furthermore, the server can query, for example... Figure 3 The second node in the second-level balanced binary tree of the target registration table, whose key is the target number in the target message, yields the address of the basic storage unit in memory;
[0129] 5. Return the memory address of the basic storage unit. The server can use the memory address corresponding to the basic storage unit as the memory address of the target message.
[0130] At this point, the memory of the basic storage unit corresponding to the target object has been allocated. The server can access and modify the memory based on the returned memory address of the basic storage unit. For example, the server can sequentially fill the position vector, velocity vector, target type, target size, target color, and bounding box information from the target message into the corresponding fields of the basic storage unit to complete the entry or update of the target information and save the last update time. Therefore, by dynamically maintaining the target registration table and event registration table, correct state transitions and detection of abnormal data streams can be achieved, comprehensively covering possible abnormal situations in reality. This ensures that the system will not crash or output incorrect results due to these abnormal situations, effectively improving the accuracy of traffic incident handling results. Furthermore, it can automatically analyze possible causes and provide feedback to maintenance personnel for targeted troubleshooting, improving the work efficiency of maintenance personnel.
[0131] In one embodiment, the step of periodically reclaiming memory released after a target message expires includes:
[0132] Determine the difference between the update time and the current time for each basic storage unit;
[0133] If the difference is greater than the threshold, release the memory of the basic storage unit and delete the node pointing to the basic storage unit in the second-level tree structure.
[0134] When the second-level tree structure is empty, release the memory of the second-level tree structure and delete the node pointing to the second-level tree structure in the first-level tree structure.
[0135] Specifically, let's take the example of a target registration table storing target information in a tree-like data structure for illustration. For example... Figure 3 The diagram shown illustrates the data structure of the target information registration table. Periodically, the server automatically reclaims memory released by expired targets from the target information registration table. The server first iterates through the table as follows: Figure 3 For each basic storage unit in the target information registration table shown, the difference between the last update time and the current time of each basic storage unit is checked. If the difference is greater than a threshold, it indicates that the target has not been observed for a long time. Therefore, the server releases the memory of this basic storage unit and deletes the node pointing to this basic storage unit in the second-level balanced binary tree corresponding to this basic storage unit. Further, the server continues to traverse as follows... Figure 3The server checks each second-level balanced binary tree in the target information registration table to see if it is empty. If so, the server releases the memory of that second-level balanced binary tree and deletes the node pointing to it from the first-level balanced binary tree. Thus, by dynamically maintaining the target registration table and event registration table, correct state transitions and detection of abnormal data flows can be achieved, comprehensively covering possible abnormal situations in reality. This ensures that the system will not crash or output incorrect results due to these abnormal situations, effectively improving the accuracy of traffic incident handling results. Furthermore, it can automatically analyze possible causes and provide feedback to maintenance personnel for targeted troubleshooting, improving the work efficiency of maintenance personnel.
[0136] In one embodiment, the step of updating the event registration table based on the event message to obtain the updated event registration table includes:
[0137] In the event registration table, the location number, target number, and event type that match the event message are checked to obtain the detection results;
[0138] When the detection result indicates that at least one of the point number, target number, and event type is empty, a corresponding memory address is allocated for the event message in the event registration table;
[0139] The parameters contained in the event message are written sequentially into the corresponding fields of the memory addresses in the event registration table to obtain the updated event registration table.
[0140] Specifically, let's take the example of an event registration table storing event information using a tree-like data structure. For example... Figure 5 The image shown is a schematic diagram of the data structure of the event information registration form. Figure 5 As shown, the event information registration table consists of a three-level balanced binary tree and basic storage units. The key of the first-level balanced binary tree is the point number, and the value is the address of the second-level balanced binary tree in memory. The key of the second-level balanced binary tree is the target number, and the value is the address of the third-level balanced binary tree in memory. The key of the third-level balanced binary tree is the event type, and the value is the address of the basic storage unit in memory. The basic storage unit stores the following fields:
[0141] 1. Event status, including not started, in progress, and completed. In this application, the default is not started;
[0142] 2. Recent event number: If this type of event is currently occurring on the target, then it is the current event number; otherwise, it is the event number of the most recent occurrence of this type of event on the target.
[0143] 3. Most recent start time: If the target is currently experiencing this type of event, then it is the start time of the current event; otherwise, it is the start time of the most recent occurrence of this type of event for the target.
[0144] 4. Most recent end time: The end time of the most recent completed event of this type that occurred for the target.
[0145] like Figure 6 The diagram shows a flowchart of the event information processing module. The server maintains a target information registration table and an event information registration table. When the server receives target messages and event messages from various edge devices, the event information processing module can initialize the event information registration table based on the event messages sent by the edge computing devices. After the event information processing module starts, it first initializes the event information registration table; that is, the event information processing module can... Figure 5 The first-level balanced binary tree in the event information registration table shown is set to an empty tree, and then proceeds as follows: Figure 6 The main loop processing flow is shown below. In, as... Figure 6 In the flowchart of the event information processing module shown, after the server receives an event message from the edge computing device, the event information processing module in the server checks whether the basic storage unit corresponding to the point number, target number, and event type in the event message already exists in the event information registration table shown in the figure. That is, the event information processing module in the server checks the event registration table to detect the point number, target number, and event type that match the event message and obtains the detection result. When the detection result indicates that at least one of the point number, target number, and event type is empty, the event information processing module in the server allocates the corresponding memory address for the event message in the event registration table. After the event information processing module in the server allocates the memory of the corresponding basic storage unit for the point number, target number, and event type in the event message, the server can write the various parameters contained in the event message into the corresponding fields of the memory address allocated to the event message in the event registration table in sequence to obtain the updated event registration table. Therefore, by dynamically maintaining the target registration form and the event registration form, correct state transitions and abnormal data flows can be achieved, comprehensively covering possible abnormal situations in reality. This ensures that the system will not crash or output incorrect results due to these abnormal situations, effectively improving the accuracy of traffic incident handling results. Furthermore, it can automatically analyze possible causes and provide feedback to maintenance personnel for targeted troubleshooting, thereby improving the work efficiency of maintenance personnel.
[0146] In one embodiment, the step of allocating a corresponding memory address for an event message in the event registry table includes:
[0147] If the location number in the event message does not exist in the key set of the first-level structure tree, insert a first node with the location number as the key into the first-level structure tree; the value of the first node is the memory address corresponding to the second-level structure tree.
[0148] If the target number in the event message does not exist in the key set of the second-level structure tree, insert a second node with the target number as the key into the second-level structure tree; the value of the second node is the memory address corresponding to the third-level structure tree.
[0149] When the event type in the event message does not exist in the key set of the third-level structure tree, a third node with the event type as the key is inserted into the third-level structure tree; the value of the third node is the memory address corresponding to the basic storage unit.
[0150] The memory address corresponding to the basic storage unit is used as the memory address corresponding to the event message.
[0151] Specifically, let's take the example of an event registration table storing event information using a tree-like data structure. For example... Figure 5 The image shown is a schematic diagram of the data structure of the event information registration form. Figure 5 As shown, the event information registration table consists of a three-level balanced binary tree and basic storage units. The key of the first-level balanced binary tree is the point number, and the value is the address of the second-level balanced binary tree in memory. The key of the second-level balanced binary tree is the target number, and the value is the address of the third-level balanced binary tree in memory. The key of the third-level balanced binary tree is the event type, and the value is the address of the basic storage unit in memory. The basic storage unit stores the following fields:
[0152] 1. Event status, including not started, in progress, and completed. In this application, the default is not started;
[0153] 2. Recent event number: If this type of event is currently occurring on the target, then it is the current event number; otherwise, it is the event number of the most recent occurrence of this type of event on the target.
[0154] 3. Most recent start time: If the target is currently experiencing this type of event, then it is the start time of the current event; otherwise, it is the start time of the most recent occurrence of this type of event for the target.
[0155] 4. Most recent end time: The end time of the most recent completed event of this type that occurred for the target.
[0156] In such Figure 6In the flowchart of the event information processing module shown, after the server receives an event message from the edge computing device, the event information processing module in the server checks whether the basic storage unit corresponding to the point number, target number, and event type in the event message already exists in the event information registration table shown in the figure. If not, the server needs to allocate a memory address for the event message in the event information registration table. That is, the event information processing module in the server checks the event registration table to detect the point number, target number, and event type that match the event message and obtains the detection result. When the detection result indicates that at least one of the point number, target number, and event type in the event message is empty, the event information processing module in the server needs to... Figure 5 The event registry table shown assigns a corresponding memory address to this event message. The specific steps are as follows:
[0157] 1. When Figure 5 When the key set of the first-level balanced binary tree in the event registry table does not contain the point number in the event message, the server can, as shown, Figure 5 The event registry table shown inserts a first node with the location number in the event message as the key into the first-level balanced binary tree, and requests an empty second-level balanced binary tree, setting the value of the newly inserted first node to the memory address of the empty second-level balanced binary tree;
[0158] 2. Furthermore, the server can query, for example... Figure 5 The first node in the first-level balanced binary tree of the event registry table, whose key is the location number in the event message, is used to obtain the memory address of the second-level balanced binary tree;
[0159] 3. When Figure 5 When the target number in the event message does not exist in the key set of the second-level balanced binary tree in the event registration table shown, the server can insert a second node with the target number in the event message as the key into the second-level balanced binary tree, and request an empty third-level balanced binary tree, setting the value of the newly inserted second node to the address of the empty third-level balanced binary tree in memory;
[0160] 4. Furthermore, the server can query queries such as... Figure 5 The second node in the second-level balanced binary tree of the event registry table, whose key is the target number in the event message, yields the memory address of the third-level balanced binary tree;
[0161] 5. When Figure 5When the event type in the event message does not exist in the key set of the third-level balanced binary tree in the event registration table shown, the server inserts a third node with the event type in the event message as the key in the third-level balanced binary tree, requests an empty basic storage unit, and sets the value of the newly inserted third node to the address of the empty basic storage unit in memory.
[0162] 6. Furthermore, the server can query, for example... Figure 5 The third node in the third-level balanced binary tree of the event registry table, whose key is the event type in the event message, yields the address of the basic storage unit in memory.
[0163] 7. Returns the memory address of the basic storage unit. The server can use the returned memory address of the basic storage unit as the memory address of the event message.
[0164] At this point, the memory of the basic storage unit corresponding to the location number, target number, and event type in the event message has been allocated. The server can access and modify the memory based on the returned memory address. Furthermore, the server can run the corresponding event action processing module based on the event action in the event message; if the event action in the event message is "start," the event start action processing module is run; if the event action in the event message is "continue," the event continue action processing module is run; if the event action in the event message is "end," the event end action processing module is run. Therefore, by dynamically maintaining the target registration table and event registration table, correct state transitions and detection of abnormal data flows can be achieved, comprehensively covering possible abnormal situations in reality. This ensures that the system will not crash or output incorrect results due to these abnormal situations, effectively improving the accuracy of traffic event handling results. It can also automatically analyze possible causes and provide feedback to maintenance personnel for targeted troubleshooting, improving the work efficiency of maintenance personnel.
[0165] In one embodiment, the method further includes:
[0166] When the target object corresponding to the third-level structure tree does not exist in the target registration table, release the memory of the third-level structure tree and the basic storage unit corresponding to the third-level structure tree, and delete the node pointing to the third-level structure tree in the second-level structure tree;
[0167] When the second-level tree structure is empty, release the memory of the second-level tree structure and delete the node pointing to the second-level tree structure in the first-level tree structure.
[0168] Specifically, the server can periodically reclaim memory released after event messages expire and delete the memory address corresponding to the released memory from the event registry table, for example, as shown in the example below. Figure 5The example shown is an event information registration table that stores event information in a tree-like data structure. The server first traverses the table as follows: Figure 5 For each third-level balanced binary tree in the event information registration table shown, check if the target corresponding to each third-level balanced binary tree exists in the target information registration table. If not, the server releases the memory of this third-level balanced binary tree and the basic storage units derived from it, and simultaneously deletes the node pointing to this third-level balanced binary tree in the second-level balanced binary tree corresponding to it. Further, the server continues to traverse... Figure 5 The event information registration table shown in the diagram checks each second-level balanced binary tree in the event information registration table to see if it is empty. If it is, the server releases the memory of that second-level balanced binary tree and deletes the node pointing to it from the first-level balanced binary tree. Therefore, by dynamically maintaining the target registration table and the event registration table, correct state transitions and detection of abnormal data flows can be achieved, comprehensively covering possible abnormal situations in reality. This ensures that the system will not crash or output incorrect results due to these abnormal situations, effectively improving the accuracy of traffic event handling results. Furthermore, it can automatically analyze possible causes and provide feedback to maintenance personnel for targeted troubleshooting, improving the work efficiency of maintenance personnel.
[0169] In one embodiment, the event registry stores event information in a tree-like data structure; the method further includes:
[0170] If the location number, target number, and event type in the event message exist in the event registration table, execute the step of updating the event registration table based on the event message.
[0171] Specifically, let's take the example of an event registration table storing event information using a tree-like data structure. For example... Figure 6 The diagram shows a flowchart of the event information processing module. The server maintains a target information registration table and an event information registration table. When the server receives target messages and event messages from various edge devices, the event information processing module can initialize the event information registration table based on the event messages sent by the edge computing devices. After the event information processing module starts, it first initializes the event information registration table; that is, the event information processing module can... Figure 5 The first-level balanced binary tree in the event information registration table shown is set to an empty tree, and then proceeds as follows: Figure 6 The main loop processing flow is shown below. In, as... Figure 6In the flowchart of the event information processing module shown, after the server receives an event message from the edge computing device, the event information processing module in the server checks whether the basic storage unit corresponding to the point number, target number, and event type in the event message already exists in the event information registration table shown. When at least one of the point number, target number, and event type in the event message is empty, the server needs to allocate the corresponding memory address for the event message in the event registration table; when the point number, target number, and event type in the event message already exist in the event registration table, the server allocates the corresponding memory address for the event message. Figure 5 In the event registry table shown, the server can perform the step of updating the event registry table based on the event message.
[0172] It is understandable that, among the various implementations of balanced binary trees, the event registration table in this embodiment can be a red-black tree, meaning the event registration table stores event information using a red-black tree data structure. Since the event registration table in this application requires a large number of query operations, insertion operations, and periodic deletion operations, a balanced binary tree is an efficient data structure. Its query, insertion, and deletion operations all have a time complexity of O(log n), where n is the number of elements in the tree. If other data structures are used, the time complexity of at least one operation will typically increase significantly. For example, although a linked list can achieve the same functionality, its query operation has a time complexity of O(n). When n is large, the linked list-based solution will be much slower than the balanced binary tree-based solution. Therefore, a balanced binary tree is a superior data structure in this scenario. Balanced binary trees can include red-black trees, AVL trees, etc. The time complexity of various operations of red-black trees and AVL trees is the same. Theoretically, AVL trees can also be used. However, in scenarios with many insertion or deletion operations (for example, in the scenario of this application), the overall performance of red-black trees is better than that of AVL trees.
[0173] In this embodiment, by dynamically maintaining the target registration table and the event registration table, correct state transitions and abnormal data streams can be achieved, comprehensively covering possible abnormal situations in reality. This ensures that the system will not crash or output incorrect results due to these abnormal situations, effectively improving the accuracy of traffic incident handling results. Furthermore, it can automatically analyze possible causes and provide feedback to maintenance personnel for targeted troubleshooting, thereby improving the work efficiency of maintenance personnel.
[0174] In one embodiment, the method further includes:
[0175] When the event action in the new event message is in the start state, check the point number, target number and event type that match the new event message in the updated event registry table;
[0176] Based on the location number and target number, the first target object is determined;
[0177] Based on the first target object and the event type, determine the progress status and end time of the traffic event corresponding to the first target object;
[0178] When a traffic event is in progress, update the progress status of the traffic event to end, and update the end time to the timestamp of the current event message.
[0179] Specifically, such as Figure 8The diagram shows the flowchart of the event initiation action processing module. First, the server sequentially searches the event information registration table for the location number, target number, and event type of the new event message to be processed, obtaining the corresponding traffic event's progress status, most recent event number, most recent start time, and most recent end time. When the event action in the new event message is in the "start" state, the server can check the updated event registration table for location numbers, target numbers, and event types that match the new event message. Based on the location number and target number, the server determines the first target object from multiple target objects. Based on the determined first target object and event type, the server can determine the progress status and end time of the traffic event corresponding to the first target object. That is, when the traffic event's progress status is "in progress," it indicates that the previous event of the same type lacked a message containing an ending action, and may also lack some messages containing ongoing actions. Because the current event has started before the previous similar event has ended, there is a possibility of redundancy. Furthermore, the previous similar event has already been reported to the business platform. Therefore, the server system decides not to report the current event to the business platform, which also means not forwarding this event message. To correctly handle potentially non-redundant events received in the future, the server can update the event status to "completed," update the most recent end time to the timestamp of this event message, and inform the business platform that events that have not ended properly have been terminated by the system. If the event status is "not started" or "completed," the server needs to call the event redundancy judgment module to determine whether the event to be processed is redundant. The event redundancy judgment module determines whether the current event is redundant from both time and spatial dimensions. In the time dimension, if the event status is "completed," and the difference between the most recent end time and the timestamp of this event message is less than the preset redundancy time threshold for this type of event, then the event to be processed is redundant. In the spatial dimension, the distinguishability of the target in the current event and each target in adjacent locations experiencing the same type of traffic event is calculated. If any distinguishability is less than a threshold, then the event to be processed is redundant. Therefore, the set of processing modules proposed in this application (event start action processing module, event continuation action processing module, event end action processing module, etc.) comprehensively covers possible abnormal situations in reality, ensuring that the system will not crash or output incorrect results due to these abnormal situations. Furthermore, it can automatically analyze possible causes and provide feedback to maintenance personnel for targeted troubleshooting, improving their work efficiency. Simultaneously, by proposing an event redundancy judgment module, which uses deep learning methods to extract multiple features, it can automatically determine whether the current event is redundant in the time and space dimensions, filtering out redundant events and thus enhancing the usability of the results.
[0180] In one embodiment, the method further includes:
[0181] When the event action in the new event message is in a continuous state, check the point number, target number and event type that match the new event message in the updated event registration table;
[0182] Based on the location number and the target number, the first target object is determined;
[0183] Based on the first target object and the event type, determine the progress status, event number, start time and end time of the traffic event corresponding to the first target object;
[0184] When a traffic incident is in progress and the incident number and start time are the same as those in the incident message, the incident message is forwarded to the business platform.
[0185] When a traffic event is in progress and the event number and start time are different from the event number and start time in the event message, the progress status of the traffic event is updated to the completed status, and the completion time is updated to the timestamp of the current event message.
[0186] Specifically, such as Figure 9The diagram shows the flowchart of the event continuous action processing module. First, the server sequentially searches the event information registration table for the location number, target number, and event type of the new event message to be processed, obtaining the corresponding traffic event status, most recent event number, most recent start time, and most recent end time. If the traffic event status is "not started" or "finished," it means that the previous similar event ended normally, and the traffic event to be processed is missing a message containing the start action, and may also be missing some messages containing continuous actions. Because the traffic event to be processed is missing a relatively important start part, the server system decides not to report the incomplete event to the business platform, which also means not forwarding this event message; since maintaining the current state is sufficient to correctly handle any complete events that may be received in the future, the event information registration table is not modified. If the traffic event status is "in progress," the server needs to check whether the event number and start time of the traffic event to be processed are equal to the most recent event number and most recent start time in the event information registration table, respectively. If yes, it means the traffic incident to be processed and the most recent event in the event information registration table are the same event, and there is no logical conflict. Therefore, this event message is forwarded to the business platform, and the event information registration table is not modified. If no, it means the traffic incident to be processed and the most recent event in the event information registration table are not the same event. The previous event of the same type is missing a message containing the ending action, while the traffic incident to be processed is missing a message containing the starting action, and both may be missing a part of the message containing the continuing action. Because the traffic incident to be processed is missing a relatively important starting part, the server system decides not to report the incomplete event to the business platform, which also means not forwarding this event message. Furthermore, in order to correctly handle complete events that may be received in the future, the server updates the progress status of the traffic incident to "completed," updates the most recent end time to the timestamp of this event message, and informs the business platform that events that have not ended properly have been terminated by the system. Finally, if a logical conflict is caused by incomplete event messages, and the server ultimately decides not to forward this event message, the server can record the logical conflict and possible causes in the log and report it to upstream personnel for investigation. The analysis method is the same as the analysis method in the event start action processing module. Therefore, the set of processing modules proposed in this application (event start action processing module, event continuation action processing module, event end action processing module, etc.) comprehensively covers possible abnormal situations in reality, ensuring that the system will not crash or output incorrect results due to these abnormal situations. Furthermore, it can automatically analyze possible causes and provide feedback to maintenance personnel for targeted troubleshooting, improving their work efficiency. Simultaneously, by proposing an event redundancy judgment module, which uses deep learning methods to extract multiple features, it can automatically determine whether the current event is redundant in the time and space dimensions, filtering out redundant events and thus enhancing the usability of the results.
[0187] In one embodiment, the method further includes:
[0188] When the event action in the new event message is in the completed state, check the point number, target number and event type that match the new event message in the updated event registration table;
[0189] Based on the location number and the target number, the first target object is determined;
[0190] Based on the first target object and the event type, determine the progress status, event number, start time and end time of the traffic event corresponding to the first target object;
[0191] When a traffic incident is in progress and the incident number and start time are the same as the incident number and start time in the incident message, the incident message is forwarded to the business platform, the progress status of the traffic incident is updated to the completed status, and the completion time is updated to the timestamp of the current incident message.
[0192] When a traffic event is in progress and the event number and start time are different from the event number and start time in the event message, the progress status of the traffic event is updated to the completed status, and the completion time is updated to the timestamp of the current event message.
[0193] Specifically, such as Figure 10The diagram shows the flowchart of the event termination action processing module. First, the server sequentially searches the event information registration table for the location number, target number, and event type of the event message to be processed, obtaining the corresponding traffic event status, most recent event number, most recent start time, and most recent end time. If the traffic event status is "not started" or "finished," it means that the previous event of the same type ended normally, and the traffic event to be processed is missing a message containing the start action, and may also be missing some messages containing ongoing actions. Because the traffic event to be processed is missing a relatively important start part, the server system decides not to report the incomplete event to the business platform, which also means not forwarding this event message; since maintaining the current state is sufficient to correctly handle any complete events that may be received in the future, the event information registration table is not modified. If the traffic event status is "in progress," the server needs to check whether the event number and start time of the traffic event to be processed are equal to the most recent event number and most recent start time in the event information registration table, respectively. If yes, it means the traffic incident to be processed and the most recent event in the event information registration table are the same event, and there is no logical conflict. Therefore, the server can forward this event message to the business platform, update the traffic incident's progress status to "completed," and update the most recent end time to the timestamp of this event message. If no, it means the traffic incident to be processed and the most recent event in the event information registration table are not the same event. The previous event of the same type is missing a message containing the ending action, while the traffic incident to be processed is missing a message containing the starting action, and both may be missing some messages containing the continuing action. Because the traffic incident to be processed is missing a relatively important beginning part, the server system decides not to report the incomplete event to the business platform, which also means not forwarding this event message. In order to correctly handle complete events that may be received in the future, the server can update the traffic incident's progress status to "completed," update the most recent end time to the timestamp of this event message, and inform the business platform that the event that did not end properly has been terminated by the system. Finally, if a logical conflict is caused by incomplete event messages, and the server ultimately decides not to forward this event message, the server can record the logical conflict and possible causes in the log and report it to upstream personnel for investigation. The analysis method is the same as that in the event start action processing module. Therefore, through the set of processing modules (event start action processing module, event continuation action processing module, event end action processing module, etc.) proposed in this embodiment, comprehensive coverage of possible abnormal situations in reality is achieved, ensuring that the system will not crash or output incorrect results due to these abnormal situations. Furthermore, it can automatically analyze possible causes and provide feedback to maintenance personnel for targeted troubleshooting, thereby improving the work efficiency of maintenance personnel.Meanwhile, by proposing an event redundancy judgment module, which uses deep learning methods to extract multiple features, it can automatically determine whether the current event is redundant in the time and space dimensions, filter out redundant events, and thus enhance the usability of the results.
[0194] In one embodiment, the step of detecting redundancy of traffic events based on target information in the updated target registry includes:
[0195] In terms of time, if a traffic event is in a completed state, and the difference between the end time of the traffic event and the timestamp of the event message is less than a preset difference, then the traffic event is determined to be a redundant event; or,
[0196] In the spatial dimension, among the adjacent points corresponding to the target object, identify the objects that have occurred in the same type of traffic event, and determine the distinguishability between the target object and the objects in the same type of traffic event; when the distinguishability is less than the threshold, the traffic event is determined to be a redundant event.
[0197] Specifically, in the time dimension, if a traffic event is in a completed state, and the difference between the end time of the traffic event and the timestamp of the event message is less than a preset difference, the server determines the traffic event as a redundant event. Alternatively, in the spatial dimension, among the adjacent points corresponding to the target object's location, objects experiencing the same type of traffic event are identified, and the distinguishability between the target object and the objects in the same type of traffic event is determined. When the distinguishability is less than a threshold, the traffic event is determined to be a redundant event. Therefore, by proposing an event redundancy judgment module, which uses deep learning methods to extract multiple features, it can automatically determine whether the current event is redundant in both time and spatial dimensions, filtering out redundant events and thus enhancing the usability of the results.
[0198] In one embodiment, the step of determining the distinguishability between a target object and objects in similar traffic events includes:
[0199] Identify the objects involved in the same type of traffic incident among the adjacent points corresponding to the target object's location;
[0200] Determine the location discrimination, speed discrimination, type discrimination, size discrimination, and color discrimination between the target object and objects in similar traffic events;
[0201] Based on location discrimination, speed discrimination, type discrimination, size discrimination, and color discrimination, the discrimination between the target object and objects in the same type of traffic event is determined.
[0202] Specifically, the discrimination in this application embodiment is defined as the weighted average of the following:
[0203] 1. Location discrimination: |xx′| 2 +|yy′| 2 , where (x,y) is the position vector of the current target, and (x',y') is the position vector of another target;
[0204] 2. Speed discrimination: |v x -v′ x | 2 +|v y -v′ y | 2 , where (v x ,v y (v′) represents the velocity vector of the current target. x ,v′ y () represents the velocity vector of another target;
[0205] 3. Type Distinction: The type distinction between pedestrians and motorcycles, motorcycles and non-motorized vehicles, and pedestrians and non-motorized vehicles is infinite. The type distinction between small cars and medium-sized cars is a preset value of 1, the type distinction between medium-sized cars and large cars is a preset value of 2, and the type distinction between small cars and large cars is a preset value of 1 + preset value of 2.
[0206] 4. Size differentiation: Where l, w, h are the length, width, and height of the current target, respectively, and l', w', h' are the length, width, and height of another target, respectively;
[0207] 5. Color differentiation: In the formula Δr = rr′, Δg = gg′, Δb = bb′, where r, g, b are the RGB color values of the current target, and r', g', b' are the RGB color values of another target, all ranging from 0 to 255.
[0208] That is, the server can identify objects in the same type of traffic event among the adjacent points corresponding to the target object's location, and determine the location differentiation, speed differentiation, type differentiation, size differentiation, and color differentiation between the target object and objects in the same type of traffic event based on the above calculation method; further, the server can calculate the weighted average of the location differentiation, speed differentiation, type differentiation, size differentiation, and color differentiation, and use the calculated weighted average as the differentiation between the target object and objects in the same type of traffic event.
[0209] If a traffic event to be processed is redundant in terms of time or space, the server will not forward the event message to the business platform, the event information registration form will remain unchanged, and the redundancy will be logged for verification when necessary. Otherwise, the server will forward the event message to the business platform, update the event status to "in progress," update the most recent event number to the event number of this event message, and update the most recent start time to the event start time of this event message. Therefore, by proposing an event redundancy judgment module, which uses deep learning methods to extract multiple features, it can automatically determine whether the current event is redundant in terms of time and space, filtering out redundant events and thus enhancing the usability of the results. Furthermore, by employing different redundancy detection methods, more accurate redundancy detection results can be obtained.
[0210] In one embodiment, after detecting redundancy of traffic events based on target information in the updated target registration table, the method further includes:
[0211] When a traffic incident is a redundant incident, the redundant information of the traffic incident is recorded in the log.
[0212] After forwarding the new event message to the business platform based on the redundancy, the method further includes:
[0213] Update the status of the traffic event to "in progress", update the event number corresponding to the traffic event to the event number of the event message, and update the start time corresponding to the traffic event to the start time of the event message.
[0214] Specifically, when a traffic event is redundant, the server logs the redundant information of the traffic event. After the server forwards a new event message to the business platform based on redundancy, it can update the progress status of the traffic event to "in progress," update the event number corresponding to the traffic event to the event number of the event message, and update the start time corresponding to the traffic event to the start time of the event message. Thus, through the set of processing modules (event start action processing module, event continuation action processing module, event end action processing module, etc.) proposed in this embodiment, comprehensive coverage of possible abnormal situations in reality is achieved, ensuring that the system will not crash or output incorrect results due to these abnormal situations. Furthermore, it can automatically analyze possible causes and provide feedback to maintenance personnel for targeted troubleshooting, improving the work efficiency of maintenance personnel. Simultaneously, by proposing an event redundancy judgment module, which uses deep learning methods to extract multiple features, it can automatically determine whether the current event is redundant in the time and space dimensions, filtering out redundant events and thus enhancing the usability of the results.
[0215] This application also provides an application scenario in which the above-described traffic incident handling method is applied. Specifically, the application of the traffic incident handling method in this scenario is as follows:
[0216] In the intelligent highway traffic incident real-time aggregation system, the aforementioned video interaction method can be used to aggregate traffic incident information detected by automatic traffic incident detection systems deployed at multiple locations along a long highway to the data center and business platform in real time. This helps traffic control and law enforcement personnel accurately, comprehensively, and efficiently identify traffic incidents, and thus take appropriate measures in a timely manner. The aggregation system (server) can receive target messages and event messages from various edge devices, and update the target registration table based on the target messages to obtain an updated target registration table. The aggregation system (server) can also update the event registration table based on event messages to obtain an updated event registration table. When the aggregation system (server) receives a new event message where the event action is in the starting state, and the traffic incident corresponding to the new event message recorded in the updated event registration table is in the ending state or not yet started state, the aggregation system (server) detects the redundancy of the traffic incident based on the target information in the updated target registration table. Based on the redundancy, the aggregation system (server) forwards the new event message to the business platform, or updates the updated event registration table based on the new event message. The method provided in this application can achieve the following effects:
[0217] 1. By using streaming representation of events, the current status of each event (including completed and ongoing events) can be displayed in real time, ensuring the timeliness of command and intervention;
[0218] 2. By designing efficient data structures and algorithms, the method provided in this application has very low performance requirements for the central computer; a single ordinary computer can handle it, and the cost and technical requirements are lower than those of distributed systems.
[0219] 3. This application proposes a set of processing modules that comprehensively cover possible abnormal situations in reality, ensuring that the system will not crash or output incorrect results due to these abnormal situations, and can automatically analyze possible causes;
[0220] 4. This application proposes an event redundancy judgment module, which uses deep learning methods to extract multiple features and can automatically determine whether the current event is redundant in the time and space dimensions, filter out redundant events, and thus enhance the usability of the results.
[0221] The method provided in this application can be applied to various traffic scenarios. The following uses the detection scenario of highway traffic incidents as an example to illustrate the traffic incident handling method provided in this application.
[0222] In traditional traffic incident handling, for multi-location traffic incidents, each location transmits its traffic incident detection results to a central computer. The central computer then aggregates the data, identifies and removes incomplete, abnormal, and redundant entries, and sends the results to the business platform, ultimately presenting them to relevant personnel in an intuitive format. It's important to note that, due to the reasons mentioned above, incomplete, abnormal, and redundant data received by the central computer is very common in practice. An undesigned system may become confused upon receiving problematic data, continuously providing incorrect calculation results for subsequent inputs, or even crash. Alternatively, an undesigned system may fail to effectively remove redundant messages in the spatiotemporal dimensions, leading to frequent duplicate reporting of events and significantly reducing the usability of the results.
[0223] Therefore, to address the aforementioned issues, this application provides a robust intelligent real-time traffic incident aggregation method for highways. This method aggregates traffic incident information detected by automated traffic incident detection systems deployed at multiple locations along a long-distance highway to a data center and business platform in real time. This helps traffic control and law enforcement personnel accurately, comprehensively, and efficiently identify traffic incidents, enabling them to take timely and appropriate measures. Its key features are twofold. First, the method proposed in this application presents a set of processing modules that comprehensively cover potential abnormal situations in reality (e.g., poor network conditions leading to packet loss; a location encountering a fault requiring a restart; or upstream data source switching due to debugging needs). This ensures that the system will not crash or output incorrect results due to these abnormal situations and can automatically analyze possible causes, providing feedback to maintenance personnel for targeted troubleshooting, thereby improving the work efficiency of maintenance personnel. Secondly, the method provided in this application proposes an event redundancy judgment module, which uses deep learning methods to extract multiple features and can automatically judge whether the current event is redundant in the time and space dimensions (time dimension redundancy refers to the same point repeatedly reporting the same event; space dimension redundancy refers to different points observing and reporting the same event, resulting in repeated reporting of the event), and filter out redundant events, thereby enhancing the usability of the results.
[0224] Robustness refers to the ability of a computer system to maintain normal operation and correct calculation results when it encounters errors, anomalies, or malfunctions (such as poor network conditions or hard drive failure) during its own operation and the input, processing, and output of data.
[0225] On the product side, the method provided in this application is used to aggregate traffic incident information detected by automatic traffic incident detection systems deployed at multiple locations along a long-distance highway to the data center and business platform in real time, helping traffic control and law enforcement personnel to accurately, comprehensively, and efficiently identify traffic incidents and then take appropriate measures in a timely manner.
[0226] On the technical side, for a single-point traffic incident detection system, two cameras facing opposite directions are set up at a certain location on the highway to continuously acquire image sequences at a certain frequency (e.g., 10Hz or 20Hz), which are then sent to the edge computing device at that location for further processing. After target detection, we can obtain the bounding boxes of the targets (vehicles, pedestrians) of interest in each frame. Then, through target lookup, we can obtain the position trajectory and target number of each target in the image sequence. The target number is assigned when the target is first detected, with the assignment rule being sequential increments, resetting to 1 after exceeding a certain limit. Through coordinate system transformation, we can obtain the position trajectory of each target in the real world and calculate its speed. Then, based on our definition of traffic incidents, the system can automatically analyze the behavior of the targets, thereby identifying a series of traffic incidents. Each traffic incident also has a number, assigned at the beginning of the incident, again with the assignment rule being sequential increments, resetting to 1 after exceeding a certain limit. The definitions of some traffic incidents are as follows:
[0227] 1. Pedestrians on the highway: Pedestrians appear on the highway and the duration reaches the preset detection time threshold.
[0228] 2. Motorcycle on the highway: A motorcycle appears on the highway and remains there for a period of time that reaches the preset detection time threshold.
[0229] 3. Speeding: The vehicle speed exceeds the speed limit (e.g., 100 km / h) for a duration that reaches the preset detection time threshold.
[0230] 4. Low speed: The vehicle speed is less than the low speed threshold (e.g., 70 km / h) and greater than the parking speed threshold (e.g., 5 km / h), and the duration reaches the preset detection time threshold.
[0231] 5. Parking: The vehicle speed is less than the parking speed threshold (e.g., 5 km / h) for a duration that reaches the preset detection time threshold.
[0232] 6. Occupying the emergency lane: The vehicle is in the emergency lane for a period of time that reaches the preset detection time threshold.
[0233] 7. Driving in the wrong direction: The vehicle is traveling in the opposite direction to the normal direction of travel in its lane for a period of time that reaches the preset detection time threshold.
[0234] After each frame of image analysis is completed (i.e., after target detection, target location, and traffic event detection), the edge computing device sends useful information to the central computer in real time. This includes target messages containing various parameters of the target, event messages containing various parameters of the event, and compressed images. Specifically, the target message contains the following fields:
[0235] 1. Timestamp, i.e., the local time when it was sent.
[0236] 2. Location number.
[0237] 3. Target number.
[0238] 4. Position Vector. Let the east-west direction be the x-axis and the north-south direction be the y-axis, thus obtaining a two-dimensional position vector.
[0239] 5. Velocity Vector. Let the east-west direction be the x-axis and the north-south direction be the y-axis, thus obtaining the two-dimensional velocity vector.
[0240] 6. Target Types. There are three main categories: pedestrians, motorcycles, and non-motorized vehicles, which are automatically provided during target detection. Non-motorized vehicles are further divided into small vehicles (such as sedans), medium-sized vehicles (such as vans), and large vehicles (such as trucks), estimated by a trained convolutional neural network.
[0241] 7. Target dimensions (length, width, height), only non-motorized vehicles have this parameter, estimated by a trained convolutional neural network.
[0242] 8. The target color is represented using the RGB three-channel method and estimated by a trained convolutional neural network.
[0243] 9. The length, width, and offset of the target rectangle bounding box relative to the top-left corner of the image. Used when displaying on the business platform.
[0244] The event message contains the following fields:
[0245] 1. Timestamp, i.e., the local time when it was sent.
[0246] 2. Location number.
[0247] 3. Target number.
[0248] 4. Incident types include pedestrians on highways, motorcycles on highways, speeding, slow driving, parking, occupying emergency lanes, and driving against traffic.
[0249] 5. Event number.
[0250] 6. Event start time.
[0251] 7. Event actions, including start, duration, and end. An event streaming representation is used: the event action is set to start in the frame where the event begins; the event action is set to duration for several consecutive frames during which the event continues; and the event action is set to end in the frame where the event ends.
[0252] In actual production, programs are often configured with automatic restart services. This means that when a program crashes for any reason, the operating system will automatically restart it, resetting the event number to 1. Additionally, for debugging purposes, developers sometimes need to switch the program's input from the online real-time data stream to a local playback data stream. In this case, the event numbers originally maintained by the program may be overwritten by the event numbers in the local playback data stream. These exceptions can test the program's logical operations. A robust system should ensure that these exceptions do not have long-term effects and minimize unavoidable short-term impacts.
[0253] This application proposes a multi-point traffic incident aggregation system with high robustness and high availability, which is the main focus and innovation of this application. The general idea is as follows: A central computer maintains a target information registration table and an event information registration table. The target information processing module, based on target messages sent from edge computing devices, inputs or updates various parameters of each target in the target information registration table and reclaims memory after the target leaves the sensing range. The event information processing module, based on event messages sent from edge computing devices and combined with target information in the target information registration table, initializes or updates the status of each event in the event information registration table, forwards event messages that meet the reporting conditions to the business platform, and reclaims memory after a period of time following the event's end. The event information registration table also maintains a set of specially designed variables to achieve correct state transitions and detect abnormal data streams. Specifically, an efficient data structure is designed for both the target information registration table and the event information registration table, such as... Figure 3 and Figure 5 As shown.
[0254] A balanced binary tree is a tree-like data structure in computer science. Each node has a key as a query index and stores one or more values related to the application problem. Balanced binary trees can perform efficient query (i.e., finding the corresponding value based on the key), insertion, and deletion operations. Among the various implementations of balanced binary trees, I chose a red-black tree. The target information registration table consists of a two-level balanced binary tree and basic storage units. The key of the first-level balanced binary tree is the point number, and the value is the memory address of the second-level balanced binary tree. The key of the second-level balanced binary tree is the target number, and the value is the memory address of the basic storage unit. The basic storage unit stores the following fields: position vector, velocity vector, target type, target size, target color, target bounding box parameters, and last update time. The event information registration table consists of a three-level balanced binary tree and basic storage units. The key of the first-level balanced binary tree is the point number, and the value is the address of the second-level balanced binary tree in memory. The key of the second-level balanced binary tree is the target number, and the value is the address of the third-level balanced binary tree in memory. The key of the third-level balanced binary tree is the event type, and the value is the address of the basic storage unit in memory. The basic storage unit stores the following fields:
[0255] 1. Event status, including not started, in progress, and finished. The default is not started.
[0256] 2. Recent event number. If this type of event is currently occurring on the target, use the current event number; otherwise, use the event number of the most recent occurrence of this type of event on the target.
[0257] 3. Most recent start time. If the target is currently experiencing this type of event, then it is the start time of the current event; otherwise, it is the start time of the most recent occurrence of this type of event for the target.
[0258] 4. Most recent end time. The end time of the most recent completed event of this type that occurred for this target.
[0259] The target information processing module and the event information processing module in this application can be regarded as the "main program" running on the server. After starting, they run in a loop until a termination command is received.
[0260] The flowchart of the target information processing module is as follows: Figure 4 As shown. After the target information processing module starts, it first initializes the target information registration table, sets the first-level balanced binary tree to an empty tree, and then enters the main loop. Upon receiving a target message from an edge computing device, it checks whether the target already exists in the target information registration table. If not, it needs to allocate memory for it in the target information registration table. The specific steps are as follows:
[0261] 1. If the key set of the first-level balanced binary tree does not contain the location number in the target message, then insert a node with this location number as the key into the first-level balanced binary tree, allocate an empty second-level balanced binary tree, and set the value of the newly inserted node to the memory address of the empty second-level balanced binary tree.
[0262] 2. Query the node in the first-level balanced binary tree whose key is the location number in the target message, and obtain the memory address of the second-level balanced binary tree.
[0263] 3. If the key set of the second-level balanced binary tree does not contain the target number in the target message, then insert a node with this target number as the key into the second-level balanced binary tree, allocate an empty basic storage unit, and set the value of the newly inserted node to the address of the empty basic storage unit in memory.
[0264] 4. Query the node in the second-level balanced binary tree whose key is the target number in the target message, and obtain the address of the basic storage unit in memory.
[0265] 5. Return to this address.
[0266] At this point, the memory for the basic storage unit corresponding to the target has been allocated. Based on the returned address, it can be accessed and modified. The position vector, velocity vector, target type, target size, target color, and bounding box information from the target message are filled into the corresponding fields in the basic storage unit, completing the target information entry or update, and saving the last update time. This target information is also readily accessible to the event information processing module and other downstream modules; only the point number and target number need to be provided.
[0267] In addition, the program automatically reclaims memory for expired targets from the target information registration table periodically. First, it iterates through each basic storage unit, checking the difference between its last update time and the current time. If the difference is greater than a threshold, it indicates that the target has not been observed for a long time, so the memory of this basic storage unit is released, and the node pointing to it is deleted from the corresponding second-level balanced binary tree. Then, it iterates through each second-level balanced binary tree, checking if it is an empty tree. If it is, the memory of this second-level balanced binary tree is released, and the node pointing to it is deleted from the first-level balanced binary tree.
[0268] The flowchart of the event information processing module is as follows: Figure 6As shown. After the event information processing module starts, it first initializes the event information registration table, sets the first-level balanced binary tree to an empty tree, and then enters the main loop. Upon receiving an event message from an edge computing device, it checks whether the basic storage unit corresponding to the point number, target number, and event type in the event message already exists in the event information registration table. If not, it needs to allocate memory for it in the event information registration table. The specific steps are as follows:
[0269] 1. If the key set of the first-level balanced binary tree does not contain the point number in the event message, then insert a node with this point number as the key into the first-level balanced binary tree, allocate an empty second-level balanced binary tree, and set the value of the newly inserted node to the memory address of the empty second-level balanced binary tree.
[0270] 2. Query the node in the first-level balanced binary tree whose key is the position number in the event message, and obtain the memory address of the second-level balanced binary tree.
[0271] 3. If the key set of the second-level balanced binary tree does not contain the target number in the event message, then insert a node with this target number as the key into the second-level balanced binary tree, allocate an empty third-level balanced binary tree, and set the value of the newly inserted node to the memory address of the empty third-level balanced binary tree.
[0272] 4. Query the node in the second-level balanced binary tree whose key is the target number in the event message, and obtain the memory address of the third-level balanced binary tree.
[0273] 5. If the key set of the third-level balanced binary tree does not contain the event type in the event message, then insert a node with this event type as the key into the third-level balanced binary tree, allocate an empty basic storage unit, and set the value of the newly inserted node to the address of the empty basic storage unit in memory.
[0274] 6. Query the nodes in the third-level balanced binary tree whose key is the event type in the event message, and obtain the address of the basic storage unit in memory.
[0275] 7. Return to this address.
[0276] At this point, the memory for the basic storage unit corresponding to the point number, target number, and event type in the event message has been allocated. Based on the returned address, it can be accessed and modified. Next, according to the event action in the event message, the corresponding event action processing module is run. If the event action in the event message is "start," the event start action processing module is run; if the event action in the event message is "continue," the event continue action processing module is run; if the event action in the event message is "end," the event end action processing module is run.
[0277] In addition, the program automatically reclaims memory for expired events from the event information registry every so often. First, it traverses each third-level balanced binary tree, checking if its corresponding target exists in the target information registry. If not, it releases the memory of this third-level balanced binary tree and the basic storage units derived from it, and simultaneously deletes the node pointing to it in the corresponding second-level balanced binary tree. Then, it traverses each second-level balanced binary tree, checking if it is an empty tree. If it is, it releases the memory of this second-level balanced binary tree, and simultaneously deletes the node pointing to it in the first-level balanced binary tree.
[0278] It is understood that in this embodiment of the application, the state of a certain target or a certain type of event is first initialized to "not started". Then, for each event message received, the following judgment and operation are performed (please also refer to...). Figure 7 Each event should consist of a "start", zero or one or more "durations", and an "end":
[0279] 1. If the current event status is "Not Started" or "Completed":
[0280] 1.1 If the event action of a newly received event message is "Start", then the event status is changed to "In Progress", that is, a new event lifecycle has begun and is in the "In Progress" state.
[0281] 1.2 If the event action of a newly received event message is "continue" or "end", the program will stop with an error message.
[0282] 2. If the current event status is "In Progress":
[0283] 2.1 If the event action of a newly received event message is "ongoing", then the event status remains unchanged and remains "in progress".
[0284] 2.2 If the event action of a newly received event message is "Ended", then the event status is changed to "Ended", that is, the life cycle of the current event has ended, and it is ready to receive the next event.
[0285] 2.3 If the newly received event message has the event action "Start", the program will stop with an error message.
[0286] The aforementioned program error-induced shutdown can be understood as a logical conflict. However, in practice, various reasons can indeed lead to incomplete "start-continue-end" streaming representations of events, causing logical conflicts. We require our system to avoid error-induced shutdowns or chaos in such situations, and to prevent long-term consequences. In fact, for the three types of logical conflicts mentioned above, we can analyze the possible causes and handle them appropriately.
[0287] The flowchart of the event start action handling module is as follows: Figure 8 As shown. First, the system searches the event information registration table sequentially for the location number, target number, and event type in the pending event message to obtain the corresponding event progress status, most recent event number, most recent start time, and most recent end time. If the event progress status is "in progress," it means that the previous event of the same type is missing a message containing the ending action, and may also be missing some messages containing the continuing action. Because the previous event of the same type has not yet ended, the current event has already started, which may constitute redundancy. Furthermore, the previous event of the same type has already been reported to the business platform, so the system decides not to report the current event to the business platform, which also means not forwarding this event message. To correctly handle any non-redundant events that may be received in the future, the event progress status is updated to "completed," the most recent end time is updated to the timestamp of this event message, and the business platform is informed that events that have not ended properly have been terminated by the system. If the event progress status is "not started" or "completed," the event redundancy judgment module needs to be called to determine whether the pending event is redundant. The event redundancy judgment module will determine whether the current event is redundant from both the time and spatial dimensions. In the time dimension, if an event is in a completed state and the difference between the most recent end time and the timestamp of this event message is less than the preset redundancy time threshold for this type of event, then the event to be processed is redundant. In the spatial dimension, the distinguishability of the current target and each target in the adjacent locations where the same type of traffic event is occurring is calculated. If a certain distinguishability is less than a threshold, then the event to be processed is redundant.
[0288] The event start action handling module is triggered when an event message containing a start action is received. If the current event status is "in progress", then there are two possible scenarios (in short, the event message is recorded as "event ID + action", arranged in chronological order):
[0289] 1. The event process is initialized to "not started" -> Event 1 starts -> Event 1 continues -> Event 1 continues -> Event 1 ends (lost) -> Event 2 starts [newly received] -> Event 2 continues -> Event 2 ends;
[0290] 2. The event status is initialized to "not started" -> Event 1 starts -> Event 1 continues -> Event 1 continues (lost) -> Event 1 ends (lost) -> Event 2 starts [newly received] -> Event 2 continues -> Event 2 ends;
[0291] The first scenario is "the previous event of the same type lacked a message containing the ending action," and the second scenario is "the previous event of the same type lacked a message containing the ending action, and also lacked a portion of a message containing the continuing action." Because the latter half of event 1 is missing, we cannot know exactly when event 1 ended. If the end time of event 1 and the start time of event 2 are too close (the difference is less than the preset redundancy time threshold for this type of event), then they constitute redundancy.
[0292] For example:
[0293] 08:00:00 Event 1 begins -> 08:00:01 Event 1 continues -> 08:00:02 Event 1 continues (missing) -> 08:00:03 Event 1 continues (missing) -> 08:00:04 Event 1 ends (missing) -> 08:00:06 Event 2 begins -> 08:00:07 Event 2 continues -> 08:00:08 Event 2 ends;
[0294] In this example, the system last received the message for event 1 at 08:00:01, but event 1 did not actually end until 08:00:04. The actual end time of event 1 differs from the start time of event 2 by 2 seconds. If the preset redundancy time threshold for this type of event is 3 seconds, then event 1 and event 2 constitute redundancy.
[0295] Discrimination is defined as the weighted average of the following:
[0296] 1. Location discrimination: |xx′| 2 +|yy′| 2 , where (x,y) is the position vector of the current target, and (x',y') is the position vector of another target.
[0297] 2. Speed discrimination: |v x -v′ x | 2 +|v y -v′ y | 2 , where (v x ,v y (v′) represents the velocity vector of the current target. x ,v′ y ) represents the velocity vector of another target.
[0298] 3. Type Distinction: The type distinction between pedestrians and motorcycles, motorcycles and non-motorized vehicles, and pedestrians and non-motorized vehicles is infinite. The type distinction between small cars and medium-sized cars is a preset value of 1, the type distinction between medium-sized cars and large cars is a preset value of 2, and the type distinction between small cars and large cars is a combination of preset value 1 and preset value 2.
[0299] 4. Size differentiation: Where l, w, and h are the length, width, and height of the current target, respectively, and l', w', and h' are the length, width, and height of another target, respectively.
[0300] 5. Color differentiation: In the formula Δr = rr′, Δg = gg′, Δb = bb′, where r, g, b are the RGB color values of the current target, and r', g', b' are the RGB color values of another target, all ranging from 0 to 255.
[0301] If the event to be processed is redundant in terms of time or space, the event message will not be forwarded to the business platform, the event information registration form will remain unchanged, and the redundancy will be logged for verification when necessary. Otherwise, the event message will be forwarded to the business platform, the event status will be updated to "in progress," the most recent event number will be updated to the event number of this event message, and the most recent start time will be updated to the event start time of this event message. Finally, if a logical conflict arises due to incomplete event messages, and it is ultimately decided not to forward the event message, the logical conflict and possible causes will be logged and reported to upstream personnel for investigation.
[0302] Specifically, there are three situations:
[0303] 1. If the event number in this event message is greater than the most recent event number in the event information registration table, and the difference between the two is less than the threshold, the cause may be packet loss due to poor network conditions. It is recommended to check the network conditions and fix the network problem.
[0304] 2. If the event number in this event message is less than a smaller preset value, the reason may be that the point encountered a fault requiring a restart, which was performed manually or automatically. If the upstream confirms that it was an automatic restart, it is recommended to check the logs to find the root cause, such as insufficient memory or program vulnerabilities.
[0305] 3. If neither of the above two scenarios applies, the reason may be that the upstream source has switched data sources. If the upstream source confirms that debugging is underway, messages from that location should be temporarily blocked until debugging is complete.
[0306] The flowchart of the event continuous action handling module is as follows: Figure 9As shown. First, the system searches the event information registration table sequentially for the location number, target number, and event type in the pending event message to obtain the corresponding event status, most recent event number, most recent start time, and most recent end time. If the event status is "not started" or "finished," it means that the previous event of the same type ended normally, and the pending event is missing a message containing the start action, and may also be missing a part of the message containing the continuing action. Because the pending event is missing a relatively important start part, the system decides not to report the incomplete event to the business platform, which also means not to forward this event message; since maintaining the current status can correctly handle any complete events that may be received in the future, the event information registration table is not modified. If the event status is "in progress," it is necessary to check whether the event number and start time of the pending event are equal to the most recent event number and most recent start time in the event information registration table, respectively. If yes, it means the pending event and the most recent event in the event information registration table are the same event, and there is no logical conflict. Therefore, this event message is forwarded to the business platform, and the event information registration table is not modified. If no, it means the pending event and the most recent event in the event information registration table are not the same event. The previous event of the same type is missing a message containing the end action, while the pending event is missing a message containing the start action, and both may be missing a part of the message containing the continuing action. Because the pending event is missing a relatively important start part, the system decides not to report the incomplete event to the business platform, which also means not forwarding this event message. In order to correctly handle the complete events that may be received in the future, the event status is updated to "completed," the most recent end time is updated to the timestamp of this event message, and the business platform is informed that the event that did not end normally has been terminated by the system. Finally, if the logical conflict is caused by the incomplete event message, and it is ultimately decided not to forward this event message, the logical conflict and possible reasons are recorded in the log and fed back to upstream personnel for investigation. The analysis method is the same as the analysis method in the event start action processing module.
[0307] The flowchart of the event end action handling module is as follows: Figure 10As shown. First, the system searches the event information registration table sequentially for the location number, target number, and event type in the pending event message to obtain the corresponding event status, most recent event number, most recent start time, and most recent end time. If the event status is "not started" or "finished," it means that the previous event of the same type ended normally, and the pending event is missing a message containing the start action, and may also be missing a part of the message containing the continuing action. Because the pending event is missing a relatively important start part, the system decides not to report the incomplete event to the business platform, which also means not to forward this event message; since maintaining the current status can correctly handle any complete events that may be received in the future, the event information registration table is not modified. If the event status is "in progress," it is necessary to check whether the event number and start time of the pending event are equal to the most recent event number and most recent start time in the event information registration table, respectively. If yes, it means the pending event and the most recent event in the event information registration table are the same event, and there is no logical conflict. Therefore, this event message is forwarded to the business platform, the event status is updated to "completed," and the most recent end time is updated to the timestamp of this event message. If no, it means the pending event and the most recent event in the event information registration table are not the same event. The previous event of the same type is missing a message containing the end action, while the pending event is missing a message containing the start action, and both may be missing a part of the message containing the continuing action. Because the pending event is missing a relatively important start part, the system decides not to report the incomplete event to the business platform, which also means not forwarding this event message. In order to correctly handle the complete events that may be received in the future, the event status is updated to "completed," the most recent end time is updated to the timestamp of this event message, and the business platform is informed that the event that did not end properly has been terminated by the system. Finally, if the logical conflict is caused by the incomplete event message, and it is ultimately decided not to forward this event message, the logical conflict and possible causes are recorded in the log and fed back to upstream personnel for investigation. The analysis method is the same as the analysis method in the event start action processing module.
[0308] Briefly describe the functions of the business platform. The business platform is software installed on a central computer or other machine to display traffic events. For each location, the business platform provides a real-time video feed, marking the target of the traffic event with a rectangle and indicating the event type and other information with text. For each event, the business platform provides a playback video, generated by edge computing devices at the start of the event based on their cached images and target information. The length of the video is determined by a preset detection time threshold for that type of event, and is then pushed to the central computer.
[0309] Furthermore, in this embodiment, when performing cross-location deduplication, a convolutional neural network is used to extract features such as target type, target size, and target color, thereby associating and deduplicating events with different IDs. There is still considerable room for expansion in the categories and extraction methods of features. For example, a deep autoencoder could be used to generate a low-dimensional vector representation of the target, potentially providing richer semantic information.
[0310] The beneficial effects of the technical solution in this application include:
[0311] The method provided in this application proposes a set of processing modules that comprehensively cover possible abnormal situations in reality, ensuring that the system will not crash or output incorrect results due to these abnormal situations. It can also automatically analyze possible causes and provide feedback to maintenance personnel for targeted troubleshooting, improving their work efficiency. This application also proposes an event redundancy judgment module that uses deep learning methods to extract multiple features. This module can automatically determine whether the current event is redundant in both time and space dimensions, filtering out redundant events and thus enhancing the usability of the results.
[0312] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0313] Based on the same inventive concept, this application also provides a traffic incident handling apparatus for implementing the traffic incident handling method described above. The solution provided by this apparatus is similar to the solution described in the above method; therefore, the specific limitations of one or more traffic incident handling apparatus embodiments provided below can be found in the limitations of the traffic incident handling method described above, and will not be repeated here.
[0314] In one embodiment, such as Figure 11 As shown, a traffic incident processing device is provided, comprising: a receiving module 1102, an updating module 1104, a detection module 1106, and a forwarding module 1108, wherein:
[0315] The receiving module 1102 is used to receive target messages and event messages of the target object sent by each edge device.
[0316] The update module 1104 is used to update the target registration table based on the target message to obtain the updated target registration table; and to update the event registration table based on the event message to obtain the updated event registration table.
[0317] The detection module 1106 is used to detect the redundancy of traffic events based on the target information in the updated target registration table when the event action in the new event message is in the start state and the traffic event corresponding to the new event message recorded in the updated event registration table is in the end state or not started state.
[0318] Forwarding module 1108 is used to forward new event messages to the business platform based on redundancy.
[0319] The update module 1104 is also used to update the updated event registry based on new event messages.
[0320] In one embodiment, the target message is obtained by each edge device performing target object detection on the received image sequence and locating the detected target object; the target message includes the location trajectory of the target object in the image sequence and the target number; wherein, the target number is assigned when the target object is first detected; the event message is obtained by event recognition based on the location trajectory and the target number.
[0321] In one embodiment, the apparatus further includes: an execution module and an allocation module; the execution module is configured to execute the step of updating the target registration table based on the target message when the target object in the target message exists in the target registration table; the allocation module is configured to allocate a corresponding memory address for the target message in the target registration table when the target object in the target message does not exist in the target registration table.
[0322] In one embodiment, the apparatus further includes: a writing module, a recycling module, and a deletion module. The writing module is used to sequentially write the parameters contained in the target message into the corresponding fields of the memory addresses in the target registration table to obtain an updated target registration table. The recycling module is used to periodically recycle the memory released after the target message expires. The deletion module is used to delete the memory address corresponding to the released memory from the target registration table.
[0323] In one embodiment, the apparatus further includes: an insertion module, configured to insert a first node with the location number as the keyword in the target message into the first-level structure tree when the location number in the target message does not exist in the keyword set of the first-level structure tree; the value of the first node is the memory address corresponding to the second-level structure tree; and to insert a second node with the target number as the keyword in the target message into the second-level structure tree when the target number in the target message does not exist in the keyword set of the second-level structure tree; the value of the second node is the memory address corresponding to the basic storage unit; and to use the memory address corresponding to the basic storage unit as the memory address corresponding to the target message.
[0324] In one embodiment, the apparatus further includes: a determining module, configured to determine the difference between the update time and the current time of each of the basic storage units; and a deleting module, configured to release the memory of the basic storage unit and delete the node pointing to the basic storage unit in the second-level tree structure if the difference is greater than a threshold; and to release the memory of the second-level tree structure and delete the node pointing to the second-level tree structure in the first-level tree structure when the second-level tree structure is an empty tree.
[0325] In one embodiment, the detection module is further configured to detect the location number, target number, and event type matching the event message in the event registration table to obtain a detection result; the allocation module is further configured to allocate a corresponding memory address for the event message in the event registration table when the detection result indicates that at least one of the location number, target number, and event type is empty; the writing module is further configured to write the parameters contained in the event message into the corresponding fields of the memory address in the event registration table in sequence to obtain an updated event registration table.
[0326] In one embodiment, the insertion module is further configured to: insert a first node with the location number as the keyword in the event message into the first-level structure tree when the location number in the event message does not exist in the keyword set of the first-level structure tree; the value of the first node is the memory address corresponding to the second-level structure tree; insert a second node with the target number as the keyword in the event message into the second-level structure tree when the target number in the event message does not exist in the keyword set of the second-level structure tree; the value of the second node is the memory address corresponding to the third-level structure tree; insert a third node with the event type as the keyword in the third-level structure tree when the event type in the event message does not exist in the keyword set of the third-level structure tree; the value of the third node is the memory address corresponding to the basic storage unit; and use the memory address corresponding to the basic storage unit as the memory address corresponding to the event message.
[0327] In one embodiment, the deletion module is further configured to release the memory of the third-level tree structure and the memory of the basic storage unit corresponding to the third-level tree structure when the target object corresponding to the third-level tree structure does not exist in the target registration table, and delete the node pointing to the third-level tree structure in the second-level tree structure; when the second-level tree structure is an empty tree, release the memory of the second-level tree structure and delete the node pointing to the second-level tree structure in the first-level tree structure.
[0328] In one embodiment, the event registration table stores the event information in a tree-like data structure; the execution module is further configured to perform the step of updating the event registration table according to the event message when the point number, target number, and event type in the event message exist in the event registration table.
[0329] In one embodiment, the detection module is further configured to detect, in the updated event registration table, a location number, a target number, and an event type that match the new event message when the event action in the new event message is in a start state; the determination module is further configured to determine a first target object based on the location number and the target number; and determine the progress status and end time of the traffic event corresponding to the first target object based on the first target object and the event type; the update module is further configured to update the progress status of the traffic event to an end state and update the end time to the timestamp of the current event message when the progress status of the traffic event is in progress.
[0330] In one embodiment, the detection module is further configured to detect, in the updated event registration table, a location number, a target number, and an event type matching the new event message when the event action in the new event message is in a continuous state; the determination module is further configured to determine a first target object based on the location number and the target number; and to determine the progress status, event number, start time, and end time of the traffic event corresponding to the first target object based on the first target object and the event type; the forwarding module is further configured to forward the event message to the business platform when the progress status of the traffic event is in progress and the event number and the start time are the same as the event number and start time in the event message; the update module is further configured to update the progress status of the traffic event to an ended state and update the end time to the timestamp of the current event message when the progress status of the traffic event is in progress and the event number and the start time are different from the event number and start time in the event message.
[0331] In one embodiment, the detection module is further configured to detect, in the updated event registration table, a location number, a target number, and an event type matching the new event message when the event action in the new event message is in an ended state; the determination module is further configured to determine a first target object based on the location number and the target number; and to determine the progress status, event number, start time, and end time of the traffic event corresponding to the first target object based on the first target object and the event type; the forwarding module is further configured to forward the event message to the business platform when the progress status of the traffic event is in progress and the event number and the start time are the same as the event number and start time in the event message, and update the progress status of the traffic event to an ended state and update the end time to the timestamp of the current event message; the updating module is further configured to update the progress status of the traffic event to an ended state and update the end time to the timestamp of the current event message when the progress status of the traffic event is in progress and the event number and the start time are different from the event number and start time in the event message.
[0332] In one embodiment, the determining module is further configured to, in the time dimension, determine that the traffic event is a redundant event if the progress state of the traffic event is an ended state and the difference between the end time of the traffic event and the timestamp of the event message is less than a preset difference; or, in the spatial dimension, determine the objects that have occurred in the same type of traffic event among the adjacent points corresponding to the point of the target object, and determine the distinguishability between the target object and the objects in the same type of traffic event; when the distinguishability is less than a threshold, determine that the traffic event is a redundant event.
[0333] In one embodiment, the determining module is further configured to: identify objects in the same type of traffic event among adjacent points corresponding to the point of the target object; determine the location distinguishability, speed distinguishability, type distinguishability, size distinguishability, and color distinguishability between the target object and the objects in the same type of traffic event; and determine the distinguishability between the target object and the objects in the same type of traffic event based on the location distinguishability, the speed distinguishability, the type distinguishability, the size distinguishability, and the color distinguishability.
[0334] In one embodiment, the apparatus further includes: a recording module, configured to record redundant information of the traffic event into a log when the traffic event is a redundant event; and an update module, configured to update the progress status of the traffic event to a progress status, update the event number corresponding to the traffic event to the event number of the event message, and update the start time corresponding to the traffic event to the start time of the event message.
[0335] The modules in the aforementioned traffic incident handling device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0336] In one embodiment, a computer device is provided, which may be a terminal or a server. In this embodiment, the computer device is described as a server, and its internal structure diagram is as follows. Figure 12 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores traffic event processing data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a traffic event processing method.
[0337] Those skilled in the art will understand that Figure 12 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0338] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0339] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0340] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0341] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0342] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0343] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0344] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for handling traffic incidents, characterized in that, The method includes: Receive target messages and event messages for the target object sent by various edge devices; The target registration form is updated based on the target message to obtain the updated target registration form; The event registration form is updated based on the event message to obtain the updated event registration form; When a new event message is received in which the event action is in the start state, and the traffic event corresponding to the new event message recorded in the updated event registration table is in the end state or not started state, the redundancy of the traffic event is detected based on the target information in the updated target registration table. This includes: in the time dimension, if the traffic event is in the end state, and the difference between the end time of the traffic event and the timestamp of the event message is less than a preset difference, then the traffic event is determined to be a redundant event; or, in the spatial dimension, among the adjacent points corresponding to the point of the target object, objects in the same type of traffic event are identified, and the location differentiation, speed differentiation, type differentiation, size differentiation, and color differentiation between the target object and the objects in the same type of traffic event are determined; based on the location differentiation, speed differentiation, type differentiation, size differentiation, and color differentiation, the differentiation between the target object and the objects in the same type of traffic event is determined; when the differentiation is less than a threshold, the traffic event is determined to be a redundant event. Based on the redundancy, the new event message is forwarded to the business platform, or the updated event registration table is updated based on the new event message, including: when the traffic event is not a redundant event, the new event message is forwarded to the business platform, and the updated event registration table is updated based on the new event message; when the traffic event is a redundant event, the new event message is not forwarded to the business platform, and the maintained updated event registration table is not updated.
2. The method according to claim 1, characterized in that, The target message is obtained by each edge device performing target object detection on the image sequence collected from the received points and locating the detected target objects; the target message includes the position trajectory of the target object in the image sequence and the target number; wherein, the target number is assigned when the target object is first detected; The event message is obtained by event identification based on the location trajectory and the target number.
3. The method according to claim 1, characterized in that, The target registration form stores the target information in a tree-like data structure; the method further includes: If the target object in the target message exists in the target registration table, the step of updating the target registration table based on the target message is executed; If the target object in the target message does not exist in the target registration table, a corresponding memory address is allocated for the target message in the target registration table.
4. The method according to claim 3, characterized in that, The step of updating the target registration table based on the target message to obtain the updated target registration table includes: The parameters contained in the target message are sequentially written into the corresponding fields of the memory addresses in the target registration table to obtain the updated target registration table; The method further includes: periodically reclaiming the memory released after the target message expires; Delete the memory address corresponding to the released memory from the target registration table.
5. The method according to claim 4, characterized in that, The step of allocating a corresponding memory address for the target message in the target registration table includes: When the location number in the target message does not exist in the keyword set of the first-level structure tree, a first node with the location number as the keyword is inserted into the first-level structure tree; the value of the first node is the memory address corresponding to the second-level structure tree. When the target number in the target message does not exist in the keyword set of the second-level structure tree, a second node with the target number as the keyword is inserted into the second-level structure tree; the value of the second node is the memory address corresponding to the basic storage unit. The memory address corresponding to the basic storage unit is used as the memory address corresponding to the target message.
6. The method according to claim 5, characterized in that, The periodic reclamation of memory released after the target message expires includes: Determine the difference between the update time and the current time for each of the basic storage units; If the difference is greater than the threshold, release the memory of the basic storage unit and delete the node pointing to the basic storage unit in the second-level structure tree; When the second-level tree structure is empty, release the memory of the second-level tree structure and delete the node pointing to the second-level tree structure in the first-level tree structure.
7. The method according to claim 1, characterized in that, The step of updating the event registration table according to the event message to obtain the updated event registration table includes: In the event registration table, the location number, target number, and event type that match the event message are detected to obtain the detection result; When the detection result indicates that at least one of the location number, the target number, and the event type is empty, a corresponding memory address is allocated for the event message in the event registration table; The parameters contained in the event message are sequentially written into the corresponding fields of the memory addresses in the event registration table to obtain the updated event registration table.
8. The method according to claim 7, characterized in that, The step of allocating a corresponding memory address for the event message in the event registration table includes: When the location number in the event message does not exist in the key set of the first-level structure tree, a first node with the location number as the key is inserted into the first-level structure tree; the value of the first node is the memory address corresponding to the second-level structure tree. When the target number in the event message does not exist in the key set of the second-level structure tree, a second node with the target number as the key is inserted into the second-level structure tree; the value of the second node is the memory address corresponding to the third-level structure tree. When the event type in the event message does not exist in the keyword set of the third-level structure tree, a third node with the event type as the keyword is inserted into the third-level structure tree; the value of the third node is the memory address corresponding to the basic storage unit. The memory address corresponding to the basic storage unit is used as the memory address corresponding to the event message.
9. The method according to claim 8, characterized in that, The method further includes: When the target object corresponding to the third-level structure tree does not exist in the target registration table, release the memory of the third-level structure tree and the basic storage unit corresponding to the third-level structure tree, and delete the node pointing to the third-level structure tree in the second-level structure tree; When the second-level tree structure is empty, release the memory of the second-level tree structure and delete the node pointing to the second-level tree structure in the first-level tree structure.
10. The method according to claim 7, characterized in that, The event registration table stores the event messages in a tree-like data structure; the method further includes: If the location number, target number, and event type in the event message exist in the event registration table, then the step of updating the event registration table based on the event message is executed.
11. The method according to claim 1, characterized in that, The method further includes: When the event action in the new event message is in the start state, the location number, target number, and event type that match the new event message are detected in the updated event registration table; Based on the location number and the target number, the first target object is determined; Based on the first target object and the event type, determine the progress status and end time of the traffic event corresponding to the first target object; When the traffic event is in progress, the progress status of the traffic event is updated to the end status, and the end time is updated to the timestamp of the current event message.
12. The method according to claim 1, characterized in that, The method further includes: When the event action in the new event message is in a continuous state, the location number, target number, and event type that match the new event message are detected in the updated event registration table; Based on the location number and the target number, the first target object is determined; Based on the first target object and the event type, determine the progress status, event number, start time and end time of the traffic event corresponding to the first target object; When the traffic event is in progress and the event number and start time are the same as the event number and start time in the event message, the event message is forwarded to the business platform. When the traffic event is in progress and the event number and start time are different from the event number and start time in the event message, the progress status of the traffic event is updated to the end status, and the end time is updated to the timestamp of the current event message.
13. The method according to claim 1, characterized in that, The method further includes: When the event action in the new event message is in an ended state, the location number, target number, and event type that match the new event message are detected in the updated event registration table; Based on the location number and the target number, the first target object is determined; Based on the first target object and the event type, determine the progress status, event number, start time and end time of the traffic event corresponding to the first target object; When the traffic event is in progress and the event number and start time are the same as the event number and start time in the event message, the event message is forwarded to the business platform, the progress status of the traffic event is updated to the end status, and the end time is updated to the timestamp of the current event message. When the traffic event is in progress and the event number and start time are different from the event number and start time in the event message, the progress status of the traffic event is updated to the end status, and the end time is updated to the timestamp of the current event message.
14. The method according to claim 1, characterized in that, After detecting the redundancy of the traffic event based on the target information in the updated target registration table, the method further includes: When the traffic event is a redundant event, the redundant information of the traffic event is recorded in the log. After forwarding the new event message to the business platform based on the redundancy, the method further includes: The status of the traffic event is updated to "in progress", the event number corresponding to the traffic event is updated to the event number of the event message, and the start time corresponding to the traffic event is updated to the start time of the event message.
15. A traffic incident handling device, characterized in that, The device includes: The receiving module is used to receive target messages and event messages of the target object sent by various edge devices; The update module is used to update the target registration table based on the target message to obtain the updated target registration table; and to update the event registration table based on the event message to obtain the updated event registration table. The detection module is used to detect the redundancy of a traffic event based on target information in the updated target registration table when the event action in a new event message is in a starting state and the traffic event corresponding to the new event message recorded in the updated event registration table is in a finished state or not started state. This includes: in the time dimension, if the traffic event is in a finished state and the difference between the end time of the traffic event and the timestamp of the event message is less than a preset difference, then the traffic event is determined to be a redundant event; or, in the spatial dimension, among adjacent points corresponding to the point of the target object, objects occurring in the same type of traffic event are identified, and the location differentiation, speed differentiation, type differentiation, size differentiation, and color differentiation between the target object and the objects in the same type of traffic event are determined; based on the location differentiation, speed differentiation, type differentiation, size differentiation, and color differentiation, the differentiation between the target object and the objects in the same type of traffic event is determined; when the differentiation is less than a threshold, the traffic event is determined to be a redundant event. The forwarding module is used to forward the new event message to the business platform according to the redundancy, including: when the traffic event is not a redundant event, forwarding the new event message to the business platform; when the traffic event is a redundant event, not forwarding the new event message to the business platform; The update module is further configured to update the updated event registration table according to the new event message, including: when the traffic event is not a redundant event, updating the updated event registration table according to the new event message; when the traffic event is a redundant event, not updating the maintained updated event registration table.
16. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 14.
17. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 14.
18. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 14.
Citation Information
Patent Citations
Traffic event reporting method and device, electronic equipment and storage medium
CN111862593A
Event stream processing system, event stream processing method, event stream processing program
US20210326335A1