Traffic event processing method and device, computer equipment and storage medium

By maintaining the target and event registration table in the server, detecting the redundancy of traffic events and deciding on message forwarding, the accuracy problem of traffic event processing caused by abnormal situations in the existing technology is solved, and a more stable processing flow and more accurate processing are achieved. High accuracy.

CN118733600AActive Publication Date: 2024-10-01TENCENT CLOUD COMPUTING (BEIJING) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310343761.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-31
Publication Date
2024-10-01
Estimated Expiration
2043-03-31

AI Technical Summary

Technical Problem

Existing traffic event processing methods are prone to erroneous logic states during aggregation due to abnormal network conditions, failures, or data source switching, resulting in poor accuracy of traffic event processing results.

Method used

Maintain the target registration table and event registration table in the server, update the registration table by receiving messages from edge devices, detect the redundancy of traffic events, and decide whether to forward event messages to the business platform based on the redundancy to ensure the stability of the processing process. and accuracy.

Benefits of technology

By dynamically maintaining the registration table, we can achieve correct state transfer and abnormal data flow detection, avoid crashes or erroneous results due to abnormal situations, and improve the accuracy and usability of traffic incident processing results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733600A_ABST
    Figure CN118733600A_ABST
Patent Text Reader

Abstract

The invention relates to a traffic event processing method and device, computer equipment, a storage medium and a computer program product. The method comprises the following steps: receiving a target message and an event message of a target object sent by each edge device; updating the target registration form based on the target message to obtain an updated target registration form; updating the event registration form according to the event message to obtain an updated event registration form; when the event action in the received new event message is in a starting state and the traffic event corresponding to the new event message recorded in the updated event registration form is in an ending state or a non-starting state, detecting the redundancy of the traffic event according to the target information in the updated target registration form; and forwarding the new event message to a service platform according to the redundancy, or updating the updated event registration form according to the new event message. By adopting the method, the accuracy of the processing result of the traffic event can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer equipment, storage medium and computer program product for processing traffic incidents. Background Art

[0002] With the development of computer technology and Internet technology, more and more real-time summary systems for traffic incidents have emerged. The current real-time summary system for traffic incidents is mainly used to automatically detect traffic incidents deployed at multiple points on a long-distance highway, and to summarize the detected traffic incident information in real time to the data center and business platform, helping traffic commanders and law enforcement personnel to accurately, comprehensively and efficiently identify traffic incidents, and then take appropriate handling measures in a timely manner.

[0003] However, in the current traffic incident processing method, when summarizing the results of traffic incident detection at multiple points, each point needs to transmit its own traffic incident detection results to the central computer, which then summarizes the data and sends the summary results to the business platform. However, considering the various abnormal situations that exist in reality, such as packet loss due to poor network conditions, a point encountering a fault and needing to be restarted, or the data source needs to be switched due to upstream debugging, the above processing method can easily fall into an erroneous logical state, resulting in erroneous results in traffic incident processing, and it is difficult to recover and troubleshoot, resulting in poor accuracy of the traffic incident processing results. Summary of the invention

[0004] Based on this, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium and computer program product for processing traffic events that can effectively improve the accuracy of the processing results of traffic events in response to the above-mentioned technical problems.

[0005] In the first aspect, the present application provides a method for handling traffic events. The method includes: receiving target messages and event messages of target objects sent by each edge device; updating the target registration table based on the target message to obtain an updated target registration table; updating the event registration table according to the event message to obtain an updated event registration table; when the event action received 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, detecting the redundancy of the traffic event based on the target information in the updated target registration table; 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.

[0006] In the second aspect, the present application also provides a device for processing traffic events. The device includes: a receiving module for receiving target messages and event messages of target objects sent by each edge device; an updating module for updating the target registration table based on the target message to obtain an updated target registration table; updating the event registration table according to the event message to obtain an updated event registration table; a detection module for detecting the redundancy of the traffic event according to the target information in the updated target registration table when the event action received in the new event message is in the starting state and the traffic event corresponding to the new event message recorded in the updated event registration table is in the ending state or not started state; a forwarding module for forwarding the new event message to the service platform according to the redundancy; the updating module is also used to update the updated event registration table according to the new event message.

[0007] In the third aspect, the present application also provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program: receiving target messages and event messages of target objects sent by each edge device; updating the target registration table based on the target message to obtain an updated target registration table; updating the event registration table according to the event message to obtain an updated event registration table; when the event action received 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, detecting the redundancy of the traffic event according to the target information in the updated target registration table; 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.

[0008] In a fourth aspect, the present application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented: receiving target messages and event messages of target objects sent by each edge device; updating the target registration table based on the target message to obtain an updated target registration table; updating the event registration table according to the event message to obtain an updated event registration table; when the event action received 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, detecting the redundancy of the traffic event according to the target information in the updated target registration table; forwarding the new event message to the service platform according to the redundancy, or updating the updated event registration table according to the new event message.

[0009] In a fifth aspect, the present application also provides a computer program product. The computer program product includes a computer program, which implements the following steps when executed by a processor: receiving target messages and event messages of target objects sent by each edge device; updating the target registration table based on the target message to obtain an updated target registration table; updating the event registration table according to the event message to obtain an updated event registration table; when the event action received 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, detecting the redundancy of the traffic event according to the target information in the updated target registration table; forwarding the new event message to the service platform according to the redundancy, or updating the updated event registration table according to the new event message.

[0010] The above-mentioned traffic event processing method, device, computer equipment, storage medium and computer program product receive target messages and event messages of target objects sent by each edge device; update the target registration table based on the target message to obtain an updated target registration table; update the event registration table according to the event message to obtain an updated event registration table; when the event action received 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 according to the target information in the updated target registration table; according to the redundancy, the new event message is forwarded to the business platform, or the updated event registration table is updated according to the new event message. Since a target registration table and an event registration table are maintained in the server respectively, after receiving the target message and event message of the target object sent by each edge device, the target registration table and the event registration table can be updated respectively based on the target message and the event message to obtain an updated target registration table and an updated event registration table. Moreover, when the event action received 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 the unstarted 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, the correct state transfer and the detection of abnormal data flow can be achieved, and the abnormal situations that may occur in reality can be fully covered to ensure that the entire processing flow will not crash or output erroneous 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, it is possible to determine whether to forward the new event message to the business platform based on the redundancy of the traffic event, thereby enhancing the availability of the results and effectively improving the accuracy of the processing results of the traffic events. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 is an application environment diagram of a method for handling traffic incidents in one embodiment;

[0012] Figure 2 is a flow chart of a method for handling a traffic incident in one embodiment;

[0013] Figure 3 A schematic diagram of a target information registration table data structure in one embodiment;

[0014] Figure 4 is a flow chart of a target information processing module in one embodiment;

[0015] Figure 5 A schematic diagram of an event information registration table data structure in one embodiment;

[0016] Figure 6 is a flow chart of an event information processing module in one embodiment;

[0017] Figure 7 is a schematic diagram of an event stream representation in one embodiment;

[0018] Figure 8 A flowchart of an event start action processing module in one embodiment;

[0019] Fig. 9 A flowchart of an event continuous action processing module in one embodiment;

[0020] Fig.10 is a flow chart of an event end action processing module in one embodiment;

[0021] Fig.11 is a structural block diagram of a device for processing traffic events in one embodiment;

[0022] Fig.12 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0024] Cloud technology refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing.

[0025] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The backend services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the rapid development and application of the Internet industry, in the future, each item may have its own identification mark, which needs to be transmitted to the backend system for logical processing. Data of different levels will be processed separately. All kinds of industry data need strong system backing 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 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 different types of storage devices (storage devices are also called storage nodes) in the network through application software or application interfaces to work together and provide external data storage and business access functions.

[0027] With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, drones, robots, smart medical care, smart customer service, Internet of Vehicles, automatic driving, smart transportation, etc. I believe that with the development of technology, artificial intelligence technology 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" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first, second and third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

[0029] The method for processing traffic incidents provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the edge device 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The server 104 receives the target message and event message of the target object sent by each edge device 102; the server 104 updates the target registration table based on the target message to obtain an updated target registration table; the server 104 updates the event registration table according to the event message to obtain an updated event registration table; when the server 104 receives the event action in the new event message 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 104 detects the redundancy of the traffic event based on the target information in the updated target registration table; the server 104 forwards the new event message to the business platform according to the redundancy, or updates the updated event registration table according to the new event message.

[0030] The edge device 102 may be a terminal, including but not limited to a smart phone, a tablet computer, a laptop computer, a desktop computer, an IoT device, and a portable wearable device. The IoT device may be a smart vehicle-mounted device, etc. The portable wearable device may be a smart watch, a smart bracelet, a head-mounted device, etc.

[0031] The server 104 may be an independent physical server or a service node in a blockchain system. A peer-to-peer (P2P) network is formed between the service nodes in the blockchain system. The P2P protocol is an application layer protocol running on top of the Transmission Control Protocol (TCP).

[0032] In addition, server 104 can also be a server cluster composed of multiple physical servers, and 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 communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), as well as big data and artificial intelligence platforms.

[0033] The edge device 102 and the server 104 may be connected via Bluetooth, USB (Universal Serial Bus) or a network or other communication connection method, which is not limited in this application.

[0034] In one embodiment, Figure 2As shown, a method for processing traffic events is provided. The method can be executed by a server or a terminal alone, or by a server and a terminal together. Figure 1 The server in the example is used to illustrate the following steps:

[0035] Step 202: Receive target messages and event messages of target objects sent by each edge device.

[0036] Among them, edge device refers to 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 calculate the received data to obtain traffic event detection results. For example, cameras, radars and other sensors installed at a certain point transmit the collected data to the edge computing device at the point, and then the edge computing device uses the built-in program to process and calculate the received data to obtain traffic event detection results. The traffic event detection results may include whether a traffic event occurs at this point, what the target object is, what type of traffic event has occurred, etc.

[0037] The target message of the target object refers to the target message corresponding to a target object. In some cases, the target object in this application may also be called the 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 include the following fields:

[0038] 1. Timestamp, i.e. the local time when sending;

[0039] 2. Point 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, let the east-west direction be the x-axis and the north-south direction be the y-axis, and we get a two-dimensional velocity vector;

[0043] 6. Target type, which can include three categories: pedestrians, motorcycles, and non-motorized vehicles, which are automatically given when the target is detected. Non-motorized vehicles are further divided into small vehicles (such as sedans), medium-sized vehicles (such as vans), and large vehicles (such as trucks). The target type can be estimated by the trained convolutional neural network;

[0044] 7. Object size (length, width, height). This parameter is only available for non-motor vehicles and can also be estimated by the trained convolutional neural network.

[0045] 8. The target color, using the RGB three-channel representation, can be estimated by the trained convolutional neural network;

[0046] 9. The length, width and offset of the target rectangular bounding box relative to the upper left corner of the image are used when displaying on the business platform.

[0047] An event message refers to a message corresponding to an event. The event message in this application refers to a message containing various parameters of the event. For example, the event message in this application may include the following fields:

[0048] 1. Timestamp, i.e. the local time when sending;

[0049] 2. Point number;

[0050] 3. Target number;

[0051] 4. Event types, including pedestrians on the highway, motorcycles on the highway, speeding, underspeed, parking, occupying the emergency lane, driving in the wrong direction, etc.

[0052] 5. Incident number;

[0053] 6. Event start time;

[0054] 7. Event actions, including start, duration, and end. The present application embodiment adopts a stream representation of events: in the frame where the event starts, the event action is set to start; in the frame 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.

[0055] The definitions of some traffic events in the embodiments of this application are as follows:

[0056] 1. Pedestrians on the highway: Pedestrians appear on the highway and the duration reaches the preset detection time threshold;

[0057] 2. Motorcycle on the highway: A motorcycle appears on the highway and the duration reaches the preset detection time threshold;

[0058] 3. Speeding: The vehicle speed is greater than the speeding threshold (e.g. 100 km / h) and the duration reaches the preset detection time threshold;

[0059] 4. Low speed: The vehicle speed is less than the low speed threshold (e.g. 70km / h) and greater than the parking speed threshold (e.g. 5km / 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. 5km / h) and the duration reaches the preset detection time threshold;

[0061] 6. Occupancy of emergency lane: The vehicle is in the emergency lane for a duration that reaches the preset detection time threshold;

[0062] 7. Against the flow: The vehicle is traveling in the opposite direction of the normal direction of its lane, and the duration reaches the preset detection time threshold.

[0063] Specifically, a traffic incident on a highway is used as an example for explanation. For example, at a certain location on the highway, two cameras facing opposite directions are set up to continuously capture image sequences at a certain frequency (for example, 10Hz or 20Hz), and the captured image sequences are sent in real time to the edge computing device at that point for subsequent processing. The edge computing device performs target object detection on the image sequence to obtain a rectangular bounding box of the target object of interest (such as a vehicle or pedestrian) in each frame of the image; further, the edge computing device can perform target search on the detected target object, and can obtain the position trajectory and target number of each target object in the image sequence. It can be understood that the target number is assigned when the target is first detected, and the assignment rule is to increase in sequence in order, and it can be reset to 1 after exceeding a certain limit.

[0064] The edge computing device can calculate the position trajectory of each target in the real world through coordinate system conversion, and then calculate the corresponding speed. The edge computing device can automatically analyze the behavior of the target based on the pre-defined traffic events, thereby identifying a series of traffic events. That is, the edge computing device performs event recognition based on the calculated position trajectory and target number, and obtains the corresponding traffic event recognition results. Among them, each traffic event also has a number, which is assigned at the beginning of the event. The allocation rule is also to increase in sequence in order, and it can be reset to 1 after exceeding a certain limit.

[0065] After the edge computing device uses the built-in program to process and calculate the received data and obtain the traffic event detection results, each point can transmit its own traffic event detection results to the central computer, that is, the server. That is, the edge computing device corresponding to each point can report the processed traffic event detection results to the server, and the server can receive the target message and event message of the target object sent by each edge computing device.

[0066] For example, after the edge computing device has finished analyzing each frame of the 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 an updated target registration table.

[0068] Among them, 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 a target information registration table. For example, the data structure of the target information registration table in this application can be a tree data structure. For example, the target information registration table stores target messages in a balanced binary tree data structure.

[0069] It can be understood that the data structure of the target information registration table in the present application includes but is not limited to the above-mentioned tree data structure, and can also be a data structure such as a linked list, which is not specifically limited here.

[0070] Specifically, after the server receives the target messages and event messages of the target objects sent by each edge computing device, 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 target leaves the perception range.

[0071] For example, the target registration table stores target information in a tree data structure. Figure 3 As shown in FIG. 1 , it is a schematic diagram of the target information registration table data structure. Figure 3 As shown in , the target information registration table consists of a two-level balanced binary tree and a basic storage unit. The keyword 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 the memory; the keyword of the second-level balanced binary tree is the target number, and the value is the address of the basic storage unit in the memory; the basic storage unit stores the following fields: position vector, velocity vector, target type, target size, target color, target rectangular bounding box parameters, last update time, etc.

[0072] like Figure 4 The target information processing module is shown in FIG. 1 . The server maintains a target information registration table and an event information registration table. When the server receives the target message and event message of the target object sent by each edge device, the target information processing module in the server can initialize the target information registration table according to the target message sent by the edge computing device. After the target information processing module is started, the target information processing module first initializes the target information registration table, that is, the target information processing module can Figure 3 The first-level balanced binary tree in the target information registration table shown in is set to an empty tree, and then enter Figure 4 In the main loop process shown in 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. 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 the memory of the corresponding basic storage unit to the target in the target message, the server can access and modify it according to 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 rectangular bounding box information in the target message into the corresponding fields in the basic storage unit to complete the entry or update of the target information and save the last update time. It can be understood that the target information stored in this storage unit is also accessible to the event information processing module and other downstream modules at any time, and only the point number and target number to be checked need to be provided.

[0074] In addition, the server will automatically reclaim the memory released by expired targets from the target information registration table at regular intervals, for example, Figure 3 As shown in FIG, a target information registration table storing target information in a tree data structure is used as an example to illustrate that the server first traverses Figure 3 For each basic storage unit in the target information registration table shown in , check the difference between the last update time of each basic storage unit and the current time. If the difference is greater than the threshold, it means that the target has not been observed for a long time, so 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 shown in Figure 3 For each second-level balanced binary tree in the target information registration table shown in , check whether each second-level balanced binary tree in the target information registration table is an empty tree. If so, the server releases the memory of the second-level balanced binary tree, and at the same time, the server deletes the node pointing to the second-level balanced binary tree in the first-level balanced binary tree.

[0075] Step 206: Update the event registration table according to the event message to obtain an updated event registration table.

[0076] Among them, 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 an event information registration table. For example, the data structure of the event information registration table in this application can be a tree data structure. For example, the event information registration table stores event messages in a balanced binary tree data structure.

[0077] It can be understood that the data structure of the event information registration table in the present application includes but is not limited to the above-mentioned tree data structure, and can also be a data structure such as a linked list, which is not specifically limited here.

[0078] Specifically, after the server receives the target messages and event messages of the target objects 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 messages, and reclaim the memory released by the ended event after a period of time after the event ends.

[0079] For example, an event registration table stores event information in a tree data structure. Figure 5 As shown in FIG. 1 , it is a schematic diagram of the data structure of the event information registration table. Figure 5 As shown in , the event information registration table consists of a three-level balanced binary tree and a basic storage unit. The keyword 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 the memory; the keyword 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 the memory; the keyword of the third-level balanced binary tree is the event type, and the value is the address of the basic storage unit in the memory.

[0080] like Figure 6 The figure shows the flow chart of the event information processing module. The server maintains a target information registration table and an event information registration table. After the server receives the target message and event message of the target object sent by each edge device, the event information processing module in the server can initialize the event information registration table according to the event message sent by the edge computing device. After the event information processing module is started, the event information processing module 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 in is set to an empty tree, and then enter Figure 6 In the main loop process shown in Figure 6 In the flowchart of the event information processing module shown in FIG. 1 , after the server receives the 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 processing module. Figure 5 If not, the server needs to allocate a memory address for the event message in the event information registration table.

[0081] After the event information processing module in the server allocates the corresponding basic storage unit memory for the point number, target number, and event type in the event message, the server can access and modify the memory address 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 according to the event action in the event message. 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 for processing; if the event action in the event message is continue, the server runs the event continue action processing module for processing; if the event action in the event message is end, the server runs the event end action processing module for processing.

[0082] In addition, the server will automatically reclaim the memory released by expired events from the event information registration table at regular intervals, for example, Figure 5 The event information registration table shown in FIG. 1 is used as an example to store event information in a tree data structure. The server first traverses Figure 5 For each third-level balanced binary tree in the event information registration table shown in , check whether 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 the third-level balanced binary tree and the basic storage unit derived from the third-level balanced binary tree, and deletes the node pointing to the third-level balanced binary tree in the second-level balanced binary tree corresponding to the third-level balanced binary tree; further, the server continues to traverse as shown in Figure 5 For each second-level balanced binary tree in the event information registration table shown in , check whether each second-level balanced binary tree in the event information registration table is an empty tree. If so, the server releases the memory of the second-level balanced binary tree and deletes the node pointing to the second-level balanced binary tree in the first-level balanced binary tree.

[0083] Step 208, when the event action in the received 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 according to the target information in the updated target registration table.

[0084] Among them, the new event message refers to the newly received event message. The event message and new event message in this application are only used to distinguish different event messages. For example, at 11:42, the server received event message 1 sent from a certain point. Two minutes later, at 11:44, the server received event message 2 sent from another point. Then event message 2 can be used as a new event message.

[0085] An event action refers to the state of an event in an image frame. For example, the event actions in this application include start, continue, and end. That is, the embodiment of this application adopts a streaming representation of events: in the frame where the event starts, 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.

[0086] The event action being in the start state means that the event action is started, that is, the event action is in the frame image where the event starts.

[0087] The traffic event corresponding to the new event message refers to different types of traffic events identified based on the various parameters contained in the new event message. For example, when the server determines, based on the various parameters in the new event message, that the vehicle speed in the new event message is greater than the speeding threshold (e.g., 100 km / h), and the duration reaches the 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 end state or the unstarted state refers to the ongoing state of the traffic event. For example, the ongoing state of the traffic event in this application includes unstarted, ongoing, ended or ended, and the default state is the unstarted state.

[0089] The redundancy of a traffic event refers to whether the traffic event is redundant, or whether the traffic event is a redundant event. For example, the redundancy of a traffic event in this application includes two situations, namely, the traffic event is a redundant event and the traffic event is not a redundant event.

[0090] Specifically, Figure 7 As shown in FIG. 1 , it is a schematic diagram of an event stream representation. That is, the event stream representation method used in the embodiment of the present application is as follows: Figure 7 As shown in: In the frame where the event starts, 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] The “target message” or “event message” mentioned in the embodiments of the present application specifically refers to a message sent from an edge computing device to a server in the above format, such as Figure 7 As shown, the type of target No. 1 is a motorcycle, the type of target No. 2 is a small car, and the type of target No. 3 is a large car, and the three are detected in sequence. Target No. 1 triggered the motorcycle high-speed event, target No. 2 triggered two speeding events, and target No. 3 triggered the parking event and the emergency lane occupation event (overlapping in time). The event number is consistent with the order of the event start time. It should be noted that the meaning of "event start" here is the event starts to enter the server system's search record process, not the initial time of the event. 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 has been faster than 100km / h in the previous 2 seconds (that is, in the last 20 frames), that is, the violation has occurred and lasted for a period of time.

[0092] The server updates the event registration table according to the event message, and after obtaining the updated event registration table, when the server receives a new event message, the server can detect the point number, target number and event type that match the new event message in the updated event registration table to obtain a detection result; when the detection result indicates that at least one of the point number, target number and event type is empty, the server can allocate a corresponding memory address for the new event message in the event registration table; after the server allocates a corresponding memory address for the new event message in the event registration table, the server can determine what processing module to run for processing according to the event action in the new event message, that is, the server runs the corresponding event action processing module according to the event action in the new event message; if the event action in the event message is a start state, the event start action processing module is run; if the event action in the event message is a continuous state, the event continuous action processing module is run; if the event action in the event message is an end state, the event end 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 for processing, that is, the event start action processing module in the server can search the point number, target number, and event type in the new event message to be processed in the event information registration table in turn, and obtain the corresponding traffic event status, latest event number, latest start time, and latest end time; if the status of the traffic event corresponding to the new event message is the ended state or the unstarted state, the server can call the event redundancy judgment module to determine whether the traffic event corresponding to the new event message to be processed is redundant, that is, the event redundancy judgment module will judge the new event message from the time dimension and the space dimension respectively. Whether the traffic event corresponding to the new event message is redundant. For example, in the time dimension, if the ongoing status of the traffic event is ended, and the difference between the most recent end time and the timestamp of this event message is less than the preset redundant time threshold of this type of event, then the traffic event is determined to be redundant; in the spatial dimension, the server can calculate the degree of distinction between the target in the traffic event and the various targets of similar traffic events occurring at adjacent points. If the degree of distinction 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] In addition, if the status of the traffic event corresponding to the new event message is in progress, it means that the previous traffic event of the same type is missing the message containing the end action, and may be missing a part of the message containing the continuous action. Because the previous event of the same type has not ended yet, the current event has already started, and the two may constitute redundancy, and the previous event of the same type has been reported to the business platform. Therefore, when the status of the traffic event corresponding to the new event message is in progress, the server makes a decision not to report the current event to the business platform, which also means not forwarding this event message; and, in order to correctly handle non-redundant events that may be received in the future, the server can update the status of the traffic event to ended, 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 normally has been terminated by the server system.

[0095] Step 210: forward the new event message to the service platform according to redundancy, or update the updated event registration table according to the new event message.

[0096] Among them, the business platform refers to a software installed on a server or other machine for displaying traffic events. For example, the business platform in this application can be a third-party application for displaying traffic events. For each point, the business platform provides a real-time picture of the point, and uses a rectangle to mark the target where the traffic event is occurring, and uses text to mark the event type and other information. For each event, the business platform can provide a playback video of the event, which is generated by the edge computing device at the beginning of the event based on its cached image and target information. The length of the video is determined by the preset detection time threshold of this 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, after the server detects the redundancy of the traffic event based on the target information in the updated target registration table, the server may forward the new event message to the business platform based on the redundancy of the traffic event, or the server updates the updated event registration table based on the new event message. When the traffic event is redundant in the time or space dimension, that is, the traffic event is a redundant event, the server does not forward this event message to the business platform, the server does not modify the maintained event information registration table, and records the redundancy of the traffic event in the log for inspection when necessary;

[0098] When the traffic event is not redundant in time or space dimension, that is, the traffic event is not a redundant event, the server can forward this event message to the business platform, and update the progress status of the traffic event to the ongoing status, 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 logic conflict occurs due to an incomplete event message, and the server ultimately decides not to forward the event message, the server can log the logic conflict and possible causes and provide feedback to upstream personnel for troubleshooting.

[0100] In this embodiment, target messages and event messages of target objects sent by each edge device are received; the target registration table is updated based on the target message to obtain an updated target registration table; the event registration table is updated according to the event message to obtain an updated event registration table; when the event action received 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; based on the redundancy, the new event message is forwarded to the business platform, or the updated event registration table is updated according to the new event message. Since a target registration table and an event registration table are maintained in the server respectively, after receiving the target message and event message of the target object sent by each edge device, the target registration table and the event registration table can be updated respectively based on the target message and the event message to obtain an updated target registration table and an updated event registration table. Moreover, when the event action received 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 the unstarted 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, the correct state transfer and the detection of abnormal data flow can be achieved, and the abnormal situations that may occur in reality can be fully covered to ensure that the entire processing flow will not crash or output erroneous 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, it is possible to determine whether to forward the new event message to the business platform based on the redundancy of the traffic event, thereby enhancing the availability of the results and effectively improving the accuracy of the processing results of the traffic events.

[0101] In one embodiment, the target message in the present application is obtained by each edge device detecting the target object in the image sequence received from the point acquisition and searching for the detected target object; the target message includes the position trajectory and target number of the target object in the image sequence; 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 target number.

[0102] Specifically, a traffic incident on a highway is used as an example for explanation. For example, at a certain location on the highway, two cameras facing opposite directions are set up to continuously capture image sequences at a certain frequency (for example, 10Hz or 20Hz), and the captured image sequences are sent in real time to the edge computing device at that point for subsequent processing. The edge computing device performs target object detection on the image sequence to obtain a rectangular bounding box of the target object of interest (such as a vehicle or pedestrian) in each frame of the image; further, the edge computing device can perform target search on the detected target object, and can obtain the position trajectory and target number of each target object in the image sequence. It can be understood that the target number is assigned when the target is first detected, and the assignment rule is to increase in sequence in order, and it can be reset to 1 after exceeding a certain limit.

[0103] The edge computing device can calculate the position trajectory of each target object in the real world through coordinate system conversion, and then calculate the corresponding speed. The edge computing device can automatically analyze the behavior of the target object based on the pre-defined traffic events, thereby identifying a series of traffic events, that is, the edge computing device performs event recognition based on the calculated position trajectory and target number, and obtains the corresponding traffic event recognition results. Among them, each traffic event also has a number, which is assigned at the beginning of the event. The allocation rule is also to increase in sequence in order, and it can be reset to 1 after exceeding a certain limit.

[0104] After the edge computing device uses the built-in program to process and calculate the received data and obtain the traffic event detection results, each point can transmit its own traffic event detection results to the central computer, that is, the server. That is, the edge computing device corresponding to each point can report the processed traffic event detection results to the server, and the server can receive the target message and event message of the target object sent by each edge computing device.

[0105] For example, after the edge computing device has finished analyzing each frame of the 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 the target registration table and the event registration table respectively, it is possible to achieve correct state transfer and detect abnormal data flows, comprehensively covering abnormal situations that may occur in reality, ensuring that the system will not crash or output wrong results due to these abnormal situations, and automatically analyzing possible causes and feeding back to operation and maintenance personnel for targeted investigation, thereby improving the work efficiency of operation and maintenance personnel. At the same time, by detecting the redundancy of traffic events, it is possible to automatically determine whether the current event is redundant in the time and space dimensions, filter out redundant events, and thus enhance the availability of the results.

[0107] In one embodiment, the target registration table stores target information in a tree data structure; the method further comprises:

[0108] When the target object in the target message exists in the target registration table, executing the step of updating the target registration table based on the target message;

[0109] When the target object in the target message does not exist in the target registration table, a corresponding memory address is allocated to the target message in the target registration table.

[0110] Specifically, the target registration table is used to store target information in a tree data structure as an example for explanation. Figure 4 The target information processing module is shown in FIG. 1 . The server maintains a target information registration table and an event information registration table. When the server receives the target message and event message of the target object sent by each edge device, the target information processing module in the server can initialize the target information registration table according to the target message sent by the edge computing device. That is, after the target information processing module is started, the target information processing module first initializes the target information registration table. That is, the target information processing module can Figure 3 The first-level balanced binary tree in the target information registration table shown in is set to an empty tree, and then enter Figure 4 In the main loop processing flow shown in Figure 4 In the flowchart of the target information processing module shown in FIG. 1 , after the server receives the 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 , triggering the server to execute 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 in Figure 3 In the target registration table shown in , it indicates that the target in the target message is a new target. The server can Figure 3 The target message is assigned a corresponding memory address in the target registration table shown in .

[0111] It can be understood that in various implementations of balanced binary trees, the target registration table in the embodiment of the present application can use a red-black tree, that is, the target registration table stores target information in a red-black tree data structure, because the target information registration table in the present application needs to perform a large number of query operations, insertion operations, and periodically perform deletion operations. A balanced binary tree is an efficient data structure, and the time complexity of its query operation, insertion operation, and deletion operation is 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 usually increase significantly. For example, although a linked list can also achieve the same function, the time complexity of its query operation is O (n). When n is very large, a solution based on a linked list will be much slower than a solution based on a balanced binary tree. Therefore, a balanced binary tree is a better data structure in this scenario. Balanced binary trees can include red-black trees, AVL trees, etc. The time complexity of each operation of red-black trees and AVL trees is the same. In theory, AVL trees can also be used, but in scenarios with more 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 the event registration table, it is possible to achieve correct state transfer and detect abnormal data flows, comprehensively covering the abnormal situations that may occur in reality, ensuring that the system will not crash or output wrong results due to these abnormal situations, and can automatically analyze possible causes and provide feedback to operation and maintenance personnel for targeted investigation, thereby improving the work efficiency of operation and maintenance personnel. At the same time, by detecting the redundancy of traffic events, it is possible to automatically determine whether the current event is redundant in the time and space dimensions, filter out redundant events, and thus enhance the availability 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 each parameter contained in the target message into the corresponding field of the memory address in the target registration table in sequence to obtain an updated target registration table;

[0115] The method further comprises: periodically reclaiming memory released after the target message expires;

[0116] Delete the memory address corresponding to the released memory from the target registration table.

[0117] Specifically, Figure 4The target information processing module is shown in FIG. 1 . The server maintains a target information registration table and an event information registration table. When the server receives the target message and event message of the target object sent by each edge device, the target information processing module in the server can initialize the target information registration table according to the target message sent by the edge computing device. After the target information processing module is started, the target information processing module first initializes the target information registration table, that is, the target information processing module can Figure 3 The first-level balanced binary tree in the target information registration table shown in is set to an empty tree, and then enter Figure 4 In the main loop processing flow shown in 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 so, the server can enter or update the various parameters of each target in the target information registration table based on the received target message, and recycle 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 the target information, and save the last update time. It can be understood that these target information stored in the basic storage unit are also available for access by the event information processing module and other downstream modules at any time, and only the point number and target number to be checked need to be provided.

[0118] Furthermore, the server can periodically recycle the memory released after the target message expires, and delete the memory address corresponding to the released memory from the target registration table, for example, Figure 3 As shown in FIG, a target information registration table storing target information in a tree data structure is used as an example to illustrate that the server first traverses Figure 3 For each basic storage unit in the target information registration table shown in , check the difference between the last update time of each basic storage unit and the current time. If the difference is greater than the threshold, it means that the target has not been observed for a long time, so 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 shown in Figure 3Each second-level balanced binary tree in the target information registration table shown in is checked to see if it is an empty tree. If so, the server releases the memory of the second-level balanced binary tree, and at the same time, the server deletes the node pointing to the second-level balanced binary tree in the first-level balanced binary tree. Thus, by dynamically maintaining the target registration table and the event registration table, it is possible to achieve correct state transfer and detect abnormal data flows, comprehensively covering the abnormal situations that may occur in reality, ensuring that the system will not crash or output wrong results due to these abnormal situations, effectively improving the accuracy of the processing results of traffic events, and automatically analyzing the possible causes, and feeding back to the operation and maintenance personnel for targeted investigation, thereby improving the work efficiency of the operation and maintenance personnel.

[0119] In one embodiment, the step of allocating a corresponding memory address for a target message in a target registration table includes:

[0120] When the point number in the target message does not exist in the keyword set of the first-level structure tree, a first node with the point 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;

[0121] 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;

[0122] The memory address corresponding to the basic storage unit is used as the memory address corresponding to the target message.

[0123] Specifically, the target registration table is used to store target information in a tree data structure as an example for explanation. Figure 3 As shown in FIG. 1 , it is a schematic diagram of the target information registration table data structure. Figure 3 As shown in , the target information registration table consists of a two-level balanced binary tree and a basic storage unit. The keyword 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 the memory; the keyword of the second-level balanced binary tree is the target number, and the value is the address of the basic storage unit in the memory; the basic storage unit stores the following fields: position vector, velocity vector, target type, target size, target color, target rectangular bounding box parameters, last update time, etc.

[0124] In such Figure 4 In the flowchart of the target information processing module shown in FIG. 1 , after the server receives the 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, Figure 3 In the target registry shown in , the server can Figure 3 The target registration table shown in FIG. 1 allocates the corresponding memory address for the target message. The specific steps are as follows:

[0125] 1. When Figure 3 When the point number in the target message does not exist in the keyword set of the first-level balanced binary tree in the target registration table shown in FIG. Figure 3 Insert the first node with the point number in the target message as the keyword into the first-level balanced binary tree in the target registration table shown, and apply for an empty second-level balanced binary tree. The server can set the value of the newly inserted first node to the address of the empty second-level balanced binary tree in the memory;

[0126] 2. Further, the server can query Figure 3 The keyword in the first-level balanced binary tree in the target registration table shown is the first node of the point number in the target message, and the address of the second-level balanced binary tree in the memory is obtained;

[0127] 3. When Figure 3 When the target number in the target message does not exist in the keyword 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 keyword in the second-level balanced binary tree, applies for 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 the memory;

[0128] 4. Further, the server can query Figure 3 The second node whose key in the second-level balanced binary tree in the target registration table is the target number in the target message is obtained to obtain the address of the basic storage unit in the memory;

[0129] 5. Return the address of the basic storage unit in the memory. The server can use the returned memory address corresponding to the basic storage unit as the memory address corresponding to the target message;

[0130] At this point, the memory of the basic storage unit corresponding to the target object has been allocated, and the server can access and modify it according to the memory address corresponding to the returned basic storage unit. For example, 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 in sequence 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 the event registration table, it is possible to achieve correct state transfer and detect abnormal data flows, comprehensively cover the abnormal situations that may occur in reality, and ensure that the system will not crash or output wrong results due to these abnormal situations, effectively improve the accuracy of the processing results of traffic events, and can automatically analyze the possible causes and feedback to the operation and maintenance personnel for targeted investigation, thereby improving the work efficiency of the operation and maintenance personnel.

[0131] In one embodiment, the step of periodically reclaiming memory released after the target message expires includes:

[0132] Determine the difference between the update time of each basic storage unit and the current time;

[0133] If the difference is greater than the threshold, the memory of the basic storage unit is released, and the node pointing to the basic storage unit is deleted in the second-level structure tree;

[0134] When the second-level structure tree is an empty tree, the memory of the second-level structure tree is released, and the node pointing to the second-level structure tree is deleted in the first-level structure tree.

[0135] Specifically, the target registration table is used to store target information in a tree data structure as an example for explanation. Figure 3 The following is a schematic diagram of the target information registration table data structure. At regular intervals, the server will automatically recycle the memory released by expired targets from the target information registration table. The server first traverses Figure 3 For each basic storage unit in the target information registration table shown in , check the difference between the last update time of each basic storage unit and the current time. If the difference is greater than the threshold, it means that the target has not been observed for a long time, so 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 shown in Figure 3Each second-level balanced binary tree in the target information registration table shown in is checked to see if it is an empty tree. If so, the server releases the memory of the second-level balanced binary tree, and at the same time, the server deletes the node pointing to the second-level balanced binary tree in the first-level balanced binary tree. Thus, by dynamically maintaining the target registration table and the event registration table, it is possible to achieve correct state transfer and detect abnormal data flows, comprehensively covering the abnormal situations that may occur in reality, ensuring that the system will not crash or output wrong results due to these abnormal situations, effectively improving the accuracy of the processing results of traffic events, and automatically analyzing the possible causes, and feeding back to the operation and maintenance personnel for targeted investigation, thereby improving the work efficiency of the operation and maintenance personnel.

[0136] In one embodiment, the step of updating the event registration table according to the event message to obtain the updated event registration table includes:

[0137] In the event registration table, the point number, target number and event type matching the event message are detected to obtain the detection result;

[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 to the event message in the event registration table;

[0139] The various parameters contained in the event message are sequentially written into the corresponding fields of the memory address in the event registration table to obtain an updated event registration table.

[0140] Specifically, an event registration table storing event information in a tree data structure is used as an example for explanation. Figure 5 As shown in FIG. 1 , it is a schematic diagram of the data structure of the event information registration table. Figure 5 As shown in , the event information registration table consists of a three-level balanced binary tree and a basic storage unit. The keyword 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 the memory; the keyword 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 the memory; the keyword of the third-level balanced binary tree is the event type, and the value is the address of the basic storage unit in the memory; wherein, the basic storage unit stores the following fields:

[0141] 1. The status of the event, including not started, in progress, and ended. In this application, the default status is not started;

[0142] 2. The most recent event number. If the target is experiencing an event of this type, then it is the current event number; otherwise, it is the event number of the most recent event of this type that occurred on the target.

[0143] 3. The most recent start time: if the target is experiencing an event of this type, then it is the start time of the current event; otherwise, it is the start time of the most recent event of this type that occurred on the target.

[0144] 4. Latest end time: the end time of the most recent event of this type that occurred for the target.

[0145] like Figure 6 The figure shows the flow chart of the event information processing module. The server maintains a target information registration table and an event information registration table. After the server receives the target message and event message of the target object sent by each edge device, the event information processing module in the server can initialize the event information registration table according to the event message sent by the edge computing device. After the event information processing module is started, the event information processing module 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 in is set to an empty tree, and then enter Figure 6 In the main loop processing flow shown in Figure 6 In the flowchart of the event information processing module shown, after the server receives the 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 as shown in the figure, that is, the event information processing module in the server detects the point number, target number, and event type matching the event message in the event registration table to obtain 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 a corresponding memory address for the event message in the event registration table; after the event information processing module in the server allocates the corresponding basic storage unit memory 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, and obtain an updated event registration table. Therefore, by dynamically maintaining the target registration table and the event registration table, it is possible to achieve correct state transfer and detect abnormal data flows, comprehensively covering abnormal situations that may occur in reality, ensuring that the system will not crash or output wrong results due to these abnormal situations, and effectively improving the accuracy of the processing results of traffic events. It can also automatically analyze possible causes and provide feedback to operation and maintenance personnel for targeted investigation, thereby improving the work efficiency of operation and maintenance personnel.

[0146] In one embodiment, the step of allocating a corresponding memory address for an event message in an event registration table includes:

[0147] When the point number in the event message does not exist in the keyword set of the first-level structure tree, insert a first node with the point number as the keyword in the first-level structure tree; the value of the first node is the memory address corresponding to the second-level structure tree;

[0148] When the target number in the event 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 third-level structure tree;

[0149] 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 a 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;

[0150] The memory address corresponding to the basic storage unit is used as the memory address corresponding to the event message.

[0151] Specifically, an event registration table storing event information in a tree data structure is used as an example for explanation. Figure 5 As shown in FIG. 1 , it is a schematic diagram of the data structure of the event information registration table. Figure 5 As shown in , the event information registration table consists of a three-level balanced binary tree and a basic storage unit. The keyword 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 the memory; the keyword 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 the memory; the keyword of the third-level balanced binary tree is the event type, and the value is the address of the basic storage unit in the memory; wherein, the basic storage unit stores the following fields:

[0152] 1. The status of the event, including not started, in progress, and ended. In this application, the default status is not started;

[0153] 2. The most recent event number. If the target is experiencing an event of this type, then it is the current event number; otherwise, it is the event number of the most recent event of this type that occurred on the target.

[0154] 3. The most recent start time: if the target is experiencing an event of this type, then it is the start time of the current event; otherwise, it is the start time of the most recent event of this type that occurred on the target.

[0155] 4. Latest end time: the end time of the most recent event of this type that occurred for the target.

[0156] In such Figure 6In the flowchart of the event information processing module shown in FIG. 1 , after the server receives the 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 FIG. 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 detects the point number, target number, and event type matching the event message in the event registration table to obtain a 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 allocate a memory address for the event message in the event registration table as shown in FIG. Figure 5 The event registration table shown in the figure allocates the corresponding memory address for the event message. The specific steps are as follows:

[0157] 1. When Figure 5 When the point number in the event message does not exist in the keyword set of the first-level balanced binary tree in the event registration table shown in FIG. Figure 5 In the event registration table shown, a first node with the position number of the event message as the key is inserted into the first-level balanced binary tree, and an empty second-level balanced binary tree is applied for, and the value of the newly inserted first node is set to the address of the empty second-level balanced binary tree in the memory;

[0158] 2. Further, the server can query Figure 5 The keyword in the first-level balanced binary tree in the event registration table shown is the first node of the point number in the event message, and the address of the second-level balanced binary tree in the memory is obtained;

[0159] 3. When Figure 5 When the target number in the event message does not exist in the keyword 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 keyword in the second-level balanced binary tree, apply for an empty third-level balanced binary tree, and set the value of the newly inserted second node to the address of the empty third-level balanced binary tree in the memory;

[0160] 4. Further, the server can query such as Figure 5 The second node whose key in the second-level balanced binary tree in the event registration table is the target number in the event message is obtained, and the address of the third-level balanced binary tree in the memory is obtained;

[0161] 5. When Figure 5When the event type in the event message does not exist in the keyword 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 a keyword in the third-level balanced binary tree, applies for 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 the memory;

[0162] 6. Further, the server can query Figure 5 The third node whose key is the event type in the event message in the third-level balanced binary tree in the event registration table shown above obtains the address of the basic storage unit in the memory.

[0163] 7. Return the address of the basic storage unit in the memory. The server can use the returned memory address corresponding to the basic storage unit as the memory address corresponding to the event message;

[0164] At this point, the memory of the basic storage unit corresponding to the point number, target number, and event type in the event message has been allocated. The server can access and modify it according to the returned memory address. Furthermore, the server can run the corresponding event action processing module according to 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 continuous, the event continuous 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 the event registration table, the correct state transfer and the detection of abnormal data flow can be achieved, which fully covers the abnormal situations that may occur in reality, and ensures that the system will not crash or output wrong results due to these abnormal situations, effectively improving the accuracy of the processing results of traffic events, and can automatically analyze the possible causes and feedback to the operation and maintenance personnel for targeted investigation, thereby improving the work efficiency of the operation and maintenance personnel.

[0165] In one embodiment, the method further comprises:

[0166] When the target object corresponding to the third-level structure tree does not exist in the target registration table, the third-level structure tree and the memory of the basic storage unit corresponding to the third-level structure tree are released, and the node pointing to the third-level structure tree is deleted in the second-level structure tree;

[0167] When the second-level structure tree is an empty tree, the memory of the second-level structure tree is released, and the node pointing to the second-level structure tree is deleted in the first-level structure tree.

[0168] Specifically, the server can periodically recycle the memory released after the event message expires, and delete the memory address corresponding to the released memory from the event registration table, for example, Figure 5The event information registration table shown in FIG. 1 is used as an example to store event information in a tree data structure. The server first traverses Figure 5 For each third-level balanced binary tree in the event information registration table shown in , check whether 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 the third-level balanced binary tree and the basic storage unit derived from the third-level balanced binary tree, and deletes the node pointing to the third-level balanced binary tree in the second-level balanced binary tree corresponding to the third-level balanced binary tree; further, the server continues to traverse as shown in Figure 5 Each second-level balanced binary tree in the event information registration table shown in is checked to see if it is an empty tree. If so, the server releases the memory of the second-level balanced binary tree and deletes the node pointing to the second-level balanced binary tree in the first-level balanced binary tree. Thus, by dynamically maintaining the target registration table and the event registration table, it is possible to achieve correct state transfer and detect abnormal data flows, comprehensively covering the abnormal situations that may occur in reality, ensuring that the system will not crash or output wrong results due to these abnormal situations, effectively improving the accuracy of the processing results of traffic events, and automatically analyzing the possible causes, and feeding back to the operation and maintenance personnel for targeted investigation, thereby improving the work efficiency of the operation and maintenance personnel.

[0169] In one embodiment, the event registration table stores event information in a tree data structure; the method further includes:

[0170] When the point number, target number and event type in the event message exist in the event registration table, a step of updating the event registration table according to the event message is performed.

[0171] Specifically, an event registration table storing event information in a tree data structure is used as an example for explanation. Figure 6 The figure shows the flow chart of the event information processing module. The server maintains a target information registration table and an event information registration table. After the server receives the target message and event message of the target object sent by each edge device, the event information processing module in the server can initialize the event information registration table according to the event message sent by the edge computing device. After the event information processing module is started, the event information processing module 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 in is set to an empty tree, and then enter Figure 6 In the main loop processing flow shown in Figure 6In the flowchart of the event information processing module shown in FIG, after the server receives the 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 FIG. When at least one of the point number, target number, and event type in the event message is empty, the server needs to allocate a corresponding memory address to the event message in the event registration table; when the point number, target number, and event type in the event message exist in the event information registration table shown in FIG. Figure 5 In the event registration table shown, the server can execute the step of updating the event registration table according to the event message.

[0172] It can be understood that in various implementations of balanced binary trees, the event registration table in the embodiment of the present application can be a red-black tree, that is, the event registration table stores event information in a red-black tree data structure, because the event information registration table in the present application needs to perform a large number of query operations, insertion operations, and periodically perform deletion operations. A balanced binary tree is an efficient data structure, and the time complexity of its query operation, insertion operation, and deletion operation is 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 usually increase significantly. For example, although a linked list can also achieve the same function, the time complexity of its query operation is O (n). When n is very large, a solution based on a linked list will be much slower than a solution based on a balanced binary tree. Therefore, a balanced binary tree is a better data structure in this scenario. Balanced binary trees can include red-black trees, AVL trees, etc. The time complexity of each operation of red-black trees and AVL trees is the same. In theory, AVL trees can also be used, but in scenarios with more 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 transfer and detection of abnormal data flows can be achieved, which comprehensively covers abnormal situations that may occur in reality, ensuring that the system will not crash or output erroneous results due to these abnormal situations, and effectively improving the accuracy of the processing results of traffic events. It can also automatically analyze possible causes and provide feedback to operation and maintenance personnel for targeted investigation, thereby improving the work efficiency of operation and maintenance personnel.

[0174] In one embodiment, the method further comprises:

[0175] When the event action in the new event message is in the start state, the point number, target number and event type matching the new event message are detected in the updated event registration table;

[0176] Based on the point number and the target number, determine the first target object;

[0177] Based on the first target object and the event type, determining the progress status and end time of the traffic event corresponding to the first target object;

[0178] When the progress status of the traffic event is in the ongoing state, the progress status of the traffic event is updated to the end state, and the end time is updated to the timestamp of the current event message.

[0179] Specifically, Figure 8The figure shows a flow chart of the event start action processing module. First, the server searches the event information registration table for the point number, target number, and event type in the new event message to be processed in turn, and obtains the corresponding traffic event status, the latest event number, the latest start time, and the latest end time. When the event action in the new event message is in the start state, the server can detect the point number, target number, and event type that match the new event message in the updated event registration table, and determine the first target object from multiple target objects based on the point number and target number. The server can determine the traffic event status and end time corresponding to the first target object based on the determined first target object and event type. That is, when the traffic event status is in progress, it means that the previous similar event is missing the message containing the end action, and may be missing a part of the message containing the continuous action. Because the previous similar event has not ended, the current event has already started, and the two may constitute redundancy, and the previous similar event has been reported to the business platform, so the server system makes a decision not to report the current event to the business platform, which also means not forwarding this event message; and, in order to correctly handle non-redundant events that may be received in the future, the server can update the event status to ended, update the most recent end time to the timestamp of this event message, and inform the business platform that the event that has not ended normally has been terminated by the system; if the event status is not started or ended, 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 will determine whether the current event is redundant from the time dimension and the space dimension respectively. In the time dimension, if the event status is ended, and the difference between the most recent end time and the timestamp of this event message is less than the preset redundant time threshold of this type of event, the event to be processed is redundant. In the space dimension, the discrimination between the target in the current event and each target of the adjacent point where the same type of traffic event is occurring is calculated. If a certain discrimination is less than the threshold, the event to be processed is redundant. Therefore, through a group of processing modules (event start action processing module, event continuous action processing module, event end action processing module, etc.) proposed in the embodiment of the present application, the abnormal situations that may occur in reality are fully covered, ensuring that the system will not crash or output wrong results due to these abnormal situations, and can automatically analyze possible causes and feedback to operation and maintenance personnel for targeted investigation, thereby improving the work efficiency of operation and maintenance personnel. At the same time, by proposing an event redundancy judgment module, a deep learning method is used to extract multiple features, which can automatically determine whether the current event is redundant in time and space dimensions, filter out redundant events, and thus enhance the availability of the results.

[0180] In one embodiment, the method further comprises:

[0181] When the event action in the new event message is in a continuous state, the point number, target number and event type matching the new event message are detected in the updated event registration table;

[0182] Determine a first target object based on the point number and the target number;

[0183] Based on the first target object and the event type, determining the progress status, event number, start time and end time of the traffic event corresponding to the first target object;

[0184] When the progress status of the traffic event is in progress, and the event number and start time are respectively the same as the event number and start time in the event message, forwarding the event message to the business platform;

[0185] When the ongoing status of a traffic event is in progress, and the event number and start time are different from those in the event message, the ongoing 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.

[0186] Specifically, Fig. 9As shown, it is a flow chart of the event continuous action processing module. First, the server searches the event information registration table for the point number, target number, and event type in the new event message to be processed in turn, and obtains the corresponding traffic event status, latest event number, latest start time, and latest end time. If the status of the traffic event is not started or has ended, it means that the previous similar event has ended normally, and the traffic event to be processed lacks the message containing the start action, and may lack a part of the message containing the continuous action. Because the traffic event to be processed has lost the relatively important starting part, the server system makes the decision not to report the incomplete event to the business platform, which also means not forwarding this event message; because the complete event that may be received in the future can be correctly processed by maintaining the current status, the event information registration table is not modified. If the status of the traffic event 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 latest event number and the latest start time in the event information registration table respectively. If yes, it means that the traffic event to be processed and the latest 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 that the traffic event to be processed and the latest event in the event information registration table are not the same event, the previous similar event lacks the message containing the end action, and the traffic event to be processed lacks the message containing the start action, and both may lack a part of the message containing the continuous action. Because the traffic event to be processed has lost the relatively important start part, the server system makes the decision not to report the incomplete event to the business platform, which also means not forwarding this event message; and in order to correctly handle the complete event that may be received in the future, the server updates the progress status of the traffic event to ended, updates the latest end time to the timestamp of this event message, and informs the business platform that the event that has not ended normally has been terminated by the system. Finally, if the event message is incomplete and causes a logical conflict, the server finally decides not to forward this event message, then the server can log the logical conflict and possible reasons and feedback to the upstream personnel for investigation. The analysis method is the same as the analysis method in the event start action processing module. Therefore, through a group of processing modules (event start action processing module, event continuous action processing module, event end action processing module, etc.) proposed in the embodiment of the present application, the abnormal situations that may occur in reality are fully covered, ensuring that the system will not crash or output wrong results due to these abnormal situations, and can automatically analyze possible causes and feedback to operation and maintenance personnel for targeted investigation, thereby improving the work efficiency of operation and maintenance personnel. At the same time, by proposing an event redundancy judgment module, a deep learning method is used to extract multiple features, which can automatically determine whether the current event is redundant in time and space dimensions, filter out redundant events, and thus enhance the availability of the results.

[0187] In one embodiment, the method further comprises:

[0188] When the event action in the new event message is in the end state, the point number, target number and event type matching the new event message are detected in the updated event registration table;

[0189] Determine a first target object based on the point number and the target number;

[0190] Based on the first target object and the event type, determining the progress status, event number, start time and end time of the traffic event corresponding to the first target object;

[0191] When the progress status of the traffic event is in progress, and the event number and start time are respectively the same as the event number and start time in the event message, the event message is forwarded to the business platform, and the progress status of the traffic event is updated to the end state, and the end time is updated to the timestamp of the current event message;

[0192] When the ongoing status of a traffic event is in progress, and the event number and start time are different from those in the event message, the ongoing 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.

[0193] Specifically, Fig.10As shown, it is a flow chart of the event end action processing module. First, the server searches the event information registration table for the point number, target number, and event type in the event message to be processed in turn, and obtains the corresponding traffic event status, the latest event number, the latest start time, and the latest end time. If the status of the traffic event is not started or has ended, it means that the previous similar event has ended normally, and the traffic event to be processed lacks the message containing the start action, and may lack a part of the message containing the continuous action. Because the traffic event to be processed has lost the relatively important starting part, the server system makes the decision not to report the incomplete event to the business platform, which also means not forwarding this event message; because the complete event that may be received in the future can be correctly processed by maintaining the current status, the event information registration table will not be modified. If the status of the traffic event 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 latest event number and the latest start time in the event information registration table respectively. If yes, it means that the traffic event to be processed and the latest 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 progress status of the traffic event to ended, and update the latest end time to the timestamp of this event message; if no, it means that the traffic event to be processed and the latest event in the event information registration table are not the same event, the previous similar event lacks the message containing the end action, and the traffic event to be processed lacks the message containing the start action, and both may lack a part of the message containing the continuous action. Because the traffic event to be processed has lost a relatively important start part, the server system makes a decision 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 server can update the progress status of the traffic event to ended, update the latest end time to the timestamp of this event message, and inform the business platform that the event that has not ended normally has been terminated by the system. Finally, if the logical conflict is caused by the incomplete event message, and the server finally decides not to forward this event message, the server can log the logical conflict situation and possible reasons and feedback to the upstream personnel for investigation. The analysis method is the same as the analysis method in the event start action processing module. Therefore, through a group of processing modules (event start action processing module, event continuous action processing module, event end action processing module, etc.) proposed in the embodiment of the present application, the abnormal situations that may occur in reality are fully covered, ensuring that the system will not crash or output wrong results due to these abnormal situations, and can automatically analyze the possible reasons and feedback to the operation and maintenance personnel for targeted investigation, thereby improving the work efficiency of the operation and maintenance personnel.At the same time, by proposing an event redundancy judgment module and using deep learning methods to extract multiple features, it is possible to automatically determine whether the current event is redundant in the time and space dimensions, filter out redundant events, and thus enhance the availability of the results.

[0194] In one embodiment, the step of detecting redundancy of traffic events according to target information in the updated target registration table includes:

[0195] In the time dimension, if the ongoing state of the traffic event is 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, the traffic event is determined to be a redundant event; or,

[0196] In the spatial dimension, among the adjacent points corresponding to the point of the target object, the objects involved in the same type of traffic incidents are determined, and the degree of distinction between the target object and the objects in the same type of traffic incidents is determined; when the degree of distinction is less than a threshold, the traffic incident is determined to be a redundant event.

[0197] Specifically, in the time dimension, if the ongoing state of the traffic event is the end state, and the difference between the end time of the traffic event and the timestamp of the event message is less than the preset difference, the server determines that the traffic event is a redundant event; or, in the space dimension, in the adjacent points corresponding to the point of the target object, the object in the same type of traffic event is determined, and the distinction between the target object and the object in the same type of traffic event is determined; when the distinction is less than the threshold, the traffic event is determined to be a redundant event. Therefore, by proposing an event redundancy judgment module, using a deep learning method to extract multiple features, it is possible to automatically judge whether the current event is redundant in the time and space dimensions, filter out redundant events, and thus enhance the availability of the results.

[0198] In one embodiment, the step of determining the degree of distinction between the target object and objects in the same type of traffic events includes:

[0199] Among the adjacent points corresponding to the point of the target object, determine the object in which the same type of traffic incident occurred;

[0200] Determine the position discrimination, speed discrimination, type discrimination, size discrimination and color discrimination between the target object and objects in the same type of traffic incident;

[0201] Based on the position distinction, the speed distinction, the type distinction, the size distinction and the color distinction, the distinction between the target object and objects in the same type of traffic events is determined.

[0202] Specifically, the discrimination in the embodiment of the present application is defined as the weighted average of the following items:

[0203] 1. Position discrimination: |xx′| 2 +|yy′| 2 , where (x, y) is the position vector of the current target, and (x', y') is the position vector of the other target;

[0204] 2. Speed ​​differentiation: |v x -v′ x | 2 +|v y -v′ y | 2 , where (v x ,v y ) is the velocity vector of the current target, (v′ x ,v′ y ) is the velocity vector of another target;

[0205] 3. Type differentiation: The type differentiation between pedestrians and motorcycles, motorcycles and non-motorized vehicles, and pedestrians and non-motorized vehicles is infinite. The type differentiation between small cars and medium-sized cars is the preset value 1, the type differentiation between medium-sized cars and large cars is the preset value 2, and the type differentiation between small cars and large cars is the preset value 1 + preset value 2;

[0206] 4. Size differentiation: Where l, w, h are the length, width, and height of the current target, respectively; 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 determine the objects involved in the same type of traffic events at the adjacent points corresponding to the point of the target object, and determine the position distinction, speed distinction, type distinction, size distinction and color distinction between the target object and the objects in the same type of traffic events based on the above calculation method; further, the server can calculate the weighted average of the position distinction, speed distinction, type distinction, size distinction and the color distinction, and use the calculated weighted average as the distinction between the target object and the objects in the same type of traffic events.

[0209] If the traffic event to be processed is redundant in time or space, the server will not forward this event message to the business platform, the event information registration table will not be modified, and the redundancy will be recorded in the log for inspection when necessary. Otherwise, the server will forward this event message to the business platform, update the event status to in progress, update the latest event number to the event number of this event message, and update the latest start time to the event start time of this event message. Therefore, by proposing an event redundancy judgment module, using deep learning methods to extract multiple features, it can automatically determine whether the current event is redundant in time and space dimensions, filter out redundant events, and enhance the availability of the results. At the same time, by adopting redundancy detection methods in different dimensions, more accurate redundancy detection results can be obtained.

[0210] In one embodiment, after detecting the redundancy of traffic events according to the target information in the updated target registration table, the method further includes:

[0211] When the traffic event is a redundant event, the redundant information of the traffic event is recorded in the log;

[0212] After forwarding the new event message to the service platform according to the redundancy, the method further includes:

[0213] The progress status of the traffic event is updated to the ongoing status, 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.

[0214] Specifically, when a traffic event is a redundant event, the server records the redundant information of the traffic event in the log; when the server forwards the new event message to the business platform according to redundancy, the server can update the ongoing state of the traffic event to the ongoing state, 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 a group of processing modules (event start action processing module, event continuous action processing module, event end action processing module, etc.) proposed in the embodiment of the present application, the abnormal situations that may occur in reality are fully covered, ensuring that the system will not crash or output wrong results due to these abnormal situations, and can automatically analyze the possible reasons, and feedback to the operation and maintenance personnel for targeted investigation, thereby improving the work efficiency of the operation and maintenance personnel. At the same time, by proposing an event redundancy judgment module, a variety of features are extracted using a deep learning method, which can automatically determine whether the current event is redundant in the time and space dimensions, and filter out redundant events, thereby enhancing the availability of the results.

[0215] The present application also provides an application scenario, and the application scenario applies the above-mentioned method for handling traffic events. Specifically, the application of the method for handling traffic events in the application scenario is as follows:

[0216] In the real-time summary system of intelligent highway traffic events, the above-mentioned video interaction method can be used to summarize the traffic event information detected by the automatic detection system of traffic events deployed at multiple points on a long-distance highway in real time to the data center and business platform, so as to help traffic commanders and law enforcement personnel accurately, comprehensively and efficiently identify traffic events, and then take appropriate treatment measures in time. The summary system, i.e., the server, can receive the target message and event message of the target object sent by each edge device, and update the target registration table based on the target message to obtain an updated target registration table; the summary system, i.e., the server, updates the event registration table according to the event message to obtain an updated event registration table; when the summary system, i.e., the server receives the event action in the new event message 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 summary system, i.e., the server detects the redundancy of the traffic event based on the target information in the updated target registration table, and the summary system, i.e., the server, forwards the new event message to the business platform according to the redundancy, or updates the updated event registration table according to the new event message. The method provided in this application can achieve the following effects:

[0217] 1. By using the streaming representation of events, the current status of each event (including ended and ongoing) can be displayed in real time to ensure the timeliness of command and intervention;

[0218] 2. By designing efficient data structures and algorithms, the method provided by this application has very low performance requirements for the central computer, and an ordinary computer can be competent. The cost and technical requirements are lower than those of a distributed system;

[0219] 3. This application proposes a set of processing modules that fully cover the abnormal situations that may occur in reality, ensuring that the system will not crash or output wrong results due to these abnormal situations, and can automatically analyze the possible causes;

[0220] 4. This application proposes an event redundancy judgment module, which uses deep learning methods to extract multiple features, can automatically determine whether the current event is redundant in time and space dimensions, filter out redundant events, and thus enhance the availability of the results.

[0221] The method provided in the embodiment of the present application can be applied to various traffic scenarios. The following takes the detection scenario of a highway traffic event as an example to illustrate the method for handling a traffic event provided in the embodiment of the present application.

[0222] In the traditional way of handling traffic incidents, for the summary of multi-point traffic incidents, each point transmits its own traffic incident detection results to a central computer, which then summarizes the data, identifies and removes incomplete, abnormal and redundant items in the data, and sends the results to the business platform, and finally presents them to relevant personnel in an intuitive form. It should be noted that due to the various reasons mentioned above, it is very common in practice that the data received by the central computer is incomplete, abnormal and redundant. A system that has not been specially designed may fall into confusion after receiving problematic data, continue to give incorrect calculation results for subsequent inputs, or even crash. Alternatively, a system that has not been specially designed may not be able to effectively remove redundant messages in the time and space dimensions, resulting in frequent repeated reporting of events, greatly reducing the availability of the results.

[0223] Therefore, in order to solve the above problems, the present application provides a highly robust real-time aggregation method for intelligent highway traffic events, which is used to aggregate the traffic event information detected by the automatic detection system of traffic events deployed at multiple points on a long-distance highway in real time to the data center and business platform, helping traffic commanders and law enforcement personnel to accurately, comprehensively and efficiently identify traffic events, and then take appropriate treatment measures in a timely manner. It has two characteristics. First, the method provided by the present application proposes a set of processing modules, which fully covers the abnormal situations that may occur in reality (for example, poor network conditions lead to packet loss; a certain point encounters a fault and needs to be restarted; or the upstream needs to switch the data source due to debugging), ensuring that the system will not crash or output wrong results due to these abnormal situations, and can automatically analyze the possible causes and feedback to the operation and maintenance personnel for targeted investigation, thereby improving the work efficiency of the operation and 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 determine whether the current event is redundant in time and space dimensions (time dimension redundancy refers to the repeated reporting of the same event at the same point; space dimension redundancy refers to the observation and reporting of the same event by different points, resulting in repeated reporting of the event), and filter out redundant events, thereby enhancing the availability of the results.

[0224] Robustness: The ability of a computer system to maintain normal operation and correct calculation results when encountering errors, anomalies, or failures (such as poor network conditions or hard disk failure) during its own operation and the process of inputting, processing, and outputting data.

[0225] On the product side, the method provided in this application is used to aggregate the traffic event information detected by the automatic traffic event detection system deployed at multiple points on a long-distance highway in real time to the data center and business platform, helping traffic commanders and law enforcement personnel to accurately, comprehensively and efficiently identify traffic events, and then take appropriate handling measures in a timely manner.

[0226] On the technical side, for a single-point traffic event detection system, two cameras facing opposite directions are set up at a certain location on the highway, and image sequences are continuously collected at a certain frequency (for example, 10Hz or 20Hz), and sent to the edge computing device at that point for subsequent processing. After target detection, we can obtain the rectangular bounding box of the target (vehicle, pedestrian) we are interested in in each frame of the image. After target search, 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. The assignment rule is to increase in sequence in order and reset to 1 after exceeding a certain limit. Through coordinate system conversion, we can obtain the position trajectory of each target in the real world and then calculate its speed. Then, based on our definition of traffic events, the system can automatically analyze the behavior of the target and identify a series of traffic events. Each traffic event also has a number, which is assigned at the beginning of the event. The assignment rule is also to increase in sequence in order and reset to 1 after exceeding a certain limit. The definitions of some traffic events 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 the duration reaches the preset detection time threshold.

[0229] 3. Speeding: The vehicle speed is greater than the speeding threshold (e.g. 100km / h) and the duration 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. 5km / h) and the duration reaches the preset detection time threshold.

[0232] 6. Occupying the emergency lane: The vehicle is located in the emergency lane and the duration reaches the preset detection time threshold.

[0233] 7. Against the flow: The vehicle is traveling in the opposite direction of the normal direction of its lane, and the duration reaches the preset detection time threshold.

[0234] After each frame of image analysis is completed (i.e., after target detection, target search, and traffic event detection are completed), the edge computing device will send useful information to the central computer in real time, including target messages containing target parameters, event messages containing event parameters, and compressed images. Specifically, the target message contains the following fields:

[0235] 1. Timestamp, i.e. the local time when sending.

[0236] 2. Point 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, and we get the 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, and we get a two-dimensional velocity vector.

[0240] 6. Target type. There are three categories: pedestrians, motorcycles, and non-motorized vehicles, which are automatically given when the target is detected. Non-motorized vehicles are further divided into small vehicles (such as sedans), medium-sized vehicles (such as vans), and large vehicles (such as trucks), which are estimated by the trained convolutional neural network.

[0241] 7. Object size (length, width, height). Only non-motor vehicles have these parameters, which are estimated by the trained convolutional neural network.

[0242] 8. Target color, using RGB three-channel representation, estimated by the trained convolutional neural network.

[0243] 9. The length, width and offset of the target rectangular bounding box relative to the upper left corner of the image. Used for business platform display.

[0244] The event message contains the following fields:

[0245] 1. Timestamp, i.e. the local time when sending.

[0246] 2. Point number.

[0247] 3. Target number.

[0248] 4. Event types, including pedestrians on the highway, motorcycles on the highway, speeding, underspeed, parking, occupying the emergency lane, driving in the wrong direction, etc.

[0249] 5. Event number.

[0250] 6. Event start time.

[0251] 7. Event actions, including start, duration, and end. Use the flow representation of events: in the frame where the event starts, the event action is set to start; in the frame 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.

[0252] In actual production, programs are often configured with automatic restart services, that is, when a program crashes for various reasons, the operating system will automatically restart the program, and the event number will be reset to 1. In addition, in order to debug the program, developers sometimes need to switch the program input from the online real-time data stream to the local playback data stream. At this time, the event number originally maintained by the program may be overwritten by the event number in the local playback data stream. These abnormal situations will test the logical operations of the program. A robust system should ensure that these abnormal situations will not have long-term effects and minimize the unavoidable short-term effects.

[0253] The present application proposes a multi-point traffic event aggregation system with high robustness and high availability, which is the main focus and innovation of the present application. The general idea is as follows: the central computer maintains a target information registration table and an event information registration table. The target information processing module enters or updates the various parameters of each target in the target information registration table according to the target message sent by the edge computing device, and recycles the memory after the target leaves the perception range. The event information processing module initializes or updates the status of each event in the event information registration table according to the event message sent by the edge computing device and the target information in the target information registration table, forwards the event message that meets the reporting conditions to the business platform, and recycles the memory after a period of time after the event ends. The event information registration table also maintains a set of specially designed variables for achieving correct state transitions and detecting abnormal data flows. Among them, an efficient data structure is designed for the target information registration table and the event information registration table, respectively, such as Figure 3 and Figure 5 shown.

[0254] A balanced binary tree is a tree data structure in computer science. Each node has a keyword as a query index and stores one or a group of values ​​related to the application problem. A balanced binary tree can perform efficient query (i.e., find the corresponding value according to the keyword), insertion, deletion and other 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 a basic storage unit. The keyword 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 keyword 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 rectangular bounding box parameters, and last update time. The event information registration table consists of a three-level balanced binary tree and a basic storage unit. The keyword 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 keyword 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 keyword 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. The status of the event, including Not Started, In Progress, and Completed. The default is Not Started.

[0256] 2. The most recent event number. If the target is experiencing an event of this type, then it is the current event number; otherwise, it is the event number of the most recent event of this type that occurred on the target.

[0257] 3. Latest start time. If the target is experiencing an event of this type, then it is the start time of the current event; otherwise, it is the start time of the most recent event of this type that occurred on the target.

[0258] 4. Latest end time: The end time of the most recent event of this type that occurred for this target.

[0259] The target information processing module and event information processing module in this application can be regarded as the "main program" running in the server, which runs in a loop after being started 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 is started, the target information registration table is initialized first, the first-level balanced binary tree is set to an empty tree, and then the main loop is entered. After receiving the target message from the edge computing device, check whether the target already exists in the target information registration table. If not, it is necessary to allocate memory for it in the target information registration table. The specific steps are as follows:

[0261] 1. If the keyword set of the first-level balanced binary tree does not contain the point number in the target message, insert a node with this point number as the keyword in the first-level balanced binary tree, apply for an empty second-level balanced binary tree, and set the value of the newly inserted node to the address of the empty second-level balanced binary tree in memory.

[0262] 2. Query the node whose keyword in the first-level balanced binary tree is the point number in the target message, and obtain the address of the second-level balanced binary tree in memory.

[0263] 3. If the target number in the target message is not in the keyword set of the second-level balanced binary tree, insert a node with this target number as the keyword in the second-level balanced binary tree, apply for an empty basic storage unit, and set the value of the newly inserted node to the address of the empty basic storage unit in the memory.

[0264] 4. Query the node whose keyword is the target number in the target message in the second-level balanced binary tree to obtain the address of the basic storage unit in the memory.

[0265] 5. Return to the address.

[0266] At this point, the memory of the basic storage unit corresponding to the target has been allocated. According to the returned address, it can be accessed and modified. The position vector, velocity vector, target type, target size, target color, and rectangular bounding box information in the target message are filled into the corresponding fields in the basic storage unit to complete the entry or update of the target information and save the last update time. This target information is also accessible to the event information processing module and other downstream modules at any time, just provide the point number and target number to be checked.

[0267] In addition, the program will automatically reclaim the memory of expired targets from the target information registration table at regular intervals. First, traverse each basic storage unit and check the difference between its last update time and the current time. If the difference is greater than the threshold, it means 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 in the corresponding second-level balanced binary tree. Then traverse each second-level balanced binary tree to check whether it is an empty tree. If so, the memory of this second-level balanced binary tree is released, and the node pointing to it is deleted in the first-level balanced binary tree.

[0268] The flow chart of the event information processing module is as follows: Figure 6As shown. After the event information processing module is started, the event information registration table is initialized first, the first-level balanced binary tree is set to an empty tree, and then the main loop is entered. After receiving the event message from the edge computing device, check 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 is necessary 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, insert a node with this point number as the key in the first-level balanced binary tree, apply for an empty second-level balanced binary tree, and set the value of the newly inserted node to the address of the empty second-level balanced binary tree in memory.

[0270] 2. Query the node whose keyword in the first-level balanced binary tree is the point number in the event message, and obtain the address of the second-level balanced binary tree in memory.

[0271] 3. If the target number in the event message is not in the keyword set of the second-level balanced binary tree, insert a node with the target number as the keyword into the second-level balanced binary tree, apply for an empty third-level balanced binary tree, and set the value of the newly inserted node to the address of the empty third-level balanced binary tree in memory.

[0272] 4. Query the node whose keyword in the second-level balanced binary tree is the target number in the event message, and obtain the address of the third-level balanced binary tree in memory.

[0273] 5. If the event type in the event message is not included in the keyword set of the third-level balanced binary tree, insert a node with this event type as the keyword into the third-level balanced binary tree, apply for an empty basic storage unit, and set the value of the newly inserted node to the address of the empty basic storage unit in the memory.

[0274] 6. Query the node whose keyword is the event type in the event message in the third-level balanced binary tree to obtain the address of the basic storage unit in the memory.

[0275] 7. Return to the address.

[0276] At this point, the memory of the basic storage unit corresponding to the point number, target number, and event type in the event message has been allocated. According to 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 will automatically reclaim the memory of expired events from the event information registration table at regular intervals. First, traverse each third-level balanced binary tree to check whether its corresponding target exists in the target information registration table. If not, release the memory of the third-level balanced binary tree and the basic storage unit derived from it, and delete the node pointing to it in the corresponding second-level balanced binary tree. Then traverse each second-level balanced binary tree to check whether it is an empty tree. If so, release the memory of the second-level balanced binary tree and delete the node pointing to it in the first-level balanced binary tree.

[0278] It can be understood that in the embodiment of the present application, the event status of a certain target or a certain type of event is first initialized to "not started", and then, each time an event message is received, the following judgment and operation are performed (please also refer to Figure 7 , each event should consist of a "start", 0 or 1 or more "durations", and an "end"):

[0279] 1. If the current event status is "Not Started" or "Ended":

[0280] 1.1 If the event action of the newly received event message is "start", the event status is changed to "in progress", that is, a new event life cycle has begun and is in the "in progress" state.

[0281] 1.2 If the event action of the newly received event message is "continue" or "end", the program will report an error and stop.

[0282] 2. If the current event status is "in progress":

[0283] 2.1 If the event action of the newly received event message is "Continue", the event status remains unchanged and remains "In Progress".

[0284] 2.2 If the event action of the newly received event message is "end", the event status is changed to "end", that is, the life cycle of the current event ends and prepares for the next event.

[0285] 2.3 If the event action of the newly received event message is "Start", the program will report an error and stop.

[0286] The above program error and stop situation can be understood as a logic conflict. However, in actual work, there are indeed situations where the "start-continue-end" stream representation of events is incomplete due to various reasons, causing logic conflicts. We require that our system should not stop with an error or fall into chaos in this case, nor should it leave long-term impact. In fact, for the above three logic conflict situations, we can analyze the possible causes and deal with them properly.

[0287] The flow chart of the event start action processing module is as follows Figure 8 As shown. First, search the point number, target number, and event type in the pending event message in the event information registration table in turn to obtain the corresponding event status, latest event number, latest start time, and latest end time. If the event status is in progress, it means that the previous event of the same type is missing the message containing the end action, and may be missing some messages containing the continuous action. Because the previous event of the same type has not ended yet, the current event has already started, and the two may constitute redundancy, and the previous event of the same type has been reported to the business platform, so the system makes a decision not to report the current event to the business platform, which also means not forwarding this event message; in order to correctly handle non-redundant events that may be received in the future, the event status is updated to ended, and the latest end time is updated to the timestamp of this event message, and the business platform is informed that the event that has not ended normally has been terminated by the system. If the event status is not started or ended, 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 the time dimension and the space dimension respectively. In the time dimension, if the event status is ended, and the difference between the most recent end time and the timestamp of this event message is less than the preset redundant time threshold of this type of event, the pending event is redundant. In the spatial dimension, the discrimination between the current target and the adjacent points where the same type of traffic events are occurring is calculated. If a discrimination is less than the threshold, the pending event is redundant.

[0288] The event start action processing module is triggered when an event message containing a start action is received. If the current event status is "in progress", there are two possible situations (in shorthand, the event message is recorded as "event id + action", arranged in chronological order):

[0289] 1. The event status 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 case is "the previous event of the same type is missing the message containing the end action", and the second case is "the previous event of the same type is missing the message containing the end action, and is missing part of the message containing the continuing action". Since the second half of event 1 is lost, we cannot know when event 1 ends. If the end time of event 1 and the start time of event 2 are too close (the difference is less than the preset redundant time threshold of this type of event), the two are redundant.

[0292] Here are some examples:

[0293] 08:00:00 Event 1 starts -> 08:00:01 Event 1 continues -> 08:00:02 Event 1 continues (lost) -> 08:00:03 Event 1 continues (lost) -> 08:00:04 Event 1 ends (lost) -> 08:00:06 Event 2 starts -> 08:00:07 Event 2 continues -> 08:00:08 Event 2 ends;

[0294] In this example, the system received the last message of event 1 at 08:00:01, but event 1 actually ended at 08:00:04, and the actual end time of event 1 differed by 2 seconds from the start time of event 2. If the preset redundancy time threshold for this type of event is 3 seconds, event 1 and event 2 are redundant.

[0295] Discrimination is defined as the weighted average of:

[0296] 1. Position discrimination: |xx′| 2 +|yy′| 2 , where (x, y) is the position vector of the current target and (x', y') is the position vector of the other target.

[0297] 2. Speed ​​differentiation: |v x -v′ x | 2 +|v y -v′ y | 2 , where (v x ,v y ) is the velocity vector of the current target, (v′ x ,v′ y ) is the velocity vector of the other target.

[0298] 3. Type differentiation: The type differentiation between pedestrians and motorcycles, motorcycles and non-motorized vehicles, and pedestrians and non-motorized vehicles is infinite. The type differentiation between small cars and medium-sized cars is preset value 1, the type differentiation between medium-sized cars and large cars is preset value 2, and the type differentiation between small cars and large cars is preset value 1 + preset value 2.

[0299] 4. Size differentiation: Where l, w, h are the length, width, and height of the current target, and l', w', h' are the length, width, and height of another target.

[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 time or space, this event message will not be forwarded to the business platform, the event information registration table will not be modified, and the redundancy will be recorded in the log for inspection when necessary. Otherwise, this 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 occurs due to an incomplete event message, and it is ultimately decided not to forward this event message, the logical conflict and possible causes will be recorded in the log and fed back 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 poor network conditions leading to packet loss. 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 that required a restart and was restarted manually or automatically. If the upstream confirms that it was an automatic restart, it is recommended to check the root cause in combination with the log, such as insufficient memory, program vulnerabilities, etc.

[0305] 3. If neither of the above two situations is true, the reason may be that the upstream has switched the data source. If the upstream confirms that debugging is in progress, the messages from this point should be temporarily blocked and restored after the debugging is completed.

[0306] The flow chart of the event continuous action processing module is as follows Fig. 9As shown. First, search the point number, target number, and event type in the pending event message in the event information registration table in turn to obtain the corresponding event status, latest event number, latest start time, and latest end time. If the event status is not started or ended, it means that the previous similar event ended normally, and the pending event is missing the message containing the start action, and may be missing a part of the message containing the continuous 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; because maintaining the current status can correctly handle 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 latest event number and the latest start time in the event information registration table respectively. If yes, it means that the pending event and the latest 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 that the pending event and the latest event in the event information registration table are not the same event, the previous similar event is missing the message containing the end action, and the pending event is missing the message containing the start action, and both may be missing a part of the message containing the continuous action. Because the pending event has lost the relatively important start part, the system makes a decision 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 event that may be received in the future, the event status is updated to ended, the latest end time is updated to the timestamp of this event message, and the business platform is informed that the event that has not ended normally has been terminated by the system. Finally, if the event message is incomplete and causes a logical conflict, it is finally decided not to forward this event message, then the logical conflict situation and possible reasons are recorded in the log and fed back to the 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 processing module is as follows Fig.10As shown. First, search the point number, target number, and event type in the pending event message in the event information registration table in turn to obtain the corresponding event status, latest event number, latest start time, and latest end time. If the event status is not started or ended, it means that the previous similar event ended normally, and the pending event is missing the message containing the start action, and may be missing a part of the message containing the continuous 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; because maintaining the current status can correctly handle 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 latest event number and the latest start time in the event information registration table respectively. If yes, it means that the pending event and the latest 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 ended, and the latest end time is updated to the timestamp of this event message; if no, it means that the pending event and the latest event in the event information registration table are not the same event, the previous similar event lacks the message containing the end action, and the pending event lacks the message containing the start action, and both may lack a part of the message containing the continuous action. Because the pending event has lost the relatively important start part, the system makes the decision 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 event that may be received in the future, the event status is updated to ended, the latest end time is updated to the timestamp of this event message, and the business platform is informed that the event that has not ended normally has been terminated by the system. Finally, if the event message is incomplete and causes a logical conflict, it is finally decided not to forward this event message, then the logical conflict situation and possible reasons are recorded in the log and fed back to the upstream personnel for investigation. The analysis method is the same as the analysis method in the event start action processing module.

[0308] Briefly introduce the functions of the business platform. The business platform is a software installed on a central computer or other machine to display traffic events. For each point, the business platform provides a real-time picture of the point, and uses a rectangle to mark the target where the traffic event is occurring, and uses text to mark the event type and other information. For each event, the business platform provides a playback video of the event, which is generated by the edge computing device at the beginning of the event based on its cached image and target information. The length of the video is determined by the preset detection time threshold of this type of event, and then pushed to the central computer.

[0309] In addition, in the embodiment of the present application, when performing cross-point deduplication, a convolutional neural network is used to extract features such as target type, target size, and target color, and then associate and deduplicate events with different IDs. There is still a lot of room for expansion in the categories and extraction methods of features. For example, a deep autoencoder can be used to generate a low-dimensional vector representation of the target, which may provide richer semantic information.

[0310] The beneficial effects of the technical solution of this application include:

[0311] The method provided in the embodiment of the present application proposes a set of processing modules that comprehensively cover the abnormal situations that may occur in reality, ensure that the system will not crash or output wrong results due to these abnormal situations, and can automatically analyze the possible causes and provide feedback to the operation and maintenance personnel for targeted investigation, thereby improving the work efficiency of the operation and maintenance personnel. The present application proposes an event redundancy judgment module that uses a deep learning method to extract multiple features, which can automatically determine whether the current event is redundant in time and space dimensions, filter out redundant events, and thus enhance the availability of the results.

[0312] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0313] Based on the same inventive concept, the embodiment of the present application also provides a traffic event processing device for implementing the above-mentioned traffic event processing method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in the embodiments of one or more traffic event processing devices provided below can refer to the limitations of the traffic event processing method above, and will not be repeated here.

[0314] In one embodiment, Fig.11 As shown, a traffic event processing device is provided, including: a receiving module 1102, an updating module 1104, a detecting module 1106 and a forwarding module 1108, wherein:

[0315] The receiving module 1102 is used to receive target messages and event messages of target objects sent by each edge device.

[0316] The updating module 1104 is used to update the target registration table based on the target message to obtain an updated target registration table; and update the event registration table according to the event message to obtain an updated event registration table.

[0317] The detection module 1106 is used to detect the redundancy of the traffic event based on the target information in the updated target registration table when the event action in the received 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] The forwarding module 1108 is used to forward the new event message to the service platform according to redundancy.

[0319] The updating module 1104 is further configured to update the updated event registration table according to the new event message.

[0320] In one embodiment, the target message is obtained by each edge device detecting the target object on the image sequence received from the point acquisition and searching for the detected target object; the target message includes the position trajectory and target number of the target object in the image sequence; wherein the target number is assigned when the target object is first detected; and the event message is obtained by event recognition based on the position trajectory and the target number.

[0321] In one embodiment, the device also includes: an execution module and an allocation module, the execution module is used 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 used 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 device also includes: a writing module, a recycling module and a deletion module. The writing module is used to write the various parameters contained in the target message into the corresponding fields of the memory address in the target registration table in sequence 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 device also includes: an insertion module, which is used to insert a first node with the point number as a keyword in the first-level structure tree when the point 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; when the target number in the target message does not exist in the keyword set of the second-level structure tree, insert a second node with the target number as a keyword in the second-level structure tree; the value of the second 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 target message.

[0324] In one embodiment, the device also includes: a determination module for determining the difference between the update time of each basic storage unit and the current time; a deletion module is also used to release the memory of the basic storage unit if the difference is greater than a threshold, and delete the node pointing to the basic storage unit in the second-level structure tree; when the second-level structure tree is an empty tree, release the memory of the second-level structure tree, and delete the node pointing to the second-level structure tree in the first-level structure tree.

[0325] In one embodiment, the detection module is also used to detect the point number, target number and event type matching the event message in the event registration table to obtain a detection result; the allocation module is also used to allocate a corresponding memory address to the event message in the event registration table when the detection result indicates that at least one of the point number, the target number and the event type is empty; the writing module is also used to write the various 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 also used to insert a first node with the point number as a keyword in the first-level structure tree when the point 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; when the target number in the event message does not exist in the keyword set of the second-level structure tree, insert a second node with the target number as a keyword in 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, insert a third node with the event type as a keyword in 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.

[0327] In one embodiment, the deletion module is also used to release the third-level structure tree and the memory of the basic storage unit corresponding to the third-level structure tree when the target object corresponding to the third-level structure tree does not exist in the target registration table, and delete the node pointing to the third-level structure tree in the second-level structure tree; when the second-level structure tree is an empty tree, release the memory of the second-level structure tree, and delete the node pointing to the second-level structure tree in the first-level structure tree.

[0328] In one embodiment, the event registration table stores the event information in a tree data structure; the execution module is also used to execute 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 also used to detect the point number, target number and event type matching the new event message in the updated event registration table when the event action in the new event message is in the start state; the determination module is also used to determine the first target object based on the point number and the target number; 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; the update module is also used to update the progress status of the traffic event to the end state when the progress status of the traffic event is in progress, and update the end time to the timestamp of the current event message.

[0330] In one embodiment, the detection module is also used to detect the point number, target number and event type matching the new event message in the updated event registration table when the event action in the new event message is in a continuous state; the determination module is also used to determine the first target object based on the point number and the target number; 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; the forwarding module is also used 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 respectively the same as the event number and start time in the event message; the update module is also used to update the progress status of the traffic event to the 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 and the event number and the start time are respectively different from the event number and start time in the event message.

[0331] In one embodiment, the detection module is also used to detect the point number, target number and event type matching the new event message in the updated event registration table when the event action in the new event message is in the end state; the determination module is also used to determine the first target object based on the point number and the target number; 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; the forwarding module is also used 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 respectively the same as the event number and the start time in the event message, and update the progress status of the traffic event to the end state and update the end time to the timestamp of the current event message; the update module is also used to update the progress status of the traffic event to the 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 and the event number and the start time are respectively different from the event number and the start time in the event message.

[0332] In one embodiment, the determination module is also used to determine that the traffic event is a redundant event in the time dimension if the ongoing state of the traffic event is 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; or, in the spatial dimension, determine the objects involved in the same type of traffic events in the adjacent points corresponding to the points of the target object, and determine the degree of distinction between the target object and the objects in the same type of traffic events; when the degree of distinction is less than a threshold, determine that the traffic event is a redundant event.

[0333] In one embodiment, the determination module is also used to determine the object involved in the same type of traffic event at the adjacent points corresponding to the point of the target object; determine the position distinction, speed distinction, type distinction, size distinction and color distinction between the target object and the object in the same type of traffic event; and determine the distinction between the target object and the object in the same type of traffic event based on the position distinction, the speed distinction, the type distinction, the size distinction and the color distinction.

[0334] In one embodiment, the device also includes: a recording module, which is used to record the redundant information of the traffic event in a log when the traffic event is a redundant event; the updating module is also used to update the ongoing status of the traffic event to an ongoing 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] Each module in the above-mentioned traffic event processing device can be implemented in whole or in part by software, hardware or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0336] In one embodiment, a computer device is provided. The computer device may be a terminal or a server. In this embodiment, the computer device is described as a server. The internal structure diagram thereof may be as follows: Fig.12 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store processing data of traffic events. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for processing traffic events is implemented.

[0337] Those skilled in the art will understand that Fig.12 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0338] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0339] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0340] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[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, stored data, displayed data, 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 relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0342] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present 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), magnetoresistive 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0343] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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 above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for handling traffic incidents, characterized in that: The method comprises: Receive target messages and event messages of target objects sent by each edge device; updating the target registration table based on the target message to obtain an updated target registration table; Update the event registration table according to the event message to obtain an updated event registration table; When the event action in the received 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 the unstarted state, detecting the redundancy of the traffic event according to the target information in the updated target registration table; According to the redundancy, the new event message is forwarded to the service platform, or the updated event registration table is updated according to the new event message.

2. The method according to claim 1, characterized in that The target message is obtained by each edge device detecting the target object on the image sequence received from the point acquisition and searching for the detected target object; the target message includes the position trajectory and target number of the target object in the image sequence; wherein the target number is assigned when the target object is detected for the first time; The event message is obtained by performing event identification based on the location track and the target number.

3. The method according to claim 1, characterized in that The target registration table stores the target information in a tree data structure; the method further comprises: When the target object in the target message exists in the target registration table, executing 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, a corresponding memory address is allocated to the target message in the target registration table.

4. The method according to claim 3, characterized in that The updating of the target registration table based on the target message to obtain an updated target registration table includes: Writing each parameter included in the target message into the corresponding field of the memory address in the target registration table in sequence to obtain an updated target registration table; The method further comprises: periodically reclaiming memory released after the target message expires; The memory address corresponding to the released memory is deleted from the target registration table.

5. The method according to claim 3, characterized in that: The allocating a corresponding memory address for the target message in the target registration table includes: When the point number in the target message does not exist in the keyword set of the first-level structure tree, inserting a first node with the point number as a keyword 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, inserting a second node with the target number as a keyword 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 periodically reclaiming the memory released after the target message expires includes: Determine the difference between the update time of each of the basic storage units and the current time; If the difference is greater than a threshold, releasing the memory of the basic storage unit, and deleting the node pointing to the basic storage unit in the second-level structure tree; When the second-level structure tree is an empty tree, the memory of the second-level structure tree is released, and the node pointing to the second-level structure tree is deleted in the first-level structure tree.

7. The method according to claim 1, characterized in that The updating of the event registration table according to the event message to obtain an updated event registration table includes: In the event registration table, detecting the point number, target number and event type matched by the event message to obtain a detection result; When the detection result indicates that at least one of the point number, the target number and the event type is empty, assigning a corresponding memory address to the event message in the event registration table; The various parameters contained in the event message are sequentially written into the corresponding fields of the memory address in the event registration table to obtain an updated event registration table.

8. The method according to claim 7, characterized in that The allocating a corresponding memory address for the event message in the event registration table includes: When the point number in the event message does not exist in the keyword set of the first-level structure tree, insert a first node with the point number as a keyword in 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 keyword set of the second-level structure tree, insert a second node with the target number as a keyword 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, inserting a third node with the event type as a keyword 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 comprises: When the target object corresponding to the third-level structure tree does not exist in the target registration table, releasing the third-level structure tree and the memory of the basic storage unit corresponding to the third-level structure tree, and deleting the node pointing to the third-level structure tree in the second-level structure tree; When the second-level structure tree is an empty tree, the memory of the second-level structure tree is released, and the node pointing to the second-level structure tree is deleted in the first-level structure tree.

10. The method according to claim 7, characterized in that The event registration table stores the event information in a tree data structure; the method further comprises: When the point number, target number and event type in the event message exist in the event registration table, the step of updating the event registration table according to the event message is performed.

11. The method according to claim 1, characterized in that The method further comprises: When the event action in the new event message is in the start state, detecting the point number, target number and event type matching the new event message in the updated event registration table; Determine a first target object based on the point number and the target number; Based on the first target object and the event type, determining the progress status and end time of the traffic event corresponding to the first target object; When the progress status of the traffic event is in the ongoing state, the progress status of the traffic event is updated to the end state, 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 comprises: When the event action in the new event message is in a continuous state, detecting the point number, target number and event type matching the new event message in the updated event registration table; Determine a first target object based on the point number and the target number; Based on the first target object and the event type, determining the progress status, event number, start time and end time of the traffic event corresponding to the first target object; When the progress status of the traffic event is in progress, and the event number and the start time are respectively the same as the event number and the start time in the event message, forwarding the event message to the service platform; When the ongoing status of the traffic event is in progress, and the event number and the start time are respectively different from the event number and the start time in the event message, the ongoing 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 comprises: When the event action in the new event message is in the end state, detecting the point number, target number and event type matching the new event message in the updated event registration table; Determine a first target object based on the point number and the target number; Based on the first target object and the event type, determining the progress status, event number, start time and end time of the traffic event corresponding to the first target object; When the progress status of the traffic event is in progress, and the event number and the start time are respectively the same as the event number and the start time in the event message, forwarding the event message to the service platform, updating the progress status of the traffic event to the end status, and updating the end time to the timestamp of the current event message; When the ongoing status of the traffic event is in progress, and the event number and the start time are respectively different from the event number and the start time in the event message, the ongoing 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 The detecting the redundancy of the traffic event according to the target information in the updated target registration table includes: In the time dimension, if the ongoing state of the traffic event is 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, 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, the objects involved in the same type of traffic events are determined, and the degree of distinction between the target object and the objects in the same type of traffic events is determined; when the degree of distinction is less than a threshold, the traffic event is determined to be a redundant event.

15. The method according to claim 14, characterized in that The determining of the degree of distinction between the target object and the objects in the same type of traffic events includes: Determine, in adjacent points corresponding to the point of the target object, objects involved in the same type of traffic incident; Determine the position distinction, speed distinction, type distinction, size distinction, and color distinction between the target object and objects in the same type of traffic event; Based on the position distinction, the speed distinction, the type distinction, the size distinction, and the color distinction, a distinction between the target object and objects in the same type of traffic event is determined.

16. The method according to claim 1, characterized in that After detecting the redundancy of the traffic event according to the target information in the updated target registration table, the method further includes: When the traffic event is a redundant event, recording the redundant information of the traffic event in a log; After forwarding the new event message to the service platform according to the redundancy, the method further includes: The ongoing status of the traffic event is updated to the ongoing status, 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.

17. A traffic incident processing device, characterized in that: The device comprises: A receiving module, used to receive target messages and event messages of target objects sent by each edge device; An updating module, configured to update a target registration table based on the target message to obtain an updated target registration table; and to update an event registration table according to the event message to obtain an updated event registration table; A detection module, configured to detect redundancy of the traffic event according to target information in the updated target registration table when the event action in the received new event message is in the starting state and the traffic event corresponding to the new event message recorded in the updated event registration table is in the ending state or the not-starting state; A forwarding module, configured to forward the new event message to the service platform according to the redundancy; The updating module is further configured to update the updated event registration table according to the new event message.

18. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 16 are implemented.

19. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 16 are implemented.

20. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 16 are implemented.

Citation Information

Patent Citations

  • Method and device for automatically recording abnormal event, storage medium and electronic equipment

    CN111324516A

  • Traffic event reporting method and device, electronic equipment and storage medium

    CN111862593A

  • Intelligent high-speed traffic flow active management method and device and electronic equipment

    CN115512546A

  • Event stream processing system, event stream processing method, event stream processing program

    US20210326335A1