Urban road accident congestion two-stage detection method based on trajectory data
Through a two-stage detection method based on trajectory data, the problem of accident congestion detection in the prior art is difficult to apply to urban road networks and low accuracy and timeliness, and high-precision and efficient accident congestion detection are achieved.
Patent Information
- Application Number
- CN202411936341.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-11
AI Technical Summary
The existing accident congestion detection methods are difficult to apply to urban road networks. The detection accuracy and timeliness are low, and the detection granularity is large, so it is impossible to accurately identify the traffic direction affected by accident congestion.
The two-stage detection method of urban road accident congestion based on trajectory data is adopted. By obtaining the lane-level spatiotemporal trajectory data of the vehicle, the space-time plane is divided into multiple space-time windows, the characteristics of each track segment are calculated, the abnormal trajectory segment is identified through clustering, the abnormal rate associated with the space-time window is calculated, and accident congestion detection is performed using the decision tree.
Accident congestion detection is realized suitable for urban road networks, improving the accuracy and timeliness of detection, with small detection granularity, and accurately identifying the traffic direction affected by accident congestion.
Smart Images

Figure CN119811078A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of accidental congestion detection, and in particular to a two-stage detection method for accidental congestion on urban roads based on trajectory data. Background Art
[0002] With the continuous growth of the demand for motor vehicle travel, traffic congestion has become a common problem on urban roads. According to the frequency of congestion, it can be divided into regular congestion and occasional congestion. Occasional congestion can be caused by a variety of factors such as large-scale events, construction areas, weather, traffic accidents, etc. According to data from the US FHWA, occasional congestion accounts for 52-58% of total traffic congestion in the United States, while accidental congestion accounts for about 25% of total traffic congestion. Compared with other types of congestion, accidental congestion may occur at any time or place, resulting in unpredictable delays for travelers, which is more difficult for travelers to tolerate. In addition, accidental congestion will not only have a negative impact on traffic efficiency, but may also cause secondary accidents and affect traffic safety. Timely and effective detection of accidental congestion is crucial to alleviating congestion, reducing delays and related losses.
[0003] The existing accident congestion detection methods have the following shortcomings:
[0004] (1) Most accident congestion detection algorithms are developed for highway scenarios. Since they do not consider the impact of intersection signal timing, they are difficult to apply to urban road network scenarios.
[0005] (2) The low penetration rate of trajectory data reduces the accuracy and timeliness of detection, which is still the main difficulty faced by trajectory-based accident congestion detection.
[0006] (3) The road section is regarded as the smallest spatial detection unit, so it is impossible to accurately identify the traffic flow affected by accidental congestion. Summary of the invention
[0007] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and to provide a two-stage detection method for accidental congestion on urban roads based on trajectory data, so as to solve or partially solve the problems of being not applicable to urban road networks, low congestion detection accuracy and large detection granularity.
[0008] The purpose of the present invention can be achieved by the following technical solutions:
[0009] In one aspect of the present invention, a two-stage detection method for accidental congestion on urban roads based on trajectory data is provided, comprising the following steps:
[0010] Obtain lane-level spatiotemporal trajectory data of the vehicle;
[0011] Based on the lane-level spatiotemporal trajectory data, dividing the spatiotemporal plane into a plurality of spatiotemporal windows according to a signal period, and obtaining a plurality of trajectory segments based on the spatiotemporal window division;
[0012] Calculate the features of each trajectory segment separately;
[0013] By clustering the features of the trajectory segments, identifying the clustered abnormal points, and obtaining the abnormal trajectory segments;
[0014] Based on the abnormal trajectory fragment, calculating the abnormal rate associated with the spatiotemporal window;
[0015] Based on the abnormal rate associated with the space-time window, a detection result representing whether accidental congestion occurs in the corresponding space-time window is obtained using a trained decision tree.
[0016] As a preferred technical solution, the lane-level spatiotemporal trajectory data includes a timestamp, a vehicle ID, a road section where the vehicle is located, a lane occupied by the vehicle, and a distance measured from the starting point of each road section.
[0017] As a preferred technical solution, the method of obtaining multiple trajectory segments based on time-space window division includes the following steps:
[0018] Based on the lane-level spatiotemporal trajectory data, for any vehicle in any time window, the moment when the vehicle enters the road section is extracted as the starting point of the trajectory segment, and it is determined whether the end point of the vehicle's solid line trajectory is within the current time window. If not, the moment when the current time window ends is taken as the end point of the trajectory segment. If so, the moment when the vehicle leaves the road section is taken as the end point of the trajectory segment.
[0019] As a preferred technical solution, the characteristics of the trajectory segment include average speed and starting time.
[0020] As a preferred technical solution, after calculating the features of each trajectory segment, the following further includes:
[0021] The trajectory segment is expressed in a polar coordinate system using the average speed as the polar diameter and the starting time as the polar angle.
[0022] As a preferred technical solution, the trajectory segment is expressed in a polar coordinate system using the following formula:
[0023]
[0024] Among them, (r, θ) is the polar coordinate after the trajectory segment is expressed in the polar coordinate system, V l is the speed limit of the road, V 0 is a very small speed, C is the duration of the signal cycle, V tra_seg , SM tra_segare the average travel speed and starting time of the trajectory segments respectively.
[0025] As a preferred technical solution, the process of clustering the features of the trajectory segments and identifying the clustered abnormal points to obtain abnormal trajectory segments includes the following steps:
[0026] Map each trajectory segment to a point in the polar coordinate system and mark all points as unvisited;
[0027] Traverse the point set, calculate the distance between the current point and other points, and determine whether the number of points whose distance is less than the preset value is greater than the preset minimum number. If so, mark the current point as a core point;
[0028] Traverse the non-core point set, calculate the distance between the current point and the nearest core point, and determine whether the distance is less than the preset value. If so, mark the current point as a boundary point; if not, mark the current point as a noise point;
[0029] The trajectory segments corresponding to all noise points are regarded as abnormal trajectory segments.
[0030] As a preferred technical solution, the abnormal rate associated with the spatiotemporal window includes and The abnormal rate associated with the spatiotemporal window is calculated using the following formula:
[0031]
[0032] in, is the abnormal rate of vehicle flow direction m in time window t, is the number of abnormal trajectory segments in the space-time window, is the total number of trajectory segments within the space-time window, is the abnormal rate of vehicle flow direction m in time window t-1, is the overall abnormal rate of the adjacent flow directions of vehicle flow direction m in time window t, M m ={L,R,T}\{m}, where T, L, and R represent the straight, left-turn, and right-turn traffic directions on the road section, respectively.
[0033] As a preferred technical solution, the decision tree training process includes the following steps:
[0034] Obtaining a training data set, wherein the training data set includes abnormal rate data associated with a spatiotemporal window and corresponding labels;
[0035] Based on the training data set, the optimal split feature and its split point are calculated at each node of the decision tree, and the training samples are divided into two subsets, corresponding to the left and right child nodes of the tree respectively. The above steps are repeated for each child node until the preset stop condition is met.
[0036] The process of obtaining the optimal splitting feature and its segmentation point includes the following steps:
[0037] Try different split points for each feature and calculate the Gini index of the split subsets;
[0038] Select the features and split points that minimize the Gini coefficient as the best split features and their split points.
[0039] The preset stop condition includes one or more of the following: the number of samples in the data set is less than a preset threshold, the Gini index is less than a preset threshold, and the maximum depth of the tree reaches a preset value.
[0040] Another aspect of the present invention provides an electronic device, comprising: one or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing the aforementioned two-stage detection method for accidental congestion on urban roads based on trajectory data.
[0041] Compared with the prior art, the present invention has at least one of the following beneficial effects:
[0042] (1) Applicable to urban road networks: The present invention takes into account the influence of intersection signal timing, divides the space-time plane into multiple space-time windows, obtains multiple trajectory segments based on the space-time window division, and implements detection based on the trajectory segments, thereby being applicable to urban roads.
[0043] (2) High detection accuracy and timeliness under low penetration trajectory data conditions: The present invention considers the impact of the timed signal control of the intersection on the traffic flow through the definition and polar coordinate transformation of key features (average vehicle speed of the trajectory segment, time of entering the road section), distinguishes the abnormal trajectory affected by accidental congestion from the normal trajectory affected by the traffic light, and fully ensures the accuracy and timeliness of the detection.
[0044] (3) Small detection granularity: The present invention realizes congestion detection at the vehicle flow level based on lane-level spatiotemporal trajectory data of multiple vehicles. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 Flow chart of a two-stage detection method for accidental congestion on urban roads based on trajectory data in an embodiment;
[0046] Figure 2 A schematic diagram of a trajectory segment and its feature definition in an embodiment;
[0047] Figure 3 A schematic diagram showing the visualization of the polar coordinate transformation result of the trajectory segment in the embodiment;
[0048] Figure 4 A schematic diagram of a decision tree after training in an embodiment;
[0049] Figure 5 A schematic diagram of a road network in an embodiment;
[0050] Figure 6 Schematic diagram of an electronic device in an embodiment. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0052] Example 1
[0053] In view of the problems existing in the above-mentioned prior art, this embodiment provides a two-stage detection method for urban road accident congestion based on trajectory data. Figure 5 The trajectory dataset obtained from the road network is used to detect accidental congestion. This method consists of two stages: abnormal trajectory segment identification and accidental congestion detection. In the abnormal trajectory segment identification stage, two key features (i.e., average speed and time to enter the road section) are defined to capture the trajectory segment characteristics within the spatiotemporal window, which is jointly affected by accidental congestion and signal timing of downstream intersections. Based on these two key features, abnormal trajectory segments are identified by clustering. In the accidental congestion detection stage, the abnormal rate of the spatiotemporal window is defined. Based on the abnormal rate, a decision tree is used to identify the spatiotemporal window of accidental congestion.
[0054] See also Figure 1 , the method comprises the following steps:
[0055] Step S1, obtaining lane-level spatiotemporal trajectory data of the vehicle.
[0056] The spatiotemporal trajectory data contains the driving status of the floating vehicle, such as timestamp, vehicle ID, road segment, occupied lane, and the distance measured from the starting point of each segment.
[0057] Preferably, after acquiring the spatiotemporal trajectory data, a data cleaning process is also included.
[0058] Step S2: based on the lane-level spatiotemporal trajectory data, the spatiotemporal plane is divided into a plurality of spatiotemporal windows according to the signal period, and a plurality of trajectory segments are obtained based on the spatiotemporal window division.
[0059] The time-space plane is divided into several time-space windows by the signal cycle duration. A trajectory can go through one time-space window (dotted line) or multiple time-space windows (solid line). A trajectory segment within a time-space window is defined by its time start and end. The time start of the trajectory segment is the moment when the vehicle enters the road section. The time end of the trajectory segment can be divided into two cases. If the trajectory leaves the road section within the time-space window, the end of the segment is the time when the trajectory leaves the road section; if the trajectory passes through this time-space window, the end of the segment is the time when the time-space window ends.
[0060] For example, see Figure 2 The dotted line trajectory in 1 and t 2 Entering and leaving spatiotemporal window 2, the corresponding trajectory segment TS 1 Yes 1 to 2 The solid line trajectory at t 3 Enter the space-time window, at t 4 Crossing the boundary between time window 3 and time window 4, t in time window 4 5 The corresponding trajectory segment TS is collected in time-space window 3. 2 Yes 3 to 4 The corresponding trajectory segment TS is collected in the spatiotemporal window 4 3 Yes 3 to 5 In the part between, the trajectory segments collected by spatiotemporal window 3 and spatiotemporal window 4 have the same starting point.
[0061] The above process defines the trajectory segments in the spatiotemporal window and their key features: the average speed of the trajectory segments and the starting time of the trajectory segments. According to the above process, the starting and ending points of all trajectory segments in each spatiotemporal window can be obtained.
[0062] This embodiment calculates two key features to characterize a trajectory segment within a spatiotemporal window, including the average travel speed V of the characteristic trajectory segment. tra_seg and the time when the vehicle enters the road segment (i.e., the starting time SM of the trajectory segment tra_seg ).For example Figure 2 V of the three trajectory segments in tra_seg and SM tra_seq The specific calculation formula is:
[0063]
[0064] An intersection and the road section where one of the entrances is located are regarded as a detection object. Each detection object contains three traffic directions: straight, left turn, and right turn. Each traffic direction is regarded as a spatial detection unit, and the cycle length of the timing control intersection is used as the time detection unit. The state of a flow direction in a cycle is defined as the state of a spatiotemporal window, which is used as a basic unit to detect whether there is accidental congestion in the spatiotemporal window in real time.
[0065] Step S3, calculating the features of each trajectory segment respectively.
[0066] This step converts the trajectory segment into a point in the polar coordinate system. The two key features of the trajectory segment (average speed and starting time) are converted into the coordinates of the point (r, θ).
[0067] The formula for converting a trajectory segment to a point (r,θ) in polar coordinates is:
[0068]
[0069] Among them, V l is the speed limit of the road (in km / h), V 0 is defined as a very small speed (e.g. 1km / h), and C is the duration of the signal cycle.
[0070] After the historical trajectory fragments of the same spatial unit are transformed into polar coordinates, they can be visualized in the polar coordinate system as follows: Figure 3 As shown, the three scatter plots (a), (b) and (c) represent the straight traffic flow, left-turn traffic flow and right-turn traffic flow respectively.
[0071] Step S4, abnormal trajectory segment identification: clustering the features of the trajectory segments, identifying the clustered abnormal points, and obtaining the abnormal trajectory segments.
[0072] This step uses the historical trajectory segments of the same spatial unit as clustering input, marks the outliers determined by the algorithm as abnormal trajectory segments, marks other points as normal trajectory segments, and outputs the recognition results.
[0073] Specifically, the recognition algorithm process is shown in Table 1.
[0074] Table 1 Clustering-based abnormal trajectory segment recognition algorithm
[0075]
[0076] Step S5, based on the abnormal trajectory segments, calculate the abnormal rate associated with the spatiotemporal window.
[0077] This step defines the feature of spatiotemporal window anomaly rate. Based on the number of abnormal trajectory segments in a spatiotemporal window, the three anomaly rates associated with the spatiotemporal window are calculated. and The specific calculation is as follows:
[0078]
[0079] in, is the anomaly rate of spatial detection unit m in time window t; is the number of abnormal trajectory segments detected in this spatiotemporal window; is the total number of trajectory segments collected in this spatiotemporal window; is the anomaly rate of spatial detection unit m in time window t-1; M is the overall abnormality rate of the adjacent flow directions of the spatial detection unit m in the time window t. m ={L,R,T}\{m}; T, L, R represent three spatial detection units on a certain road section, namely, the three flow directions of straight, left turn and right turn.
[0080] Step S6, accidental congestion detection: Based on the abnormal rate associated with the time-space window, a detection result representing whether an accidental congestion occurs in the corresponding time-space window is obtained using a trained decision tree.
[0081] Three anomaly rates associated with a spatiotemporal window ( and ) as a feature, and whether accidental congestion occurs in the time-space window as a binary classification result. A decision tree is trained based on historical data. For example, the trained decision tree is Figure 4 , and then use the trained decision tree to classify the spatiotemporal windows in real time. See 2 for the algorithm of binary tree training.
[0082] Table 2 Decision tree training algorithm
[0083]
[0084] See Table 3 for the process of using the trained decision tree to identify accidental congestion.
[0085] Table 3 Accidental congestion identification
[0086]
[0087] In summary, this method realizes accident congestion detection at the signal cycle level in time and the vehicle flow level in space for urban road networks. Through the definition and polar coordinate transformation of key features (average vehicle speed of trajectory segments, time of entering the road section), the impact of the timed signal control of the intersection on the traffic flow is considered, and the abnormal trajectories affected by accident congestion are distinguished from the normal trajectories affected by traffic lights. A two-stage detection framework of abnormal trajectory segment recognition and accident congestion detection is designed, and the abnormal rate of the spatiotemporal window is defined to capture the traffic status at the cycle-flow level, so as to improve the adaptability of the algorithm to low-penetration trajectory conditions and diversified road conditions.
[0088] Example 2
[0089] This embodiment provides an electronic device, including: one or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing the two-stage detection method for accidental congestion on urban roads based on trajectory data as described in Example 1.
[0090] like Figure 6 As mentioned above, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 The two-stage detection method for accidental congestion on urban roads based on trajectory data. Of course, in addition to the software implementation, the present invention does not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0091] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0092] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0093] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A two-stage detection method for accidental congestion on urban roads based on trajectory data, characterized in that: The steps include: Obtain lane-level spatiotemporal trajectory data of the vehicle; Based on the lane-level spatiotemporal trajectory data, dividing the spatiotemporal plane into a plurality of spatiotemporal windows according to a signal period, and obtaining a plurality of trajectory segments based on the spatiotemporal window division; Calculate the features of each trajectory segment separately; By clustering the features of the trajectory segments, identifying the clustered abnormal points, and obtaining the abnormal trajectory segments; Based on the abnormal trajectory fragment, calculating the abnormal rate associated with the spatiotemporal window; Based on the abnormal rate associated with the space-time window, a detection result representing whether accidental congestion occurs in the corresponding space-time window is obtained using a trained decision tree.
2. According to claim 1, a two-stage detection method for urban road accident congestion based on trajectory data is characterized in that: The lane-level spatiotemporal trajectory data includes a timestamp, a vehicle ID, the road section where the vehicle is located, the lane occupied by the vehicle, and the distance measured from the starting point of each road section.
3. The two-stage detection method for urban road accident congestion based on trajectory data according to claim 1 is characterized in that: The method of obtaining multiple trajectory segments based on the time-space window division includes the following steps: Based on the lane-level spatiotemporal trajectory data, for any vehicle in any time window, the moment when the vehicle enters the road section is extracted as the starting point of the trajectory segment, and it is determined whether the end point of the vehicle trajectory is within the current time window. If not, the moment when the current time window ends is taken as the end point of the trajectory segment. If so, the moment when the vehicle leaves the road section is taken as the end point of the trajectory segment.
4. The two-stage detection method for urban road accident congestion based on trajectory data according to claim 1 is characterized in that: The track segment features include average speed and starting time.
5. The two-stage detection method for urban road accident congestion based on trajectory data according to claim 4 is characterized in that: After calculating the features of each trajectory segment, it also includes: The transformed average speed is used as the polar diameter, and the transformed starting point time is used as the polar angle to represent the trajectory segment in the polar coordinate system. The representation of the trajectory segment in the polar coordinate system is implemented by the following formula: Among them, (r, θ) is the polar coordinate after the trajectory segment is expressed in the polar coordinate system, V l is the speed limit of the road, V0 is a very small speed, C is the duration of the signal cycle, V tra_seg , SM tra_seg are the average travel speed and starting time of the trajectory segments respectively.
6. The two-stage detection method for urban road accident congestion based on trajectory data according to claim 1 is characterized in that: The process of clustering the features of the trajectory segments and identifying the clustered abnormal points to obtain abnormal trajectory segments comprises the following steps: Map each trajectory segment to a point in the polar coordinate system and mark all points as unvisited; Traverse the point set, calculate the distance between the current point and other points, and determine whether the number of points whose distance is less than the preset value is greater than the preset minimum number. If so, mark the current point as a core point; Traverse the non-core point set, calculate the distance between the current point and the nearest core point, and determine whether the distance is less than the preset value. If so, mark the current point as a boundary point; if not, mark the current point as a noise point; The trajectory segments corresponding to all noise points are regarded as abnormal trajectory segments.
7. The two-stage detection method for urban road accident congestion based on trajectory data according to claim 1 is characterized in that: The abnormal rates associated with the spatiotemporal windows include and The abnormal rate associated with the spatiotemporal window is calculated using the following formula: in, is the abnormal rate of vehicle flow direction m in time window t, is the number of abnormal trajectory segments in the space-time window, is the total number of trajectory segments within the space-time window, is the abnormal rate of vehicle flow direction m in time window t-1, is the overall abnormal rate of the adjacent flow directions of vehicle flow direction m in time window t, M m ={L,R,T}\{m}, where T, L, and R represent the straight, left-turn, and right-turn traffic directions on the road section, respectively.
8. The two-stage detection method for urban road accident congestion based on trajectory data according to claim 1 is characterized in that: The training process of the decision tree includes the following steps: Obtaining a training data set, wherein the training data set includes abnormal rate data associated with a spatiotemporal window and corresponding labels; Based on the training data set, the optimal split feature and its split point are calculated at each node of the decision tree, and the training samples are divided into two subsets, corresponding to the left and right child nodes of the tree respectively. The above steps are repeated for each child node until the preset stop condition is met. When a node no longer splits, it is marked as a leaf node, and the leaf node outputs the classification result. The process of obtaining the optimal splitting feature and its segmentation point includes the following steps: Try different split points for each feature and calculate the Gini index of the split subsets; Select the features and split points that minimize the Gini coefficient as the best split features and their split points. The preset stop condition includes one or more of the following: the number of samples in the data set is less than a preset threshold, the Gini index is less than a preset threshold, and the maximum depth of the tree reaches a preset value.
9. The two-stage detection method for urban road accident congestion based on trajectory data according to claim 1 is characterized in that: An intersection and the road section where one of the entrances is located are taken as a detection object. Each detection object includes straight, left-turn and right-turn vehicle flows. Each vehicle flow direction is taken as a spatial detection unit. The cycle duration of the timed intersection is used as a time detection unit. The state of a flow direction within a cycle is taken as the state of a space-time window, which is used as a basic unit to detect in real time whether there is accidental congestion in the space-time window.
10. An electronic device, characterized in that: include: One or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing the two-stage detection method for accidental congestion on urban roads based on trajectory data as described in any one of claims 1-9.