A spatio-temporal clustering method for traffic abnormal events
By constructing a unified topological space and a validity verification method, the problems of poor data fusion and incomplete clustering in highway traffic management were solved, enabling accurate location and clear range identification of abnormal traffic events.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-12
- Publication Date
- 2026-03-27
AI Technical Summary
In existing technologies for highway traffic management, the lack of a unified spatial correlation benchmark between fixed detector data and floating car GPS data leads to incomplete clustering of traffic anomaly clues, which is prone to generating invalid clusters and makes it difficult to determine the continuous road segment range of abnormal events.
By constructing a unified topology space, the GPS data of fixed detectors and floating cars are clustered on the basis of road network topology data. Initial abnormal clusters are generated based on topological proximity relationships, and their validity is verified. Invalid clusters are eliminated, and the range of continuous road segments is finally determined.
It achieves effective fusion of multi-source anomaly data, aggregating upstream and downstream gantries and adjacent road sections related to the same anomaly, providing a clear coverage of anomaly events, and improving the targeting and efficiency of traffic anomaly handling.
Smart Images

Figure CN121256405B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of highway traffic management. More particularly, the present application relates to a spatio-temporal clustering method for traffic abnormal events. BACKGROUND
[0002] In the work of highway traffic management, timely detecting and locating traffic abnormal events is an important basis for ensuring road traffic efficiency and reducing traffic risk. Currently, the industry often relies on two types of information, traffic data generated by fixed detectors and travel data generated by floating cars GPS, to obtain traffic abnormal clues.
[0003] However, the sources and associated carriers of these two types of data are different. Fixed detector data is often bound to specific gantries or toll stations, while floating car data corresponds to specific road segments. These two types of data lack a unified spatial correlation benchmark, making it difficult to effectively integrate the data. When clustering these abnormal clues, existing methods often do not fully consider the topological connection of the highway network itself, and rely only on simple geographic coordinates for aggregation, which can easily lead to the dispersion of upstream and downstream gantry, toll station abnormalities, or adjacent road segment floating car abnormalities in different clustering results, making it difficult to form clusters that reflect the complete abnormal situation. Moreover, the existing clustering process lacks an effective screening step for the results, which can easily produce invalid clusters containing a small number of clues, short duration, or weak abnormality. After clustering, it is difficult to clearly define the range of continuous road segments covered by the abnormal event, which can make it difficult to accurately handle subsequent traffic abnormal events.
[0004] Therefore, it is necessary to design a technical solution that can overcome the above-mentioned defects. SUMMARY
[0005] An object of the present application is to provide a spatio-temporal clustering method for traffic abnormal events, which can provide clear range reference for traffic abnormal event handling and help improve the pertinence and efficiency of handling.
[0006] To achieve these objects and other advantages and in accordance with the purpose of the application, as embodied and broadly described herein, the present application provides a traffic anomaly event oriented spatio-temporal clustering method, comprising: S1: obtaining traffic anomaly clues and highway basic data in a clustering period, the traffic anomaly clues comprising flow anomaly data generated by fixed detector data and floating car anomaly data generated by floating car GPS data, the highway basic data comprising road network topology data, gantry geographic information data and toll station geographic information data; S2: importing the traffic anomaly clues and the highway basic data into the same geographic information system, constructing a unified topology space based on the road network topology data, so that all data elements have a unified topology relationship; S3: in the unified topology space, performing clustering processing on the traffic anomaly clues based on a topology proximity relationship, generating an initial anomaly cluster, wherein for flow anomaly data from the same gantry or toll station, searching and aggregating the directly connected upstream and downstream gantries or toll stations along the road network topology, and for the floating car anomaly data, searching and aggregating adjacent anomaly clues within a preset distance threshold around each anomaly point; S4: performing validity checking on the initial anomaly cluster, eliminating invalid clusters whose number of clues in the cluster is less than a number threshold, or whose anomaly duration is less than a time threshold, or whose anomaly intensity is less than an intensity threshold; S5: marking the anomaly cluster that passes the validity checking as a valid anomaly event, and searching all continuous road segments covered by the valid anomaly event in the unified topology space; and S6: outputting a linear anomaly road segment set composed of the continuous road segments.
[0007] Further, in S1, original fixed detector data and original probe GPS data are acquired; the original fixed detector data is preprocessed, including data cleaning, outlier rejection, and fixed time interval aggregation, to generate time series traffic flow parameters with gantries or toll stations as basic units, including at least timestamp, location information, traffic flow, average speed, and time occupancy; based on the time series traffic flow parameters, a statistical process control-based method is used to calculate the dynamic control upper and lower limits of each traffic flow parameter of each gantry or toll station in the current clustering period; the time series traffic flow parameters are compared with the dynamic control upper and lower limits, and if the time series traffic flow parameters continuously exceed the dynamic control upper and lower limits, it is determined that traffic anomalies occur at the location, and the abnormal start time, end time, abnormal intensity, and abnormal type of the traffic anomaly data are recorded; the original probe GPS data is preprocessed, including coordinate matching, trajectory point denoising and compensation, and map matching, to match discrete GPS point sequences to specific road segments in the highway basic data; based on the map-matched trajectory data, the instantaneous speed and travel time of each probe vehicle on each road segment are calculated; taking road segments as basic units, the travel time distribution of all probe vehicle samples in the current clustering period is counted, and the historical same-period reference distribution is calculated; a kernel density estimation-based hypothesis testing method is used to determine whether there is a significant difference between the current travel time distribution and the historical reference distribution, and if there is a significant difference, it is determined that probe vehicle anomalies occur on the road segment, and the specific location, abnormal occurrence time, abnormal confidence, and abnormal intensity of the probe vehicle anomaly data are recorded.
[0008] Further, in S2, the coordinate positions of each gantry and toll station in the road network topology data are abstracted as nodes in a unified topological space; the highway road segments connecting two adjacent gantries or toll stations are abstracted as edges in the unified topological space, where each edge contains length, direction, and road number attributes; according to the connection relationship defined in the road network topology data, the connection relationship between all nodes and edges is established, thereby constructing a graph structure with nodes and edges as basic elements, denoted as G(N, E), where N is the node set and E is the edge set; the traffic anomaly data is mapped to the corresponding node in the graph G according to the gantry or toll station ID of its source, and is taken as attribute data of the node; the probe vehicle anomaly data is mapped to the corresponding edge in the graph G according to the specific post number or latitude and longitude coordinates after map matching, and its relative position on the edge is recorded as attribute data of the edge; through the above mapping process, all types of traffic anomaly clues obtain a unique, topological network-based location code in the graph structure G, thereby realizing the fusion and expression of all data elements under the unified topological relationship.
[0009] Further, in S3, for any traffic anomaly data, the node mapped by the traffic anomaly data in the unified topology space is determined as a core node; based on the connection relationship of the graph structure G(N, E), the first-hop node directly connected downstream of the core node is searched along the driving direction of the road, and the first-hop node directly connected upstream of the core node is searched in the reverse driving direction; the core node and all the upstream and downstream first-hop nodes of the core node, which also have traffic anomaly data within the clustering period, are aggregated into an initial anomaly cluster, and if the first-hop node searched does not exist, the search in the direction is terminated; for any probe vehicle anomaly data, the edge and relative position mapped by the probe vehicle anomaly data in the unified topology space are determined as a core position; based on the core position, the topology network distance of the core position and the surrounding edges in the graph structure G(N, E) is calculated, and the topology network distance is the physical length of the shortest path required to pass through the graph structure; the probe vehicle anomaly data on all edges within the preset distance threshold of the topology network distance is aggregated into an initial anomaly cluster; for the initial anomaly clusters formed by the traffic anomaly data and the probe vehicle anomaly data respectively, which have overlap in the time window and have intersection in the spatial range, cluster merging across data sources is performed to form a new merged initial anomaly cluster, and the merged initial anomaly cluster contains anomaly clues from the traffic anomaly data and the probe vehicle anomaly data.
[0010] Further, the time overlap degree of the first initial anomaly cluster and the second initial anomaly cluster is calculated, the time overlap degree is the ratio of the intersection time length to the union time length of the two cluster anomaly durations, when the time overlap degree is greater than or equal to a preset time overlap threshold, it is determined that the two clusters satisfy the overlap in the time window; the spatial proximity of the first initial anomaly cluster and the second initial anomaly cluster is calculated based on the spatial distribution of the two clusters in the graph structure G(N, E): the node set and the edge set mapped by the two clusters are extracted respectively, and the minimum topology network distance between all elements in the two sets is calculated, when the minimum topology network distance is less than or equal to a preset spatial proximity threshold, it is determined that the two clusters satisfy the intersection in the spatial range; the cluster merging process is started only when the two initial anomaly clusters from different data sources simultaneously satisfy the time overlap degree condition and the spatial proximity condition; the cluster merging process includes: merging all anomaly clues of the two clusters into a new anomaly cluster set, and recalculating the anomaly start time and the anomaly end time of the merged initial anomaly cluster based on the anomaly start time and the anomaly end time of all the merged anomaly clues.
[0011] Further, in S4, the method for verifying the effectiveness of the initial anomaly cluster includes: counting the total number C of traffic anomaly clues contained in each initial anomaly cluster; if C is less than a preset number threshold C min, determine that the cluster is an invalid cluster; extract the abnormal start time and end time of each abnormal clue in the cluster, take the earliest value of all start times as the cluster abnormal start time T s , take the latest value of all end times as the cluster abnormal end time T e , calculate the cluster abnormal duration ΔT=T e -T s , if ΔT is less than a preset time threshold ΔT min , determine that the cluster is an invalid cluster; obtain the abnormal intensity value I i of each abnormal clue in the cluster, the abnormal intensity value is derived from the attribute data generated in S1; calculate the comprehensive abnormal intensity I of the cluster, the comprehensive abnormal intensity I is the weighted average of all abnormal intensity values I i in the cluster, wherein the weights can be allocated according to the abnormal data type and confidence, if I is less than a preset intensity threshold I min , determine that the cluster is an invalid cluster; only when an initial abnormal cluster passes the above three checks, i.e. C≥C min , and ΔT≥ΔT min , and I≥I min , mark it as passing the effectiveness check.
[0012] Further, in S5, for each effective abnormal event passing the effectiveness check, obtain the node set N event and edge set E event mapped by all traffic abnormal clues in the cluster in the graph structure G(N, E); take the node set N event and edge set E event as the core to construct a spatial buffer, for a node, its buffer is a road segment range extending a preset segment length L segment upstream and downstream along the road with the node as the center, for an edge, its buffer is the edge itself and adjacent edges within a preset topological network distance, fuse all the buffer ranges to obtain one or more continuous spatial regions; in the graph structure G(N, E), retrieve all edges that completely fall into or partially penetrate the fused spatial regions; based on the node connection relationship defined in the road network topology data, perform topological connectivity analysis on all the retrieved edges, and merge edges that are topologically connected to each other into a continuous path; define the continuous road segment covered by the effective abnormal event as a set of one or more continuous paths, and record the start node, end node, ordered sequence of edges contained in the path, and total length for each continuous path.
[0013] Further, in S6, the continuous road section covered by each effective abnormal event obtained in S5 is organized into a linear abnormal road section set; an abnormal event record corresponding to each abnormal event is generated, the abnormal event record at least including: an event identifier, a discovery time, a duration, a comprehensive abnormal intensity, and a spatial coordinate sequence of the continuous road section; the linear abnormal road section set is associated with the abnormal event record and output.
[0014] The present application at least includes the following beneficial effects:
[0015] The present application solves the problems of difficult multi-source abnormal data fusion, incomplete clustering, invalid result interference, and fuzzy road section positioning, establishes a unified spatial correlation benchmark for two types of abnormal clues of fixed detectors and floating cars, realizes effective data fusion, and avoids data dispersion. Based on road network topology proximity relationship clustering, upstream and downstream gantries, toll station abnormalities, and adjacent road section floating car abnormalities related to the same abnormality can be aggregated to form a cluster group reflecting complete abnormalities. Through effectiveness verification, invalid clustering interference with few clues, short duration, or weak intensity can be reduced, the continuous road section covered by the abnormal event can be clearly defined, clear range reference is provided for traffic abnormality disposal, and the pertinence and efficiency of disposal are improved.
[0016] Other advantages, objects, and features of the present application will be partly embodied in the following description, and partly understood by those skilled in the art through research and practice of the present application. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 Flowchart of an embodiment of the present application. DETAILED DESCRIPTION
[0018] The present application will be further described in detail below, so that those skilled in the art can implement it according to the description.
[0019] It should be understood that the terms such as "have", "contain", and "include" used in the embodiments of the present application are not exclusive to the presence or addition of one or more other elements or combinations thereof. All directional indications (such as upper, lower, left, right, front, back, etc.) in the embodiments of the present application are only used to explain the relative position relationship, movement condition, etc. between the components in a certain specific posture, and if the specific posture changes, the directional indications also change accordingly. When an element is referred to as "fixed to" or "disposed on" another element, it can be directly on the other element or can have a middle element. When an element is referred to as "connected to" another element, it can be directly connected to the other element or can be indirectly connected to the other element through a middle element. The descriptions of "first", "second", etc. in the embodiments of the present application are only for the purpose of description, and cannot be understood as indicating or implying the relative importance of the technical features indicated or implying the number of the technical features indicated. Therefore, the features defined as "first", "second" can explicitly or implicitly include at least one of the features.
[0020] It should be noted that the technical solutions among the various embodiments of the present application can be combined with each other, but it must be based on the realization of a person skilled in the art, when the combination of technical solutions appears contradictory or unachievable, it should be considered that the combination of technical solutions does not exist, nor is it within the scope of protection required by the present application.
[0021] As Figure 1As shown, the embodiments of the present application provide a traffic anomaly event-oriented spatio-temporal clustering method, comprising: S1: acquiring traffic anomaly clues and highway basic data in a clustering period, the traffic anomaly clues comprising flow anomaly data generated by fixed detector data and floating car anomaly data generated by floating car GPS data, the highway basic data comprising road network topology data, gantry geographic information data and toll station geographic information data; S2: importing the traffic anomaly clues and the highway basic data into the same geographic information system, constructing a unified topological space based on the road network topology data, so that all data elements have a unified topological relationship; S3: in the unified topological space, performing clustering processing on the traffic anomaly clues based on a topological proximity relationship, generating an initial anomaly cluster, wherein for flow anomaly data from the same gantry or toll station, a gantry or toll station directly connected upstream and downstream along the road network topology is searched and aggregated, and for floating car anomaly data, adjacent anomaly clues within a preset distance threshold around each anomaly point are searched and aggregated; S4: performing validity checking on the initial anomaly cluster, and eliminating invalid clusters whose number of clues in the cluster is less than a number threshold, or whose anomaly duration is less than a time threshold, or whose anomaly intensity is less than an intensity threshold; S5: marking the anomaly cluster that passes the validity checking as a valid anomaly event, and searching all continuous road segments covered by the valid anomaly event in the unified topological space; S6: outputting a linear anomaly road segment set composed of the continuous road segments.
[0022] Exemplarily, when S1 is performed, firstly, a clustering period is determined, the clustering period refers to a specific time interval for analyzing traffic anomalies, and 15 minutes or 30 minutes can be selected; the device for acquiring data can use a data acquisition server, which can be placed in the computer room of the highway management center and connected with external data transmission equipment through a network cable. In the traffic anomaly clues, the flow anomaly data is generated by analyzing the data collected by the fixed detector, and the fixed detector can be a radar and video fusion detector (such as Hikvision iDS-TCV900), which can be installed below the horizontal pole of the highway gantry and faces the driving direction of the road surface; the floating car anomaly data is generated by the GPS equipment of the floating car, and the GPS equipment can select Beidou Starcom BD-950 vehicle terminal, which can be installed inside the instrument panel of the floating car and powered by the vehicle power supply and communicate with the satellite. In the highway basic data, the road network topology data is a data set recording the connection relationship of the highway road and the road segment attribute, the gantry geographic information data is a data set containing the longitude and latitude of the gantry and the road number it belongs to, and the toll station geographic information data is a data set containing the location coordinates of the toll station and the number of lanes. These data can be obtained through the database of the highway management department and stored in the hard disk of the data acquisition server. When S2 is performed, the geographic information system into which the data is imported can select ArcGIS Desktop 10.8, which can be installed on a computer placed in the office area of the highway management center and connected with the data acquisition server through a local area network; the import process is to first convert the traffic anomaly clues and the highway basic data into the shp format supported by the geographic information system using a data conversion tool, and then import the converted data into the system through the “add data” function of the geographic information system. When the unified topological space is constructed based on the road network topology data, the nodes (gantries, toll stations) and edges (road segments between adjacent nodes) are first extracted from the road network topology data, and then the connection rules of the nodes and edges (such as two-way traffic or one-way traffic) are defined through the network data set construction tool of the geographic information system. The coordinate system used by the unified topological space can select CGCS2000 coordinate system or WGS84 coordinate system, so that the position information of all data elements is expressed based on the coordinate system, and the topological relationship is unified, that is, each data element can be clearly associated with the node or edge in the topological space, such as the flow anomaly data associated with the corresponding gantry node and the floating car anomaly data associated with the corresponding road segment edge. When S3 is performed, the tool for clustering processing in the unified topological space can select Python programming environment, which can be installed on a computer; the topological proximity relationship refers to the relationship between nodes that are directly connected (without other nodes in between) or edges that share nodes, and the clustering processing process is to traverse each traffic anomaly clue through Python script, find adjacent anomaly clues according to the topological proximity relationship, and aggregate.For traffic anomaly data from the same gantry or toll station, search the upstream and downstream directly connected gantries or toll stations along the network topology. First, determine the ID of the current gantry or toll station through the node attribute table in the topology space, then query the node connection table to find the first hop node (the nearest gantry or toll station) downstream along the driving direction and the first hop node upstream along the reverse driving direction. If these nodes also have traffic anomaly data (judged by comparing the anomaly data identifier associated with the nodes), aggregate the traffic anomaly data of the current node with these nodes. The distance between adjacent gantries or toll stations in the search range can be 500 meters or 800 meters. For floating car anomaly data, the anomaly point refers to the location point of the floating car GPS positioning with abnormality. The preset distance threshold can be set to 2000 meters. The retrieval process is to calculate the shortest path distance (i.e. the shortest distance along the road) between each anomaly point and other floating car anomaly points in the topology space through the near neighbor analysis tool of the geographic information system. If the distance is less than the preset threshold, aggregate the anomaly clues of these anomaly points to generate an initial anomaly cluster. When performing S4, the validity check can be implemented through a Python program running on a computer. When counting the number of clues in the cluster, count the number of anomaly clues in the cluster by traversing the list of anomaly clues in the cluster. The number threshold can be set to 5 or 8. When calculating the anomaly duration, first extract the anomaly start time and end time of each anomaly clue in the cluster. Take the minimum value of all start times as the cluster anomaly start time and the maximum value of all end times as the cluster anomaly end time. The difference between the two is the anomaly duration. The time threshold can be set to 5 minutes or 10 minutes. When calculating the anomaly intensity, the anomaly intensity is an indicator reflecting the severity of traffic anomalies (such as speed deviation rate, i.e. the difference between actual speed and normal speed as a proportion of normal speed). First, obtain the anomaly intensity value of each anomaly clue, then calculate the comprehensive anomaly intensity of the cluster by weighted average (the weight can be set to 0.6 for fixed detector data, 0.4 for floating car data, or 0.5 for fixed detector data and 0.5 for floating car data according to data type). The intensity threshold can be set to 20% or 30%. If the cluster does not meet any threshold condition, it is determined as invalid clustering and is excluded. When performing S5, the marker for valid anomaly events can be implemented by assigning a unique identifier to the cluster that passes the check in the Python program. When searching for continuous road segments covered by valid anomaly events, first find the nodes and edges associated with the anomaly cluster through the network analysis tool of the geographic information system, then connect adjacent edges into continuous road segments according to the network topology relationship. The minimum length of the road segment can be set to 200 meters or 300 meters during the search process.The device outputting the set of linear abnormal road segments in S6 is a computer, and the output format can be a road layer file in shp format (which can be used for geographic information system display) or an Excel table (containing road segment number, start and end longitude and latitude, length, etc.), and the output process is to arrange the information of continuous road segments into the corresponding format through a Python program, and then save it to the local hard disk or transmit it to the database of the highway management system through the file export function of the computer.
[0023] In the prior art, when processing highway traffic abnormal clues, fixed detector data or floating car data is often analyzed separately, such as clustering only with fixed detector data, determining whether to aggregate by calculating the straight-line distance between gantries, not constructing a unified topological space, and not performing effectiveness verification, often resulting in abnormal dispersion of the same abnormal in different clusters, and also containing 1-2 invalid results lasting for 1-2 minutes, and the output abnormal range can only be located to a single gantry or road segment, and cannot be clearly located to a continuous road segment. The embodiment can aggregate related clues of the same abnormal by constructing a unified topological space to fuse multi-source data, clustering based on road network topological relationship, and then removing invalid clusters through effectiveness verification, and finally clearly locating the continuous road segment covered by the abnormal, solving the problems of poor data fusion, incomplete clustering, invalid results, and fuzzy range in the prior art, making the identification of abnormal events more accurate, providing clearer range information for traffic disposal, and being more in line with the actual needs of highway management.
[0024] In another embodiment, in S1, original fixed detector data and original probe GPS data are acquired; the original fixed detector data is preprocessed, the preprocessing including data cleaning, outlier rejection and fixed time interval aggregation, to generate time series traffic flow parameters with gantry or toll station as basic unit, the time series traffic flow parameters including at least time stamp, location information, traffic flow, average speed and time occupancy; based on the time series traffic flow parameters, a statistical process control based method is used to calculate dynamic control upper and lower limits of each traffic flow parameter of each gantry or toll station in the current clustering period; the time series traffic flow parameters are compared with the dynamic control upper and lower limits, if the time series traffic flow parameters continuously exceed the dynamic control upper and lower limits, it is determined that traffic anomaly occurs at the location, and the abnormal start time, end time, abnormal intensity and abnormal type of the traffic anomaly data are recorded; the original probe GPS data is preprocessed, the preprocessing including coordinate matching, trajectory point denoising and compensation, and map matching, to match discrete GPS point sequence to specific road segments in highway basic data; based on the map matched trajectory data, instantaneous speed and travel time of each probe vehicle on each road segment are calculated; taking road segment as basic unit, travel time distribution of all probe vehicle samples in the current clustering period is counted, and its historical same period reference distribution is calculated; a kernel density estimation based hypothesis testing method is used to determine whether there is significant difference between the current travel time distribution and the historical reference distribution, if there is significant difference, it is determined that probe vehicle anomaly occurs on the road segment, and the specific location, abnormal occurrence time, abnormal confidence and abnormal intensity of the probe vehicle anomaly data are recorded.
[0025] Exemplarily, when obtaining the original fixed detector data and the original floating car GPS data in S1, the original fixed detector data can be obtained through a data collector connected with the fixed detector, the data collector is installed in the control box of the gantry, and the data collector is connected with the fixed detector through a wired network to transmit the collected data to a data collection server; the original floating car GPS data can be transmitted to a cloud server through a vehicle-mounted GPS terminal via a 4G / 5G network, and then the data collection server downloads and obtains the data from the cloud server, the data collection server is placed in a computer room of a highway management center, and the cloud server communicates with the data collection server through the Internet. When preprocessing the original fixed detector data, the preprocessing can be realized through a Python programming environment, the environment is installed on a computer, and the computer is connected with the data collection server through a local area network; the data cleaning is to remove the null values and format error data in the data, which can be realized through the dropna() function of Pandas and data format verification code; the outlier removal is to remove the data beyond the reasonable range (such as negative traffic flow and average speed exceeding 150 km / h), which can adopt the 3σ criterion (calculating the mean and standard deviation of the data, and removing the data beyond the range of mean ± 3σ) or the box plot method (removing the data beyond the range of 1.5 times the interquartile range); the fixed time interval aggregation is to integrate the data according to a unified time interval, the time interval can be selected as 5 minutes or 10 minutes, and when aggregating, the traffic flow in each time interval is summed, the average speed is taken as the arithmetic mean, and the time occupancy is taken as the arithmetic mean, to finally generate the time series traffic flow parameters taking the gantry or toll station as the basic unit, wherein the time stamp is the starting time of each aggregation interval (such as 10:00:00 and 10:05:00), the position information is the latitude and longitude of the gantry or toll station, the traffic flow is the number of vehicles passing through in the time interval, the average speed is the average speed of all vehicles in the time interval, and the time occupancy is the time occupancy ratio of the vehicles in the detection area of the detector in the time interval. When calculating the dynamic control upper and lower limits based on the time series traffic flow parameters by using the statistical process control method, the statistical process control method can select the Shewhart control chart method or the cumulative sum control chart method, for example, the Shewhart control chart method, first calculate the mean μ and the standard deviation σ of the corresponding traffic flow parameters in the same clustering period in the past 7 days or 14 days, set the dynamic control upper limit as μ+3σ or μ+2.5σ, and set the dynamic control lower limit as μ-3σ or μ-2.5σ (if the lower limit of the traffic flow, the time occupancy and other parameters is 0, the lower limit is 0), and the calculation process can be realized through the Scipy library of Python and related codes running on the computer.When comparing the time-series traffic flow parameters with the dynamic control upper and lower limits, the comparison process is automatically executed by a Python program. The judgment criteria for continuous exceeding is that the parameter values in 2 or 3 consecutive aggregated time intervals all exceed the upper and lower limits. If the criteria are met, it is determined that the gantry or toll station has an abnormal flow. When recording the flow abnormality data, the abnormal start time is the timestamp when the upper and lower limits are first exceeded, the abnormal end time is the timestamp when it returns to the upper and lower limits, the abnormal intensity can be calculated as (actual parameter value-upper limit) / upper limit×100% (when exceeding the upper limit) or (lower limit-actual parameter value) / lower limit×100% (when below the lower limit), the abnormal type can be divided into flow too large, flow too small, speed too low, time occupancy too high, etc. The recorded information is stored in the MySQL database of the data collection server. When preprocessing the original floating car GPS data, the preprocessing can be realized by the geographic processing tool of ArcGIS Desktop 10.8, which is installed on the computer. Coordinate matching is to convert the WGS84 coordinate system of GPS data to the CGCS2000 coordinate system or Beijing 54 coordinate system consistent with the highway basic data, which can be realized by the projection transformation tool of ArcGIS. Trajectory point denoising is to eliminate the trajectory points deviating from the road due to GPS signal interference, which can use the sliding window filtering method (window size is set to 5 or 7 trajectory points, calculate the average position in the window, and remove points with a distance greater than 50 meters or 80 meters from the average position). Trajectory point compensation is to supplement the missing trajectory points, which can use the linear interpolation method (calculate the coordinates of the missing point according to the coordinates and time of the trajectory points before and after the missing point). Map matching is to associate the discrete GPS point sequence to a specific road section, which can be realized by the map matching tool of ArcGIS. First, load the road layer of highway basic data, then spatially associate the GPS points with the road layer to determine the road section to which each GPS point belongs. When calculating the instantaneous speed and travel time based on the map-matched trajectory data, the calculation tool is a Python program. The instantaneous speed is obtained by dividing the distance between two adjacent GPS trajectory points by the time difference (e.g. if the distance between two points is 1000 meters and the time difference is 60 seconds, the instantaneous speed is 60 km / h). The travel time is the end time minus the start time of the floating car passing a certain road section. The calculation results are stored in an Excel table on the computer.When the current travel time distribution and the historical reference distribution of the same period are counted by taking the road section as the basic unit, the current clustering period can be the morning peak of 7:00-9:00 or the evening peak of 17:00-19:00 of the day, the current travel time distribution is the frequency distribution of the travel time of all floating cars on the road section in the period (for example, 20 cars in 1-2 minutes, 35 cars in 2-3 minutes), which can be realized by drawing a histogram through the Matplotlib library of Python; the historical reference distribution is the frequency distribution of the travel time of the road section in the same period in the past 4 weeks or 8 weeks, the historical data is obtained from the MySQL database of the data collection server, and the statistical process runs the related program on the computer. When the difference between the distributions is judged by the hypothesis testing method of kernel density estimation, the kernel density estimation method can select Gaussian kernel function or Epanechnikov kernel function, and the hypothesis testing method can select K-S test (Kolmogorov-Smirnov test), the K-S statistic and P value of the current distribution and the historical distribution are calculated, if the P value is less than 0.05 or 0.01, it is determined that there is a significant difference, that is, the floating car anomaly occurs on the road section; when the floating car anomaly data is recorded, the specific position is the start and end stake number of the road section (such as K100+000-K101+000), the anomaly occurrence time is the start time of the current clustering period, the anomaly confidence is (1-P value) × 100% (such as P value 0.03, confidence 97%), and the anomaly intensity is the difference between the current travel time mean and the historical travel time mean, which accounts for the proportion of the historical mean (such as current mean 3 minutes, historical mean 2 minutes, intensity 50%), the recorded information is also stored in the MySQL database of the data collection server.
[0026] In the prior art, when processing fixed detector data, the original data is often directly used or only simple filtering of null values is performed, without fixed time interval aggregation, and the time sequence parameters are irregular; when calculating the control limit, a fixed threshold is often used, which is not dynamically adjusted with time, and is easy to misjudge the anomaly. When processing floating car GPS data, the map matching accuracy is low, and the GPS points are often matched to the wrong road section, and the anomaly is only compared with the historical mean of a single sample travel time, without counting the distribution difference, and is easy to be affected by individual abnormal samples. The embodiment processes the fixed detector data by multiple steps to regularize the data, calculates the dynamic control limit by the statistical process control method, improves the accuracy of traffic anomaly judgment, finely processes the floating car data, and checks the distribution difference by kernel density estimation, thereby improving the accuracy of floating car anomaly identification, solving the problems of rough data preprocessing and inaccurate anomaly judgment in the prior art, and providing more reliable anomaly clues for subsequent clustering.
[0027] In another embodiment, in S2, the coordinate positions of each gantry and toll station in the road network topology data are abstracted as nodes in a unified topology space; the highway road section connecting two adjacent gantries or toll stations is abstracted as an edge in the unified topology space, wherein each edge contains length, direction, and road number attributes; the connection relationship between all nodes and edges is established according to the connection relationship defined in the road network topology data, thereby constructing a graph structure with nodes and edges as basic elements, denoted as G(N, E), wherein N is a node set and E is an edge set; the traffic anomaly data is mapped to the corresponding node in the graph G according to the gantry or toll station ID of the source, and is taken as attribute data of the node; the floating car anomaly data is mapped to the corresponding edge in the graph G according to the specific post number or latitude and longitude coordinates after map matching, and the relative position thereof on the edge is recorded as attribute data of the edge; through the above mapping process, all types of traffic anomaly clues obtain a unique, topology network-based position code in the graph structure G, thereby realizing fusion and expression of all data elements under a unified topology relationship.
[0028] Exemplarily, in the processing of road network topology data in S2, the road network topology data used can be obtained from the highway management department, stored in the shp file format, and the software is installed on the computer placed in the office area of the highway management center, connected with the server storing data through the local area network. When the gantry and toll station coordinate positions are abstracted as nodes, the coordinate positions of the gantry and toll station are the longitude and latitude of the center point, and the abstraction process is to mark the coordinate point of each gantry or toll station as an independent node in the geographic information system, and each node is assigned a unique ID (such as the gantry node ID G001 and the toll station node ID S001), and the attributes of the node can also include the name of the gantry or toll station, the road number, etc. When the road segment between adjacent gantries or toll stations is abstracted as an edge, adjacent means that there is no other gantry or toll station between the two gantries or toll stations, and the road segment is directly connected through the highway, the length of the edge is the actual physical length of the road segment (which can be calculated by the length measurement tool of the geographic information system, such as 1500 meters or 2000 meters), the direction is the driving direction of the road segment (such as "bidirectional" for bidirectional traffic and "Beijing direction" or "Shanghai direction" for one-way traffic), and the road number is the highway number corresponding to the road segment. Each edge is also assigned a unique ID (such as E001, E002). When the connection relationship between nodes and edges is established and the graph structure G(N, E) is constructed, the connection relationship refers to the starting node and the ending node of the edge (such as the starting node of edge E001 is G001 and the ending node is G002), and the construction process can be realized through the NetworkX library of Python. First, create a node set N (including all gantry and toll station nodes) and an edge set E (including all road segment edges), then define the starting node and the ending node of each edge through the add_edges_from() function, form the graph structure G(N, E), and the graph structure can be stored as a GraphML format file. When the traffic anomaly data is mapped to the corresponding node, the traffic anomaly data contains the source gantry or toll station ID (such as G001, S001), the mapping process is realized through a Python program, the program reads the ID field of the traffic anomaly data and matches it with the ID of the node in the graph G, finds the corresponding node, and adds the abnormal start time, end time, and abnormal intensity of the traffic anomaly data as the attribute data of the node (such as adding "abnormal start time: 10:00" and "abnormal intensity: 30%" in the attributes of node G001), and updates the attribute information of the graph structure G after the mapping is completed.When mapping the floating car abnormal data to the corresponding edge, the specific stake number or latitude and longitude coordinates of the floating car abnormal data can be obtained from the preprocessed floating car data. The linear reference system can select the linear reference tool set of ArcGIS, which is integrated in the ArcGIS Desktop software. The mapping process is as follows: first, the linear reference system is used to convert the stake number or latitude and longitude coordinates into the mileage value of the corresponding road segment edge (for example, the length of edge E001 is 1500 meters, and the stake number K100+500 corresponds to the 500-meter mileage on edge E001); the relative position is represented by the proportion of the mileage value in the total length of the edge (for example, 500 meters / 1500 meters≈33.3%); then, the abnormal occurrence time and confidence of the floating car abnormal data are taken as the attribute data of the edge, and the relative position is recorded; after the mapping is completed, the attributes of the graph structure G are also updated. When realizing the fusion and expression of all data elements under the unified topological relationship, based on the updated graph structure G, each traffic anomaly clue (traffic flow anomaly or floating car anomaly) can correspond to a unique node or edge in the graph, and the node and the edge are associated through the topological relationship (for example, edge E001 connects nodes G001 and G002); during subsequent analysis, the spatial correlation of the abnormal clues (for example, the abnormality of node G001 can be associated with the abnormality of edge E001) can be directly obtained through the graph structure; the results of fusion and expression can be displayed on the computer through the drawing function of the NetworkX library, and the distribution and association of the abnormal clues can be intuitively presented.
[0029] In the prior art, when fusing fixed detector data and floating car data, the two types of data are usually stored in different tables, and are only associated through road names, without constructing a unified topological graph structure, resulting in unclear spatial correlation between data, and it is difficult to quickly obtain upstream and downstream association information of abnormal clues during subsequent analysis, and data isolation may occur. The present embodiment maps the two types of abnormal data to nodes and edges respectively and adds attributes by constructing a graph structure containing nodes and edges, so that all data are associated under a unified topological relationship, and spatial correlation can be directly analyzed based on the graph structure in the subsequent analysis, solving the problem of loose data fusion and fuzzy spatial correlation in the prior art, and providing a clear data basis for subsequent clustering based on topological relationship.
[0030] In another embodiment, in S3, for any traffic anomaly data, the node mapped in the unified topology space is determined as the core node; taking the core node as the starting point, based on the connection relationship of the graph structure G(N, E), the first-hop node directly connected downstream thereof is searched along the road driving direction, and the first-hop node directly connected upstream thereof is searched in the reverse driving direction; the nodes in the core node and all upstream and downstream first-hop nodes that also have traffic anomaly data within the clustering period are aggregated into an initial anomaly cluster, and if the first-hop node searched does not exist, the search in the direction is terminated; for any floating car anomaly data, the edge and relative position mapped in the unified topology space are determined as the core position; taking the core position as the center, the topology network distance of the core position and the surrounding edges in the graph structure G(N, E) is calculated, the topology network distance is the physical length of the shortest path required to pass through in the graph structure, and the floating car anomaly data on all edges within the preset distance threshold value is aggregated into an initial anomaly cluster; for the initial anomaly clusters formed by the traffic anomaly data and the floating car anomaly data respectively, which have overlap in the time window and intersection in the spatial range, the cluster merging across the data sources is performed to form a new merged initial anomaly cluster, and the merged initial anomaly cluster contains the anomaly clues from the traffic anomaly data and the floating car anomaly data.
[0031] For example, when processing traffic anomaly data clustering in S3, the graph structure G(N,E) used is the GraphML format file built and updated in S2. The processing tool is the NetworkX library of Python, and the running environment is a computer. The computer is connected to the server storing the graph structure file via a local area network. When determining the core node, any traffic anomaly data has been mapped to a certain node in graph G (such as node G001), and this node is the core node. The determination process is implemented by a Python program. The program traverses all traffic anomaly data, extracts the node IDs mapped to each one, and marks the node corresponding to each ID as a core node. When searching for upstream and downstream first-hop nodes, the road driving direction can be obtained from the attributes of the edges in graph G (e.g., the direction of edge E001 is "Shanghai direction"). Based on the connection relationship of graph structure G (the correspondence between edges and nodes), searching for the downstream first-hop node along the driving direction means finding the starting node corresponding to the edge with the core node as the terminating node (e.g., for core node G002, find edge E001 with G002 as the terminating node, and its starting node G001 is the upstream first-hop node). Searching for the upstream first-hop node against the driving direction means finding the terminating node corresponding to the edge with the core node as the terminating node (e.g., for core node G001, find edge E001 with G001 as the terminating node, and its terminating node G002 is the downstream first-hop node). The search process is implemented through the neighbors() function of the NetworkX library. After obtaining the adjacent nodes of the core node, the upstream and downstream first-hop nodes are determined by combining the direction of the edges. When aggregating the initial anomaly cluster, the clustering period is either 15 minutes or 30 minutes as determined in S1. The presence of abnormal traffic data at a node is determined by checking if its attributes contain traffic anomaly-related fields such as "anomaly start time" and "anomaly intensity" (e.g., if node G002's attributes contain these fields, an anomaly is identified). If both the core node G001 and the downstream first-hop node G002 exhibit anomalies, but the upstream first-hop node G000 does not, the abnormal traffic data of G001 and G002 are aggregated into an initial anomaly cluster, labeled C001. If the downstream first-hop node G003 of G002 also exhibits anomalies, aggregation of G003 continues until no anomalies are found in a particular direction, at which point the search in that direction terminates. When processing floating car anomaly data clustering, determining the core location involves extracting the edge ID (e.g., E001) and relative position mapped to the floating car anomaly data. This edge and relative position constitute the core location. This determination process is implemented by a Python program reading the edge ID and relative position fields of the floating car anomaly data.When calculating the topological network distance, the topological network distance refers to the physical length of the shortest path from the edge where the core location is located to the peripheral edge along the road in the graph G. The calculation tool is the shortest_path_length() function of the NetworkX library, which can calculate the shortest path length based on the length attribute of the edge. For example, the core location is in edge E001, the peripheral edge E002 is connected to E001 through node G002, the shortest path is E001-E002, and the length is 1500 meters of E001 plus 1800 meters of E002, i.e. 3300 meters; the preset distance threshold can be set to 2000 meters or 3000 meters, and it is judged whether the topological network distance of the peripheral edge is less than the threshold. If the distance of edge E002 is 1500 meters (less than 2000 meters), it is included in the aggregation range. When aggregating the initial abnormal cluster, the floating car abnormal data on all edges with a topological network distance within the threshold (such as the floating car abnormal data on edges E001 and E002) are integrated together to form an initial abnormal cluster, and the identification of the cluster can be set as C002. The aggregation process is realized by traversing the edges that meet the conditions through the Python program and extracting the floating car abnormal data in the edge attribute. When merging the clusters across data sources, first determine the initial abnormal clusters formed by the traffic anomaly data and the floating car abnormal data respectively (such as C001 being a traffic anomaly cluster and C002 being a floating car abnormal cluster), the time window overlap refers to the existence of intersection of the abnormal duration of the two clusters, and the judgment method is to extract the abnormal start and end time of C001 (such as 10:00-10:30) and the abnormal start and end time of C002 (such as 10:10-10:25), and check whether there is a time intersection (such as 10:10-10:25); the spatial range intersection refers to the existence of topological association between the nodes or edges covered by the two clusters (such as C001 covering nodes G001 and G002, corresponding to edge E001, and C002 covering edges E001 and E002, having a common edge E001), and the judgment process is realized by comparing the node set and edge set of the two clusters. If the time window overlap and the spatial range intersection are satisfied, C001 and C002 are merged into a new initial abnormal cluster C003, and the merging process integrates the abnormal clues (traffic anomaly data and floating car abnormal data) of the two clusters into the same cluster set through the Python program. The attributes of C003 include the abnormal time range, covered nodes and edges of the two clusters, etc. The merged cluster is stored in the Excel table of the computer, recording the cluster ID, the type and number of abnormal clues contained, etc.
[0032] In the prior art, when clustering traffic anomaly clues, fixed detector data and floating car data are often clustered separately without considering the time and space correlation of the two types of clusters, resulting in two independent clusters corresponding to the same anomaly event, which cannot comprehensively reflect the complete anomaly situation by combining multiple source clues; and when clustering flow anomalies, only the anomalies of the same gantry are clustered without searching upstream and downstream nodes, and when clustering floating car anomalies, only the straight-line distance is considered without considering the road network topology. In this embodiment, the flow anomaly nodes are aggregated by searching the topology relationship, the floating car anomalies are aggregated by the topology network distance, and the time and space correlated cross-data source clusters are also merged, solving the problem of incomplete clustering and isolated multiple source clusters in the prior art, so that the initial anomaly cluster can more comprehensively reflect the anomaly event.
[0033] In another embodiment, the initial anomaly clusters formed by respectively aggregating the flow anomaly data and the floating car anomaly data which exist overlap in the time window and have intersection in the spatial range are merged across data sources, specifically including: calculating the time overlap degree of the first initial anomaly cluster and the second initial anomaly cluster, the time overlap degree being the ratio of the intersection time length to the union time length of the two cluster anomaly durations, when the time overlap degree is greater than or equal to a preset time overlap threshold, it is determined that the two clusters satisfy the condition of existing overlap in the time window; calculating the spatial proximity of the first initial anomaly cluster and the second initial anomaly cluster, the spatial proximity being calculated based on the spatial distribution of the two clusters in the graph structure G(N, E): extracting the node set and edge set mapped by the two clusters respectively, calculating the minimum topology network distance between all elements in the two sets, when the minimum topology network distance is less than or equal to a preset spatial proximity threshold, it is determined that the two clusters satisfy the condition of having intersection in the spatial range; when and only when the two initial anomaly clusters from different data sources simultaneously satisfy the time overlap degree condition and the spatial proximity condition, the cluster merging process is started; the cluster merging process includes: merging all anomaly clues of the two clusters into a new anomaly cluster set, and based on the anomaly start time and the anomaly end time of all anomaly clues after merging, the anomaly start time and the anomaly end time of the merged initial anomaly cluster are recalculated.
[0034] Exemplarily, when calculating the time overlap degree of the first initial abnormal cluster and the second initial abnormal cluster, the abnormal duration of the first initial abnormal cluster (such as C001, the traffic abnormal cluster) and the second initial abnormal cluster (such as C002, the probe vehicle abnormal cluster) can be obtained from the attribute information of the cluster, the abnormal duration of C001 is T1_start (10:00:00) to T1_end (10:30:00), and the abnormal duration of C002 is T2_start (10:10:00) to T2_end (10:25:00). When calculating the intersection length, the start time of the intersection is max(T1_start, T2_start) (10:10:00), the end time of the intersection is min(T1_end, T2_end) (10:25:00), the intersection length ΔT_inter is 15 minutes; when calculating the union length, the start time of the union is min(T1_start, T2_start) (10:00:00), the end time of the union is max(T1_end, T2_end) (10:30:00), the union length ΔT_union is 30 minutes; the time overlap degree γ is ΔT_inter / ΔT_union = 0.5. The preset time overlap threshold can be set to 0.3 or 0.4, and when judging, the size of γ and the threshold is compared by the Python program, if γ≥0.3 (such as 0.5≥0.3), it is determined that the two clusters meet the time window overlap condition, the calculation process and the judgment logic are realized by the Python code, and the running environment is a computer, and the computer stores the time attribute data of the two clusters. When calculating the spatial proximity, first extract the node set and edge set of the two clusters, the node set N1 of C001 is {G001, G002}, and the edge set E1 is {E001}; the node set N2 of C002 is {} (the probe vehicle abnormal cluster has no node mapping), and the edge set E2 is {E001, E002}. When calculating the minimum topological network distance of all elements of the two sets, the elements include nodes and edges, the distance between the node and the edge is the shortest path length from the node to the edge (such as the distance from node G001 to edge E002 is the length of edge E001, which is 1500 meters), and the distance between edges is the shortest path length between two edges (such as the distance between edges E001 and E002 is 0 meters, because they are directly connected through node G002), and the calculation tool is the shortest_path_length() function of the NetworkX library of Python, which calculates the shortest path based on the edge length attribute of the graph structure G(N, E). All element combinations (such as G001 and E001, G001 and E002, G002 and E001, etc.) are traversed, the topological network distance of each combination is calculated, and the minimum value is taken as the minimum topological network distance d_min, such as d_min = 0 meters in this example.The preset spatial proximity threshold value can be set to 500 meters or 800 meters. When judging, the size of d_min and the threshold value is compared by the Python program. If d_min≤500 meters (such as 0 meters≤500 meters), it is determined that the two clusters meet the spatial range intersection condition. The graph structure G used in the calculation process is stored in the GraphML file of the computer, and the program can be directly read and called. The judgment condition for starting the cluster merging process is that the two clusters meet the time overlap condition and the spatial proximity condition at the same time. The judgment logic is realized by the conditional statement of Python. Only when both conditions are True, the subsequent merging operation is performed. If either condition is not met (such as time overlap degree 0.2<0.3 or minimum topological distance 1000 meters>800 meters), the merging is not started. In the cluster merging process, when the abnormal clues of the two clusters are merged into the new cluster set, C001 contains 3 traffic anomaly data, C002 contains 5 floating car anomaly data, and the abnormal clue set of the new cluster C003 after merging contains 3+5=8 clues. The merging process is realized by the list merging function of the Python program, and the clue list of C001 and C002 is merged into the clue list of C003. When recalculating the abnormal start time and end time of the merged cluster, the abnormal start time and end time of all 8 clues after merging are extracted. The abnormal start time Ts=min (all start times)=10:00:00, and the abnormal end time Te=max (all end times)=10:30:00. The calculation process is realized by the min() and max() functions of Python. The recalculated time information is stored as the attribute of C003. All information of the new cluster (clue set, time range, covered nodes and edges) is saved in the MySQL database of the computer, which is convenient for subsequent effectiveness verification and calling.
[0035] In the prior art, when merging clusters across data sources, it is often only simply judged whether the two clusters are on the same road, without calculating the time overlap degree and the minimum topological distance, which is easy to merge clusters that are not related in time or far apart in space. Or only judge whether there is an intersection in time, without considering the overlap degree. The loose merging condition leads to cluster redundancy. The embodiment calculates the time overlap degree and the minimum topological distance, strictly sets the merging condition, and only merges clusters with high spatial and temporal correlation, solving the problem of inaccurate merging and loose condition in the prior art, and ensuring that the merged cluster can accurately correspond to the same abnormal event.
[0036] In another embodiment, in S4, the method for validating the initial abnormal clusters includes: counting the total number C of traffic anomaly clues contained in each initial abnormal cluster; if C is less than a preset number threshold Cmin, the cluster is determined to be an invalid cluster; extracting the start and end times of each abnormal clue within the cluster, taking the earliest value of all start times as the cluster anomaly start time Ts, taking the latest value of all end times as the cluster anomaly end time Te, calculating the cluster anomaly duration ΔT = Te - Ts, and if ΔT is less than a preset time threshold ΔTmin, the cluster is determined to be invalid. The cluster is considered invalid. The anomaly intensity value Ii of each anomaly clue within the cluster is obtained. The anomaly intensity value comes from the attribute data generated in S1. The comprehensive anomaly intensity I of the cluster is calculated. The comprehensive anomaly intensity I is the weighted average of all anomaly intensity values Ii within the cluster. The weights can be allocated according to the anomaly data type and confidence level. If I is less than the preset intensity threshold Imin, the cluster is determined to be invalid. Only when an initial anomaly cluster passes the above three checks simultaneously, i.e., C≥Cmin, ΔT≥ΔTmin, and I≥Imin, is it marked as passing the validity check.
[0037] For example, when validating the initial abnormal cluster in S4, the initial abnormal cluster data (including cluster-specific abnormal clue information) is stored in a MySQL database on a computer. The validation process is implemented using a Python program. The program connects to the database to read the cluster data, and the runtime environment is a computer. The computer communicates with the database server via a local area network. When counting the total number C of abnormal clues within a cluster, the Python program uses an SQL query to extract the list of abnormal clues for the target cluster (e.g., C003) from the database, and then uses the len() function to calculate the length of the list, obtaining the value C. For example, if C003 contains 8 abnormal clues, then C=8. A preset threshold C is used. minThe number of threads can be set to 5 or 6. When judging, compare the size of C and Cmin through the Python conditional statement. If C=8≥5 (or 6), pass the quantity check. If a cluster C=3<5, determine that it is an invalid cluster, and the program will mark "Invalid reason: insufficient number of clues" in the attribute of the cluster. When extracting the cluster anomaly start time Ts and end time Te and calculating ΔT, the program traverses all the "anomaly start time" and "anomaly end time" fields of the abnormal clues in the cluster. For example, the start times of the 8 clues of C003 are 10:00, 10:02, 10:10, etc., and the earliest value Ts=10:00 is obtained by the min() function. The end times are 10:25, 10:30, 10:28, etc., and the latest value Te=10:30 is obtained by the max() function. The cluster anomaly duration ΔT=Te-Ts=30 minutes. The calculation process processes the time format through the Python datetime library and calculates the difference. The preset time threshold ΔTmin can be set to 10 minutes or 15 minutes. When judging, compare ΔT with ΔTmin. If ΔT=30≥10 (or 15), pass the time check. If a cluster ΔT=5 minutes<10, determine that it is an invalid cluster, and mark "Invalid reason: duration is too short". When obtaining the anomaly intensity value Ii and calculating the comprehensive anomaly intensity I, the anomaly intensity value Ii comes from the attributes of the traffic anomaly data and the floating car anomaly data generated in S1 (such as the intensity of traffic anomaly is 30%, 25%, and the intensity of floating car anomaly is 40%, 35%). The program reads the Ii value of each clue from the database. When assigning weights, if the anomaly data type is traffic anomaly (higher confidence, such as 90%), the weight can be set to 0.6. The weight of floating car anomaly (confidence such as 80%) can be set to 0.4. Or adjust according to the confidence, increase the weight by 0.1 for every 10% increase in confidence. For example, a traffic anomaly confidence of 95% has a weight of 0.65, and a floating car anomaly confidence of 85% has a weight of 0.45. When calculating the weighted average value I, the formula is I=(ΣIi×Wi) / ΣWi, where Wi is the weight of the ith clue. For example, C003 contains 3 traffic anomalies (I1=30%, W1=0.6; I2=25%, W2=0.6; I3=28%, W3=0.6) and 5 floating car anomalies (I4=40%, W4=0.4; I5=35%, W5=0.4; I6=38%, W6=0.4; I7=32%, W7=0.4; I8=36%, W8=0.4), then ΣI i ×W i =112.2, ΣW i=3x0.6+5x0.4=1.8+2=3.8, I=112.2 / 3.8≈29.5%. The preset intensity threshold Imin can be set to 20% or 25%, and when judging, I is compared with Imin. If I≈29.5%≥20% (or 25%), the intensity check is passed; if I=18%<20%, it is determined that the cluster is invalid. When marking the clusters that pass the validity check, the program judges whether the cluster meets C≥Cmin, ΔT≥ΔTmin, and I≥Imin at the same time. If all the three conditions C003 are met, “validity: passed” is marked in its attribute, and an effective cluster identifier is assigned. If any condition is not met, “validity: failed” is marked. The cluster information that passes the check is updated to the database, and the cluster that fails the check is filtered out and does not participate in subsequent abnormal event marking.
[0038] In the prior art, when judging the validity of abnormal clusters, only the number of clues is considered, and the duration and abnormal intensity are not considered, resulting in retention of invalid clusters with short duration and weak intensity; or only the arithmetic mean of abnormal intensity is simply taken, without weighting according to data types and confidence, and the comprehensive intensity calculation is inaccurate. The embodiment verifies from the aspects of quantity, time, and intensity, and calculates the comprehensive intensity by weighting, solving the problems of single verification dimension and inaccurate intensity calculation in the prior art, effectively eliminating invalid clusters, and improving the reliability of subsequent abnormal event identification.
[0039] In another embodiment, in S5, for each effective abnormal event that passes the validity check, the node set N event and the edge set E event to which all traffic abnormal clues in the cluster are mapped in the graph structure G(N,E) are obtained event ; taking the node set N event and the edge set E event as the core, a spatial buffer is constructed. For a node, the buffer is a road segment range that is centered on the node and extends a preset segment length Lsegment upstream and downstream along the road. For an edge, the buffer is the edge itself and adjacent edges within a preset topological network distance. All the buffer ranges are fused to obtain one or more continuous spatial regions. In the graph structure G(N,E), all edges that completely fall into or partially penetrate the fused spatial regions are retrieved. Based on the node connection relationship defined in the road network topology data, topological connectivity analysis is performed on all the retrieved edges, and edges that are topologically connected to each other are merged into a continuous path. The continuous road segment covered by the effective abnormal event is defined as a set of one or more continuous paths, and the start node, end node, ordered sequence of edges contained in the path, and total length of each continuous path are recorded.
[0040] Exemplarily, in the processing of the valid abnormal event in S5, the information of the valid abnormal event (such as V001) passing the validity check is stored in the MySQL database of the computer, the graph structure G(N, E) is a GraphML format file stored in the local hard disk of the computer, the processing tool includes the NetworkX library of Python and ArcGIS Desktop 10.8, and the computer is connected with the database server through a local area network. The node set N event and the edge set E eventWhen the Python program reads the attribute information of the valid exception event V001, it extracts the node IDs and edge IDs mapped by the exception clues contained in V001, such as the traffic exception clue of V001 mapping nodes G001 and G002, and the probe vehicle exception clue mapping edges E001 and E002, so Nevent={G001,G002} and Eevent={E001,E002}. The node and edge lists in the cluster attribute are parsed by the program to achieve the acquisition process, and the results are stored as Python collection objects. When constructing the spatial buffer, the preset segment length Lsegment can be set to 200 meters or 300 meters. The node buffer is constructed by using the buffer tool of ArcGIS. Taking node G001 as an example, first determine the driving direction and reverse driving direction of the road where G001 is located, and expand 200 meters along both directions to form a road segment range with G001 as the center and 200 meters upstream and downstream (corresponding to 0-200 meters of edge E001 and 1300-1500 meters of edge E000, assuming E000 connects G000 and G001, with a length of 1500 meters). The preset topological network distance of the edge can be set to 300 meters or 500 meters. The edge buffer is constructed by calculating the topological network distance of the surrounding edges using the NetworkX library, such as edge E001's surrounding edges E002 (distance 0 meters) and E000 (distance 1500 meters, which exceeds 500 meters and is not included). The buffer is E001 and E002 themselves. Buffer fusion is achieved by using the fusion tool of ArcGIS to superimpose the spatial ranges of node buffers and edge buffers, remove overlapping parts, and form a continuous spatial region (such as 1300-1500 meters of E000, all of E001, and all of E002). The fused region is stored as a shp format face layer and saved on the computer. When retrieving all edges falling within the fused region, use the spatial query tool of ArcGIS to perform spatial overlay analysis between the face layer of the fused region and the edge layer of graph G to determine whether each edge completely falls within or partially penetrates the fused region. For example, the 1300-1500 meter part of edge E000 penetrates the region, edges E001 and E002 completely fall within the region, and are all retrieved. The retrieval result is the edge set {E000,E001,E002}, which is stored in a Python list. When performing topological connectivity analysis and merging continuous paths, based on the node connection relationship of the road network topology data (such as the terminal node of E000 being G001, the starting node of E001 being G001, and the terminal node of E002 being G002), the connectivity of the retrieved edges is analyzed by the function, E000-E001-E002 are connected through nodes G001 and G002, and are merged into a continuous path. The starting node of the path is the starting node G000 of E000, the terminal node is the terminal node G003 of E002, and the ordered sequence of the contained edges is [E000,E001,E002].When recording the continuous path information, the total length of the path is the sum of the lengths of each edge (e.g., E000 is 1500 meters long, E001 is 1500 meters long, and E002 is 1800 meters long, and the total length is 1500+1500+1800=4800 meters), and the recorded information also includes the path ID (e.g., P001), the starting node latitude and longitude, and the ending node latitude and longitude. These pieces of information are sorted into a dictionary format by a Python program and stored in an Excel table, which is saved in the local hard disk of the computer, facilitating the subsequent output of the linear abnormal road section set.
[0041] In the prior art, when determining the abnormal event covered road section, only the edge mapped by the abnormal clue is often taken as the covered road section, no buffer zone is constructed, and no connectivity of the edge is analyzed, resulting in that the covered road section is incomplete and cannot reflect the continuous range of abnormal diffusion; or the expansion range is only according to the straight-line distance, not along the road network topology, and does not conform to the actual road direction. In the embodiment, the buffer zones of the nodes and edges are constructed along the topology, the edges are retrieved after fusion, and the connectivity is analyzed, which solves the problems of incomplete covered road section and non-conformity of the range to the road network in the prior art, and can accurately determine the continuous covered road section of the abnormal event.
[0042] In another embodiment, the traffic anomaly event-oriented spatio-temporal clustering method according to claim 1, characterized in that in S6, the continuous road sections covered by each valid abnormal event obtained in S5 are organized into a linear abnormal road section set; an abnormal event record corresponding to each abnormal event is generated, and the abnormal event record at least contains: an event identifier, a discovery time, a duration, a comprehensive abnormal intensity, and a spatial coordinate sequence of the continuous road section; the linear abnormal road section set and the abnormal event record are associated and output.
[0043] Exemplarily, in the organization of the linear abnormal road section set in S6, the continuous road section information (such as paths P001, P002) obtained in S5 is stored in an Excel table of a computer, the processing tool is a Python program and ArcGIS Desktop 10.8, and the computer is connected with a server storing continuous road section data through a local area network. In the organization of the linear abnormal road section set, the Python program reads the continuous road section information in the Excel table, each continuous road section corresponds to a linear element, and the geometric information of the linear element is the spatial coordinate sequence of the road section (the start and end longitude and latitude of each edge can be obtained from the edge attribute of the graph structure G). All linear elements of the continuous road sections are integrated into a linear layer in shp format, which is the linear abnormal road section set, and the layer attribute contains the road section ID (such as P001), the corresponding abnormal event ID (such as V001), the road section length (such as 4800 meters) and other information. The organization process is realized by the feature class creation tool of ArcGIS, and the linear layer is saved in the local hard disk of the computer. In the generation of the abnormal event record, the event identifier is the unique identifier of the valid abnormal event (such as EV001); the discovery time is the time when the abnormal event passes the validity check (such as 2025-08-26 10:35:00), which is extracted from the attribute of the valid abnormal event; the duration is the cluster abnormal duration ΔT (such as 30 minutes), which is derived from the calculation result of S4; the comprehensive abnormal intensity is the comprehensive abnormal intensity I of the cluster (such as 29.5%), which is also derived from S4; and the spatial coordinate sequence of the continuous road section is the longitude and latitude coordinate list corresponding to the path, which is extracted from the geometric attribute of the linear abnormal road section set. The abnormal event record can be arranged into an Excel table or a JSON format file, the table contains columns of “event identifier”, “discovery time”, “duration”, “comprehensive abnormal intensity”, “spatial coordinate sequence”, etc., each record corresponds to a valid abnormal event, and the generation process is realized by the pandas library of Python, and the file is saved in the computer. In the association of the output linear abnormal road section set and the abnormal event record, the association method is to establish a corresponding relationship through the abnormal event ID (such as V001) and the road section ID (such as P001), add the “event identifier” field in the shp layer attribute of the linear abnormal road section set, and fill in the corresponding EV001 identifier; add the “road section ID” field in the table of the abnormal event record, and fill in the corresponding P001 identifier. The output method is to superimpose the linear abnormal road section set on the highway map through the map export function of ArcGIS, generate a visual map picture, and print the picture together with the abnormal event record table through the printer of the computer for traffic management personnel to check and use. In the output process, the integrity and correlation of the data are ensured to avoid the situation of unmatched identifiers.
[0044] In the prior art, when outputting abnormal road sections and event information, the two are often output separately without clear association identification, and the management personnel need to manually match; and the road section information only contains a road section number without a spatial coordinate sequence, which is not convenient for map display and positioning. The embodiment associates and outputs the two, and contains a spatial coordinate sequence, solving the problems of unclear association and inconvenient positioning in the prior art, facilitating the management personnel to quickly correspond abnormal events and road sections, and improving traffic disposal efficiency.
[0045] Although embodiments of the present application have been disclosed as above, they are not limited only to the applications listed in the specification and embodiments, and can be fully applied to various fields suitable for the present application, and additional modifications can be easily implemented by those skilled in the art, and thus the present application is not limited to specific details and the embodiments shown and described herein, without departing from the general concept defined by the claims and the equivalent scope.
Claims
1. A spatio-temporal clustering method for traffic abnormal events, characterized in that, The method comprises the following steps: S1: obtaining traffic anomaly clues in a clustering period and highway basic data, the traffic anomaly clues comprising traffic anomaly data generated by fixed detector data and floating car anomaly data generated by floating car GPS data, the highway basic data comprising road network topology data, gantry geographic information data and toll station geographic information data; S2: importing the traffic anomaly clues and the highway basic data into the same geographic information system, constructing a unified topological space based on the road network topology data, and enabling all data elements to have a unified topological relationship; S3: in the unified topological space, performing clustering processing on the traffic anomaly clues based on a topological proximity relationship, and generating an initial anomaly cluster, wherein for the traffic anomaly data from the same gantry or toll station, a gantry or toll station directly connected upstream and downstream along the road network topology is searched and aggregated, and for the floating car anomaly data, adjacent anomaly clues within a preset distance threshold around each anomaly point are searched and aggregated; S4: performing effectiveness verification on the initial anomaly cluster, and eliminating invalid clusters whose number of clues in the cluster is less than a number threshold, or whose anomaly duration is less than a time threshold, or whose anomaly intensity is less than an intensity threshold; S5: marking the anomaly cluster passing the effectiveness verification as an effective anomaly event, and searching all continuous road segments covered by the effective anomaly event in the unified topological space; S6: outputting a linear anomaly road segment set composed of the continuous road segments.
2. The spatio-temporal clustering method for traffic abnormal events as claimed in claim 1 wherein, In S1, original fixed detector data and original floating car GPS data are obtained; The original fixed detector data is preprocessed, the preprocessing comprising data cleaning, outlier elimination and fixed time interval aggregation, time series traffic flow parameters with a gantry or a toll station as a basic unit are generated, and the time series traffic flow parameters at least comprise a timestamp, position information, traffic flow, average speed and time occupancy; Based on the time series traffic flow parameters, a statistical process control-based method is used to calculate dynamic control upper and lower limits of each traffic flow parameter of each gantry or toll station in the current clustering period; the time series traffic flow parameters are compared with the dynamic control upper and lower limits, if the time series traffic flow parameters continuously exceed the dynamic control upper and lower limits, it is determined that traffic anomaly occurs at the position, and the anomaly start time, end time, anomaly intensity and anomaly type of the traffic anomaly data are recorded; The original floating car GPS data is preprocessed, the preprocessing comprising coordinate matching, trajectory point denoising and compensation, and map matching, discrete GPS point sequences are matched to specific road segments in the highway basic data; based on the map-matched trajectory data, instantaneous speed and travel time of each floating car on each road segment are calculated; Taking a road segment as a basic unit, travel time distribution of all floating car samples in the current clustering period is counted, and a historical same-period reference distribution is calculated; A hypothesis testing method based on kernel density estimation is used to determine whether there is a significant difference between the current travel time distribution and the historical reference distribution, if there is a significant difference, it is determined that the road segment has floating car anomaly, and the specific position, anomaly occurrence time, anomaly confidence and anomaly intensity of the floating car anomaly data are recorded.
3. The traffic anomaly event oriented spatio-temporal clustering method of claim 1, wherein, In S2, the coordinate positions of each gantry and toll station in the road network topology data are abstracted as nodes in a unified topology space; The highway road section connecting two adjacent gantries or toll stations is abstracted as an edge in the unified topology space, where each edge contains length, direction, and road number attributes; According to the connection relationship defined in the road network topology data, the connection relationship between all nodes and edges is established, thereby constructing a graph structure with nodes and edges as basic elements, denoted as G(N, E), where N is a node set and E is an edge set; The traffic anomaly data is mapped to the corresponding node in the graph G according to the ID of the gantry or toll station as the source, and is taken as attribute data of the node; The floating car anomaly data is mapped to the corresponding edge in the graph G according to the specific post number or latitude and longitude coordinates after map matching, and the relative position on the edge is recorded as attribute data of the edge; Through the above mapping process, all types of traffic anomaly clues are given a unique, topology network-based location code in the graph structure G, thereby realizing the fusion and expression of all data elements in a unified topology relationship.
4. The traffic anomaly event oriented spatio-temporal clustering method of claim 1, wherein, In S3, for any traffic anomaly data, the node mapped in the unified topology space is determined as a core node; Based on the connection relationship of the graph structure G(N, E), the first-hop node directly connected downstream of the core node is searched along the driving direction, and the first-hop node directly connected upstream of the core node is searched in the reverse driving direction; the nodes in the core node and all upstream and downstream first-hop nodes that also have traffic anomaly data within the clustering period are aggregated into an initial anomaly cluster, and if the first-hop node searched does not exist, the search in this direction is terminated; For any floating car anomaly data, the edge and relative position mapped in the unified topology space are determined as a core position; based on the core position, the topology network distance of the surrounding edges is calculated in the graph structure G(N, E), and the topology network distance is the physical length of the shortest path required for travel in the graph structure; the floating car anomaly data on all edges within the preset distance threshold are aggregated into an initial anomaly cluster; For the initial anomaly clusters formed by traffic anomaly data and floating car anomaly data respectively, which have overlap in the time window and intersection in the spatial range, the cluster merging across data sources is performed to form a new merged initial anomaly cluster, which contains anomaly clues from traffic anomaly data and floating car anomaly data.
5. The spatio-temporal clustering method for traffic abnormal events as claimed in claim 1, wherein, The time overlap degree of the first initial anomaly cluster and the second initial anomaly cluster is calculated, and the time overlap degree is the ratio of the intersection time length to the union time length of the two cluster anomaly durations; when the time overlap degree is greater than or equal to the preset time overlap threshold, it is determined that the two clusters satisfy the overlap in the time window. calculating spatial proximity of the first initial abnormal cluster and the second initial abnormal cluster, the spatial proximity being calculated based on spatial distribution of the two clusters in the graph structure G(N, E): extracting node set and edge set respectively mapped by the two clusters, calculating minimum topological network distance between all elements in the two sets, and determining that the two clusters satisfy spatial range intersection when the minimum topological network distance is less than or equal to a preset spatial proximity threshold; starting a cluster merging process only when and if two initial abnormal clusters respectively originating from different data sources simultaneously satisfy the time overlap condition and the spatial proximity condition; the cluster merging process comprising: merging all abnormal clues of the two clusters into a new abnormal cluster set, and recalculating abnormal start time and abnormal end time of the merged initial abnormal cluster based on abnormal start time and abnormal end time of all abnormal clues after merging.
6. The traffic anomaly event oriented spatio-temporal clustering method of claim 1, wherein, In S4, the method for verifying the effectiveness of the initial abnormal cluster comprises: counting the total number C of traffic anomaly clues contained in each initial anomaly cluster; if C is less than a preset number threshold C min , determining that the cluster is invalid clustering; extract the abnormal start time and the abnormal end time of each abnormal clue in the cluster, take the earliest value of all the start times as the cluster abnormal start time T s , take the latest value of all the end times as the cluster abnormal end time T e , calculate the cluster abnormal duration ΔT=T e -T s , if ΔT is less than a preset time threshold ΔT min , determine that the cluster is invalid clustering; obtaining an anomaly intensity value I of each abnormal clue in the cluster i , wherein the anomaly intensity value is derived from the attribute data generated in S1; calculating a comprehensive anomaly intensity I of the cluster, wherein the comprehensive anomaly intensity I is a weighted average of all anomaly intensity values I i in the cluster, and wherein the weights can be assigned according to the anomaly data type and the confidence level; and determining that the cluster is invalid if the comprehensive anomaly intensity I is less than a preset intensity threshold I min . Only when a certain initial anomaly cluster passes all three checks above, i.e. C ≥ C min , and ΔT ≥ ΔT min , and I ≥ I min , it is marked as passing the validity check.
7. The traffic anomaly event oriented spatio-temporal clustering method of claim 1, wherein, In S5, for each valid abnormal event passing the validity check, obtain the node set N in which all traffic abnormal clues in the cluster of the abnormal event are mapped in the graph structure G(N, E) event and the edge set E event ; A node set N event and an edge set E event are taken as the core to construct a spatial buffer, for a node, the buffer thereof is a road segment range centered on the node and extending a preset segment length L segment upstream and downstream along the road, and for an edge, the buffer thereof is the edge itself and adjacent edges within a preset topological network distance, and all the buffer ranges are fused to obtain one or more continuous spatial regions; In the graph structure G(N, E), all edges completely falling into or partially penetrating the fused spatial region are retrieved; Based on the node connection relationship defined in the road network topology data, topological connectivity analysis is performed on all retrieved edges, and edges topologically connected to each other are merged into a continuous path; The continuous road segment covered by the effective abnormal event is defined as a set of one or more continuous paths, and the starting node, the ending node, the ordered sequence of edges contained in the path, and the total length of each continuous path are recorded.
8. The traffic anomaly event oriented spatio-temporal clustering method of claim 1, wherein, In S6, the continuous road segment covered by each effective abnormal event obtained in S5 is organized into a linear abnormal road segment set; An abnormal event record corresponding to each abnormal event is generated, and the abnormal event record at least contains: event identifier, discovery time, duration, comprehensive abnormal intensity, and spatial coordinate sequence of the continuous road segment; the linear abnormal road segment set and the abnormal event record are associated and output.
Citation Information
Patent Citations
Traffic jam event extraction and situation fusion method and system
CN117253364A
Multi-level highway event distinguishing and early warning method based on self-adaptive network topology and electronic equipment
CN120472667A