Road traffic accident prediction method and system
By generating weather dynamic heterogeneous maps and vehicle flow dynamic heterogeneous maps, and using graph neural networks for feature extraction and time evolution, the problem of difficult to effectively predict road traffic accidents in the existing technology is solved, and the prediction accuracy is significantly improved.
Patent Information
- Application Number
- CN202411549881.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-11-01
AI Technical Summary
It is difficult for the prior art to effectively integrate road traffic data into dynamic heterogeneous maps, capture heterogeneous and timing information, and conduct link predictions, resulting in insufficient accuracy of road traffic accident prediction.
By acquiring and preprocessing the traffic network data, a weather dynamic heterogeneous map and a vehicle flow dynamic heterogeneous map are generated, and a graph neural network is used to perform feature extraction and time evolution to predict the probability of traffic accidents.
The prediction accuracy of road traffic accidents has been significantly improved, and the potential laws and influencing factors of traffic accidents have been captured by comprehensively considering various factors.
Smart Images

Figure CN119066433B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of graph neural network technology, and more specifically, to a road traffic accident prediction method and system. Background Art
[0002] The occurrence of a traffic accident is a random event, which is affected by accidental factors such as the state of various factors in the road traffic system and natural conditions. Although accidents are accidental, there are inherent laws behind their appearance. Relevant research shows that these inherent laws exist objectively and reveal the potential connection between the various factors of traffic accidents, which makes traffic accident prediction possible.
[0003] With the development of Dynamic Heterogeneous Graph Neural Network, it has more diverse node types and edge types than homogeneous graphs, contains more semantic information, and more comprehensively describes the intrinsic correlation characteristics between nodes, which is suitable for the field of road traffic. Dynamic heterogeneous graphs can be used for multiple tasks such as link prediction and node classification, and have very good development prospects. How to integrate road traffic data into dynamic heterogeneous graphs and capture the heterogeneity and temporal information in them at the same time, and use them to perform link prediction, is a difficult problem and challenge. Summary of the invention
[0004] The purpose of the present invention is to address the deficiencies of the prior art and to propose a road traffic accident prediction method and system.
[0005] First, a road traffic accident prediction method is provided, including:
[0006] Step 1: Obtain traffic network data and perform preprocessing; the traffic network data includes: location data, time data, vehicle speed data, vehicle flow data, accident data and weather data;
[0007] Step 2: Generate different nodes and edges based on the preprocessed traffic network data;
[0008] Step 3: Divide the traffic network into several grids of equal size;
[0009] Step 4: Generate a weather dynamic heterogeneous graph for the entire traffic network based on the nodes and edges; generate a corresponding traffic dynamic heterogeneous graph for each grid;
[0010] Step 5: Predict the probability of traffic accidents through a graph neural network based on the weather dynamic heterogeneous graph and the traffic flow dynamic heterogeneous graph.
[0011] Preferably, step 1 comprises:
[0012] Step 1.1, obtaining location data, time data, vehicle speed data, vehicle flow data, accident data and weather data; the location data includes the gantry pile number, the accident data includes the pile number where the accident occurred, and the weather data corresponds to the location data;
[0013] Step 1.2, completing the missing data in the transportation network data;
[0014] Step 1.3: Calculate the frequency of occurrence of the traffic volume and speed corresponding to the location data at specific time intervals.
[0015] Preferably, step 2 comprises:
[0016] Step 2.1, according to the location data, vehicle speed data, and vehicle flow data, obtain corresponding location nodes, vehicle speed nodes, and vehicle flow nodes;
[0017] Step 2.2, obtaining a corresponding weather node according to the weather data, wherein the weather data includes air temperature data, dew point temperature data, wind speed data, and future rainfall data;
[0018] Step 2.3, setting accident-related nodes, wherein the accident-related nodes include accident nodes and non-accident nodes;
[0019] Step 2.4, convert the frequency between the location node and the traffic flow node and the frequency between the location node and the vehicle speed node into edges;
[0020] Step 2.5, according to the accident data, converting the relationship between the location node and the accident-related nodes into an edge;
[0021] Step 2.6: Convert the relationship between the location node and the weather node into an edge.
[0022] Preferably, in step 4, the weather dynamic heterogeneous graph includes weather nodes, location nodes, accident-related nodes and edges between nodes; the traffic flow dynamic heterogeneous graph includes traffic flow nodes, location nodes, accident-related nodes and edges between nodes, and the traffic flow nodes are vehicle speed nodes or vehicle flow nodes.
[0023] Preferably, step 5 comprises:
[0024] Step 5.1: Use graph neural network to extract features and perform time evolution on the weather dynamic heterogeneous graph and the traffic dynamic heterogeneous graph;
[0025] Step 5.2, determining a link prediction function based on the features obtained in step 5.1;
[0026] Step 5.3: Predict the accident probability of the location node based on the link prediction function.
[0027] In a second aspect, a road traffic accident prediction system is provided, which is used to execute any of the methods described in the first aspect, including:
[0028] An acquisition module is used to acquire and pre-process traffic network data; the traffic network data includes: location data, time data, vehicle speed data, vehicle flow data, accident data and weather data;
[0029] The first generation module is used to generate different nodes and edges according to the preprocessed traffic network data;
[0030] A partitioning module is used to divide the traffic network into several grids of equal size;
[0031] The second generation module is used to generate a weather dynamic heterogeneous graph for the entire transportation network based on the nodes and edges; and to generate a corresponding vehicle flow dynamic heterogeneous graph for each grid;
[0032] The prediction module is used to predict the probability of traffic accidents through a graph neural network based on the weather dynamic heterogeneous map and the traffic flow dynamic heterogeneous map.
[0033] According to a third aspect, a computer storage medium is provided, wherein a computer program is stored in the computer storage medium; when the computer program is executed on a computer, the computer executes any method described in the first aspect.
[0034] In a fourth aspect, an electronic device is provided, including:
[0035] Memory, used to store computer programs;
[0036] A processor is used to execute the computer program to implement any method as described in the first aspect.
[0037] The beneficial effects of the present invention are as follows: the present invention can more comprehensively capture the potential patterns and influencing factors of traffic accidents by comprehensively considering multiple factors such as location, time, vehicle speed, traffic flow, accidents and weather in the traffic network, and use graph neural networks to extract features from weather dynamic heterogeneous graphs and traffic dynamic heterogeneous graphs, thereby significantly improving the accuracy of road traffic accident prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A flow chart of a road traffic accident prediction method provided by an embodiment of the present invention;
[0039] Figure 2 A data preprocessing flow chart provided for an embodiment of the present invention;
[0040] Figure 3 A schematic diagram of the algorithm flow of each dynamic heterogeneous graph provided by an embodiment of the present invention;
[0041] Figure 4 The overall algorithm flow diagram provided by the embodiment of the present invention is shown;
[0042] Figure 5 A schematic diagram of the road system structure provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0043] The present invention is further described below in conjunction with embodiments. The description of the following embodiments is only used to help understand the present invention. It should be noted that for ordinary persons in the art, without departing from the principle of the present invention, the present invention can also be modified in some ways, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
[0044] Embodiment 1:
[0045] Example 1 of the present application provides a method for predicting road traffic accidents, such as Figure 1 As shown, including:
[0046] Step 1: Obtain traffic network data and perform preprocessing; the traffic network data includes: location data, time data, vehicle speed data, vehicle flow data, accident data and weather data.
[0047] Step 1 includes:
[0048] Step 1.1, obtaining location data, time data, vehicle speed data, vehicle flow data, accident data and weather data; the location data includes the gantry pile number, the accident data includes the pile number where the accident occurred, and the weather data corresponds to the location data.
[0049] Step 1.2: Complete the missing data in the transportation network data.
[0050] Specifically, when processing missing data, the present invention chooses not to process nighttime data. Large-scale missing data rarely occur during the day, but since accurate traffic flow data for the day is required, large-scale missing data are discarded. Figure 2 As shown in the figure, if there is a small range of missing data, this type of data missing is usually due to the detector being affected by external or internal factors in a very short period of time, resulting in missing sampled data. The characteristic of small-scale missing data is that it occurs frequently, but the distribution of its missing time is relatively scattered, and a simple interpolation algorithm is used to process it. Abnormal data is generally not processed to maintain the authenticity of the data. For extreme individual data, it is treated as missing values.
[0051] In the weather data set, since the data is collected every three hours, and each weather data point corresponds to the longitude and latitude information of a specific location. In order to align with the location data, this application needs to separately obtain the longitude and latitude information of the gantry pile number and match it with the weather data. When extracting weather data, this application uses the interpolation processing method, that is, the weather data of the previous sampling point is used for filling. In addition, the sampling time is consistent with the location receipt sampling time, and the time interval is 1 minute.
[0052] In addition, the accident information at the current time needs to be clearly marked.
[0053] Step 1.3: Calculate the frequency of occurrence of the traffic volume and speed corresponding to the location data at specific time intervals.
[0054] The time interval is set to a specific interval such as 5 minutes or 10 minutes to better adapt to the changes in the actual traffic system. In addition, the vehicle speed and traffic flow are divided into segments, and the frequency of the vehicle speed and traffic flow at the corresponding location within the time interval is calculated. For example, the time interval is set to 5 minutes, and the vehicle speed and traffic flow are segmented with a unit length of 1 minute, where the vehicle speed is at a speed interval of 1 km / h and the traffic flow is at an interval of 1 vehicle per minute. The frequency in each speed and traffic flow segment is calculated, for example, the frequency of 50-51 km / h is 0.2, and the frequency of 6-7 vehicles is 0.3.
[0055] Step 2: Generate different nodes and edges based on the preprocessed data.
[0056] Step 2 includes:
[0057] Step 2.1: According to the location data, vehicle speed data, and vehicle flow data, obtain corresponding location nodes, vehicle speed nodes, and vehicle flow nodes.
[0058] Specifically, the location data is noded to input each sampling point (gantry pile number) as a node. This application selects 8 sampling points and generates 8 location nodes.
[0059] The vehicle speed data is noded by setting a node for every 1km / h, from 0km / h to 120km / h, generating a total of 120 vehicle speed nodes (excluding 0km / h).
[0060] The nodeization of traffic flow data is to set a node for every 1 vehicle / min, from 0 vehicles / min to 50 vehicles / min, and generate a total of 50 traffic flow nodes (excluding 0 vehicles / min).
[0061] Step 2.2: Obtain corresponding weather nodes according to the weather data, wherein the weather data includes air temperature data, dew point temperature data, wind speed data, and future rainfall data.
[0062] Specifically, weather nodes include temperature nodes, dew point nodes, wind speed nodes, and future rainfall nodes.
[0063] The temperature data is noded by setting a node every 4℃, from 0℃ to 40℃, generating a total of 10 temperature nodes (excluding 0℃).
[0064] The dew point temperature data is noded by setting a node every 2.8°C, from 0°C to 28°C, generating a total of 10 dew point temperature nodes (excluding 0°C).
[0065] The wind speed data is noded by setting a node every 6 km / h, from 0 km / h to 60 km / h, generating a total of 10 wind speed nodes (excluding 0 km / h).
[0066] Nodalization of future rainfall data: a node will be set every 2 mm / h, from 0 mm / h to 20 mm / h, and a total of 10 future rainfall nodes will be generated (excluding 0 mm / h).
[0067] Step 2.3: Set accident-related nodes, where the accident-related nodes include accident nodes and non-accident nodes.
[0068] Step 2.4: Convert the frequencies between the location node and the traffic flow node and the frequencies between the location node and the vehicle speed node into edges.
[0069] Step 2.5: According to the accident data, the relationship between the location node and the accident-related nodes is converted into an edge.
[0070] Specifically, if an accident occurs at a location node, there is an edge between the location node and the accident node, otherwise there is an edge between the location node and the non-accident node.
[0071] Step 2.6: Convert the relationship between the location node and the weather node into an edge, and generate different edges according to the different weather conditions at the current moment.
[0072] Step 3: Divide the transportation network into several grids of equal size.
[0073] Specifically, according to the size of the traffic network, it is divided into L*T grids, where each grid is d*d in size. Figure 3 As shown in the figure, a city's traffic network is divided into four small areas. Each small area represents a grid, and the circles connected to each area represent its attributes, which are divided into two categories: traffic attributes and weather attributes.
[0074] Step 4: Generate a weather dynamic heterogeneous graph for the entire transportation network based on the nodes and edges; generate a corresponding traffic dynamic heterogeneous graph for each grid.
[0075] Since weather has similar characteristics in the same city, a dynamic heterogeneous weather map is generated with each traffic grid and weather-related attributes as nodes, and the time change is in days. As traffic flow has the characteristic of fast change, a dynamic heterogeneous traffic flow map is generated in each traffic grid with location nodes and traffic flow-related attributes (i.e., speed, traffic volume), and the time change is in minutes.
[0076] Specifically, the dynamic heterogeneous graph can be expressed as , It represents the graph under a certain time slice, and the superscript T represents the time slice. V represents the set of nodes, and E represents the set of edges. It also contains the mappings to them. , , and Represent the type of node and edge respectively, where In each grid, a dynamic heterogeneous graph is generated with each data collection point, traffic flow and accident as a node, and the time is measured in minutes. In the entire transportation network, a dynamic heterogeneous graph is generated with each grid, weather and accident as a node, and the time is measured in days.
[0077] like Figure 4 As shown, the weather dynamic heterogeneous graph includes weather nodes, location nodes, accident-related nodes and edges between nodes; the traffic flow dynamic heterogeneous graph includes traffic flow nodes, location nodes, accident-related nodes and edges between nodes, and the traffic flow nodes are vehicle speed nodes or vehicle flow nodes. Figure 4 The circular nodes in the dynamic heterogeneous graph shown are location nodes, representing data collection locations, and in the embodiment of the present application, represent gantries on highways. The triangular nodes are traffic flow nodes, which can be traffic flow nodes or speed nodes, which represent traffic flow data, and their attributes can be the average speed or average traffic flow within a certain minute. Traffic flow nodes at the same location in different time slices will be updated over time. Diamond nodes are accident-related nodes, which are divided into accident nodes and non-accident nodes, indicating situations where accidents occur and where no accidents occur, respectively. Cloud nodes are weather nodes, indicating the weather conditions during this period of time on that day. Specifically, weather-related nodes can be temperature nodes, dew point nodes, wind speed nodes, future rainfall nodes, etc.
[0078] like Figure 4 As shown in FIG. 1 , for the dynamic heterogeneous graphs of traffic flow and weather, three days (D1, D2, and D3) are selected as training days. Several consecutive time periods with the same time interval are selected every day, and the dynamic heterogeneous graph is generated according to the above steps.
[0079] Step 5: Predict the probability of traffic accidents through a graph neural network based on the weather dynamic heterogeneous graph and the traffic flow dynamic heterogeneous graph.
[0080] Embodiment 2:
[0081] Based on Example 1, Example 2 of the present application provides a more specific road traffic accident prediction method, including:
[0082] Step 1: Obtain traffic network data and perform preprocessing; the traffic network data includes: location data, time data, vehicle speed data, vehicle flow data, accident data and weather data;
[0083] Step 2: Generate different nodes and edges based on the preprocessed data;
[0084] Step 3: Divide the traffic network into several grids of equal size;
[0085] Step 4: Generate a weather dynamic heterogeneous graph for the entire traffic network based on the nodes and edges; generate a corresponding traffic dynamic heterogeneous graph for each grid;
[0086] Step 5: Predict the probability of traffic accidents through a graph neural network based on the weather dynamic heterogeneous graph and the traffic flow dynamic heterogeneous graph.
[0087] In step 5, the following processing is performed on any dynamic heterogeneous graph.
[0088] Step 5.1: For each dynamic heterogeneous graph, divide it into multiple dynamic heterogeneous graphs according to the edge type. Figure 3 As shown in the figure, the weather dynamic heterogeneous graph and the traffic flow dynamic heterogeneous graph are feature extracted and time evolved through graph neural network.
[0089] The steps of feature extraction are as follows: Feature extraction is applied to each subgraph G separated from the time slice t , for node i in time slice t and edge type r, it is represented as:
[0090]
[0091] in Is a node The characteristic vector of is the activation function, It is the neighbor node of node i in time slice t and edge type r. The attention coefficient of a node pair (i, j) at time slice t and edge type r is defined as:
[0092]
[0093] in, Is used for edge type The transformation matrix, It is The parameterized weight vector of the attention function for class edges. Notation || Represents a splicing operation, Is a node The feature vector of .
[0094] The steps of time evolution are as follows: Time evolution uses the GRU algorithm, and the representation of node i in each time slice t is It will be input into GRU to learn the time evolution pattern, the formula is:
[0095]
[0096] middle ,2,...,T; and Respectively represent the update gate and reset gate; W z , W r , and b z , b r , is a trainable parameter; is the activation function; || represents the connection operation; ⊙ represents the Hadamard product operation. Used in the iterative equation of GRU to model the latent features passed from the previous state. The expression is:
[0097]
[0098] The representation of node i at each time slice t Equivalent to The final output can be expressed as , ,..., , .
[0099] Step 5.2: Determine the link prediction function based on the features obtained in step 5.1.
[0100] Specifically, the features obtained in the previous steps are fused for link prediction, and the last time slice is used To predict the link relationship between two nodes at time T. The link prediction function is as follows:
[0101]
[0102] Among them, Wp, bp are trainable parameters. If = , it is predicted that the node pair i, j has a link relationship at time T+1. In actual application, the comparison is and The probability is determined by the degree of similarity. The following formula is used to calculate the similarity:
[0103]
[0104] In practical applications, a threshold value for Y is used for judgment, which is generally set to 0.5. A value greater than or equal to 0.5 indicates that the link exists, and a value less than 0.5 indicates that the link does not exist.
[0105] Step 5.3: Predict the accident probability of the location node based on the link prediction function.
[0106] In step 5.3, for a dataset with N samples and C locations, the final output is , directly use the fully connected layer to reduce the feature dimension, and then make predictions. Specifically, Figure 3 As shown, the fully connected layer will give a prediction value, and the traffic dynamics are heterogeneous. Figure 3 Three prediction values out1, out2, and out3 will be obtained for each day (D1, D2, and D3). Depending on the number of grids, 3n prediction values will be obtained according to the number of grids n, and then merged into one Two-dimensional vector. The weather heterogeneous map will not undergo feature dimensionality reduction, and the predicted value out will be obtained. Finally, according to the above output value, a one-dimensional vector with a data volume of n is obtained after passing through a fully connected layer, where each value represents the probability of an accident at the current location.
[0107] It should be noted that the parts in this embodiment that are the same or similar to those in Embodiment 1 can be referenced to each other and will not be described in detail in this application.
[0108] Embodiment 3:
[0109] Based on Examples 1 and 2, Example 3 of the present application provides a road traffic accident prediction system, such as Figure 5 As shown, including:
[0110] An acquisition module is used to acquire and pre-process traffic network data; the traffic network data includes: location data, time data, vehicle speed data, vehicle flow data, accident data and weather data;
[0111] The first generation module is used to generate different nodes and edges according to the preprocessed traffic network data;
[0112] A partitioning module is used to divide the traffic network into several grids of equal size;
[0113] The second generation module is used to generate a weather dynamic heterogeneous graph for the entire transportation network based on the nodes and edges; and to generate a corresponding vehicle flow dynamic heterogeneous graph for each grid;
[0114] The prediction module is used to predict the probability of traffic accidents through a graph neural network based on the weather dynamic heterogeneous map and the traffic flow dynamic heterogeneous map.
[0115] Specifically, the system provided in this embodiment is a system corresponding to the method provided in Embodiments 1 and 2. Therefore, the parts in this embodiment that are the same or similar to Embodiments 1 and 2 can be referenced to each other and will not be repeated in this application.
Claims
1. A road traffic accident prediction method, characterized in that: include: Step 1: Obtain traffic network data and perform preprocessing; The traffic network data includes: location data, time data, vehicle speed data, vehicle flow data, accident data and weather data; Step 2: Generate different nodes and edges based on the preprocessed traffic network data; Step 3: Divide the traffic network into several grids of equal size; Step 4: Generate a dynamic weather heterogeneous graph for the entire transportation network based on nodes and edges; generate a corresponding dynamic traffic heterogeneous graph for each grid; generate a dynamic weather heterogeneous graph with each transportation grid and weather-related attributes as nodes in the entire transportation network, and the time change is in days; generate a dynamic traffic heterogeneous graph with location nodes and traffic-related attributes in each transportation grid, and the time change is in minutes; the dynamic heterogeneous graph is expressed as G={G 1 ,G 2 ,...,G T }, G t =(V t ,E t ) represents the graph under a certain time slice, and the superscript T represents the time slice; V represents the set of nodes, E represents the set of edges; and contains their mappings, ϕ=V→A, ψ=E→R, A and R represent the type of nodes and the type of edges respectively, where |A|+|R|>2; Step 5: predicting the probability of traffic accidents through a graph neural network according to the weather dynamic heterogeneous graph and the traffic flow dynamic heterogeneous graph; Step 5 includes: Step 5.1: For each dynamic heterogeneous graph, divide it into multiple dynamic heterogeneous graphs according to the edge type, and perform feature extraction and time evolution of the weather dynamic heterogeneous graph and the traffic dynamic heterogeneous graph through the graph neural network; The steps of feature extraction are as follows: Feature extraction is applied to each subgraph G separated from the time slice t , for node i in time slice t and edge type r, it is represented as: where x j is the feature vector of node j, σ is the activation function, is the neighbor node of node i in time slice t and edge type r; The attention coefficient of a node pair (i, j) at time slice t and edge type r is defined as: in, Wr Is used for edge type r The transformation matrix, a r It is r The parameterized weight vector of the attention function for the edge class; the symbol || represents the concatenation operation, x k is the feature vector of node k; The steps of time evolution are as follows: Time evolution uses the GRU algorithm, and the representation of node i in each time slice t is It will be input into GRU to learn the time evolution pattern, the formula is: where t∈1,2,...,T; z t and r t ∈R D Represent the update gate and reset gate respectively; W z , W r , W s ∈RD×2F and b z , b r , b s ∈RD is a trainable parameter; σ is an activation function; || represents a connection operation; ⊙ represents a Hadamard product operation; r is used in the iteration equation of GRU t ·s t−1 to model the potential features passed from the previous state; h t The expression is: The representation of node i at each time slice t Equivalent to h t ; The final output is expressed as ; Step 5.2, determining a link prediction function based on the features obtained in step 5.1; The features obtained in the previous steps are combined for link prediction, and the last time slice is used To predict the link relationship between two nodes at time T; the link prediction function is as follows: Among them, Wp, bp are trainable parameters. If , it is predicted that the node pair i, j has a link relationship at time T+1; the similarity is calculated using the following formula: Take a threshold value for Y for judgment; Step 5.3, predicting the accident probability of the location node according to the link prediction function; In step 5.3, for a data set with N samples and C locations, the final output Y is N∗4C , directly use the fully connected layer to reduce the dimension of features, and then make predictions; the fully connected layer will give a prediction value, and the traffic dynamic heterogeneous map will get three prediction values out1, out2, and out3 in three days; according to the number of grids, 3n prediction values are obtained according to the number of grids n, which are fused into an n*3 two-dimensional vector; the weather heterogeneous map will not undergo feature dimensionality reduction, and will get a prediction value out, and get an n*1 two-dimensional vector; finally, according to the above output value, a fully connected layer is passed through to get a one-dimensional vector with a data volume of n, in which each value represents the probability of an accident at the current location.
2. The road traffic accident prediction method according to claim 1, characterized in that: Step 1 includes: Step 1.1, obtaining location data, time data, vehicle speed data, vehicle flow data, accident data and weather data; the location data includes the gantry pile number, the accident data includes the pile number where the accident occurred, and the weather data corresponds to the location data; Step 1.2, completing the missing data in the transportation network data; Step 1.3: Calculate the frequency of occurrence of the traffic volume and speed corresponding to the location data at specific time intervals.
3. The road traffic accident prediction method according to claim 2, characterized in that: Step 2 includes: Step 2.1, according to the location data, vehicle speed data, and vehicle flow data, obtain corresponding location nodes, vehicle speed nodes, and vehicle flow nodes; Step 2.2, obtaining a corresponding weather node according to the weather data, wherein the weather data includes air temperature data, dew point temperature data, wind speed data, and future rainfall data; Step 2.3, setting accident-related nodes, wherein the accident-related nodes include accident nodes and non-accident nodes; Step 2.4, convert the frequency between the location node and the traffic flow node and the frequency between the location node and the vehicle speed node into edges; Step 2.5, according to the accident data, converting the relationship between the location node and the accident-related nodes into an edge; Step 2.6: Convert the relationship between the location node and the weather node into an edge.
4. The road traffic accident prediction method according to claim 3, characterized in that: In step 4, the weather dynamic heterogeneous graph includes weather nodes, location nodes, accident-related nodes and edges between nodes; the traffic flow dynamic heterogeneous graph includes traffic flow nodes, location nodes, accident-related nodes and edges between nodes, and the traffic flow nodes are vehicle speed nodes or vehicle flow nodes.
5. A road traffic accident prediction system, characterized in that: Used to perform the method according to any one of claims 1 to 4, characterized in that it includes: An acquisition module is used to acquire and pre-process traffic network data; the traffic network data includes: location data, time data, vehicle speed data, vehicle flow data, accident data and weather data; The first generation module is used to generate different nodes and edges according to the preprocessed traffic network data; A partitioning module is used to divide the traffic network into several grids of equal size; The second generation module is used to generate a weather dynamic heterogeneous graph for the entire transportation network based on the nodes and edges; and to generate a corresponding vehicle flow dynamic heterogeneous graph for each grid; The prediction module is used to predict the probability of traffic accidents through a graph neural network based on the weather dynamic heterogeneous map and the traffic flow dynamic heterogeneous map.
6. A computer storage medium, characterized in that: The computer storage medium stores a computer program; when the computer program is executed on a computer, the computer executes any one of the methods described in claims 1 to 4.
7. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Urban traffic accident risk prediction method based on flow and accident collaborative awareness
CN114139984A
Rail passenger flow prediction method based on depth map neural network and environment fusion
CN115392554A