Traffic event cascade influence prediction method and device and storage medium

Through the fusion of space-time multi-grain size graph modeling and multi-grain size feature, the space-time correlation characteristics of traffic flow are extracted using the attention mechanism layer, which solves the problems of insufficient directional constraint modeling, high computational complexity and insufficient capture of space-time diffusion characteristics in the existing technology, and achieves higher accuracy traffic event impact prediction.

CN120031208AActive Publication Date: 2025-05-23HIGHWAY MONITORING & RESPONSE CENT MINIST OF TRANSPORT OF THE P R C

Patent Information

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

AI Technical Summary

Technical Problem

The existing traffic event impact prediction methods have shortcomings in directional constraint modeling, computational complexity and spatiotemporal diffusion characteristics capture, resulting in low error characterization and prediction accuracy of traffic flow propagation paths.

Method used

The multi-grained graph modeling of space-time is used to fuse static topological features and dynamic timing features through feature transformation functions, and the local characteristics of the sensor nodes are mapped to the road node using the multi-grained feature fusion and attention mechanism layer, and global fusion and reverse mapping are performed to extract spatial correlation features.

Benefits of technology

It improves the prediction accuracy of the impact range of traffic events, reduces the computational complexity, and can more accurately capture the spatial and temporal diffusion characteristics of traffic flow.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120031208A_ABST
    Figure CN120031208A_ABST
Patent Text Reader

Abstract

The invention provides a traffic incident cascade influence prediction method and device, and a storage medium, and the method comprises the steps: introducing a plurality of granularities in time and space through a space-time multi-granularity graph, carrying out the modeling of a road network, and marking the monitoring direction of a sensor and the relation between roads, so as to achieve the directional constraint and long-range association. And distinguishing and dividing the observation time window into data differences before and after event verification and before and after the occurrence of the concerned event. Data are represented hierarchically and fused, and space-time multi-granularity fusion is performed through an attention mechanism layer, so that the expression ability of the model is enhanced, and the calculation complexity is reduced. And finally, distinguishing the feature sequence before verification and the feature sequence after verification for the data, introducing an event influence degree matrix to quantify the influence degree of the traffic event on different regions, and inputting the influence degree into a traffic event cascade influence prediction module to output the node position and time period of the influenced road 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 in particular to a method, device and storage medium for predicting the cascading impact of traffic events. Background Art

[0002] With the acceleration of urbanization and the continuous growth of traffic demand, urban transportation systems are becoming increasingly complex, and traffic abnormalities (such as traffic accidents, road construction, large-scale events, etc.) occur frequently. Such events will not only cause sudden changes in local traffic conditions, but also spread through the road network to produce cascading effects, causing serious impacts on the efficiency and safety of road network operations. Therefore, accurately predicting the spatiotemporal impact range and duration of traffic events is a core requirement for formulating emergency management strategies and alleviating traffic congestion.

[0003] However, existing technologies still have many shortcomings in predicting the impact of traffic events. First, 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 actual traffic scenarios. For example, in a highway scenario, even if the sensors monitoring different directions are geographically adjacent, the actual traffic flow correlation is extremely low due to the prohibition of U-turns or lane change restrictions. In addition, although the sensors near the intersection are geographically close, vehicles need 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 the incorrect representation of the traffic flow propagation path, thereby affecting the prediction accuracy of the event impact range.

[0004] Secondly, mainstream methods use global attention mechanisms (such as Transformer) to model node associations, and their computational complexity is as high as O(|S|³), where |S| is the number of sensors. In scenarios where large-scale road networks are deployed based on city-level sensors, the real-time and resource consumption issues of model training and reasoning are prominent, making it difficult to meet actual application requirements.

[0005] In addition, existing studies are singular in temporal modeling, overly relying on short-term time data (such as minute-level fluctuations) and ignoring the periodicity of traffic conditions (such as morning and evening peaks) and long-term trends. Some studies use a fixed radius or K nearest neighbors to define the impact range for coarse-grained spatial modeling, but they cannot adapt to the nonlinear diffusion characteristics of traffic flow propagation (such as congestion ripple effects), resulting in the failure of predictions in remote associated areas. The impact of traffic events has significant spatiotemporal diffusion characteristics, and its impact range changes dynamically over time. Therefore, it is urgent to propose a new traffic event impact prediction method that can overcome the above problems in order to improve the scientificity and effectiveness of traffic emergency management. Summary of the invention

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

[0007] One aspect of the present invention provides a method for predicting the cascading impact of traffic events, the method comprising the following steps: Based on spatiotemporal multi-granularity graph modeling, the static topological features and dynamic time series features of the traffic network to be analyzed are obtained and organized into a hierarchical representation and fused through a feature transformation function to obtain a first fusion feature; wherein, the spatiotemporal multi-granularity graph divides the time granularity into short-term, medium-term and long-term, and divides the spatial granularity 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; the monitoring direction of the sensor node in the road is marked, and the connection relationship of each road segment is marked as the topological structure information; the dynamic time series 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 and after verification according to the event verification time; Based on multi-granularity feature fusion, the first fused feature is input into a pre-trained attention mechanism layer to perform hierarchical feature conversion to obtain a second fused feature, so as to map the local characteristics of the sensor node to the road node, and then globally fuse the characteristics between the road nodes and then reversely map them to the local characteristics of the sensor node; The second fusion feature is distinguished between a feature sequence before verification and a feature sequence after verification as a feature conversion sequence, an event impact degree matrix is ​​introduced to quantify the impact degree of a traffic event on different areas, and then input into a pre-trained traffic event cascade impact prediction module to output the road node locations and time periods affected by the traffic event; wherein the traffic event cascade impact pre-training includes a weighted fusion layer and a SUMPool layer.

[0008] In some embodiments, the time granularity includes minute level, hour level and day level; in the spatiotemporal multi-granularity graph, the local spatial granularity is the relationship between sensors and roads, the regional spatial granularity is the relationship between roads, and the global spatial granularity is the relationship of the entire road network; Build a traffic network diagram ,in, is the sensor node set, is the road node set, Indicates the number of sensors, represents the number of road nodes, and E is the set of connecting edges; An adjacency matrix is ​​constructed to mark the monitoring direction of the sensor node on the road. The adjacency matrix expression is: ; in, , ; The relationship between the roads is divided into four categories, including the first-level connection between different sections of the same road, the second-level connection between two roads with a physical intersection, the third-level connection between two roads connected by a third road, and the fourth-level connection that is guaranteed to be reachable in the road network; Construct a global adjacency matrix to mark the road association relationship, the expression is: .

[0009] In some embodiments, the dynamic timing characteristics are expressed as ; in, , To update sensor-road connection relationships based on real-time sensor node data, In order to adjust the connection strength between roads according to the traffic flow status, The impact of road conditions on sensor observations; The static topological characteristics and dynamic temporal characteristics of the traffic network to be analyzed are organized into a hierarchical representation, expressed as follows: ; ; Wherein, H is the sensor node observation value and the road node attribute information; The first fusion feature is obtained by fusion of feature transformation function, and the expression is: ; in, are the corresponding feature transformation functions, Represents the feature fusion operation.

[0010] In some embodiments, the first fused feature is input into a pre-trained attention mechanism layer to perform hierarchical feature conversion to obtain a second fused feature based on multi-granularity feature fusion, including: For each time point t, the global potential feature tensor of the road node is constructed ,in, Indicates the number of road nodes, represents the length of the observation time window, Represents feature dimension; For the sensor node, construct a feature representation ,in, Indicates the number of input channels of the sensor; Calculate the attention weight from the sensor node to the road node, and the calculation formula is: ; in, 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, It is the feature embedding representation of road nodes; is the attention head dimension; Ensure attention weights for the softmax activation function, and the sum of the weights is 1; is the adjacency matrix; ⊙ represents element-by-element multiplication; Then the expression for mapping the local characteristics of the sensor node to the road node is: ; in, is the linear transformation layer parameter used to adjust the feature dimension. is the value projection matrix; The characteristics between the road nodes are globally fused and then reversely mapped to the local characteristics of the sensor nodes to obtain the second fusion feature, including: The multi-head attention weights between the road nodes are calculated as: ; in, represents the road-to-road query projection matrix (i.e. the global fused query projection matrix), is the road-to-road key-value projection matrix (i.e. the global fused key-value projection matrix), represents the global adjacency matrix; ⊙ represents element-by-element multiplication; Calculate the fusion features between the road nodes, the expression is: ; in, , is the linear transformation layer parameter used to adjust the feature dimension. is the value projection matrix; Calculate the reverse attention weight, the calculation formula is: ; in, Represented as the query projection matrix from road to sensor (i.e., the reverse-mapped query projection matrix), It is represented as a key-value projection matrix from road to sensor (i.e., the key-value projection matrix of the reverse mapping).

[0011] The second fusion feature is calculated as follows: ; in, , is the linear transformation layer parameter used to adjust the feature dimension, is the value projection matrix.

[0012] In some embodiments, the pre-training steps of the feature transformation function, the attention mechanism layer, the impact degree matrix, and the traffic event cascade impact prediction module include: Obtain a training sample set, including a plurality of samples, each sample including a set of sample traffic network data based on the spatiotemporal multi-granularity graph under a specified traffic event; the sample traffic network data includes sample static topological features and sample dynamic time series features; the sample also marks the real position and real time period of the road node affected by the traffic event as a label; Organizing the sample static topological features and the sample dynamic time series features in the sample into a hierarchical representation and fusing them through an initial feature transformation function to obtain a first sample fusion feature; Based on multi-granularity feature fusion, the first sample fusion feature is input into the initial attention mechanism layer to perform hierarchical feature conversion to obtain a second sample fusion feature; The second sample fusion feature distinguishes the feature sequence before sample verification and the feature sequence after sample verification as the sample feature conversion sequence, introduces an all-zero initial event impact degree matrix to quantify the impact degree of traffic events on different areas, and then inputs the initial traffic event cascade impact prediction module on the one hand, outputs the predicted position and predicted time period of the road nodes affected by the traffic event; on the other hand, it is encoded by the initial time series encoder to obtain a time series feature sequence; the time series feature sequence and the feature sequence before sample verification are input into the first decoder to output a first reconstruction sequence with the feature sequence before sample verification as the target, and the deviation between the first reconstruction sequence and the sample feature conversion sequence is used to update the initial event impact degree matrix; the time series feature sequence, the feature sequence before sample verification and the updated initial event impact degree matrix are input into the second decoder to output a second reconstruction sequence with the feature sequence before sample verification as the target; The first decoder is used as a discriminator and the second decoder is used as a generator for adversarial training. The discriminator iterates and updates the initial event impact degree matrix by minimizing the reconstruction error, and the generator generates traffic state features consistent with the real abnormal distribution by maximizing the reconstruction error; the first loss is constructed by the deviation between the first reconstruction sequence and the feature sequence before sample verification; the second loss is constructed by the deviation between the second reconstruction sequence and the feature sequence before sample verification; the third loss is constructed by the deviation between the real position and the predicted position in the label and the deviation between the real time period and the predicted time period; the first loss, the second loss and the third loss are combined to update the parameters of the initial feature transformation function, the initial attention mechanism layer, the initial traffic event cascade impact prediction module, the initial event impact degree matrix, the initial time series encoder, the first decoder and the second decoder, and the feature transformation function, the attention mechanism layer, the impact degree matrix and the traffic event cascade impact prediction module are obtained after multiple rounds of iterations.

[0013] In some embodiments, the temporal feature sequence is obtained by encoding by the initial temporal encoder, and the expression is: ; in, represents the timing encoder, represents the sample feature transformation sequence, A matrix representing the impact degree of the initial event; The time series feature sequence and the feature sequence before sample verification are input into the first decoder, and the first reconstruction sequence is outputted with the feature sequence before sample verification as the target, and the expression is: ; in, is the first self-attention layer, is the first cross attention layer; Represents the characteristic sequence of the sample before verification; The initial event influence degree matrix is ​​updated using the deviation between the first reconstruction sequence and the sample feature conversion sequence, and the expression is: ; The time series feature sequence, the feature sequence before sample verification and the updated initial event influence degree matrix are input into the second decoder to output the second reconstructed sequence with the feature sequence before sample verification as the target, and the expression is: ; in, 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: ; in, represents the predicted value of the affected period under the traffic event, Indicates the actual time period affected by the traffic incident; represents the predicted value of the affected location under the traffic incident, Indicates the actual road section affected by the traffic incident; The formula for calculating the joint loss is: ; in, and is the weight.

[0014] In some embodiments, the second fusion feature is distinguished into a feature sequence before verification and a feature sequence after verification as a feature conversion sequence, and an event impact degree matrix is ​​introduced to quantify the impact degree of traffic events on different areas. The calculation formula is: ; Among them, ⊙ represents element-by-element multiplication, represents the sample feature conversion sequence, and I represents the event impact degree matrix.

[0015] On the other hand, the present invention also provides a traffic event cascade impact prediction device, comprising a processor, a memory, and a computer program / instructions stored in the memory, wherein 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.

[0016] On the other hand, the present invention further provides a computer-readable storage medium having a computer program / instruction stored thereon, which implements the steps of the above method when the computer program / instruction is executed by a processor.

[0017] On the other hand, the present invention also provides a computer program product, comprising a computer program / instruction, which implements the steps of the above method when the computer program / instruction is executed by a processor.

[0018] The beneficial effects of the present invention are at least: The traffic event cascade impact prediction method, device and storage medium of the present invention use a spatiotemporal multi-granularity graph to introduce multiple granularities in time and space to model the road network, mark the sensor monitoring direction and the relationship between roads to achieve directional constraints and long-range association. The observation time window is divided into before and after event verification, and the data difference before and after the event is focused on. On the basis of hierarchical representation of data, fusion is performed based on feature transformation functions, and then the local characteristics of sensor nodes are mapped to road nodes through the attention mechanism layer. The characteristics between road nodes are globally fused and then reversely mapped to the local characteristics of sensor nodes to extract spatial correlation features, enhance the expression ability of the model, and reduce the computational complexity. Finally, the data is distinguished between 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 cascade impact prediction module to output the road node position and time period affected by the traffic event.

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

[0020] Furthermore, a temporal encoder and dual decoder architecture are introduced. The first decoder reconstructs the features before the event to be closer to the true value, and the second decoder generates a reasonable traffic state after the event. Parameters are updated based on adversarial training, and the event impact degree matrix is ​​updated.

[0021] Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention may be achieved and obtained by the structures specifically indicated in the specification and the accompanying drawings.

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

[0023] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of the present application, and do not constitute a limitation of the present invention. In the drawings: Figure 1 The figure is a flow chart of a method for predicting the cascading impact of traffic events according to an embodiment of the present invention.

[0024] Figure 2This is a logical schematic diagram of a method for predicting the cascading impact of traffic events based on a spatiotemporal multi-granularity graph network according to another embodiment of the present invention. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0026] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.

[0027] It should be emphasized that the term “include / comprises” 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.

[0028] With the acceleration of urbanization and the continuous growth of traffic demand, urban transportation systems have become highly complex. In this context, traffic abnormalities (such as traffic accidents, road construction, large-scale events, etc.) occur frequently. Such events not only cause sudden changes in local traffic conditions, but also spread through the road network to produce cascading effects, causing serious impacts on the efficiency and safety of road network operations. Therefore, accurately predicting the spatiotemporal impact range and duration of traffic events is a core requirement for formulating emergency management strategies and alleviating traffic congestion. However, existing methods have the following key problems in modeling and prediction: First, 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 actual traffic scenarios. For example, in highway scenarios, even if sensors monitoring different directions are geographically adjacent, the actual traffic flow correlation is extremely low due to the prohibition of U-turns or lane change restrictions. Although the sensors near the intersection are geographically close, vehicles need 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 the incorrect representation of the traffic flow propagation path, thereby affecting the prediction accuracy of the event impact range. Secondly, the mainstream method uses a global attention mechanism (such as Transformer) to model node associations, and its computational complexity is as high as O(|S|³) (|S| is the number of sensors). In large-scale road network scenarios (such as city-level sensor deployment), the real-time and resource consumption issues of model training and inference are prominent, making it difficult to meet actual application needs. In existing prediction models of traffic event impacts, existing research mainly relies too much on short-term time data (such as minute-level fluctuations) and ignores the periodicity of traffic status (such as morning and evening peaks) and long-term trends. Some studies use fixed radius or K nearest neighbors to define the impact range for coarse-grained spatial modeling, but they cannot adapt to the nonlinear diffusion characteristics of traffic flow propagation (such as congestion ripple effect), resulting in the failure of prediction of remote associated areas. The impact of traffic events has significant spatiotemporal diffusion characteristics, and its impact range changes dynamically over time.

[0029] In view of this, the present invention provides a method for predicting the cascading impact of traffic events, such as Figure 1 As shown, the method includes the following steps S101-S103: Step S101: Based on spatiotemporal multi-granularity graph modeling, static topological features and dynamic time series features of the traffic network to be analyzed are obtained and organized into a hierarchical representation and fused through a feature transformation function to obtain a first fusion feature; wherein, the spatiotemporal multi-granularity graph divides the time granularity into short-term, medium-term and long-term, and divides the spatial granularity 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; the monitoring direction of the sensor node in the road is marked, and the connection relationship of each road segment is marked as the topological structure information; the dynamic time series 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.

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

[0031] Step S103: distinguish the feature sequence before verification and the feature sequence after verification for the second fusion feature as a feature conversion sequence, introduce an event impact degree matrix to quantify the impact degree of the traffic event on different areas, and then input it into the pre-trained traffic event cascade impact prediction module to output the road node position and time period affected by the traffic event; wherein the traffic event cascade impact pre-training includes a weighted fusion layer and a SUMPool layer.

[0032] In step S101, in order to enhance the ability to dynamically evolve traffic status, the application divides the traffic status into three granularities: short-term, medium-term, and long-term in the spatiotemporal multi-granularity graph, corresponding to the minute level, hour level, and day level, respectively, to capture instantaneous fluctuations, periodic changes, and long-term trends. The local spatial granularity is the relationship between sensors and roads, the regional spatial granularity is the relationship between roads, and the global spatial granularity is the relationship of the entire road network. Modeling for microscopic, mesoscopic, and macroscopic characteristics can enhance the model's accurate description of the traffic flow propagation path.

[0033] Specifically, construct a traffic network diagram ,in, is the set of sensor nodes, is the road node set, Indicates the number of sensors, represents the number of road nodes, and E is the set of connecting edges.

[0034] Construct an adjacency matrix to mark the monitoring direction of the sensor nodes on the road. The adjacency matrix expression is: ; in, , .

[0035] The relationships between roads are divided into four categories, including the first-level connection between different sections of the same road, the second-level connection where two roads have a physical intersection, the third-level connection where two roads are connected by a third road, and the fourth-level connection that is guaranteed to be reachable in the road network.

[0036] Construct a global adjacency matrix to mark the road association relationship, the expression is: .

[0037] In some embodiments, the dynamic timing characteristics are expressed as .

[0038] in, , To update sensor-road connection relationships based on real-time sensor node data, In order to adjust the connection strength between roads according to the traffic flow status, The influence of road conditions on sensor observation.

[0039] The static topological characteristics and dynamic temporal characteristics of the traffic network to be analyzed are organized into a hierarchical representation, expressed as follows: ; ; Among them, H is the sensor node observation value and road node attribute information.

[0040] The first fusion feature is obtained by fusion of feature transformation function, and the expression is: ; in, are the corresponding feature transformation functions, Represents the feature fusion operation.

[0041] In step S102, a temporal and spatial attention mechanism is introduced to dynamically and interactively fuse the multi-level features fused in step S101 to extract the temporal and spatial correlation characteristics of the traffic flow.

[0042] In some embodiments, based on multi-granularity feature fusion, the first fused feature is input into the pre-trained attention mechanism layer to perform hierarchical feature conversion to obtain the second fused feature, including steps S1021-S1024: Step S1021: Construct a global potential feature tensor of a road node for each time point t ,in, Indicates the number of road nodes, represents the length of the observation time window, Represents the feature dimension.

[0043] For sensor nodes, construct feature representation ,in, Indicates the number of sensor input channels.

[0044] Step S1022: Calculate the attention weight from the sensor node to the road node, the calculation formula is: ; in, 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, It is the feature embedding representation of road nodes; is the attention head dimension; Ensure attention weights for the softmax activation function, and the sum of the weights is 1; is the adjacency matrix; ⊙ represents element-by-element multiplication.

[0045] The expression for mapping the local characteristics of sensor nodes to road nodes is: ; in, is the linear transformation layer parameter used to adjust the feature dimension. is the value projection matrix.

[0046] Step S1023: globally fusing the characteristics between the road nodes and then reversely mapping them to the local characteristics of the sensor nodes to obtain the second fusion feature, including: The multi-head attention weights between road nodes are calculated as: ; in, represents the road-to-road query projection matrix (i.e. the global fused query projection matrix), is the road-to-road key-value projection matrix (i.e. the global fused key-value projection matrix), represents the global adjacency matrix; ⊙ represents element-by-element multiplication.

[0047] Calculate the fusion features between road nodes, the expression is: ; in, , is the linear transformation layer parameter used to adjust the feature dimension. is the value projection matrix.

[0048] Step S1024: Calculate the reverse attention weight, the calculation formula is: ; in, Represented as the query projection matrix from road to sensor (i.e., the reverse-mapped query projection matrix), It is represented as a key-value projection matrix from road to sensor (i.e., the key-value projection matrix of the reverse mapping).

[0049] Calculate the second fusion feature, the calculation formula is: ; in, , is the linear transformation layer parameter used to adjust the feature dimension. is the value projection matrix.

[0050] In step S103, for the fused features, the event impact degree matrix is ​​introduced to quantify the impact, and the calculation formula is: ; Among them, ⊙ represents element-by-element multiplication, represents the sample feature conversion sequence, and I represents the event impact degree matrix.

[0051] The final feature representation is then extracted through an aggregation operation in the spatiotemporal dimension to comprehensively consider the changes in the temporal and spatial dimensions and ultimately accurately locate the area affected by the event: .

[0052] In some embodiments, the pre-training steps of the feature transformation function, the attention mechanism layer, the impact degree matrix, and the traffic event cascade impact prediction module include steps S201 to S205: Step S201: Obtain a training sample set, which includes multiple samples, each sample includes a set of sample traffic network data based on a spatiotemporal multi-granularity graph under a specified traffic event; the sample traffic network data includes sample static topological features and sample dynamic time series features; the sample also marks the real location and real time period of the road nodes affected by the traffic event as labels.

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

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

[0055] Step S204: the second sample fusion feature is distinguished as a feature sequence before sample verification and a feature sequence after sample verification as a sample feature conversion sequence, and an initial event impact degree matrix of all zeros is introduced to quantify the impact degree of traffic events on different areas. On the one hand, the initial traffic event cascade impact prediction module is input to output the predicted position and predicted time period of the road nodes affected by the traffic event; on the other hand, the time series feature sequence is obtained by encoding and processing by the initial time series encoder; the time series feature sequence and the feature sequence before sample verification are input to the first decoder to output a first reconstructed sequence with the feature sequence before sample verification as the target, and the initial event impact degree matrix is ​​updated using the deviation between the first reconstructed sequence and the sample feature conversion sequence; the time series feature sequence, the feature sequence before sample verification and the updated initial event impact degree matrix are input to the second decoder to output a second reconstructed sequence with the feature sequence before sample verification as the target.

[0056] Step S205: adversarial training is performed using the first decoder as a discriminator and the second decoder as a generator, wherein the discriminator iterates and updates the initial event impact degree matrix by minimizing the reconstruction error, and the generator generates traffic state features consistent with the real anomaly distribution by maximizing the reconstruction error, forcing the discriminator to have difficulty in distinguishing the real anomaly from the generated anomaly; a first loss is constructed by the deviation between the first reconstructed sequence and the feature sequence before sample verification; a second loss is constructed by the deviation between the second reconstructed sequence and the feature sequence before sample verification; a third loss is constructed by the deviation between the real position and the predicted position in the label and the deviation between the real time period and the predicted time period; the first loss, the second loss and the third loss are combined to update the parameters of the initial feature transformation function, the initial attention mechanism layer, the initial traffic event cascade impact prediction module, the initial event impact degree matrix, the initial time series encoder, the first decoder and the second decoder, and after multiple rounds of iterations, the feature transformation function, the attention mechanism layer, the impact degree matrix and the traffic event cascade impact prediction module are obtained.

[0057] In step S204, the temporal feature sequence is obtained by encoding with the initial temporal encoder, and the expression is: ; in, represents the timing encoder, represents the sample feature transformation sequence, Represents the impact matrix of the initial event; In step S204, the time series feature sequence and the feature sequence before sample verification are input into the first decoder, and the first reconstructed sequence is output with the feature sequence before sample verification as the target, and the expression is: ; in, is the first self-attention layer, is the first cross attention layer; Represents the feature sequence before sample verification.

[0058] In step S204, the initial event influence degree matrix is ​​updated using the deviation between the first reconstruction sequence and the sample feature conversion sequence, and the expression is: ; In step S204, the time series feature sequence, the feature sequence before sample verification and the updated initial event influence degree matrix are input into the second decoder to output the second reconstructed sequence with the feature sequence before sample verification as the target, and the expression is: ; in, is the second self-attention layer, is the second cross attention layer.

[0059] In step S205, the calculation formula of the first loss is: ; The calculation formula for the second loss is: ; The calculation formula for the third loss is: ; in, represents the predicted value of the affected period under the traffic event, Indicates the actual time period affected by the traffic incident; represents the predicted value of the affected location under the traffic incident, Indicates the actual road section affected by the traffic incident; The formula for calculating the joint loss is: ; in, and is the weight.

[0060] On the other hand, the present invention also provides a traffic event cascade impact prediction device, comprising a processor, a memory, and a computer program / instructions stored in the memory, wherein 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.

[0061] On the other hand, the present invention further provides a computer-readable storage medium having a computer program / instruction stored thereon, which implements the steps of the above method when the computer program / instruction is executed by a processor.

[0062] On the other hand, the present invention also provides a computer program product, comprising a computer program / instruction, which implements the steps of the above method when the computer program / instruction is executed by a processor.

[0063] The present invention is described below in conjunction with a specific embodiment: like Figure 2 As shown, this embodiment proposes a method for predicting the cascading impact of traffic events based on a spatiotemporal multi-granularity graph network, decoupling the traffic network into a multi-level modeling of time granularity and space granularity, and combining a dynamic adversarial optimization mechanism to achieve accurate prediction of the cascading impact of traffic events. The method includes the following technical solutions: Step S1: Spatiotemporal multi-granularity graph modeling Dividing the traffic network into a multi-level structure of time and space provides a basis for subsequent feature extraction and event prediction, which includes the following sub-steps: Sub-step S11: Time granularity division In order to solve the problem of single modeling of time characteristics in traditional methods and enhance the model's ability to describe the dynamic evolution of traffic status, this embodiment divides the traffic status into three granularities: short-term, medium-term, and long-term, respectively capturing instantaneous fluctuations, periodic changes, and long-term trends. Specifically divided into short-term granularity (minute level), traffic flow fluctuations at this granularity are usually manifested as sudden events, such as traffic accidents, sudden congestion, etc., providing instant feedback for dynamic prediction models. Medium-term granularity (hour level), this granularity is mainly used to model periodic changes in traffic status (such as morning and evening rush hours), providing periodic change trends for prediction models. Long-term granularity (day level) is used to describe the long-term changes in traffic flow caused by long-term events (such as construction duration, holidays, etc.).

[0064] Sub-step S12: Spatial granularity division In order to solve the problem that traditional methods ignore directional constraints and long-range correlations and enhance the model's accurate description of traffic flow propagation paths, this embodiment divides the traffic network into three granularities: local (sensor-road), regional (road-road), and global (road network level), and models micro, meso, and macro characteristics respectively.

[0065] (1) Local granularity division (sensor-road) At the local level, this embodiment focuses on the direct relationship between the sensor and the road segment it covers. Each sensor node only establishes a connection with the road segment it directly covers, which can be refined to a specific monitoring point to ensure that the monitoring data of each sensor node accurately reflects the traffic conditions in the area it covers. To this end, the traffic network is represented as a graph ,in, is the set of sensor nodes, is the road node set, Indicates the number of sensors, represents the number of road nodes, and E is the set of connected edges. Then, each sensor node is labeled with its monitoring direction, and an adjacency matrix is ​​constructed based on the geographic location information. , the expression is: ; in, , .

[0066] (2) Regional granularity division (road-road) 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: (3) Global granularity division (road network level) At the global level, we focus on the characteristics and long-range connections of the entire transportation network, and Representation, and based on this, the global adjacency matrix is ​​constructed Characterize the road association relationship at different levels. The calculation formula is as follows: .

[0067] Sub-step S13: Dynamic graph timing construction Considering the dynamic impact characteristics of traffic events, this embodiment introduces time granularity on the basis of the static road network structure to construct a dynamic graph representation. First, the observation time window T is divided into (observation data before the event) and after verification (The impact data after the event). Among them, Verify the time for the event, To verify the previous time window length parameter, To verify the time window length parameters, they can be dynamically adjusted according to the actual application scenario to balance the real-time and accuracy of the prediction.

[0068] Then, for any timestamp , construct a time-varying dynamic graph sequence ,in , To update sensor-road connections based on real-time sensor data, Adjust the connection strength between roads according to the traffic flow status, Reflects the impact of road conditions on sensor observations.

[0069] Sub-step S14: Graph feature fusion In order to provide an input basis for the subsequent multi-granularity feature fusion step S2, this embodiment organizes the static topological features and dynamic temporal features into a hierarchical representation , to generate a unified feature representation. Represents a dynamic graph sequence, reflecting the time-varying traffic status, Represents a static adjacency matrix, containing topological structure information, is a node feature set that integrates sensor observations and road attribute information. The fused feature representation can be expressed as: ; in, are the corresponding feature transformation functions, Represents the feature fusion operation.

[0070] Step S2: Multi-granularity feature fusion Based on the construction of spatiotemporal multi-granularity graphs, this embodiment designs a multi-granularity feature fusion method, which realizes the dynamic interaction and fusion of multi-level features through the temporal and spatial attention mechanism, thereby extracting the spatiotemporal correlation characteristics of traffic flow. Specifically, it includes the following sub-steps: Sub-step S21: Hierarchical feature representation initialization Considering that roads play a key role in connecting and transmitting traffic flows in the transportation network, we first construct a global potential feature tensor of road nodes for each time point t. ,in, Indicates 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 status information, providing a basic representation for subsequent feature conversion. For sensor nodes, construct feature representation , focusing on the temporal evolution characteristics of the measured values, where Enter the channel number for the sensor.

[0071] Sub-step S22: Mapping of local node characteristics to road characteristics In order to solve the problem of separation between sensor data and road characteristics and achieve accurate aggregation at the micro level, this embodiment maps the dynamic observation characteristics of the sensor to the road nodes based on the attention mechanism. First, according to the local traffic node mapping relationship constructed in step S1, the monitoring range and directionality of the sensor are considered to ensure the accuracy of feature transfer. The sensor-to-road attention weight is calculated as follows: ; in, 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, It is the feature embedding representation of road nodes; is the attention head dimension; Ensure attention weights for the softmax activation function, and the sum of the weights is 1; is the sensor-road adjacency mask matrix, which inherits the connection relationship from step S1, and ⊙ represents element-by-element multiplication.

[0072] Then, the feature representation of the road node is updated based on the calculated attention weight: ; in, is the linear transformation layer parameter used to adjust the feature dimension. is the projection matrix, and this update process achieves feature aggregation from sensors to roads.

[0073] Sub-step S23: Fusion of characteristics between roads In order to solve the problem of insufficient modeling of meso- and macro-level characteristics in traditional methods and enhance the model's ability to globally characterize traffic flow propagation paths, this embodiment fuses multi-level road association characteristics through a multi-head attention mechanism to further capture the global propagation characteristics of traffic flow and dynamically fuse the multi-level connection relationships of road segments: ; ; Then calculate the multi-head attention weights and perform road feature fusion: ; in, represents the road-to-road query projection matrix (i.e. the global fused query projection matrix), is the road-to-road key-value projection matrix (i.e. the global fused key-value projection matrix), represents the global adjacency matrix; ⊙ represents element-by-element multiplication.

[0074] Calculate the fusion features between road nodes, the expression is: ; in, , is the linear transformation layer parameter used to adjust the feature dimension. is the value projection matrix.

[0075] Sub-step S24: Reverse mapping from road characteristics to local node characteristics In order to allow traffic nodes to perceive the dynamic characteristics of surrounding roads and enhance the model's ability to capture long-range associations, the present invention reversely maps road characteristics to traffic node characteristics to form a closed-loop feature interaction. The reverse mapping process needs to consider the sensor's observation range limitations and the impact of the road topology on the sensor, and sensors in different directions should ensure independence. The reverse attention weight and the final sensor feature update calculation formula are as follows: ; in, Represented as the query projection matrix from road to sensor (i.e., the reverse-mapped query projection matrix), It is represented as a key-value projection matrix from road to sensor (i.e., the key-value projection matrix of the reverse mapping).

[0076] Calculate the second fusion feature, the calculation formula is: ; in, , is the linear transformation layer parameter used to adjust the feature dimension. is the value projection matrix.

[0077] Step S3: Event impact range positioning based on dynamic weights This embodiment uses a dynamic weight allocation method to identify key areas affected by the event using changes in traffic characteristics. The 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 positioning of the event impact range. Specifically, it includes the following sub-steps: Sub-step S31: Detection of characteristic changes in the event-affected area In order to accurately capture the impact of traffic events on traffic status, it is necessary to detect changes in traffic characteristics before and after the event, so as to provide a basis for subsequent dynamic weight allocation. First, the input feature sequence is processed by time series encoding, and combined with the time window definition in step S1, the output from the spatial feature converter, that is, the feature sequence before verification, is converted into And the verified feature sequence Convert the time series features into , in order to extract effective time-varying features. And in order to quantify the impact of events on different regions, an event impact matrix with all zeros is initialized to record the impact changes of each node before and after the event, and then a complete time series feature set is formed through feature concatenation: ; in, represents the timing encoder, which uses position encoding to maintain timing information. represents the sample feature transformation sequence, represents the initial event impact matrix, Represents a feature concatenation operation.

[0078] Sub-step S32: Dynamic weight allocation In order to solve the coarse-grained problem of traditional event impact range delineation, this embodiment dynamically assigns weights to each node based on the rate of change of node characteristics, reflecting the degree of impact of the node during the traffic incident. Nodes that are more affected by the incident receive higher weights, thereby ensuring accurate positioning of the event impact range. In order to efficiently learn and assign weights, the present invention adopts a dual decoder architecture, with decoder #1 as the discriminator and decoder #2 as the generator. The two jointly optimize the prediction of the event impact range through adversarial learning.

[0079] (1) Decoder #1: Feature reconstruction and event impact update The role of decoder #1 is to perform reconstruction tasks and continuously update the impact of events through reconstruction errors with the original input features. It uses self-attention layers and cross-attention layers to capture the dependencies and spatial correlations between time series data. The self-attention layer helps the model understand the dependencies between each time step within the time series, and the cross-attention layer helps the model capture the association between time and space features, so as to accurately judge the impact of events on different areas. Decoder 1 acts as a discriminator, inputting the feature sequence before the event and the feature sequence after the event. The goal is to reconstruct the features predicted before the event to make it closer to the real features before the event, and detect abnormal changes after the event to update the event impact matrix. It is responsible for distinguishing the traffic status before and after the event. The larger the reconstruction error, the more significant the impact of the event on the node. Its specific implementation is as follows: ; in, is the first self-attention layer, is the first cross-attention layer, used to capture temporal dependencies and spatial associations; Represents the feature sequence before sample verification. Updates the event impact based on the reconstruction error .

[0080] (2) Decoder #2: Secondary reconstruction based on the updated impact Decoder #2 further refines the prediction of the event impact range based on the updated information provided by decoder #1 through the generation process to ensure that the final event impact prediction is more accurate: ; in, is the second self-attention layer, is the second cross attention layer.

[0081] Sub-step S33: Dynamic event impact and propagation prediction In order to improve the accuracy of event impact prediction, this step is based on the idea of ​​generative adversarial network (GAN) for adversarial training. , the reconstruction loss of decoder #1 and the reconstruction loss of decoder #2 , design the joint loss function: ; in, Represent the true values ​​of impact duration and impact length, respectively. , is the corresponding predicted value, is the L1 norm, is the prediction loss weight, is the dynamically adjusted reconstruction loss weight. In the early stage of training, the larger The weights enable decoder #1 to learn to distinguish the feature differences before and after the event. The weight gradually increases, and decoder #2 is forced to generate more accurate event impact prediction values. The progressive training strategy ensures both the accuracy of the prediction and the stable convergence of the overall model. The entire adversarial training process is to first optimize decoder #1 so that it can accurately detect anomalies, and then optimize decoder #2 so that it can maximize the reconstruction error of decoder #1. In this way, in the early stage of training, decoder #1 will prioritize learning the normal mode, and 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 reconstruction errors.

[0082] Finally, based on the learned event impact prediction value, weighted fusion is used to ensure that the model can focus on the key areas affected by the event during prediction. The specific formula is as follows: ; Among them, ⊙ represents element-by-element multiplication, represents the sample feature conversion sequence, and I represents the event impact matrix. The final feature representation is then extracted through the aggregation operation of the time and space dimensions to comprehensively consider the changes in the time and space dimensions, and finally accurately locate the area affected by the event: .

[0083] The effects of this embodiment are as follows: (1) Through the spatiotemporal multi-granularity graph network, the traffic network is divided into a multi-level structure of time and space, overcoming the limitations of traditional methods in directional constraints 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 adversarial training strategy, the spatiotemporal diffusion pattern of 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, and has wide promotion value and practicality.

[0084] In summary, the traffic event cascade impact prediction method, device and storage medium of the present invention use spatiotemporal multi-granularity graphs to introduce multiple granularities in time and space to model the road network, mark the sensor monitoring direction and the relationship between roads to achieve directional constraints and long-range association. The observation time window is divided into before and after event verification, and the data difference before and after the event is focused on. On the basis of hierarchical representation of data, fusion is performed based on feature transformation functions, and then the local characteristics of sensor nodes are mapped to road nodes through the attention mechanism layer. The characteristics between road nodes are globally fused and then reversely mapped to the local characteristics of sensor nodes to extract spatial correlation features, enhance the expression ability of the model, and reduce the computational complexity. Finally, the data is distinguished between 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 cascade impact prediction module to output the location and time period of the road nodes affected by the traffic event.

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

[0086] Furthermore, a temporal encoder and dual decoder architecture are introduced. The first decoder reconstructs the features before the event to be closer to the true value, and the second decoder generates a reasonable traffic state after the event. Parameters are updated based on adversarial training, and the event impact degree matrix is ​​updated.

[0087] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond 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 function 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 on a transmission medium or a communication link via a data signal carried in a carrier.

[0088] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is 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, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.

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

[0090] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for predicting the cascading impact of traffic incidents, characterized in that: The method comprises the following steps: Based on spatiotemporal multi-granularity graph modeling, the static topological features and dynamic time series features of the traffic network to be analyzed are obtained and organized into a hierarchical representation and fused through a feature transformation function to obtain a first fusion feature; wherein, the spatiotemporal multi-granularity graph divides the time granularity into short-term, medium-term and long-term, and divides the spatial granularity 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; the monitoring direction of the sensor node in the road is marked, and the connection relationship of each road segment is marked as the topological structure information; the dynamic time series 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 and after verification according to the event verification time; Based on multi-granularity feature fusion, the first fused feature is input into a pre-trained attention mechanism layer to perform hierarchical feature conversion to obtain a second fused feature, so as to map the local characteristics of the sensor node to the road node, and then globally fuse the characteristics between the road nodes and then reversely map them to the local characteristics of the sensor node; The second fusion feature is distinguished between a feature sequence before verification and a feature sequence after verification as a feature conversion sequence, an event impact degree matrix is ​​introduced to quantify the impact degree of a traffic event on different areas, and then input into a pre-trained traffic event cascade impact prediction module to output the road node locations and time periods affected by the traffic event; wherein the traffic event cascade impact pre-training includes a weighted fusion layer and a SUMPool layer.

2. The method for predicting the cascading impact of traffic events according to claim 1, characterized in that: In the spatiotemporal multi-granularity graph, the time granularity includes minute level, hour level and day level; the local spatial granularity is the relationship between sensors and roads, the regional spatial granularity is the relationship between roads, and the global spatial granularity is the relationship of the entire road network; Build a traffic network diagram ,in, is the sensor node set, is the road node set, Indicates the number of sensors, represents the number of road nodes, and E is the set of connecting edges; An adjacency matrix is ​​constructed to mark the monitoring direction of the sensor node on the road. The adjacency matrix expression is: ; in, , ; The relationship between the roads is divided into four categories, including the first-level connection between different sections of the same road, the second-level connection between two roads with a physical intersection, the third-level connection between two roads connected by a third road, and the fourth-level connection that is guaranteed to be reachable in the road network; Construct a global adjacency matrix to mark the road association relationship, the expression is: 。 3. The method for predicting the cascading impact of traffic events according to claim 2, characterized in that: The dynamic timing characteristics are expressed as ; in, , To update sensor-road connection relationships based on real-time sensor node data, In order to adjust the connection strength between roads according to the traffic flow status, The impact of road conditions on sensor observations; The static topological characteristics and dynamic temporal characteristics of the traffic network to be analyzed are organized into a hierarchical representation, expressed as follows: ; ; Wherein, H is the sensor node observation value and the road node attribute information; The first fusion feature is obtained by fusion of feature transformation function, and the expression is: ; in, are the corresponding feature transformation functions, Represents the feature fusion operation.

4. The method for predicting the cascading impact of traffic events according to claim 3, characterized in that: Based on multi-granularity feature fusion, the first fused feature is input into the pre-trained attention mechanism layer to perform hierarchical feature conversion to obtain a second fused feature, including: For each time point t, the global potential feature tensor of the road node is constructed ,in, Indicates the number of road nodes, represents the length of the observation time window, Represents feature dimension; For the sensor node, construct a feature representation ,in, Indicates the number of input channels of the sensor; Calculate the attention weight from the sensor node to the road node, and the calculation formula is: ; in, is the query projection matrix from sensor to road, is the key-value projection matrix from sensor to road; is the feature embedding representation of the sensor, It is the feature embedding representation of road nodes; is the attention head dimension; Ensure attention weights for the softmax activation function, and the sum of the weights is 1; is the adjacency matrix; ⊙ represents element-by-element multiplication; Then the expression for mapping the local characteristics of the sensor node to the road node is: ; in, is the linear transformation layer parameter used to adjust the feature dimension. is the value projection matrix; The characteristics between the road nodes are globally fused and then reversely mapped to the local characteristics of the sensor nodes to obtain the second fusion feature, including: The multi-head attention weights between the road nodes are calculated as: ; in, is the road-to-road query projection matrix, is the road-to-road key-value projection matrix, represents the global adjacency matrix; ⊙ represents element-by-element multiplication; Calculate the fusion features between the road nodes, the expression is: ; in, , is the linear transformation layer parameter used to adjust the feature dimension. is the value projection matrix; Calculate the reverse attention weight, the calculation formula is: ; in, Represented as the query projection matrix from road to sensor, Represented as a key-value projection matrix from road to sensor; The second fusion feature is calculated as follows: ; in, , is the linear transformation layer parameter used to adjust the feature dimension. is the value projection matrix.

5. The method for predicting the cascading impact of traffic events 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 cascade impact prediction module include: Obtain a training sample set, including a plurality of samples, each sample including a set of sample traffic network data based on the spatiotemporal multi-granularity graph under a specified traffic event; the sample traffic network data includes sample static topological features and sample dynamic time series features; the sample also marks the real position and real time period of the road node affected by the traffic event as a label; Organizing the sample static topological features and the sample dynamic time series features in the sample into a hierarchical representation and fusing them through an initial feature transformation function to obtain a first sample fusion feature; Based on multi-granularity feature fusion, the first sample fusion feature is input into the initial attention mechanism layer to perform hierarchical feature conversion to obtain a second sample fusion feature; The second sample fusion feature distinguishes the feature sequence before sample verification and the feature sequence after sample verification as the sample feature conversion sequence, introduces an all-zero initial event impact degree matrix to quantify the impact degree of traffic events on different areas, and then inputs the initial traffic event cascade impact prediction module on the one hand, outputs the predicted position and predicted time period of the road nodes affected by the traffic event; on the other hand, it is encoded by the initial time series encoder to obtain a time series feature sequence; the time series feature sequence and the feature sequence before sample verification are input into the first decoder to output a first reconstruction sequence with the feature sequence before sample verification as the target, and the deviation between the first reconstruction sequence and the sample feature conversion sequence is used to update the initial event impact degree matrix; the time series feature sequence, the feature sequence before sample verification and the updated initial event impact degree matrix are input into the second decoder to output a second reconstruction sequence with the feature sequence before sample verification as the target; The first decoder is used as a discriminator and the second decoder is used as a generator for adversarial training. The discriminator iterates and updates the initial event impact degree matrix by minimizing the reconstruction error, and the generator generates traffic state features consistent with the real abnormal distribution by maximizing the reconstruction error; the first loss is constructed by the deviation between the first reconstruction sequence and the feature sequence before sample verification; the second loss is constructed by the deviation between the second reconstruction sequence and the feature sequence before sample verification; the third loss is constructed by the deviation between the real position and the predicted position in the label and the deviation between the real time period and the predicted time period; the first loss, the second loss and the third loss are combined to update the parameters of the initial feature transformation function, the initial attention mechanism layer, the initial traffic event cascade impact prediction module, the initial event impact degree matrix, the initial time series encoder, the first decoder and the second decoder, and the feature transformation function, the attention mechanism layer, the impact degree matrix and the traffic event cascade impact prediction module are obtained after multiple rounds of iterations.

6. The method for predicting the cascading impact of traffic events according to claim 5, characterized in that: After the initial time series encoder is used to encode the time series feature sequence, the expression is: ; in, represents the timing encoder, represents the sample feature transformation sequence, A matrix representing the impact degree of the initial event; The time series feature sequence and the feature sequence before sample verification are input into the first decoder, and the first reconstruction sequence is outputted with the feature sequence before sample verification as the target, and the expression is: ; in, is the first self-attention layer, is the first cross attention layer; Represents the characteristic sequence of the sample before verification; The initial event influence degree matrix is ​​updated using the deviation between the first reconstruction sequence and the sample feature conversion sequence, and the expression is: ; The time series feature sequence, the feature sequence before sample verification and the updated initial event influence degree matrix are input into the second decoder to output the second reconstructed sequence with the feature sequence before sample verification as the target, and the expression is: ; in, 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: ; in, represents the predicted value of the affected period under the traffic event, Indicates the actual time period affected by the traffic incident; represents the predicted value of the affected location under the traffic incident, Indicates the actual road section affected by the traffic incident; The formula for calculating the joint loss is: ; in, and is the weight.

7. The method for predicting the cascading impact of traffic events according to claim 6, characterized in that: The second fusion feature is distinguished as a feature conversion sequence before verification and a feature sequence after verification. The event impact degree matrix is ​​introduced to quantify the impact degree of traffic events on different areas. The calculation formula is: ; Among them, ⊙ represents element-by-element multiplication, represents the sample feature conversion sequence, and I represents the event impact degree matrix.

8. A traffic event cascade impact prediction device, comprising a processor, a memory, and a computer program / instruction stored in 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 a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method as claimed in 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 a 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

  • A computer-implemented method for forecasting traffic indicators in a road network

    WO2024068527A1

Cited By

  • Urban area dynamic representation learning method based on context representation learning

    CN120317401A

  • Electronic equipment and traffic data label generation method

    CN121350255A

  • Electronic device and traffic data tag generation method

    CN121350255B