A method, device, and storage medium for predicting cascading impacts of traffic events

Through the combination of space-time multi-grained graph and attention mechanism layer, the problem of high directional constraints and high computational complexity in the prediction of existing traffic event impacts is solved, and accurate prediction of the impact range of traffic event and optimization of resource consumption is achieved.

CN120031208BActive Publication Date: 2025-07-08HIGHWAY MONITORING & RESPONSE CENT MINIST OF TRANSPORT OF THE P R C
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510485767.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-17
Publication Date
2025-07-08
Estimated Expiration
2045-04-17

AI Technical Summary

Technical Problem

The existing traffic event impact prediction methods ignore directional constraints and traffic rules when modeling, and have high computational complexity and cannot adapt to the nonlinear diffusion characteristics of traffic flow propagation, resulting in low prediction accuracy and excessive resource consumption.

Method used

The spatial and temporal multi-grained graph modeling is used to map the local characteristics of the sensor node to the road node through the feature transformation function and attention mechanism layer, and perform global fusion, and quantify the impact of traffic events in combination with the event impact matrix, reduce the computational complexity and improve prediction accuracy.

Benefits of technology

Accurate prediction of the impact range of traffic events is achieved, the calculation complexity is reduced to O(|S||R|² + |R|³, and the expression ability and prediction efficiency of the model are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120031208B_ABST
    Figure CN120031208B_ABST
Patent Text Reader

Abstract

The present invention provides a traffic event cascading impact prediction method, device and storage medium, which uses a spatio-temporal multi-granularity graph to introduce multiple granularities in time and space to model the road network, marks the monitoring directions of sensors and the relationships between roads to achieve directional constraints and long-range association construction. The observation time window is divided into before event verification and after event verification, and the data differences before and after the event are concerned. The data is hierarchically represented and fused, and spatio-temporal multi-granularity fusion is performed through the attention mechanism layer to enhance the expression ability of the model and reduce the computational complexity. Finally, the data is distinguished into a feature sequence before verification and a feature sequence after verification, and an event impact degree matrix is introduced to quantify the impact degree of traffic events on different regions, and then input into the traffic event cascading impact prediction module to output the positions and time periods of the road nodes affected under the traffic event.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of traffic data processing, and particularly to a traffic event cascade impact prediction method, device, and storage medium. Background Art

[0002] With the acceleration of urbanization and the continuous growth of traffic demand, the urban traffic system has become increasingly complex, and traffic abnormal events (such as traffic accidents, road construction, large-scale events, etc.) occur frequently. Such events not only cause sudden changes in the local traffic state but also generate cascade effects through the road network, seriously affecting the operation efficiency and safety of the road network. Therefore, accurately predicting the spatio-temporal impact range and duration of traffic events is the core requirement for formulating emergency management strategies and alleviating traffic congestion.

[0003] However, there are still many deficiencies in the existing technology for traffic event impact prediction. First of all, the existing traffic network modeling methods usually construct the connection relationship between sensor nodes based on geographical distance, but ignore the directional constraints and traffic rules in the actual traffic scenario. For example, in the highway scenario, sensors monitoring different directions, even if they are adjacent geographically, have extremely low actual traffic flow correlation due to the prohibition of U-turns or lane-changing restrictions. In addition, although the sensors near intersections are close geographically, vehicles need to pass through ramps or detours to achieve turning, resulting in the actual traffic propagation path being much longer than the Euclidean distance. Such modeling errors will directly lead to the misrepresentation of the traffic flow propagation path, and further affect the prediction accuracy of the event impact range.

[0004] Secondly, the mainstream methods use the global attention mechanism (such as Transformer) to model node associations, and its computational complexity is as high as O(|S|³), where |S| is the number of sensors. In the scenario of a large-scale road network deployed based on urban-level sensors, the real-time performance and resource consumption problems of model training and inference are prominent, and it is difficult to meet the actual application requirements.

[0005] In addition, there is a single nature in the existing research on time modeling, which overly relies on short-term time data (such as minute-level fluctuations) and ignores the periodicity (such as morning and evening rush hours) and long-term trends of traffic states. Some studies use a fixed radius or K-nearest neighbors to delimit the impact range for coarse-grained spatial modeling, but they cannot adapt to the non-linear diffusion characteristics of traffic flow propagation (such as congestion ripple effects), resulting in the prediction failure of the distal associated area. The impact of traffic events has significant spatio-temporal diffusion characteristics, and its impact range changes dynamically with time. Therefore, it is urgent to propose a new traffic event impact prediction method that can overcome the above problems to improve the scientificity and effectiveness of traffic emergency management. Summary of the Invention

[0006] In view of this, embodiments of the present invention provide a traffic event cascading impact prediction method, apparatus, and storage medium to eliminate or improve one or more defects existing in the prior art, and solve the problems of missing directional constraint modeling, high computational complexity, and insufficient capture of spatio-temporal diffusion characteristics in existing traffic event impact prediction methods.

[0007] One aspect of the present invention provides a traffic event cascading impact prediction method, which includes the following steps:

[0008] Based on spatio-temporal multi-granularity graph modeling, obtain the static topological features and dynamic temporal features of the traffic network to be analyzed, organize them into a hierarchical representation, and fuse them through a feature transformation function to obtain a first fused feature; wherein, in the spatio-temporal multi-granularity graph, the time granularity is divided into short-term, medium-term, and long-term, and the space granularity is divided into local, regional, and global; the static topological features include the sensor node set, road node set, and connection edge set in the traffic network to be analyzed; mark the monitoring direction of the sensor nodes in the road and mark the connection relationship of each road segment as topological structure information; the dynamic temporal features are the sensor node observation values and road node attribute information extracted based on the sliding of the observation time window, and the observation time window is divided into before verification and after verification according to the event verification time;

[0009] Based on multi-granularity feature fusion, input the first fused feature into a pre-trained attention mechanism layer to perform hierarchical feature transformation to obtain a second fused feature, so as to map the local characteristics of the sensor nodes to the road nodes, then globally fuse the characteristics between the road nodes and reverse map them to the local characteristics of the sensor nodes;

[0010] Distinguish the feature sequence before verification and the feature sequence after verification of the second fused feature as a feature transformation sequence, introduce an event impact degree matrix to quantify the impact degree of traffic events on different regions, and then input it into a pre-trained traffic event cascading impact prediction module to output the positions and time periods of the affected road nodes under the traffic event; wherein, the traffic event cascade impact prediction module includes a weighted fusion layer and a SUMPool layer.

[0011] In some embodiments, the time granularity includes minute level, hour level, and day level; in the spatio-temporal multi-granularity graph, the local space granularity is the relationship between sensors and roads, the regional space granularity is the relationship between roads, and the global space granularity is the relationship of the entire road network;

[0012] Construct a traffic network graph , where is the sensor node set, is the road node set, represents the number of sensors, represents the number of road nodes, and E is the connection edge set;

[0013] Construct an adjacency relationship matrix to label the monitoring directions of the sensor nodes in the road. The expression of the adjacency relationship matrix is:

[0014] ;

[0015] Among them, , ;

[0016] Divide the relationships between the roads into four categories, including primary connections between different sections within the same road, secondary connections where two roads have physical intersections, tertiary connections where two roads are connected through a third road, and quaternary connections that ensure reachability in the road network;

[0017] Construct a global adjacency matrix to mark the road association relationships. The expression is:

[0018] .

[0019] In some embodiments, the dynamic temporal characteristics are represented as ;

[0020] Among them, , is to update the sensor-road connection relationship based on real-time sensor node data, is to adjust the connection strength between roads according to the traffic flow state, is the influence of road state on sensor observations;

[0021] Organize the static topological characteristics and dynamic temporal characteristics of the traffic network to be analyzed into a hierarchical representation. The expression is:

[0022] ;

[0023] ;

[0024] Among them, H is the observation value of the sensor node and the attribute information of the road node;

[0025] The first fusion feature is obtained by fusing through a feature transformation function. The expression is:

[0026] ;

[0027] Among them, are the corresponding feature transformation functions respectively, represents the feature fusion operation.

[0028] In some embodiments, based on multi-granularity feature fusion, input the first fusion feature into a pre-trained attention mechanism layer to perform hierarchical feature transformation to obtain a second fusion feature, including:

[0029] Construct the global potential feature tensor of the road nodes for each time point t , where represents the number of road nodes, represents the length of the observation time window, represents the feature dimension;

[0030] For the sensor nodes, construct the feature representation , where represents the number of input channels of the sensor;

[0031] Calculate the attention weights from the sensor nodes to the road nodes, and the calculation formula is:

[0032] ;

[0033] where is the query projection matrix from the sensor to the road (i.e., the query projection matrix of the local mapping), is the key-value projection matrix from the sensor to the road (i.e., the key-value projection matrix of the local mapping); is the feature embedding representation of the sensor, is the feature embedding representation of the road node; is the attention head dimension; is the softmax activation function to ensure the attention weights, and the sum of the weights is 1; is the adjacency relationship matrix; ⊙ represents element-wise multiplication;

[0034] Then the expression for mapping the local characteristics of the sensor nodes to the road nodes is:

[0035] ;

[0036] where is the parameter of the linear transformation layer for adjusting the feature dimension, is the value projection matrix;

[0037] Perform global fusion on the characteristics between the road nodes and then reverse map to the local characteristics of the sensor nodes to obtain the second fusion feature, including:

[0038] Calculate the multi-head attention weights between the road nodes as:

[0039] ;

[0040] where represents the query projection matrix from the road to the road (i.e., the query projection matrix of the global fusion), is the key-value projection matrix from road to road (i.e., the key-value projection matrix for global fusion), represents the global adjacency matrix; ⊙ represents element-wise multiplication;

[0041] Calculate the fusion feature between the road nodes, and the expression is:

[0042] ;

[0043] where, and are the parameters of the linear transformation layer for adjusting the feature dimension, is the value projection matrix;

[0044] Calculate the reverse attention weight, and the calculation formula is:

[0045] ;

[0046] where, represents the query projection matrix from road to sensor (i.e., the query projection matrix for reverse mapping), represents the key-value projection matrix from road to sensor (i.e., the key-value projection matrix for reverse mapping).

[0047] Calculate the second fusion feature, and the calculation formula is:

[0048] ;

[0049] where, and are the parameters of the linear transformation layer for adjusting the feature dimension, is the value projection matrix.

[0050] In some embodiments, the pre-training steps of the feature transformation function, the attention mechanism layer, the influence degree matrix, and the traffic event cascade influence prediction module include:

[0051] Obtain a training sample set, which contains multiple samples. Each sample contains a set of sample traffic network data based on the spatio-temporal multi-granularity graph under a specified traffic event; the sample traffic network data includes sample static topological features and sample dynamic temporal features; the sample also marks the true positions and true time periods of the road nodes affected under the traffic event as labels;

[0052] Organize the sample static topological features and the sample dynamic temporal features in the sample into a hierarchical representation and fuse them through an initial feature transformation function to obtain a first sample fusion feature;

[0053] Input the first sample fusion feature into the initial attention mechanism layer based on multi-granularity feature fusion to perform hierarchical feature transformation to obtain the second sample fusion feature;

[0054] Distinguish the sample verification pre-feature sequence and the sample verification post-feature sequence from the second sample fusion feature as the sample feature transformation sequence. After introducing the initial event impact degree matrix of all zeros to quantify the impact degree of traffic events on different regions, on the one hand, input it into the initial traffic event cascading impact prediction module to output the predicted positions and predicted time periods of the road nodes affected under the traffic event; on the other hand, obtain the time series feature sequence through the encoding process of the initial time series encoder; input the time series feature sequence and the sample verification pre-feature sequence into the first decoder, and use the sample verification pre-feature sequence as the target to output the first reconstruction sequence, and use the deviation between the first reconstruction sequence and the sample feature transformation sequence to update the initial event impact degree matrix; input the time series feature sequence, the sample verification pre-feature sequence, and the updated initial event impact degree matrix into the second decoder, and use the sample verification pre-feature sequence as the target to output the second reconstruction sequence;

[0055] Use the first decoder as the discriminator and the second decoder as the generator for adversarial training. The discriminator iterates with the goal of minimizing the reconstruction error and updates the initial event impact degree matrix. The generator generates traffic state features consistent with the true abnormal distribution with the goal of maximizing the reconstruction error; construct the first loss based on the deviation between the first reconstruction sequence and the sample verification pre-feature sequence; construct the second loss based on the deviation between the second reconstruction sequence and the sample verification pre-feature sequence; construct the third loss based on the deviation between the true position and the predicted position in the label and the deviation between the true time period and the predicted time period; jointly update the parameters of the initial feature transformation function, the initial attention mechanism layer, the initial traffic event cascading impact prediction module, the initial event impact degree matrix, the initial time series encoder, the first decoder, and the second decoder using the first loss, the second loss, and the third loss. After multiple rounds of iteration, obtain the feature transformation function, the attention mechanism layer, the impact degree matrix, and the traffic event cascading impact prediction module.

[0056] In some embodiments, the time series feature sequence obtained through the encoding process of the initial time series encoder has the expression:

[0057] ;

[0058] where represents the time series encoder, represents the sample feature transformation sequence, represents the initial event impact degree matrix;

[0059] Input the time series feature sequence and the pre-sample verification feature sequence into the first decoder, and use the pre-sample verification feature sequence as the target to output the first reconstruction sequence. The expression is:

[0060] ;

[0061] Among them, is the first self-attention layer, is the first cross-attention layer; represents the pre-sample verification feature sequence;

[0062] Update the initial event impact degree matrix using the deviation between the first reconstruction sequence and the sample feature conversion sequence. The expression is:

[0063] ;

[0064] Input the time series feature sequence, the pre-sample verification feature sequence, and the updated initial event impact degree matrix into the second decoder, and use the pre-sample verification feature sequence as the target to output the second reconstruction sequence. The expression is:

[0065] ;

[0066] Among them, is the second self-attention layer, is the second cross-attention layer;

[0067] The calculation formula of the first loss is:

[0068] ;

[0069] The calculation formula of the second loss is:

[0070] ;

[0071] The calculation formula of the third loss is:

[0072] ;

[0073] Among them, represents the predicted value of the affected time period under the traffic event, represents the actual time period affected under the traffic event; represents the predicted value of the affected location under the traffic event, represents the actual section affected under the traffic event;

[0074] The combined loss calculation formula is:

[0075] ;

[0076] Among them, and are weights.

[0077] In some embodiments, before distinguishing the verification of the second fusion feature, the pre-verification feature sequence and the post-verification feature sequence are used as the feature transformation sequence, and an event impact degree matrix is introduced to quantify the impact degree of traffic events on different regions. The calculation formula is:

[0078] ;

[0079] Among them, ⊙ represents element-wise multiplication, represents the sample feature transformation sequence, and I represents the event impact degree matrix.

[0080] On the other hand, the present invention also provides a traffic event cascading impact prediction device, including a processor, a memory, and a computer program / instructions stored in the memory. The processor is used to execute the computer program / instructions, and when the computer program / instructions are executed, the device implements the steps of the above method.

[0081] On the other hand, the present invention also provides a computer-readable storage medium, on which computer program / instructions are stored. When the computer program / instructions are executed by a processor, the steps of the above method are implemented.

[0082] On the other hand, the present invention also provides a computer program product, including computer program / instructions. When the computer program / instructions are executed by a processor, the steps of the above method are implemented.

[0083] The beneficial effects of the present invention are at least:

[0084] The traffic event cascading impact prediction method, device, and storage medium of the present invention use a spatio-temporal multi-granularity graph to introduce multiple granularities in time and space to model the road network, mark the monitoring directions of sensors and the relationships between roads to achieve directional constraints and long-range association construction. The observation time window is divided into before-event verification and after-event verification to focus on the data differences before and after the event. On the basis of hierarchical representation of the data, fusion is performed based on the feature transformation function, and then through the attention mechanism layer, the local characteristics of sensor nodes are mapped to road nodes, and then the characteristics between road nodes are globally fused and then inversely mapped to the local characteristics of sensor nodes to extract spatial association features, enhancing the expression ability of the model and reducing the computational complexity. Finally, the data is distinguished into a pre-verification feature sequence and a post-verification feature sequence, and an event impact degree matrix is introduced to quantify the impact degree of traffic events on different regions, and then input into a pre-trained traffic event cascading impact prediction module to output the positions and time periods of the affected road nodes under the traffic event.

[0085] Furthermore, by introducing multi-granularity fusion and based on the temporal and spatial attention mechanisms, the data complexity is reduced to O(|S||R|² + |R|³), solving the problem of excessive model resource consumption.

[0086] Furthermore, a temporal encoder and a dual-decoder architecture are introduced. The first decoder reconstructs the features before the event occurs to be closer to the true values, and the second decoder generates a reasonable traffic state affected by the event. Parameter updates are performed based on adversarial training, and the event impact degree matrix is updated.

[0087] The additional advantages, objectives, and features of the present invention will be partially described below, and will become partially apparent to those of ordinary skill in the art after studying the following text, or can be learned from the practice of the present invention. The objectives and other advantages of the present invention can be achieved and obtained through the structures specifically pointed out in the specification and the drawings.

[0088] Those skilled in the art will understand that the objectives and advantages that can be achieved by the present invention are not limited to the above specific descriptions, and the above and other objectives that the present invention can achieve will be more clearly understood according to the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0089] The drawings described herein are used to provide a further understanding of the present invention, form a part of this application, and do not limit the present invention. In the drawings:

[0090] Figure 1 It is a schematic flow chart of the traffic event cascading impact prediction method according to an embodiment of the present invention.

[0091] Figure 2 It is a schematic logical diagram of the traffic event cascading impact prediction method based on a spatio-temporal multi-granularity graph network according to another embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0092] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the embodiments and the drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but do not limit the present invention.

[0093] Here, it should also be noted that in order to avoid obscuring the present invention with unnecessary details, only the structures and / or processing steps closely related to the solution of the present invention are shown in the drawings, while other details less related to the present invention are omitted.

[0094] It should be emphasized that the term "comprising / including" when used herein refers to the presence of features, elements, steps, or components, but does not exclude the presence or addition of one or more other features, elements, steps, or components.

[0095] With the acceleration of urbanization and the continuous growth of traffic demand, urban traffic systems exhibit highly complex characteristics. Against this backdrop, traffic anomaly events (such as traffic accidents, road construction, large-scale events, etc.) occur frequently. Such events not only cause sudden changes in local traffic states but also generate cascading effects through the road network, severely affecting the operation efficiency and safety of the road network. Therefore, accurately predicting the spatio-temporal impact range and duration of traffic events is the core requirement for formulating emergency management strategies and alleviating traffic congestion. However, the existing methods have the following key problems in modeling and prediction:

[0096] First, existing traffic network modeling methods usually construct connection relationships between sensor nodes based on geographical distances, but ignore the directional constraints and traffic rules in actual traffic scenarios. For example, in highway scenarios, sensors monitoring different directions, even if adjacent geographically, have extremely low actual traffic flow correlation due to the prohibition of U-turns or lane-changing restrictions. Sensors near intersections, although close geographically, require vehicles to turn through ramps or detours, resulting in the actual traffic propagation path being much longer than the Euclidean distance. Such modeling errors will directly lead to incorrect representations of traffic flow propagation paths, thereby affecting the prediction accuracy of the event impact range. Second, mainstream methods use global attention mechanisms (such as Transformer) to model node associations, and their computational complexity is as high as O(|S|³) (|S| is the number of sensors). In large-scale road network scenarios (such as urban-level sensor deployments), the real-time performance and resource consumption problems of model training and inference are prominent, making it difficult to meet the actual application requirements. In existing prediction models of traffic event impacts, existing research mainly over-relies on short-term time data (such as minute-level fluctuations), ignoring the periodicity (such as morning and evening rush hours) and long-term trends of traffic states. Some studies use fixed radii or K-nearest neighbors to delimit the impact range for coarse-grained spatial modeling, but cannot adapt to the non-linear diffusion characteristics of traffic flow propagation (such as congestion ripple effects), resulting in prediction failures in distal associated regions. And the impacts of traffic events have significant spatio-temporal diffusion characteristics, and their impact ranges change dynamically over time.

[0097] In view of this, the present invention provides a method for predicting cascading impacts of traffic events, as Figure 1 shown, the method includes the following steps S101 to S103:

[0098] Step S101: Based on spatio-temporal multi-granularity graph modeling, obtain the static topological features and dynamic temporal features of the traffic network to be analyzed, organize them into a hierarchical representation, and fuse them through a feature transformation function to obtain the first fused feature. Among them, in the spatio-temporal multi-granularity graph, the time granularity is divided into short-term, medium-term, and long-term, and the space granularity is divided into local, regional, and global. The static topological features include the sensor node set, road node set, and connection edge set in the traffic network to be analyzed. Mark the monitoring direction of the sensor nodes in the road and mark the connection relationship of each road segment as topological structure information. The dynamic temporal features are the sensor node observation values and road node attribute information extracted based on the sliding of the observation time window, and the observation time window is divided into before verification and after verification according to the event verification time.

[0099] Step S102: Based on multi-granularity feature fusion, input the first fused feature into a pre-trained attention mechanism layer to perform hierarchical feature transformation to obtain the second fused feature, so as to map the local characteristics of the sensor nodes to the road nodes, then globally fuse the characteristics between the road nodes and reverse-map them to the local characteristics of the sensor nodes.

[0100] Step S103: Distinguish the feature sequence before verification and the feature sequence after verification of the second fused feature as the feature transformation sequence, introduce an event impact degree matrix to quantify the impact degree of traffic events on different regions, and then input it into a pre-trained traffic event cascade impact prediction module to output the positions and time periods of the road nodes affected under the traffic event. Among them, the traffic event cascade impact prediction module includes a weighted fusion layer and a SUMPool layer.

[0101] In step S101, in order to enhance the ability to dynamically evolve the traffic state, in the spatio-temporal multi-granularity graph, the traffic state is divided into three granularities: short-term, medium-term, and long-term, corresponding to the minute level, hour level, and day level respectively, for capturing instantaneous fluctuations, periodic changes, and long-term trends. The local space granularity is the relationship between sensors and roads, the regional space granularity is the relationship between roads, and the global space granularity is the relationship of the entire road network. Modeling for micro, meso, and macro characteristics can enhance the accurate description of the traffic flow propagation path by the model.

[0102] Specifically, construct a traffic network graph , where, is the sensor node set, is the road node set, represents the number of sensors, represents the number of road nodes, and E is the connection edge set.

[0103] Construct an adjacency relationship matrix to mark the monitoring direction of the sensor nodes in the road. The expression of the adjacency relationship matrix is:

[0104] ;

[0105] Among them, , .

[0106] The relationships between roads are divided into four categories, including primary connections between different sections within the same road, secondary connections where two roads have physical intersection points, tertiary connections where two roads are connected through a third road, and quaternary connections that ensure reachability in the road network.

[0107] Construct a global adjacency matrix to mark the road association relationships, and the expression is:

[0108] .

[0109] In some embodiments, the dynamic temporal feature is expressed as .

[0110] Among them, , is to update the sensor-road connection relationship based on real-time sensor node data, is to adjust the connection strength between roads according to the traffic flow state, is the influence of road state on sensor observations.

[0111] Organize the static topological features and dynamic temporal features of the traffic network to be analyzed into a hierarchical representation, and the expression is:

[0112] ;

[0113] ;

[0114] Among them, H is the sensor node observation value and road node attribute information.

[0115] The first fusion feature is obtained through feature transformation functions, and the expression is:

[0116] ;

[0117] Among them, are the corresponding feature transformation functions respectively, represents the feature fusion operation.

[0118] In step S102, introduce the time and space attention mechanism to perform dynamic interaction fusion on the multi-level features fused in step S101 to extract the spatio-temporal correlation characteristics of the traffic flow.

[0119] In some embodiments, based on multi-granularity feature fusion, input the first fusion feature into the pre-trained attention mechanism layer to perform hierarchical feature transformation to obtain the second fusion feature, including steps S1021~S1024:

[0120] Step S1021: Construct the global latent feature tensor of road nodes for each time point t , where represents the number of road nodes, represents the length of the observation time window, represents the feature dimension.

[0121] For sensor nodes, construct the feature representation , where represents the number of sensor input channels.

[0122] Step S1022: Calculate the attention weights from sensor nodes to road nodes, and the calculation formula is:

[0123] ;

[0124] where is the query projection matrix from sensor to road (i.e., the query projection matrix of local mapping), is the key-value projection matrix from sensor to road (i.e., the key-value projection matrix of local mapping); is the feature embedding representation of the sensor, is the feature embedding representation of the road node; is the attention head dimension; is the softmax activation function to ensure the attention weights, and the sum of the weights is 1; is the adjacency relation matrix; ⊙ represents element-wise multiplication.

[0125] The expression for mapping the local characteristics of sensor nodes to road nodes is:

[0126] ;

[0127] where is the parameter of the linear transformation layer for adjusting the feature dimension, is the value projection matrix.

[0128] Step S1023: Perform global fusion on the characteristics between road nodes and then reverse map to the local characteristics of sensor nodes to obtain the second fusion feature, including:

[0129] Calculate the multi-head attention weights between road nodes as:

[0130] ;

[0131] where represents the query projection matrix from road to road (i.e., the query projection matrix of global fusion), is the key-value projection matrix from road to road (i.e., the key-value projection matrix of global fusion), represents the global adjacency matrix; ⊙ represents element-wise multiplication.

[0132] Calculate the fused features between road nodes, and the expression is:

[0133] ;

[0134] where and are the parameters of the linear transformation layer for adjusting the feature dimension, and is the value projection matrix.

[0135] Step S1024: Calculate the reverse attention weights, and the calculation formula is:

[0136] ;

[0137] where represents the query projection matrix from road to sensor (i.e., the query projection matrix of the reverse mapping), and represents the key-value projection matrix from road to sensor (i.e., the key-value projection matrix of the reverse mapping).

[0138] Calculate the second fused feature, and the calculation formula is:

[0139] ;

[0140] where and are the parameters of the linear transformation layer for adjusting the feature dimension, and is the value projection matrix.

[0141] In step S103, for the fused features, the influence is quantified by introducing the event influence degree matrix, and the calculation formula is:

[0142] ;

[0143] where ⊙ represents element-wise multiplication, represents the sample feature transformation sequence, and I represents the event influence degree matrix.

[0144] Subsequently, the final feature representation is extracted through the aggregation operation in the spatio-temporal dimension to comprehensively consider the changes in the time and space dimensions, and finally accurately locate the area affected by the event:

[0145] .

[0146] In some embodiments, the pre-training steps of the feature transformation function, the attention mechanism layer, the influence degree matrix, and the traffic event cascading influence prediction module include steps S201~S205:

[0147] Step S201: Obtain a training sample set, which contains multiple samples. Each sample contains a set of sample traffic network data based on a spatio-temporal multi-granularity graph under a specified traffic event; the sample traffic network data includes sample static topological features and sample dynamic temporal features; the sample is also labeled with the true positions and true time periods of the road nodes affected under the traffic event as labels.

[0148] Step S202: Organize the sample static topological features and sample dynamic temporal features in the sample into a hierarchical representation and fuse them through an initial feature transformation function to obtain a first sample fusion feature.

[0149] Step S203: Based on multi-granularity feature fusion, input the first sample fusion feature into the initial attention mechanism layer to perform hierarchical feature transformation to obtain a second sample fusion feature.

[0150] Step S204: Distinguish the sample verification pre-feature sequence and the sample verification post-feature sequence from the second sample fusion feature as the sample feature transformation sequence. After introducing an initial event impact degree matrix of all zeros to quantify the impact degree of the traffic event on different regions, on the one hand, input it into the initial traffic event cascading impact prediction module to output the predicted positions and predicted time periods of the road nodes affected under the traffic event; on the other hand, perform encoding processing through the initial time series encoder to obtain a time series feature sequence; input the time series feature sequence and the sample verification pre-feature sequence into the first decoder to output a first reconstruction sequence with the sample verification pre-feature sequence as the target, and use the deviation between the first reconstruction sequence and the sample feature transformation sequence to update the initial event impact degree matrix; input the time series feature sequence, the sample verification pre-feature sequence, and the updated initial event impact degree matrix into the second decoder to output a second reconstruction sequence with the sample verification pre-feature sequence as the target.

[0151] Step S205: Conduct adversarial training with the first decoder as the discriminator and the second decoder as the generator. The discriminator iterates to minimize the reconstruction error and updates the initial event impact degree matrix. The generator generates traffic state features consistent with the true abnormal distribution to maximize the reconstruction error, forcing the discriminator to be difficult to distinguish between true and generated anomalies; construct a first loss based on the deviation between the first reconstruction sequence and the sample verification pre-feature sequence; construct a second loss based on the deviation between the second reconstruction sequence and the sample verification pre-feature sequence; construct a third loss based on the deviation between the true position and the predicted position and the deviation between the true time period and the predicted time period in the label; jointly update the parameters of the initial feature transformation function, the initial attention mechanism layer, the initial traffic event cascading impact prediction module, the initial event impact degree matrix, the initial time series encoder, the first decoder, and the second decoder with the first loss, the second loss, and the third loss. After multiple rounds of iteration, obtain the feature transformation function, the attention mechanism layer, the impact degree matrix, and the traffic event cascading impact prediction module.

[0152] In step S204, a timing feature sequence is obtained through encoding and processing by an initial timing encoder, and the expression is:

[0153] ;

[0154] Among them, represents the timing encoder, represents the sample feature conversion sequence, represents the initial event influence degree matrix;

[0155] In step S204, the timing feature sequence and the pre-sample-verification feature sequence are input into the first decoder, and the first reconstruction sequence is output with the pre-sample-verification feature sequence as the target, and the expression is:

[0156] ;

[0157] Among them, is the first self-attention layer, is the first cross-attention layer; represents the pre-sample-verification feature sequence.

[0158] In step S204, the initial event influence degree matrix is updated by using the deviation between the first reconstruction sequence and the sample feature conversion sequence, and the expression is:

[0159] ;

[0160] In step S204, the timing feature sequence, the pre-sample-verification feature sequence, and the updated initial event influence degree matrix are input into the second decoder, and the second reconstruction sequence is output with the pre-sample-verification feature sequence as the target, and the expression is:

[0161] ;

[0162] Among them, is the second self-attention layer, is the second cross-attention layer.

[0163] In step S205, the calculation formula of the first loss is:

[0164] ;

[0165] The calculation formula of the second loss is:

[0166] ;

[0167] The calculation formula of the third loss is:

[0168] ;

[0169] Among them, Represents the predicted value of the affected time period under a traffic event, represents the actual affected time period under a traffic event; represents the predicted value of the affected location under a traffic event, represents the actual affected road section under a traffic event;

[0170] The combined loss calculation formula is:

[0171] ;

[0172] wherein, and are weights.

[0173] On the other hand, the present invention also provides a traffic event cascading impact prediction device, including a processor, a memory, and a computer program / instructions stored on the memory. The processor is used to execute the computer program / instructions, and when the computer program / instructions are executed, the device implements the steps of the above method.

[0174] On the other hand, the present invention also provides a computer-readable storage medium, on which computer program / instructions are stored, and when the computer program / instructions are executed by a processor, the steps of the above method are implemented.

[0175] On the other hand, the present invention also provides a computer program product, including computer program / instructions, and when the computer program / instructions are executed by a processor, the steps of the above method are implemented.

[0176] The present invention will be described below in conjunction with a specific embodiment:

[0177] As Figure 2 shown, this embodiment proposes a traffic event cascading impact prediction method based on a spatio-temporal multi-granularity graph network, which decouples the traffic network into a multi-level modeling of time granularity and space granularity, and combines a dynamic adversarial optimization mechanism to achieve accurate prediction of traffic event cascading impacts. The method includes the following technical solutions:

[0178] Step S1: Spatio-temporal multi-granularity graph modeling

[0179] The traffic network is divided into a multi-level structure of time and space, providing a basis for subsequent feature extraction and event prediction. Specifically, it includes the following sub-steps:

[0180] Sub-step S11: Time granularity division

[0181] To solve the problem of the single modeling of time characteristics in traditional methods and enhance the model's ability to depict the dynamic evolution of traffic states, in this embodiment, traffic states are divided into three granularities: short-term, medium-term, and long-term, to capture instantaneous fluctuations, periodic changes, and long-term trends respectively. Specifically, it is divided into short-term granularity (minute level). At this granularity, the fluctuations of traffic flow usually manifest as sudden events, such as traffic accidents and sudden congestions, providing immediate feedback for the dynamic prediction model. Medium-term granularity (hour level), which is mainly used to model the periodic changes of traffic states (such as morning and evening rush hours), providing the periodic change trend for the prediction model. Long-term granularity (day level), to depict the long-term impact of long-term events of traffic flow (such as the duration of construction, holidays, etc.).

[0182] Sub-step S12: Spatial granularity division

[0183] To solve the problem that traditional methods ignore directional constraints and long-range correlations and enhance the model's accurate description of the traffic flow propagation path, in this embodiment, the traffic network is divided into three granularities: local (sensor-road), regional (road-road), and global (road network level), to model micro, meso, and macro characteristics respectively.

[0184] (1) Local granularity division (sensor-road)

[0185] At the local level, this embodiment focuses on the direct relationship between sensors and the road segments they cover. Each sensor node only establishes a connection with the road segment it directly covers, so that it can be refined to specific monitoring points, ensuring that the monitoring data of each sensor node accurately reflects the traffic conditions in the area it covers. For this purpose, the traffic network is represented as a graph , where is the set of sensor nodes, is the set of road nodes, represents the number of sensors, represents the number of road nodes, and E is the set of connecting edges. Then, each sensor node is labeled with its monitoring direction, and an adjacency relationship matrix is constructed according to the geographical location information, and the expression is:

[0186] ;

[0187] where , .

[0188] (2) Regional granularity division (road-road)

[0189] At the regional level, this embodiment further models the traffic propagation characteristics between different road segments and divides them into four types of connection relationships:

[0190]

[0191] (3)Global granularity division (road network level)

[0192] At the global level, focus on the characteristics and long-range correlations of the entire traffic network. For the road connections after regional granularity division, it is represented by and based on this, construct a global adjacency matrix to characterize the road association relationships at different levels. The calculation formula is as follows:

[0193] .

[0194] Sub-step S13: Construction of dynamic graph time series

[0195] Considering the dynamic impact characteristics of traffic events, in this embodiment, time granularity is introduced on the basis of the static road network structure to construct a dynamic graph representation. First, divide the observation time window T into before verification (observation data before the event occurs) and after verification (impact data after the event occurs). Among them, is the event verification time, is the length parameter of the time window before verification, is the length parameter of the time window after verification, and both of them can be dynamically adjusted according to the actual application scenario to balance the real-time performance and accuracy of prediction.

[0196] Then, for any time stamp , construct a time-varying dynamic graph sequence , where , is to update the sensor-road connection relationship based on real-time sensor data, adjust the connection strength between roads according to the traffic flow state, reflect the impact of road status on sensor observations.

[0197] Sub-step S14: Graph feature fusion

[0198] In order to provide an input basis for the subsequent multi-granularity feature fusion step S2, this embodiment organizes static topological features and dynamic time series features into a hierarchical representation to generate a unified feature representation. Among them represents the dynamic graph sequence, reflecting the time-varying traffic state, represents the static adjacency relationship matrix, containing topological structure information, is the node feature set, which fuses sensor observation values and road attribute information. The fused feature representation can be expressed as:

[0199] ;

[0200] Among them, are the corresponding feature transformation functions respectively, indicating the feature fusion operation.

[0201] Step S2: Multi-granularity feature fusion

[0202] Based on the construction of the spatio-temporal multi-granularity graph, this embodiment designs a multi-granularity feature fusion method, which realizes the dynamic interaction and fusion of multi-level features through the time and space attention mechanisms, so as to extract the spatio-temporal correlation characteristics of traffic flow. Specifically, it includes the following sub-steps:

[0203] Sub-step S21: Initialization of hierarchical feature representation

[0204] Considering that roads play a key role in connecting and transmitting traffic flow in the traffic network, first, for each time point t, a global latent feature tensor of road nodes is constructed , where, represents the number of road nodes, represents the length of the observation time window, represents the feature dimension. This feature tensor contains both static topological features and dynamic traffic state information, providing a basic representation for subsequent feature transformation. For sensor nodes, a feature representation is constructed, focusing on the temporal evolution characteristics of the measurement values, where, is the number of sensor input channels.

[0205] Sub-step S22: Mapping from local node characteristics to road characteristics

[0206] To solve the problem of the disconnection between sensor data and road characteristics and achieve precise aggregation at the microscopic level, this embodiment maps the dynamic observation characteristics of sensors to road nodes based on the attention mechanism. First, according to the local traffic node mapping relationship constructed in step S1, considering the monitoring range and directionality of sensors, the accuracy of feature transmission is ensured. The calculation of the attention weight from the sensor to the road is as follows:

[0207] ;

[0208] where, is the query projection matrix from the sensor to the road (i.e., the query projection matrix of the local mapping), is the key-value projection matrix from the sensor to the road (i.e., the key-value projection matrix of the local mapping); is the feature embedding representation of the sensor, is the feature embedding representation of the road node; is the attention head dimension; is the softmax activation function to ensure the attention weight, and the sum of the weights is 1; is the sensor-road adjacency mask matrix, inherited from the connection relationship in step S1, and ⊙ represents element-wise multiplication.

[0209] Then, update the feature representation of the road nodes based on the calculated attention weights:

[0210] ;

[0211] Among them, is the parameter of the linear transformation layer for adjusting the feature dimension, is the value projection matrix, and this update process realizes the feature aggregation from the sensor to the road.

[0212] Sub-step S23: Feature fusion between roads

[0213] To solve the problem of insufficient meso- and macro-feature modeling in traditional methods and enhance the model's global characterization ability of the traffic flow propagation path, in this embodiment, the multi-head attention mechanism is used to fuse multi-level road association features, further capture the global propagation characteristics of the traffic flow, and perform dynamic feature fusion on the multi-level connection relationships of road segments:

[0214] ;

[0215] ;

[0216] Then calculate the multi-head attention weights and perform road feature fusion:

[0217] ;

[0218] Among them, represents the query projection matrix from road to road (i.e., the query projection matrix for global fusion), is the key-value projection matrix from road to road (i.e., the key-value projection matrix for global fusion), represents the global adjacency matrix; ⊙ represents element-wise multiplication.

[0219] Calculate the fusion features between road nodes, and the expression is:

[0220] ;

[0221] Among them, and are the parameters of the linear transformation layer for adjusting the feature dimension, is the value projection matrix.

[0222] Sub-step S24: Reverse mapping from road features to local node features

[0223] To enable traffic nodes to perceive the dynamic characteristics of surrounding roads and enhance the model's ability to capture long-range correlations, the present invention maps road characteristics backward into traffic node characteristics to form a closed-loop feature interaction. The backward mapping process needs to consider the observation range limitation of sensors and the influence of road topology on sensors, and different-direction sensors should ensure independence. The calculation formulas for the backward attention weights and the final sensor feature update are as follows:

[0224] ;

[0225] Among them, is expressed as the query projection matrix from the road to the sensor (i.e., the query projection matrix for backward mapping), is expressed as the key-value projection matrix from the road to the sensor (i.e., the key-value projection matrix for backward mapping).

[0226] Calculate the second fusion feature, and the calculation formula is:

[0227] ;

[0228] Among them, , are the parameters of the linear transformation layer for adjusting the feature dimension, is the value projection matrix.

[0229] Step S3: Event influence range localization based on dynamic weights

[0230] In this embodiment, through a dynamic weight allocation method, the key areas affected by events are identified by using traffic characteristic changes. This method designs a dynamic weight allocation mechanism based on the dynamic graph generated in step S1 and the multi-scale features extracted in step S2 to achieve accurate localization of the event influence range. It specifically includes the following sub-steps:

[0231] Sub-step S31: Detection of characteristic changes in the event influence area

[0232] To accurately capture the impact of traffic events on traffic states, it is necessary to detect the changes in traffic characteristics before and after the event occurs, so as to provide a basis for subsequent dynamic weight allocation. First, perform temporal encoding processing on the input feature sequence. Combining with the time window definition in step S1, the output from the spatial feature converter, that is, the pre-verification feature sequence and the post-verification feature sequence are temporally feature-transformed into to extract effective time change features. And to quantify the impact degree of the event on different areas, an event impact degree matrix of all zeros is initialized to record the impact changes of each node before and after the event occurs. Then, through feature concatenation operations, a complete temporal feature set is formed:

[0233] ;

[0234] Among them, represents the temporal encoder, which uses positional encoding to maintain temporal information, represents the sample feature conversion sequence, represents the initial event impact degree matrix, represents the feature concatenation operation.

[0235] Sub-step S32: Dynamic weight allocation

[0236] To solve the problem of the coarse-grained nature of the traditional event impact range delineation, in this embodiment, weights are dynamically assigned to each node based on the change rate of node characteristics, reflecting the degree of influence of the node during the occurrence of a traffic event. Nodes that are more affected by the event obtain higher weights, thereby ensuring the accurate positioning of the event impact range. To efficiently learn and allocate weights, the present invention adopts a dual-decoder architecture. Decoder #1 serves as a discriminator, and decoder #2 serves as a generator. The two are jointly optimized for the prediction of the event impact range through adversarial learning.

[0237] (1) Decoder #1: Feature reconstruction and event impact update

[0238] The role of decoder #1 is to perform a reconstruction task and continuously update the event impact degree through the reconstruction error with the original input features. It uses self-attention layers and cross-attention layers to capture the dependencies and spatial correlations between temporal data. Among them, the self-attention layer helps the model understand the dependencies between different time steps within the time series, and the cross-attention layer helps the model capture the correlations between time and spatial features, thereby accurately judging the impact of the event on different regions. Decoder 1 serves as a discriminator, inputting the feature sequence before the event occurs and the feature sequence after the event occurs. The goal is to reconstruct the predicted features before the event occurs to make them closer to the real features before the event occurs, and at the same time detect the abnormal changes after the event occurs, which are used to update the event impact degree matrix. It is responsible for distinguishing the traffic states before and after the event. The greater the reconstruction error, the more significant the impact of the event on the node. The specific implementation is as follows:

[0239] ;

[0240] Among them, is the first self-attention layer, is the first cross-attention layer, which is used to capture temporal dependencies and spatial correlations; represents the feature sequence before sample verification. Update the event impact degree based on the reconstruction error .

[0241] (2) Decoder #2: Secondary reconstruction based on the updated impact degree

[0242] Decoder #2 further refines the prediction of the event impact scope through a generation process mainly based on the updated information provided by Decoder #1, ensuring that the final event impact prediction is more accurate:

[0243] ;

[0244] Among them, is the second self-attention layer, is the second cross-attention layer.

[0245] Sub-step S33: Dynamic event impact and propagation prediction

[0246] To improve the accuracy of event impact degree prediction, this step conducts adversarial training based on the idea of a generative adversarial network (GAN). Combining the prediction error , the reconstruction loss of Decoder #1 and the reconstruction loss of Decoder #2, a joint loss function is designed:

[0247] ;

[0248] Among them, respectively represent the true values of the impact duration and impact length, , is the corresponding predicted value, is the L1 norm, is the prediction loss weight, is the dynamically adjusted reconstruction loss weight. At the beginning of training, a larger weight enables Decoder #1 to learn to distinguish the feature differences before and after the event. As the weight gradually increases, Decoder #2 is forced to generate more accurate event impact prediction values. The progressive training strategy not only ensures the accuracy of the prediction but also ensures the stable convergence of the overall model. The entire adversarial training process is as follows: first, Decoder #1 is optimized to enable it to accurately detect anomalies, and then Decoder #2 is optimized to maximize the reconstruction error of Decoder #1. In the initial stage of training, Decoder #1 will preferentially learn the normal mode. In the later stage of training, Decoder #2 is forced to generate more realistic abnormal data. It can be simply understood that Decoder #1 discriminates anomalies (detection), and Decoder #2 generates anomalies (generation), and the two confront each other through the reconstruction error.

[0249] Finally, based on the learned event impact prediction values, weighted fusion is adopted to ensure that the model can focus on the key areas affected by the event during prediction. The specific formula is as follows:

[0250] ;

[0251] Among them, ⊙ represents element-wise multiplication, represents the sample feature transformation sequence, and I represents the event impact degree matrix. Subsequently, the final feature representation is extracted through the aggregation operation in the spatio-temporal dimension to comprehensively consider the changes in both the time and space dimensions, and finally accurately locate the area affected by the event:

[0252] .

[0253] The effects of this embodiment are as follows:

[0254] (1) Through the spatio-temporal multi-granularity graph network, the traffic network is divided into multi-level structures in time and space, overcoming the limitations of traditional methods in directional constraint and long-range correlation modeling. (2) Through the multi-granularity attention mechanism, the computational complexity is reduced from O(|S|³) to O(|S||R|² + |R|³), significantly improving the computational efficiency. (3) Based on the dual-decoder architecture and the adversarial training strategy, the spatio-temporal diffusion pattern of the event impact is adaptively tracked, improving the prediction accuracy and interpretability. (4) Wide applicability. This embodiment can be applied to highway traffic flow management, as well as complex traffic scenarios such as urban road networks and rail transit, with broad popularization value and practicality.

[0255] In summary, for the traffic event cascading impact prediction method, device, and storage medium of the present invention, spatio-temporal multi-granularity graphs are used to introduce multiple granularities in time and space to model the road network, and the monitoring directions of sensors and the relationships between roads are marked to achieve directional constraint and long-range correlation modeling. The observation time window is divided into before and after event verification, and the data differences before and after the event are concerned. On the basis of hierarchical representation of the data, fusion is performed based on the feature transformation function, and then through the attention mechanism layer, the local characteristics of sensor nodes are mapped to road nodes, and then the characteristics between road nodes are globally fused and then inversely mapped to the local characteristics of sensor nodes to extract spatial correlation features, enhancing the expression ability of the model and reducing the computational complexity. Finally, the data is distinguished into the feature sequence before verification and the feature sequence after verification, and the event impact degree matrix is introduced to quantify the impact degree of traffic events on different regions, and then input into the pre-trained traffic event cascading impact prediction module to output the positions and time periods of the road nodes affected under the traffic event.

[0256] Furthermore, by introducing multi-granularity fusion and based on the time and space attention mechanisms, the data complexity is reduced to O(|S||R|² + |R|³), solving the problem of excessive model resource consumption.

[0257] Furthermore, a temporal encoder and a dual-decoder architecture are introduced. The first decoder reconstructs the features before the event occurs to be closer to the true values, and the second decoder generates a reasonable traffic state affected by the event. Parameter updates are performed based on adversarial training, and an event impact degree matrix is updated and obtained.

[0258] Those of ordinary skill in the art should understand that the various exemplary components, systems, and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software, or a combination of both. Specifically, whether to implement it in hardware or software depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a functional card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium or transmitted via a data signal carried in a carrier wave over a transmission medium or a communication link.

[0259] It should be clear that the present invention is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order between steps after understanding the spirit of the present invention.

[0260] In the present invention, the features described and / or illustrated for one embodiment can be used in the same or similar manner in one or more other embodiments, and / or combined with the features of other embodiments or replace the features of other embodiments.

[0261] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, various changes and variations can be made to the embodiments of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A traffic event cascading impact prediction method, characterized in that The method includes the following steps: Based on spatio-temporal multi-granularity graph modeling, obtain the static topological features and dynamic temporal features of the traffic network to be analyzed, organize them into a hierarchical representation, and fuse them through a feature transformation function to obtain the first fused feature; wherein, in the spatio-temporal multi-granularity graph, the time granularity is divided into short-term, medium-term, and long-term, and the space granularity is divided into local, regional, and global; the static topological features include the sensor node set, road node set, and connection edge set in the traffic network to be analyzed; label the monitoring direction of the sensor nodes in the road and mark the connection relationship of each road segment as topological structure information; the dynamic temporal features are the sensor node observation values and road node attribute information extracted based on the sliding of the observation time window, and the observation time window is divided into before verification and after verification according to the event verification time; Based on multi-granularity feature fusion, input the first fused feature into a pre-trained attention mechanism layer to perform hierarchical feature transformation to obtain the second fused feature, so as to map the local characteristics of the sensor nodes to the road nodes, then globally fuse the characteristics between the road nodes and reverse-map them to the local characteristics of the sensor nodes; Distinguish the feature sequences before verification and after verification from the second fused feature as the feature transformation sequence, introduce an event impact degree matrix to quantify the impact degree of traffic events on different regions, and then input it into a pre-trained traffic event cascading impact prediction module to output the positions and time periods of the road nodes affected by the traffic events; wherein, the traffic event cascading impact prediction module includes a weighted fusion layer and a SUMPool layer.

2. The traffic event cascade impact prediction method according to claim 1, wherein In the spatio-temporal multi-granularity graph, the time granularity includes minute level, hour level, and day level; the local space granularity is the relationship between sensors and roads, the regional space granularity is the relationship between roads, and the global space granularity is the relationship of the entire road network; Construct a transportation network graph , where is the set of the sensor nodes is the set of the road nodes represents the number of sensors represents the number of road nodes, and E is the set of the connecting edges; Construct an adjacency relationship matrix to label the monitoring direction of the sensor nodes in the road, and the expression of the adjacency relationship matrix is: ; Among them, , ; Divide the relationships between the roads into four categories, including the first-level connection of different road segments within the same road, the second-level connection where two roads have a physical intersection, the third-level connection where two roads are connected through a third road, and the fourth-level connection to ensure reachability in the road network; Construct a global adjacency matrix to mark the road association relationship, and the expression is: 。 3. The traffic incident cascading impact prediction method according to claim 2, wherein The dynamic timing characteristics are represented as ; Among them, , is to update the sensor-road connection relationship based on real-time sensor node data, is to adjust the connection strength between roads according to the traffic flow state, is the influence of road conditions on sensor observations; Organize the static topological features and dynamic temporal features of the traffic network to be analyzed into a hierarchical representation, and the expression is: ; ; wherein, H is the sensor node observation value and the road node attribute information; Fuse through a feature transformation function to obtain the first fused feature, and the expression is: ; Among them, are the corresponding feature transformation functions respectively, represents the feature fusion operation.

4. The traffic event cascade impact prediction method according to claim 3, wherein, Based on multi-granularity feature fusion, input the first fused feature into a pre-trained attention mechanism layer to perform hierarchical feature transformation to obtain the second fused feature, including: Construct the global latent feature tensor of the road nodes for each time point t , where represents the number of road nodes, represents the length of the observation time window, represents the feature dimension; Construct a feature representation for the sensor node , where represents the number of sensor input channels; Calculate the attention weight from the sensor node to the road node, and the calculation formula is: ; Among them, is the query projection matrix from the sensor to the road, is the key-value projection matrix from the sensor to the road; is the feature embedding representation of the sensor, is the feature embedding representation of the road node; is the attention head dimension; is the softmax activation function to ensure the attention weights, and the sum of the weights is 1; is the adjacency relationship matrix; ⊙ represents element-wise multiplication; Then the expression for mapping the local characteristics of the sensor nodes to the road nodes is: ; Among them, is the parameter of the linear transformation layer for adjusting the feature dimension, is the value projection matrix; Globally fuse the characteristics between the road nodes and reverse-map them to the local characteristics of the sensor nodes to obtain the second fused feature, including: Calculate the multi-head attention weight between the road nodes as: ; Among them, is the query projection matrix from road to road, is the key-value projection matrix from road to road, represents the global adjacency matrix; ⊙ represents element-wise multiplication; Calculate the fused feature between the road nodes, and the expression is: ; Among them, , are the parameters of the linear transformation layer for adjusting the feature dimension, is the value projection matrix; Calculate the reverse attention weights, and the calculation formula is as follows: ; Among them, is expressed as the query projection matrix from the road to the sensor, is expressed as the key-value projection matrix from the road to the sensor; Calculate the second fusion feature, and the calculation formula is as follows: ; Among them, , are the parameters of the linear transformation layer for adjusting the feature dimension, is the value projection matrix.

5. The traffic incident cascade impact prediction method according to claim 4, characterized in that, The pre-training steps of the feature transformation function, the attention mechanism layer, the impact degree matrix, and the traffic event cascading impact prediction module include: Obtain a training sample set, which contains multiple samples. Each sample contains a set of sample traffic network data based on the spatio-temporal multi-granularity graph under a specified traffic event. The sample traffic network data includes sample static topological features and sample dynamic temporal features. The sample also marks the true positions and true time periods of the road nodes affected under the traffic event as labels; Organize the sample static topological features and the sample dynamic temporal features in the sample into a hierarchical representation and fuse them through an initial feature transformation function to obtain a first sample fusion feature; Based on multi-granularity feature fusion, input the first sample fusion feature into the initial attention mechanism layer to perform hierarchical feature transformation to obtain a second sample fusion feature; Distinguish the sample pre-verification feature sequence and the sample post-verification feature sequence from the second sample fusion feature as a sample feature transformation sequence. After introducing an initial event impact degree matrix of all zeros to quantify the impact degree of the traffic event on different regions, on the one hand, input it into the initial traffic event cascading impact prediction module to output the predicted positions and predicted time periods of the road nodes affected under the traffic event; on the other hand, perform encoding processing through the initial time series encoder to obtain a time series feature sequence. Input the time series feature sequence and the sample pre-verification feature sequence into the first decoder to output a first reconstruction sequence with the sample pre-verification feature sequence as the target, and use the deviation between the first reconstruction sequence and the sample feature transformation sequence to update the initial event impact degree matrix. Input the time series feature sequence, the sample pre-verification feature sequence, and the updated initial event impact degree matrix into the second decoder to output a second reconstruction sequence with the sample pre-verification feature sequence as the target; Perform adversarial training with the first decoder as the discriminator and the second decoder as the generator. The discriminator iterates to minimize the reconstruction error and updates the initial event impact degree matrix. The generator generates traffic state features consistent with the true abnormal distribution by maximizing the reconstruction error. Construct a first loss based on the deviation between the first reconstruction sequence and the sample pre-verification feature sequence. Construct a second loss based on the deviation between the second reconstruction sequence and the sample pre-verification feature sequence. Construct a third loss based on the deviation between the true position and the predicted position and the deviation between the true time period and the predicted time period in the label. Jointly update the parameters of the initial feature transformation function, the initial attention mechanism layer, the initial traffic event cascading impact prediction module, the initial event impact degree matrix, the initial time series encoder, the first decoder, and the second decoder with the first loss, the second loss, and the third loss. After multiple rounds of iteration, obtain the feature transformation function, the attention mechanism layer, the impact degree matrix, and the traffic event cascading impact prediction module.

6. The traffic event cascade impact prediction method according to claim 5, wherein Perform encoding processing through the initial time series encoder to obtain a time series feature sequence, and the expression is as follows: ; Among them, represents a timing encoder, represents a sample feature conversion sequence, represents the initial event influence degree matrix; Input the time series feature sequence and the pre-sample verification feature sequence into the first decoder, and take the pre-sample verification feature sequence as the target to output the first reconstruction sequence. The expression is: ; Among them, is the first self-attention layer, is the first cross-attention layer; represents the feature sequence before sample verification; Update the initial event impact degree matrix by using the deviation between the first reconstruction sequence and the sample feature transformation sequence. The expression is: ; Input the time series feature sequence, the pre-sample verification feature sequence, and the updated initial event impact degree matrix into the second decoder, and take the pre-sample verification feature sequence as the target to output the second reconstruction sequence. The expression is: ; Among them, is the second self-attention layer, is the second cross-attention layer; The calculation formula of the first loss is: ; The calculation formula of the second loss is: ; The calculation formula of the third loss is: ; Among them, represents the predicted value of the affected time period under the traffic event, represents the actual time period affected under the traffic event; represents the predicted value of the affected location under the traffic event, represents the actual road section affected under the traffic event; The calculation formula of the combined loss is: ; Among them, and are weights.

7. The traffic event cascade impact prediction method according to claim 6, wherein Distinguish the pre-sample verification feature sequence and the post-sample verification feature sequence from the second fusion feature as the feature transformation sequence, introduce the event impact degree matrix to quantify the impact degree of traffic events on different regions. The calculation formula is: ; Among them, ⊙ represents element-wise multiplication, represents the sample feature conversion sequence, and I represents the event influence degree matrix.

8. A traffic event cascading impact prediction device, comprising a processor, a memory, and computer programs / instructions stored on the memory, characterized in that The processor is used to execute the computer program / instructions. When the computer program / instructions are executed, the device implements the steps of the method according to any one of claims 1 to 7.

9. A computer-readable storage medium having computer programs / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Time-space correlation traffic flow prediction method based on deep learning

    CN119274345A

  • Road traffic signal lamp management system based on big data

    CN119694146A