A traffic accident risk assessment method for urban primary and secondary road networks based on multi-source risks
By building a multi-source risk assessment model in the city's primary and secondary trunk road network, and using graph convolution network and attention mechanism to fusion feature, the problem of difficulty in characterizing and integrating multi-source risks in the existing technology is solved, and the city's primary and secondary trunk road network is achieved Real-time assessment and early warning of traffic accident risks in the dry road network have improved the safety of the traffic system.
Patent Information
- Application Number
- CN202410219248.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-28
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-02-28
AI Technical Summary
The existing technology is difficult to effectively characterize and integrate the multi-source risks in the city's main and secondary trunk road network at the time and space level, and cannot meet the full-time and full-region accurate perception and quantification needs of traffic accident risks. Traditional technology is mainly applicable to a single road type. It cannot meet the risk assessment needs of the city's primary and secondary trunk road network.
A method for risk assessment of traffic accidents in urban primary and secondary trunk road networks based on multi-source risks is proposed. By obtaining historical traffic accidents, traffic flows, road characteristics and weather conditions, the space graph convolution network, space-time graph convolution network and full The connection layer extracts features, combines attention mechanisms to fusion of multi-source risk characteristics, builds a risk assessment model, and selects the best risk grading threshold through the maximum yoden index for real-time evaluation and early warning.
Real-time assessment and early warning of traffic accident risks in urban main and secondary trunk road networks, improve the safety and reliability of the traffic system, and timely issue early warnings and take intervention measures under high-risk circumstances to reduce the possibility of traffic accidents. .
Smart Images

Figure CN118097953B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method for assessing the risk of traffic accidents in urban primary and secondary trunk road networks based on multi-source risks, and belongs to the technical field of intelligent transportation. Background Art
[0002] Traffic on urban main and secondary roads is responsible for the driving and transportation activities of various types of vehicles in the city. It is an important carrier of urban road traffic and has an important impact on various aspects of the city's economy, society and environment. Compared with other road traffic environments, there are often more road traffic risk elements gathered in the urban space-time range. The interaction between these risk elements from different risk sources is common, making the main and secondary roads in the city present the characteristics of high incidence of traffic accidents. Traditional road traffic accident prevention and control technology mainly identifies and focuses on "accident black spots" where accidents frequently occur after traffic accidents occur. This traffic safety management model has the disadvantages of "afterwards" and "passivity" and cannot meet the needs of pre-prevention of road traffic accident risks. Therefore, a technology is needed to conduct real-time assessment of traffic accident risks on urban main and secondary roads, to timely warn and intervene in high-risk situations, and to reduce the possibility of traffic accidents from the source.
[0003] In recent years, with the rapid development of information collection, transmission, and processing technologies, the number of data acquisition sources has gradually increased, and data fusion technologies have gradually become richer. Real-time perception and quantitative assessment of traffic accident risks based on multi-source risk data have gradually become an important development direction for road traffic safety research and technology applications. However, after obtaining high-dimensional spatiotemporal data on multi-source risks in the road traffic system, how to accurately quantify accident risks based on multi-source risks remains a major problem. In addition, traditional technologies mainly focus on the risk assessment of traffic accidents on a single road type (such as highways and expressways). These technical achievements cannot meet the needs of accurate perception and comprehensive quantification of risks at the full-time and full-domain level of urban primary and secondary trunk road networks.
[0004] The present invention is proposed to address the common problems in existing real-time risk assessment models, namely, difficulty in characterizing and integrating multi-source risks at the spatiotemporal level. The aim is to design a module that can realize real-time assessment of traffic accident risks at the level of urban primary and secondary trunk road networks. Summary of the invention
[0005] Purpose of the invention: The present invention mainly solves the problem of traffic accident risk assessment in urban primary and secondary road networks, and proposes a traffic accident risk assessment method for urban primary and secondary road networks based on multi-source risks.
[0006] Technical solution: To achieve the above purpose, the present invention proposes a traffic accident risk assessment method for urban primary and secondary trunk road networks based on multi-source risks, the method comprising the following steps:
[0007] S1. Obtain historical traffic accident samples, non-accident samples without accidents, and historical traffic flow, road characteristics and weather condition datasets on the main and secondary trunk roads of the city to be evaluated;
[0008] S2. Based on the time and location information, feature extraction is performed on the traffic flow risk sources, road characteristic risk sources and weather condition risk sources of the road section where the sample described in S1 is located and the adjacent road sections, and feature fusion is performed on multi-source risks to construct a risk assessment model;
[0009] S3. Input the data set into the risk assessment model for model training, and select the optimal risk classification threshold according to the maximum Youden index;
[0010] S4: Obtain data on traffic flow, road characteristics and weather conditions on the roads to be evaluated in real time, and use the risk assessment model determined by S2 and S3 to calculate the risk level on the main and secondary roads to be evaluated in real time.
[0011] Furthermore, the specific method of step S1 is as follows:
[0012] S101, the historical traffic accident sample set includes the time and location information of the accident, the time is accurate to the minute, and the location is the ID information of the road section where the accident occurred. The non-accident sample set is a sample set randomly extracted at a time other than when the accident occurred, and includes the time and location information;
[0013] S102, the traffic flow data set is obtained by the GPS device of the vehicle, including speed standard deviation, congestion level parameters, and parameter collection time, accurate to the minute level, and location information, i.e., the road section ID; the road feature data set includes the number of lanes, lane width, section speed limit parameters and section ID information; the weather condition data set is obtained by the meteorological station at the preset location, including visibility, wind speed, rainfall parameters, and parameter collection time, accurate to the hour;
[0014] S103, marking the labels of the accident samples in the accident sample set described in S101 as 1, and marking the labels of the non-accident samples in the non-accident sample set as 0.
[0015] Furthermore, the specific method of step S2 is as follows:
[0016] S201, converting the original primary and secondary trunk road connection relationship into a graph structure that can be input into the model. The original primary and secondary trunk road network connection relationship is expressed as:
[0017] G0={V0,E0}
[0018] Among them, E0 represents the set of road sections on the primary and secondary trunk road networks, and V0 represents the set of connection points between road sections;
[0019] The road segment set and the connection point set in the primary and secondary trunk road network connection relationship are converted into each other to obtain an inputtable graph structure:
[0020] G=(V,E,A)
[0021] In the formula, V is the node in the graph structure, which is converted from the road segment set E0; E is the edge in the graph structure, which represents the connection edge between nodes, which is converted from the set of road segment connection points; A is the adjacency matrix, which represents the connectivity between any two nodes in the graph structure. If A ij is equal to 1, indicating that the i-th node is directly connected to the j-th node; if there is no direct connection, A ij is equal to 0;
[0022] S202, the road feature risk source feature extraction refers to the process of aggregating and extracting the road feature information of the road section where the sample described in S1 is located and the adjacent road sections directly connected to it based on the graph structure G described in S201 by using a spatial graph convolutional network operation, and the method is as follows:
[0023] For the i-th road section where a certain sample described in S1 is located, after aggregating the road feature information of itself and the adjacent road sections on the l-th information aggregation layer, the output feature is expressed as:
[0024]
[0025] In the formula, j represents the i-th road segment itself and its adjacent road segments. The i-th road segment itself and its adjacent road segment j together constitute the road segment set N(i), c ij equal N(i) and N(j) represent the node degrees of the i-th and j-th road segments, respectively; represents the input features from the road segment j at the information aggregation layer at level l; W l and b l are the training weights and biases on the lth layer respectively; BN refers to the use of batch normalization method to normalize features, and the nonlinear activation function uses the RELU function;
[0026] The road feature data described in S1 Input spatial graph convolutional network to extract road feature risk sources Where N is the number of road sections, F road is the dimension of the output features of the spatial graph convolutional network;
[0027] S203, Traffic flow risk source feature extraction refers to the process of aggregating and extracting traffic flow information in time and space dimensions respectively using a spatiotemporal graph convolutional network, and the method is as follows:
[0028] In the spatial dimension, the spatial graph convolution network described in S202 is used to aggregate the traffic flow information of itself and the adjacent sections in each time segment. The time segments are 5 to 10 minutes, 10 to 15 minutes, and 15 to 20 minutes before the sample occurrence time described in S101. In the time segment t, for the i-th section where a certain sample described in S1 is located, after aggregating the traffic flow information of itself and the adjacent sections, the output feature is expressed as:
[0029]
[0030] In the formula, j represents the i-th road segment itself and its adjacent road segments, represents the input features from the j-th road segment at time segment t;
[0031] In the time dimension, the time convolution network is used to further aggregate the traffic flow information. For the i-th road section, the output feature of channel m on the l-th time convolution layer is expressed as:
[0032]
[0033] Where * represents the cross-correlation operator, F is the number of input channels, is the input feature of channel k, and is the training weight and bias on channel k of layer l, and σ is the activation function;
[0034] The spatial graph convolution network layer and the temporal convolution network layer form a spatiotemporal convolution module, and the spatiotemporal convolution module forms a spatiotemporal graph convolution component. The traffic flow data described in S1 As the feature input to the spatiotemporal graph convolution component, the risk source features of traffic operation status are extracted through the above operations. Among them, F traffic is the dimension of the output features of the spatiotemporal graph convolution module;
[0035] S204, weather condition risk source feature extraction refers to using a fully connected layer module to reduce the dimension and noise of the input weather condition information, and convert the weather condition data described in S1 Extract weather risk source features as feature input to the fully connected layer module Among them, F weather is the output feature dimension of the fully connected layer module;
[0036] S205, the multi-source risk feature fusion refers to using a feature fusion module based on an attention mechanism to fusion the multi-source risk r i road , r i traffic and r iweather Perform feature fusion;
[0037] The risk source characteristics r i road , r i traffic and r i weather Splice into vector r i Then multiply by three different weight matrices w q , w k and w v Get the query vector q i , key vector k i Sum value vector v i ; The key vector k i and the query vector q i Multiply to get the correlation strength matrix a i , for the correlation strength matrix a i The attention weight matrix a is obtained by normalization i '; Set the value vector v i With the attention weight matrix a i 'After multiplication, we get the feature fusion vector o i ;
[0038] Use Sigmoid function to fusion feature vector o i Processing to obtain the traffic accident risk assessment value R i :
[0039] R i =Sigmoid(w T o i +b)
[0040] Where: w T and b are the trainable parameters of the output layer, and T is the transposed symbol.
[0041] Furthermore, the specific method of step S3 is as follows:
[0042] S301, input the data set in S1 into the model in S2 for training, and output the traffic accident risk assessment value set R of the data set = {R n};
[0043] S302, construct a classification threshold sequence C with 0 as the initial value, 1 as the final value, and 0.001 as the step size. j}, for any classification threshold c j , compare all the risk assessment values in the risk assessment value set R with it in turn:
[0044]
[0045] in, Is the evaluation of whether an accident will occur after comparison, y n To determine whether an accident actually occurred. When TP n ;when y n =0, recorded as false positive FP n ;when y n =1, recorded as false negative FN n ;when When n , all evaluation values in set R are consistent with the classification threshold c j After comparison, the true positive TP n The number of TP and false positive FP n The number of FP and false negative FN n The number of true negatives FN and TN n The number TN and calculate the threshold c j The recall rate TPR under j and false alarm rate FPR j :
[0046]
[0047]
[0048] The classification threshold sequence C = {c j All c in} j After traversal, the recall rate set TPR is obtained = {TPR j} and the false alarm rate set FPR = {FPR j};
[0049] S303, the Youden index is each classification threshold c j Corresponding TPR j With FPR j The difference between the values of j The optimal classification threshold for judging whether an accident has occurred or not
[0050] Furthermore, the specific method of step S4 is as follows:
[0051] S401, for the main and secondary roads to be evaluated, collect the real-time traffic flow, road characteristics and real-time weather condition information data described in S1;
[0052] S402: Input the data to be tested into the risk assessment model described in S2 to conduct real-time assessment of the risk index of the current road section. If the risk value is lower than the optimal classification threshold described in S303, The current situation is considered to be low risk and no intervention or warning information is required; if the risk value is higher than the optimal classification threshold described in S303 The current situation is considered a high-risk scenario, and early warning information is issued and intervention measures are taken to reduce the risk.
[0053] Beneficial effects: Compared with the prior art, the technical solution of the present invention has the following beneficial technical effects:
[0054] The utility of the present invention solves the difficulty of real-time assessment of traffic accident risks on urban primary and secondary trunk road networks, realizes the function of real-time assessment and early warning of traffic accident risks on urban primary and secondary trunk roads, and improves the safety and reliability of traffic system operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 A technical roadmap for the implementation of the invention;
[0056] Figure 2 Real-time risk assessment model structure diagram;
[0057] Figure 3 Real-time risk assessment flow chart. DETAILED DESCRIPTION
[0058] The technical solution of the present invention will be further explained below in conjunction with the accompanying drawings in the actual embodiments of the present invention. In addition, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, other embodiments obtained by ordinary technicians in this field without making creative work are all within the scope of protection of the present invention.
[0059] Example:
[0060] like Figure 1 As shown, the present invention mainly solves the problem of traffic accident risk assessment of urban primary and secondary trunk road networks, and proposes a traffic accident risk assessment method for urban primary and secondary trunk road networks based on multi-source risks, which provides a basis for real-time assessment of road risks, issuance of control measures and travel route planning. The specific implementation steps are as follows:
[0061] S1. Obtain historical traffic accident samples, non-accident samples without accidents, and historical traffic flow, road characteristics and weather condition datasets on the main and secondary trunk roads of the city to be evaluated;
[0062] S2. Based on the time and location information, feature extraction is performed on the traffic flow risk sources, road characteristic risk sources and weather condition risk sources of the road section where the sample described in S1 is located and the adjacent road sections, and feature fusion is performed on multi-source risks to construct a risk assessment model;
[0063] S3. Input the data set into the risk assessment model for model training, and select the optimal risk classification threshold according to the maximum Youden index;
[0064] S4: Obtain data on traffic flow, road characteristics and weather conditions on the roads to be evaluated in real time, and use the risk assessment model determined by S2 and S3 to calculate the risk level on the main and secondary roads to be evaluated in real time.
[0065] Furthermore, the specific method of step S1 is as follows:
[0066] S101, the historical traffic accident sample set includes the time and location information of the accident, the time is accurate to the minute, and the location is the ID information of the road section where the accident occurred. The non-accident sample set is a sample set randomly extracted at a time other than when the accident occurred, and includes the time and location information;
[0067] S102, the traffic flow data set is obtained by the GPS device of the vehicle, including speed standard deviation, congestion level parameters, and parameter collection time, accurate to the minute level, and location information, i.e., the road section ID; the road feature data set includes the number of lanes, lane width, section speed limit parameters and section ID information; the weather condition data set is obtained by the meteorological station at the preset location, including visibility, wind speed, rainfall parameters, and parameter collection time, accurate to the hour;
[0068] S103, marking the labels of the accident samples in the accident sample set described in S101 as 1, and marking the labels of the non-accident samples in the non-accident sample set as 0.
[0069] Furthermore, the specific method of step S2 is as follows:
[0070] S201, converting the original primary and secondary trunk road connection relationship into a graph structure that can be input into the model. The original primary and secondary trunk road network connection relationship is expressed as:
[0071] G0={V0,E0}
[0072] Among them, E0 represents the set of road sections on the primary and secondary trunk road networks, and V0 represents the set of connection points between road sections;
[0073] The road segment set and the connection point set in the primary and secondary trunk road network connection relationship are converted into each other to obtain an inputtable graph structure:
[0074] G=(V,E,A)
[0075] In the formula, V is the node in the graph structure, which is converted from the road segment set E0; E is the edge in the graph structure, which represents the connection edge between nodes, which is converted from the set of road segment connection points; A is the adjacency matrix, which represents the connectivity between any two nodes in the graph structure. If A ijis equal to 1, indicating that the i-th node is directly connected to the j-th node; if there is no direct connection, A ij is equal to 0;
[0076] S202, the road feature risk source feature extraction refers to the process of aggregating and extracting the road feature information of the road section where the sample described in S1 is located and the adjacent road sections directly connected to it based on the graph structure G described in S201 by using a spatial graph convolutional network operation, and the method is as follows:
[0077] For the i-th road section where a certain sample described in S1 is located, after aggregating the road feature information of itself and the adjacent road sections on the l-th information aggregation layer, the output feature is expressed as:
[0078]
[0079] In the formula, j represents the i-th road segment itself and its adjacent road segments. The i-th road segment itself and its adjacent road segment j together constitute the road segment set N(i), c ij equal N(i) and N(j) represent the node degrees of the i-th and j-th road segments, respectively; represents the input features from the road segment j at the information aggregation layer at level l; W l and b l are the training weights and biases on the lth layer respectively; BN refers to the use of batch normalization method to normalize features, and the nonlinear activation function uses the RELU function;
[0080] The road feature data described in S1 Input spatial graph convolutional network to extract road feature risk source r i road ∈R N×Froad , where N is the number of road segments, F road is the dimension of the output features of the spatial graph convolutional network;
[0081] S203, Traffic flow risk source feature extraction refers to the process of aggregating and extracting traffic flow information in time and space dimensions respectively using a spatiotemporal graph convolutional network, and the method is as follows:
[0082] In the spatial dimension, the spatial graph convolution network described in S202 is used to aggregate the traffic flow information of itself and the adjacent sections in each time segment. The time segments are 5 to 10 minutes, 10 to 15 minutes, and 15 to 20 minutes before the sample occurrence time described in S101. In the time segment t, for the i-th section where a certain sample described in S1 is located, after aggregating the traffic flow information of itself and the adjacent sections, the output feature is expressed as:
[0083]
[0084] In the formula, j represents the i-th road segment itself and its adjacent road segments, represents the input features from the j-th road segment at time segment t;
[0085] In the time dimension, the time convolution network is used to further aggregate the traffic flow information. For the i-th road section, the output feature of channel m on the l-th time convolution layer is expressed as:
[0086]
[0087] Where * represents the cross-correlation operator, F is the number of input channels, is the input feature of channel k, and is the training weight and bias on channel k of layer l, and σ is the activation function;
[0088] The spatial graph convolution network layer and the temporal convolution network layer form a spatiotemporal convolution module, and the spatiotemporal convolution module forms a spatiotemporal graph convolution component. The traffic flow data described in S1 As the feature input to the spatiotemporal graph convolution component, the risk source features of traffic operation status are extracted through the above operations. Among them, F traffic is the dimension of the output features of the spatiotemporal graph convolution module;
[0089] S204, weather condition risk source feature extraction refers to using a fully connected layer module to reduce the dimension and noise of the input weather condition information, and convert the weather condition data described in S1 Extract weather risk source features as feature input to the fully connected layer module Among them, F weather is the output feature dimension of the fully connected layer module;
[0090] S205, the multi-source risk feature fusion refers to using a feature fusion module based on an attention mechanism to fusion the multi-source risk r i road , r i traffic and r i weather Perform feature fusion;
[0091] The risk source characteristics r i road , r i traffic and r i weather Splice into vector r i Then multiply by three different weight matrices w q , wk and w v Get the query vector q i , key vector k i Sum value vector v i ; The key vector k i and the query vector q i Multiply to get the correlation strength matrix a i , for the correlation strength matrix a i The attention weight matrix a is obtained by normalization i '; Set the value vector v i With the attention weight matrix a i 'After multiplication, we get the feature fusion vector o i ;
[0092] Use Sigmoid function to fusion feature vector o i Processing to obtain the traffic accident risk assessment value R i :
[0093] R i =Sigmoid(w T o i +b)
[0094] Where: w T and b are the trainable parameters of the output layer, and T is the transposed symbol.
[0095] Furthermore, the specific method of step S3 is as follows:
[0096] S301, input the data set in S1 into the model in S2 for training, and output the traffic accident risk assessment value set R of the data set = {R n};
[0097] S302, construct a classification threshold sequence C with 0 as the initial value, 1 as the final value, and 0.001 as the step size. j}, for any classification threshold c j , compare all the risk assessment values in the risk assessment value set R with it in turn:
[0098]
[0099] in, Is the evaluation of whether an accident will occur after comparison, y n To determine whether an accident actually occurred. When TP n ;when y n =0, recorded as false positive FP n ;when y n=1, recorded as false negative FN n ;when When n , all evaluation values in set R are consistent with the classification threshold c j After comparison, the true positive TP n The number of TP and false positive FP n The number of FP and false negative FN n The number of true negatives FN and TN n The number TN and calculate the threshold c j The recall rate TPR under j and false alarm rate FPR j :
[0100]
[0101]
[0102] The classification threshold sequence C = {c j All c in} j After traversal, the recall rate set TPR is obtained = {TPR j} and the false alarm rate set FPR = {FPR j};
[0103] S303, the Youden index is each classification threshold c j Corresponding TPR j With FPR j The difference between the values of j The optimal classification threshold for judging whether an accident has occurred or not
[0104] Furthermore, the specific method of step S4 is as follows:
[0105] S401, for the main and secondary roads to be evaluated, collect the real-time traffic flow, road characteristics and real-time weather condition information data described in S1;
[0106] S402: Input the data to be tested into the risk assessment model described in S2 to conduct real-time assessment of the risk index of the current road section. If the risk value is lower than the optimal classification threshold described in S303, The current situation is considered to be low risk and no intervention or warning information is required; if the risk value is higher than the optimal classification threshold described in S303 The current situation is considered a high-risk scenario, and early warning information is issued and intervention measures are taken to reduce the risk.
[0107] The above description is only a specific implementation mode of the present invention, which is only used to help understand the principles and core ideas of the present invention, and is not used to limit the present invention. Within the ideas and principles of the present invention, any modifications, equivalent substitutions, etc. made to the technical solutions described in the present invention by any technician in the field should be included in the protection scope of the present invention.
Claims
1. A traffic accident risk assessment method for urban primary and secondary road networks based on multi-source risks, characterized in that: The method comprises the following steps: S1. Obtain historical traffic accident samples, non-accident samples without accidents, and historical traffic flow, road characteristics and weather condition datasets on the main and secondary trunk roads of the city to be evaluated; S2. Based on the time and location information, feature extraction is performed on the traffic flow risk sources, road characteristic risk sources and weather condition risk sources of the road section where the sample described in S1 is located and the adjacent road sections, and feature fusion is performed on multi-source risks to construct a risk assessment model; S3. Input the data set into the risk assessment model for model training, and select the optimal risk classification threshold according to the maximum Youden index; S4, real-time acquisition of traffic flow, road characteristics and weather condition data on the road to be assessed, and use of the risk assessment model determined in S2 and S3 to calculate in real time the risk level on the main and secondary roads to be assessed; The specific method of step S2 is as follows: S201, converting the original primary and secondary trunk road connection relationship into a graph structure that can be input into the model. The original primary and secondary trunk road network connection relationship is expressed as: G0={V0,E0} Among them, E0 represents the set of road sections on the primary and secondary trunk road networks, and V0 represents the set of connection points between road sections; The road segment set and the connection point set in the primary and secondary trunk road network connection relationship are converted into each other to obtain an inputtable graph structure: G=(V,E,A) In the formula, V is the node in the graph structure, which is converted from the road segment set E0; E is the edge in the graph structure, which represents the connection edge between nodes, which is converted from the set of road segment connection points; A is the adjacency matrix, which represents the connectivity between any two nodes in the graph structure. If A ij is equal to 1, indicating that the i-th node is directly connected to the j-th node; if there is no direct connection, A ij is equal to 0; S202, the road feature risk source feature extraction refers to the process of aggregating and extracting the road feature information of the road section where the sample described in S1 is located and the adjacent road sections directly connected to it based on the graph structure G described in S201 by using a spatial graph convolutional network operation, and the method is as follows: For the i-th road section where the sample described in S1 is located, after aggregating the road feature information of itself and the adjacent road sections on the l-th information aggregation layer, the output feature is expressed as: In the formula, j represents the i-th road segment itself and its adjacent road segments. The i-th road segment itself and its adjacent road segment j together constitute the road segment set N(i), c ij equal N(i) and N(j) represent the node degrees of the i-th and j-th road segments, respectively; represents the input features from the road segment j at the information aggregation layer at level l; W l and b l are the training weights and biases on the lth layer respectively; BN refers to the use of batch normalization method to normalize features, and the nonlinear activation function uses the RELU function; The road feature data described in S1 Input spatial graph convolutional network to extract road feature risk sources Where N is the number of road sections, F road is the dimension of the output features of the spatial graph convolutional network; S203, Traffic flow risk source feature extraction refers to the process of aggregating and extracting traffic flow information in time and space dimensions respectively using a spatiotemporal graph convolutional network, and the method is as follows: In the spatial dimension, the spatial graph convolution network described in S202 is used to aggregate the traffic flow information of itself and the adjacent sections in each time segment. The time segments are 5 to 10 minutes, 10 to 15 minutes, and 15 to 20 minutes before the occurrence time of the sample described in S101. In the time segment t, for the i-th section where the sample described in S1 is located, after aggregating the traffic flow information of itself and the adjacent sections, the output feature is expressed as: In the formula, j represents the i-th road segment itself and its adjacent road segments, represents the input features from the j-th road segment at time segment t; In the time dimension, the time convolution network is used to further aggregate the traffic flow information. For the i-th road section, the output feature of channel m on the l-th time convolution layer is expressed as: Where * represents the cross-correlation operator, F is the number of input channels, is the input feature of channel k, and is the training weight and bias on channel k of layer l, and σ is the activation function; The spatial graph convolution network layer and the temporal convolution network layer form a spatiotemporal convolution module, and the spatiotemporal convolution module forms a spatiotemporal graph convolution component. The traffic flow data described in S1 As the feature input to the spatiotemporal graph convolution component, the risk source features of traffic operation status are extracted through the above operations. Among them, F traffic is the dimension of the output features of the spatiotemporal graph convolution module; S204, weather condition risk source feature extraction refers to using a fully connected layer module to reduce the dimension and noise of the input weather condition information, and convert the weather condition data described in S1 Extract weather risk source features as feature input to the fully connected layer module Among them, F weather is the output feature dimension of the fully connected layer module; S205, the multi-source risk feature fusion refers to using a feature fusion module based on an attention mechanism to fusion the multi-source risk r i road , r i traffic and r i weather Perform feature fusion; The risk source characteristics r i road , r i traffic and r i weather Splice into vector r i Then multiply by three different weight matrices w q , w k and w v Get the query vector q i , key vector k i Sum value vector v i ; The key vector k i and the query vector q i Multiply to get the correlation strength matrix a i , for the correlation strength matrix a i The attention weight matrix a is obtained by normalization i '; Set the value vector v i With the attention weight matrix a i 'After multiplication, we get the feature fusion vector o i ; Use Sigmoid function to fusion feature vector o i Processing to obtain the traffic accident risk assessment value R i : R i =Sigmoid(w T ·o i +b) Where: w T and b are trainable parameters of the output layer, and T is the transposed symbol; The specific method of step S3 is as follows: S301, input the data set in S1 into the model in S2 for training, and output the traffic accident risk assessment value set R of the data set = {R n }; S302, construct a classification threshold sequence C with 0 as the initial value, 1 as the final value, and 0.001 as the step size. j }, for any classification threshold c j , and compare all the risk assessment values in the risk assessment value set R with it in turn: in, Is the evaluation of whether an accident will occur after comparison, y n To determine whether an accident actually occurred. When TP n ;when y n =0, recorded as false positive FP n ;when y n =1, recorded as false negative FN n ;when When n , all evaluation values in set R are consistent with the classification threshold c j After comparison, the true positive TP n The number of TP and false positive FP n The number of FP and false negative FN n The number of true negatives FN and TN n The number TN and calculate the threshold c j The recall rate TPR under j and false alarm rate FPR j : The classification threshold sequence C = {c j All c in} j After traversal, the recall rate set TPR is obtained = {TPR j } and the false alarm rate set FPR = {FPR j }; S303, the Youden index is each classification threshold c j Corresponding TPR j With FPR j The difference between the values of j The optimal classification threshold for judging whether an accident has occurred or not The specific method of step S4 is as follows: S401, for the main and secondary roads to be evaluated, collect the real-time traffic flow, road characteristics and real-time weather condition information data described in S1; S402: Input the data to be tested into the risk assessment model described in S2 to conduct real-time assessment of the risk index of the current road section. If the risk value is lower than the optimal classification threshold described in S303, The current situation is considered to be low risk and no intervention or warning information is required; if the risk value is higher than the optimal classification threshold described in S303 The current situation is considered a high-risk scenario, and early warning information is issued and intervention measures are taken to reduce the risk.
2. The traffic accident risk assessment method for urban primary and secondary trunk road networks based on multi-source risks according to claim 1 is characterized in that: The specific method of step S1 is as follows: S101, the historical traffic accident sample set includes the time and location information of the accident, the time is accurate to the minute, and the location is the ID information of the road section where the accident occurred. The non-accident sample set is a sample set randomly extracted at a time other than when the accident occurred, and includes the time and location information; S102, traffic flow data set is obtained by the GPS device of the vehicle, including speed standard deviation, congestion level parameters, and parameter collection time, accurate to the minute level, and location information, i.e., the road section ID; The road feature data set includes the number of lanes, lane width, road section speed limit parameters and road section ID information; the weather condition data set is obtained from a meteorological station at a preset location, including visibility, wind speed, rainfall parameters, and the collection time of the parameters, accurate to the hour; S103, marking the labels of the accident samples in the accident sample set described in S101 as 1, and marking the labels of the non-accident samples in the non-accident sample set as 0.