Bidirectional traffic flow prediction method and system based on dynamic interaction graph convolution circulation network

Through the method of dynamic interactive graph convolution recurrent network, the problem of capturing the asymmetric interdependence characteristics of two-way traffic in traffic hubs is solved, and a higher precision two-way traffic flow prediction is achieved, supporting traffic management and resource allocation.

CN120340259APending Publication Date: 2025-07-18SUN YAT SEN UNIVERSITY SHENZHEN +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510720541.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

The prior art is difficult to accurately capture the asymmetric interdependence characteristics of bidirectional flow in traffic hubs, resulting in inaccurate prediction of bidirectional traffic flow and ineffective application in traffic scheduling and resource allocation.

Method used

Using a method based on a dynamic interactive graph convolution recurrent network, a two-way traffic flow prediction model is constructed through the time embedding layer, an interactive graph convolutional layer, a graph convolutional gated recurrent layer and a multi-scale output layer.

Benefits of technology

It significantly improves the accuracy of two-way traffic flow prediction, improves the matching degree between the prediction results and actual resource scheduling, and reduces the risk of resource waste and congestion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120340259A_ABST
    Figure CN120340259A_ABST
Patent Text Reader

Abstract

The invention discloses a two-way traffic flow prediction method and system based on a dynamic interaction graph convolution circulation network, and the method comprises the steps: carrying out the time feature embedding of a two-way traffic flow time sequence sample through a time embedding layer, and generating the incoming and outgoing flow feature data fusing the spatial and temporal features; bidirectional feature interaction fusion is carried out on the inlet and outlet flow feature data through an interaction graph convolution layer, and bidirectional flow dependence features are obtained; performing spatio-temporal feature extraction on the bidirectional flow dependence features through a graph convolution gating circulation layer to obtain multi-scale spatio-temporal features; performing feature fusion on the multi-scale spatial-temporal features based on hierarchical convolution and an attention mechanism through a multi-scale output layer to obtain spatial-temporal fusion features, and mapping the spatial-temporal fusion features into a bidirectional flow prediction result; and updating parameters of the dynamic interaction graph convolution circulation network according to the bidirectional traffic flow prediction result and the sample label to obtain a bidirectional traffic flow prediction model. The method improves the accuracy of two-way traffic flow prediction, and can be applied to the technical field of traffic flow prediction.
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 flow prediction, and in particular to a two-way traffic flow prediction method and system based on a dynamic interaction graph convolutional recurrent network. Background Art

[0002] With the acceleration of the urbanization process, problems such as traffic congestion, resource waste, and low efficiency in dealing with emergencies have become increasingly prominent. As the core nodes of the urban traffic network, transportation hubs undertake the connection and conversion functions of various transportation modes (highways, railways, aviation, etc.), and their operating efficiency is directly related to the overall performance of the urban traffic system. Traffic flow prediction for important transportation hubs has become an important means to optimize traffic management, improve travel efficiency, and ensure public safety. However, traditional traffic flow prediction methods often focus on the prediction and analysis of total traffic flow, making it difficult to comprehensively capture the complex two-way traffic flow interaction relationships and their dynamic evolution laws in transportation hubs, and thus unable to be applied to actual scenarios such as traffic scheduling and resource allocation.

[0003] The difficulties in two-way traffic flow prediction mainly stem from two aspects:

[0004] 1) The high spatio-temporal heterogeneity of traffic hub flow. In terms of time, the normal working day cycle (characterized by the morning and evening rush hours driven by commuting) and the heterogeneous tourist behavior result in a binary opposition between weekdays and holidays; spatially, there are completely different traffic flow patterns between different traffic stations. For example, office areas are mainly dominated by commuters, showing obvious morning and evening rush hour fluctuations, while commercial areas show irregular trends due to tourists. Such differentiated fluctuations at different stations present very different patterns.

[0005] 2) The asymmetric interdependence characteristics of two-way traffic flow, that is, the in-flow and out-flow. Specifically, the storage effect in transportation hubs generates the interdependent relationship between asymmetric in-flow and out-flow, which is a factor that cannot be considered in traditional total traffic flow prediction, increasing the difficulty of collaborative prediction for traffic in-flow and out-flow.

[0006] Classical statistical models such as ARIMA and machine learning methods such as linear regression and support vector regression provide partial solutions for traffic flow prediction. However, such methods are based on linear assumptions and stationarity premises, fundamentally limiting their ability to model long-term and short-term time characteristics in traffic flow. This limitation has led people to turn to research deep learning architectures that can learn complex spatio-temporal representations. In terms of time modeling, recurrent neural networks (RNNs) and their variants (LSTMs, GRUs) can effectively capture time characteristics in traffic flow; while convolutional neural networks (CNNs) and graph neural networks (GNNs) can effectively extract spatial characteristics in traffic flow. However, these single time models or spatial models cannot capture the complete spatio-temporal heterogeneity in traffic flow, resulting in inaccurate results for two-way traffic flow prediction.

[0007] Therefore, some hybrid spatio-temporal models have emerged. For example, in patents such as "A Traffic Flow Prediction Method Based on Transformer Spatio-Temporal Graph Convolutional Network" and "Traffic Flow Prediction System and Method Based on Adaptive Gated Spatio-Temporal Graph Convolutional Network", such hybrid architectures obtain higher accuracy than single models through parallel time convolution and spatial graph operations. However, some models adopt a static graph structure, that is, taking the physical topology of the road as the input, which cannot effectively represent the dynamically changing traffic road network. Therefore, the patent "A Traffic Flow Prediction Method Based on Multi-View Spatio-Temporal Graph Convolutional Network" explores the application of adaptive graph learning in traffic flow prediction. By learning trainable node embeddings to represent the dynamic spatial correlation between nodes, the adaptive graph learning method obtains better performance than methods based on static graph structures. However, these methods are still essentially predictions of the total traffic flow. When facing the two-way traffic flow prediction task at important traffic hubs, they cannot capture the asymmetric interdependent characteristics of the two-way traffic flow, which also affects the accuracy of two-way traffic flow prediction.

[0008] The above problems need to be solved urgently. Summary of the Invention

[0009] An object of the present invention is to solve at least to some extent one of the technical problems existing in the prior art.

[0010] To this end, an object of an embodiment of the present invention is to provide a two-way traffic flow prediction method based on a dynamic interaction graph convolutional recurrent network, which improves the accuracy of two-way traffic flow prediction.

[0011] Another object of an embodiment of the present invention is to provide a two-way traffic flow prediction system based on a dynamic interaction graph convolutional recurrent network.

[0012] In order to achieve the above technical objectives, the technical solutions adopted in the embodiments of the present invention include:

[0013] In the first aspect, an embodiment of the present invention provides a two-way traffic flow prediction method based on a dynamic interaction graph convolutional recurrent network, including the following steps:

[0014] Obtain initial traffic flow data, perform traffic flow statistics on the initial traffic flow data at a preset time interval to obtain two-way traffic flow time series samples and corresponding sample labels, and input the two-way traffic flow time series samples into a dynamic interaction graph convolutional recurrent network, where the dynamic interaction graph convolutional recurrent network includes a time embedding layer, an interaction graph convolutional layer, a graph convolutional gated recurrent layer, and a multi-scale output layer;

[0015] Performing time feature embedding on the two-way traffic flow time series samples through the time embedding layer to generate in-out flow feature data integrating spatio-temporal features;

[0016] Performing two-way feature interaction fusion on the in-out flow feature data through the interactive graph convolutional layer to obtain two-way flow dependence features;

[0017] Performing spatio-temporal feature extraction on the two-way flow dependence features through the graph convolutional gated recurrent layer to obtain multi-scale spatio-temporal features;

[0018] Performing feature fusion on the multi-scale spatio-temporal features through the multi-scale output layer based on hierarchical convolution and attention mechanism to obtain spatio-temporal fusion features, and mapping the spatio-temporal fusion features to corresponding two-way traffic flow prediction results;

[0019] Updating the parameters of the dynamic interactive graph convolutional recurrent network according to the two-way traffic flow prediction results and the sample labels to obtain a trained two-way traffic flow prediction model;

[0020] Obtaining real-time two-way traffic flow time series data, inputting the real-time two-way traffic flow time series data into the two-way traffic flow prediction model to obtain corresponding two-way traffic flow prediction data.

[0021] Further, in an embodiment of the present invention, the obtaining of the two-way traffic flow time series samples and corresponding sample labels by performing traffic flow statistics on the initial traffic flow data at preset time intervals specifically includes:

[0022] Aggregating the initial traffic flow data at the time interval and concatenating in the last dimension to obtain a two-way flow tensor;

[0023] Performing a sliding time window operation on the two-way flow tensor based on a time step to obtain two-way traffic flow data with multiple time steps;

[0024] Determining the two-way traffic flow time series samples and the sample labels according to the two-way traffic flow data;

[0025] Wherein, the sample label is the actual two-way traffic flow value corresponding to the two-way traffic flow time series sample after the prediction time step.

[0026] Further, in an embodiment of the present invention, the performing of time feature embedding on the two-way traffic flow time series samples to generate in-out flow feature data integrating spatio-temporal features specifically includes:

[0027] Performing daily cyclic encoding and weekly cyclic encoding on the time context of the two-way traffic flow time series samples in sequence to obtain time encoding information;

[0028] Fuse the time-coded information with the two-way traffic flow time series samples to obtain the in-out flow feature data.

[0029] Further, in an embodiment of the present invention, the two-way feature interaction fusion of the in-out flow feature data to obtain the two-way flow dependence feature specifically includes:

[0030] Divide the in-out flow feature data into in-flow feature data and out-flow feature data;

[0031] Input the in-flow feature data and the out-flow feature data into a graph convolutional neural network respectively to obtain a first in-flow feature and a first out-flow feature;

[0032] Fuse the first in-flow feature with the out-flow feature data to obtain a first fusion feature, and fuse the first out-flow feature with the in-flow feature data to obtain a second fusion feature;

[0033] Input the first fusion feature and the second fusion feature into the graph convolutional neural network respectively to obtain a second in-flow feature and a second out-flow feature;

[0034] Concatenate the second in-flow feature with the second fusion feature to obtain updated in-flow feature data, and concatenate the second out-flow feature with the first fusion feature to obtain updated out-flow feature data;

[0035] Obtain the two-way flow dependence feature according to the updated in-flow feature data and out-flow feature data;

[0036] Wherein, the graph convolutional neural network performs graph convolution operations on the input data by constructing a dynamic adjacency matrix.

[0037] Further, in an embodiment of the present invention, the update process of the graph convolutional gated recurrent layer is as follows:

[0038] z t =σ(IGCN(h t )+W z h t-1 +b z )

[0039] r t =σ(IGCN(h t )+W r h t-1 +b r )

[0040]

[0041] Wherein, rt Indicates the reset gate, z t Indicates the update gate, Indicates the candidate hidden state, h t Indicates the hidden state at the current time step, h t-1 Indicates the hidden state at the previous time step, σ represents the Sigmoid activation function, tanh represents the hyperbolic tangent activation function, ⊙ represents element-wise multiplication, IGCN(h t ) indicates performing an interactive graph convolution operation on h t and W z , W r and W h represent weight parameters, b z , b r and b h represent bias parameters.

[0042] Furthermore, in an embodiment of the present invention, the feature fusion of the multi-scale spatio-temporal features based on hierarchical convolution and attention mechanism to obtain spatio-temporal fusion features specifically includes:

[0043] Dividing the multi-scale spatio-temporal features into multiple sub-channel spatio-temporal features;

[0044] Performing convolution processing on each of the sub-channel spatio-temporal features to obtain multiple sub-channel feature maps;

[0045] Based on the attention mechanism, performing feature fusion on the sub-channel feature maps to obtain the spatio-temporal fusion features.

[0046] Furthermore, in an embodiment of the present invention, updating the parameters of the dynamic interactive graph convolutional recurrent network according to the bidirectional traffic flow prediction result and the sample label to obtain a trained bidirectional traffic flow prediction model, which specifically includes:

[0047] Taking the mean absolute error between the bidirectional traffic flow prediction result and the sample label as the loss value;

[0048] Updating the parameters of the dynamic interactive graph convolutional recurrent network according to the loss value, and returning to the step of inputting the bidirectional traffic flow time series sample into the dynamic interactive graph convolutional recurrent network until a preset convergence condition is reached, to obtain the trained bidirectional traffic flow prediction model.

[0049] Second, an embodiment of the present invention provides a bidirectional traffic flow prediction system based on a dynamic interactive graph convolutional recurrent network, including:

[0050] A sample generation module, configured to obtain initial traffic flow data, perform traffic flow statistics on the initial traffic flow data at a preset time interval to obtain two-way traffic flow time series samples and corresponding sample labels, and input the two-way traffic flow time series samples into a dynamic interactive graph convolutional recurrent network, where the dynamic interactive graph convolutional recurrent network includes a time embedding layer, an interactive graph convolutional layer, a graph convolutional gated recurrent layer, and a multi-scale output layer;

[0051] A time embedding module, configured to perform time feature embedding on the two-way traffic flow time series samples through the time embedding layer to generate in-out traffic feature data integrating spatio-temporal features;

[0052] An interactive graph convolutional module, configured to perform two-way feature interaction and fusion on the in-out traffic feature data through the interactive graph convolutional layer to obtain two-way traffic dependence features;

[0053] A graph convolutional gated recurrent module, configured to perform spatio-temporal feature extraction on the two-way traffic dependence features through the graph convolutional gated recurrent layer to obtain multi-scale spatio-temporal features;

[0054] A multi-scale output module, configured to perform feature fusion on the multi-scale spatio-temporal features based on hierarchical convolution and an attention mechanism through the multi-scale output layer to obtain spatio-temporal fusion features, and map the spatio-temporal fusion features to corresponding two-way traffic flow prediction results;

[0055] A parameter update module, configured to update the parameters of the dynamic interactive graph convolutional recurrent network according to the two-way traffic flow prediction results and the sample labels to obtain a trained two-way traffic flow prediction model;

[0056] A model prediction module, configured to obtain real-time two-way traffic flow time series data, input the real-time two-way traffic flow time series data into the two-way traffic flow prediction model to obtain corresponding two-way traffic flow prediction data.

[0057] In a third aspect, an embodiment of the present invention provides a two-way traffic flow prediction device based on a dynamic interactive graph convolutional recurrent network, including:

[0058] At least one processor;

[0059] At least one memory, configured to store at least one program;

[0060] When the at least one program is executed by the at least one processor, the at least one processor is caused to implement the above-mentioned two-way traffic flow prediction method based on a dynamic interactive graph convolutional recurrent network.

[0061] Fourthly, an embodiment of the present invention further provides a computer-readable storage medium, which stores a program executable by a processor. The program executable by the processor is used to execute the above-mentioned two-way traffic flow prediction method based on a dynamic interactive graph convolutional recurrent network when executed by the processor.

[0062] The advantages and beneficial effects of the present invention will be partially given in the following description, partially become obvious from the following description, or be understood through the practice of the present invention:

[0063] In the embodiment of the present invention, initial traffic flow data is obtained, traffic flow statistics are performed on the initial traffic flow data at a preset time interval to obtain two-way traffic flow time series samples and corresponding sample labels, and the two-way traffic flow time series samples are input into a dynamic interactive graph convolutional recurrent network. The time feature embedding is performed on the two-way traffic flow time series samples through a time embedding layer to generate in-out flow feature data integrating spatio-temporal features. The bidirectional feature interaction and fusion are performed on the in-out flow feature data through an interactive graph convolutional layer to obtain two-way flow dependence features. The spatio-temporal features are extracted from the two-way flow dependence features through a graph convolutional gated recurrent layer to obtain multi-scale spatio-temporal features. The feature fusion is performed on the multi-scale spatio-temporal features through a multi-scale output layer based on hierarchical convolution and an attention mechanism to obtain spatio-temporal fusion features, and the spatio-temporal fusion features are mapped to corresponding two-way traffic flow prediction results. The parameters of the dynamic interactive graph convolutional recurrent network are updated according to the two-way traffic flow prediction results and sample labels to obtain a trained two-way traffic flow prediction model. Real-time two-way traffic flow time series data is obtained and input into the two-way traffic flow prediction model to obtain corresponding two-way traffic flow prediction data. In the embodiment of the present invention, the gating mechanism is used to control the fusion weight of spatio-temporal features in the graph convolutional network, and time embedding is introduced to enhance the time series of the original data, so that the periodic law in the time dimension and the adjacency relationship in the space dimension can be optimized synergistically, significantly improving the efficiency and integrity of feature learning, effectively extracting spatio-temporal features. Through the bidirectional coupled interactive graph convolutional layer, the spatial features of each node can dynamically capture the spatial transformation information of the oncoming traffic flow, solving the problem that unidirectional prediction cannot coordinate the multimodal transport demand, significantly improving the matching degree between the prediction result and the actual resource scheduling, improving the accuracy of two-way traffic flow prediction, and reducing the risk of resource waste and congestion. Description of the Drawings

[0064] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following introduces the drawings required to be used in the embodiments of the present invention. It should be understood that the drawings introduced below only conveniently and clearly represent some embodiments of the technical solutions in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative efforts.

[0065] Figure 1 The flowchart of steps for a two-way traffic flow prediction method based on a dynamic interaction graph convolutional recurrent network provided by an embodiment of the present invention;

[0066] Figure 2 The structural schematic diagram of an interaction graph convolutional layer provided by an embodiment of the present invention;

[0067] Figure 3 The structural schematic diagram of a graph convolutional gated recurrent layer provided by an embodiment of the present invention;

[0068] Figure 4 The comparison schematic diagram between the predicted inflow volume result and the actual value provided by an embodiment of the present invention;

[0069] Figure 5 The comparison schematic diagram between the predicted outflow volume result and the actual value provided by an embodiment of the present invention;

[0070] Figure 6 The structural block diagram of a two-way traffic flow prediction system based on a dynamic interaction graph convolutional recurrent network provided by an embodiment of the present invention;

[0071] Figure 7 The structural block diagram of a two-way traffic flow prediction device based on a dynamic interaction graph convolutional recurrent network provided by an embodiment of the present invention. Detailed implementation manners

[0072] The embodiments of the present invention are described in detail below. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals represent the same or similar elements or elements with the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention and should not be construed as a limitation of the present invention. For the step numbers in the following embodiments, they are only set for the convenience of elaboration and explanation, and no limitation is imposed on the order between the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.

[0073] In the description of the present invention, the meaning of "a plurality" is two or more. If the first and second are described, it is only for the purpose of distinguishing technical features and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features or implicitly indicating the sequence of the indicated technical features. In addition, unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field of the present invention.

[0074] Regarding the problem of two-way traffic flow prediction for important transportation hubs, the existing technologies mainly focus on combining the time and space modules in deep learning for spatio-temporal feature extraction to predict the total flow of people or vehicles in the traffic network, which leads to two problems: 1) It is unable to capture the high spatio-temporal heterogeneity in transportation hubs; 2) It ignores the asymmetric interdependence characteristics of two-way traffic flows.

[0075] The present invention proposes an innovative deep learning framework, which realizes more accurate and universal traffic flow prediction by dynamically aligning spatio-temporal features, adaptively modeling spatial heterogeneity, and collaboratively capturing the asymmetry of two-way traffic flows. Specifically, the framework effectively captures the spatio-temporal heterogeneity in traffic flows through a spatio-temporal joint feature extraction module and a dynamic graph neural network; meanwhile, for the two-way traffic flow characteristics, a two-way coupling prediction mechanism is designed to explicitly model the asymmetric characteristics of two-way traffic flows, thereby improving the prediction accuracy, providing collaborative decision-making support for traffic management and services, finally constructing a high-precision two-way traffic flow prediction system, and promoting the efficient progress of tasks such as traffic scheduling and resource allocation for important transportation hubs.

[0076] Referring to Figure 1 , an embodiment of the present invention provides a two-way traffic flow prediction method based on a dynamic interaction graph convolutional recurrent network, specifically including the following steps:

[0077] S101. Obtain initial traffic flow data, perform flow statistics on the initial traffic flow data at a preset time interval to obtain two-way traffic flow time series samples and corresponding sample labels, and input the two-way traffic flow time series samples into the dynamic interaction graph convolutional recurrent network, where the dynamic interaction graph convolutional recurrent network includes a time embedding layer, an interaction graph convolutional layer, a graph convolutional gated recurrent layer, and a multi-scale output layer;

[0078] S102. Perform time feature embedding on the two-way traffic flow time series samples through the time embedding layer to generate in-out flow feature data integrating spatio-temporal features;

[0079] S103. Perform two-way feature interaction and fusion on the in-out flow feature data through the interaction graph convolutional layer to obtain two-way flow dependence features;

[0080] S104. Perform spatio-temporal feature extraction on the two-way flow dependence features through the graph convolutional gated recurrent layer to obtain multi-scale spatio-temporal features;

[0081] S105. Perform feature fusion on the multi-scale spatio-temporal features through the multi-scale output layer based on hierarchical convolution and attention mechanism to obtain spatio-temporal fusion features, and map the spatio-temporal fusion features to corresponding two-way traffic flow prediction results;

[0082] S106. Update the parameters of the dynamic interactive graph convolutional recurrent network according to the two-way traffic flow prediction results and the sample labels to obtain a trained two-way traffic flow prediction model;

[0083] S107. Obtain the real-time two-way traffic flow time series data, and input the real-time two-way traffic flow time series data into the two-way traffic flow prediction model to obtain the corresponding two-way traffic flow prediction data.

[0084] The two-way traffic flow prediction model of the embodiment of the present invention is obtained by training a dynamic interactive graph convolutional recurrent network (DIGCRN). The dynamic interactive graph convolutional recurrent network mainly includes four components, namely a time embedding layer (TE), an interactive graph convolutional layer (IGCN), a graph convolutional gated recurrent layer (GCGRU), and a multi-scale output layer (MO) for finally outputting the prediction results. The dynamic interactive graph convolutional recurrent network first adds corresponding time features to the processed traffic inflow and outflow data respectively for feature fusion, and then uses a self-supervised graph learning method to learn the corresponding dynamic graph structures from the inflow and outflow features respectively. Furthermore, a cross-flow interaction structure is used to update its own spatial feature map with the spatial feature map of the opposite flow to extract the mutual dependence of the two-way flow. In order to jointly extract spatio-temporal features, the interactively fused two-way flow spatial features are embedded into a gated recurrent unit to use different types of "gates" to update and forget node features. The recursive structure of the gated recurrent unit effectively extracts time features. Finally, a multi-scale convolution is used to output the final prediction results to ensure that robust prediction results can be obtained.

[0085] A complete process of the two-way traffic flow prediction method of the embodiment of the present invention is as follows:

[0086] 1) First, process the original traffic flow data, and divide it according to the corresponding time interval to form the inflow and outflow statistics at fixed times. Subsequently, divide the training set, validation set, and test set according to the corresponding ratio, and then form the original input of the dynamic interactive graph convolutional recurrent network by sliding the window according to the determined time step.

[0087] 2) According to the training set input obtained in step 1), perform time feature embedding according to the corresponding known prior time knowledge to form the inflow and outflow features including the corresponding periodic features.

[0088] 3) Input the inflow and outflow features into an adaptive graph convolutional network respectively to generate the corresponding dynamic graph structures, and then use an interactive graph convolutional structure to interactively fuse the two-way flow features to extract the mutual dependence between the two-way flows.

[0089] 4) Incorporate the interactive graph convolutional layer in step 3) into a gated recurrent unit to obtain a graph convolutional gated recurrent layer for jointly extracting spatio-temporal features, and then input the obtained result into a multi-scale output module to hierarchically aggregate features to output accurate prediction results.

[0090] 5) Determine the most effective prediction model based on the training results in step 4) and verify it on real traffic datasets of different transportation modes in two different regions to evaluate the effectiveness of the model. Finally, apply the model to the prediction of two-way traffic flow in real scenarios.

[0091] In the embodiment of the present invention, a gating mechanism is used to control the fusion weight of spatio-temporal features in the graph convolutional network, and time embedding is introduced to perform temporal enhancement on the original data, enabling the periodic law in the time dimension and the adjacency relationship in the space dimension to be optimized synergistically, significantly improving the efficiency and integrity of feature learning, effectively extracting spatio-temporal features. Through the bidirectional coupled interactive graph convolutional layer, the spatial features of each node can dynamically capture the spatial transformation information of the oncoming traffic, solving the problem that unidirectional prediction cannot coordinate the demand of multimodal transportation, significantly improving the matching degree between the prediction result and the actual resource scheduling, enhancing the accuracy of two-way traffic flow prediction, and reducing resource waste and congestion risk.

[0092] The following details the specific implementation process of the embodiment of the present invention with reference to the accompanying drawings.

[0093] Further as an optional implementation manner, traffic statistics are performed on the initial traffic flow data at a preset time interval to obtain two-way traffic flow time series samples and corresponding sample labels, which specifically include:

[0094] S1011. Aggregate the initial traffic flow data at the time interval and splice it in the last dimension to obtain a two-way flow tensor;

[0095] S1012. Perform a sliding time window operation on the two-way flow tensor based on the time step to obtain two-way traffic flow data with multiple time steps;

[0096] S1013. Determine two-way traffic flow time series samples and sample labels according to the two-way traffic flow data;

[0097] Among them, the sample label is the actual two-way traffic flow value corresponding to the two-way traffic flow time series sample after the prediction time step.

[0098] Specifically, the original traffic in-out flow data obtained from the sensor is aggregated at the corresponding time interval and then spliced in the last dimension to construct a two-way flow tensor:

[0099]

[0100] Among them, I t ∈R N and O t ∈R N respectively represent the inflow and outflow of N nodes at T historical time steps.

[0101] Perform a sliding time window according to the time step length to form the inflow and outflow data X ∈ R of multiple time step lengths L×T×N×2 , where L, T, N, and 2 respectively represent the total data length, the time step length of traffic inflow and outflow prediction, the number of nodes in the traffic network, and the corresponding values of the inflow and outflow.

[0102] Divide the training set, validation set, and test set according to a preset ratio. The training set, validation set, and test set all contain two-way traffic flow time series samples and corresponding sample labels.

[0103] Further as an optional implementation manner, perform time feature embedding on the two-way traffic flow time series samples to generate inflow and outflow feature data integrating spatio-temporal features, which specifically includes:

[0104] S1021. Perform daily cyclic encoding and weekly cyclic encoding on the time context of the two-way traffic flow time series samples in sequence to obtain time encoding information;

[0105] S1022. Integrate the time encoding information with the two-way traffic flow time series samples to obtain the inflow and outflow feature data.

[0106] Specifically, divide the input training set inflow and outflow data according to the batch size (the number of samples used in each iterative training). Each training length is the data of batch size, that is, the input data of X ∈ R B×T×N×2 of.

[0107] Encode the known time context and use learnable positional embeddings to enrich the original inflow-outflow tensor features. First, perform daily cyclic encoding, encoding according to the relative position of the current day's time node corresponding to the inflow and outflow data, that is Then perform weekly cyclic encoding, encoding according to the relative position of the date corresponding to the inflow and outflow data in the current week, that is Since the times at the corresponding positions of the inflow and outflow are exactly the same, the encoding methods of these two variables are also exactly the same.

[0108] Map the simple position encoding to a richer feature representation through learnable embeddings, that is:

[0109] H day = t day E day , H week = t week E week

[0110] Among them, E day and E week are used to encode the daily and weekly time semantics respectively.

[0111] Finally, the original traffic flow is fused with the time embedding to obtain the initial feature input. This is achieved by adding the time encoding information to the last dimension of the feature tensor, thereby providing rich time information for the input data, that is

[0112] H c =(W f X + b f ) || H day || H week

[0113] Among them, W f and b f represent the weight parameter and bias parameter of the time embedding layer respectively.

[0114] In some optional embodiments, the time embedding layer adopts a two-stream architecture to process the inflow and outflow respectively:

[0115]

[0116] Among them and are the time embedding matrices independent for the inflow and outflow respectively.

[0117] Furthermore, as an optional implementation manner, two-way feature interaction fusion is performed on the inflow and outflow feature data to obtain two-way traffic-dependent features, which specifically include:

[0118] S1031. Divide the inflow and outflow feature data into inflow feature data and outflow feature data;

[0119] S1032. Input the inflow feature data and the outflow feature data into the graph convolutional neural network respectively to obtain the first inflow feature and the first outflow feature;

[0120] S1033. Fuse the first inflow feature with the outflow feature data to obtain the first fusion feature, and fuse the first outflow feature with the inflow feature data to obtain the second fusion feature;

[0121] S1034. Input the first fusion feature and the second fusion feature into the graph convolutional neural network respectively to obtain the second inflow feature and the second outflow feature;

[0122] S1035. Concatenate the second inflow feature with the second fusion feature to obtain the updated inflow feature data, and concatenate the second outflow feature with the first fusion feature to obtain the updated outflow feature data;

[0123] S1036. Obtain the two-way traffic dependence feature based on the updated inflow feature data and outflow feature data;

[0124] Among them, the graph convolutional neural network performs graph convolution operations on the input data by constructing a dynamic adjacency matrix.

[0125] Specifically, the inflow and outflow feature data obtained in the foregoing steps pass through a simple linear neural network layer to obtain the inflow feature data and the outflow feature data, and then the inflow feature data and the outflow feature data are respectively input into the interactive graph convolution structure for two-way feature interaction and fusion.

[0126] As Figure 2 shown in the structural schematic diagram of the interactive graph convolution layer provided by the embodiment of the present invention, it can be seen that after obtaining the spatial features of the inflow and outflow, the spatial features are updated according to the opposite spatial features, so that both the inflow and outflow can learn the spatial transformation features of each other. To be precise, that is, the inflow and outflow features are mutually recalibrated through graph operations:

[0127]

[0128] Among them, GCN represents the graph convolution operation of the graph convolutional neural network, I t and O t respectively represent the inflow feature data and the outflow feature data before update, and respectively represent the inflow feature data and the outflow feature data after update. This mechanism simulates how the inflow surge of upstream nodes (such as subway entrances) propagates after a time delay to affect the downstream outflow.

[0129] The above-mentioned graph convolutional neural network performs graph convolution operations on the input data by constructing a dynamic adjacency matrix. Specifically, a learnable parameter matrix E p ∈R D×N is used to capture the dynamic spatial relationship between different traffic sequences at each node. represents the transpose of this matrix, that is Through E p and its transpose matrix for matrix operations, we can obtain the dynamic weight matrix S of the entire road network w ∈R N×NUsing Softmax as the activation function, thresholding and zeroing the connections between neighboring points with relatively low weight values to approximately describe the connectivity between nodes. This method can more accurately capture the dynamic dependencies between nodes. That is:

[0130]

[0131] To dynamically adapt to the unique spatio-temporal patterns of nodes, the Einstein summation convention is used to process the input and weight data, thereby constructing a time-varying adjacency matrix. This method allows the model to flexibly capture the complex time-varying relationships between different nodes:

[0132]

[0133] where I w is the S w degree matrix, H c is the input traffic inflow and outflow, and A p ∈R B×N×N is the adaptive dynamic adjacency matrix obtained through calculation, and W is the learnable parameter matrix.

[0134] During the process of generating the adaptive dynamic graph, the inflow and outflow are processed separately because the inflow and outflow do exhibit different spatial dependencies. This difference not only reflects different flow patterns in the traffic network but also provides a necessary prerequisite for the fusion of inflow and outflow characteristics.

[0135] During the process of generating the adaptive dynamic graph, a multi-step diffusion mechanism is adopted to propagate and aggregate node features. Specifically, let the initial node feature matrix be X∈R B×C×N , where B is the batch size, C is the number of feature channels, and N is the number of traffic nodes; the adjacency matrix A p ∈R B×N×N is the dynamic adjacency matrix obtained through adaptive graph convolution. In the i-th diffusion step, the current node feature performs a matrix multiplication operation with the adjacency matrix A p to update the node feature:

[0136]

[0137] After each iteration, the updated node feature is added to the feature list. After L diffusion steps, the feature vectors obtained in all steps are concatenated along the feature channel dimension (i.e., the L dimension) to form the final feature representation:

[0138]

[0139] To gradually refine the dependence of two-way traffic flow, the embodiments of the present invention use multiple stacked IGCN layers to fuse multi-level two-way traffic flow dependencies, that is:

[0140]

[0141] Among them represents the feature concatenation of the incoming and outgoing traffic of each layer. The iterative process captures complex spillover effects, such as the congestion of commuters at transportation hubs during peak hours.

[0142] Further as an optional implementation, the update process of the graph convolutional gated recurrent layer is as follows:

[0143] z t = σ(IGCN(h t ) + W z h t-1 + b z )

[0144] r t = σ(IGCN(h t ) + W r h t-1 + b r )

[0145]

[0146] Among them, r t represents the reset gate, z t represents the update gate, represents the candidate hidden state, h t represents the hidden state at the current time step, h t-1 represents the hidden state at the previous time step, σ represents the Sigmoid activation function, tanh represents the hyperbolic tangent activation function, ⊙ represents element-wise multiplication, IGCN(h t ) represents performing an interactive graph convolution operation on h t , W z , W r and W h represent weight parameters, b z , b r and b h represent bias parameters.

[0147] Specifically, in order to effectively capture the spatio-temporal dependence in traffic flow data, the embodiments of the present invention use an improved interactive graph convolutional layer (IGCN) to replace the gating mechanism of the gated recurrent unit (GRU), and the obtained graph convolutional gated recurrent layer (GCGRU) is shown in Figure 3 .

[0148] This integration results in a new GCGRU network that allows for joint learning of spatio-temporal patterns by integrating graph convolution into the GRU gates. Specifically, for a specific time step t, assuming the currently received input is The operation of the GCGRU module can be expressed as:

[0149] z t = σ(IGCN(h t ) + W z h t-1 + b z )

[0150] r t = σ(IGCN(h t ) + W r h t-1 + b r )

[0151]

[0152] The input here is obtained by concatenating traffic inflow and outflow data, and the corresponding hidden state is also concatenated, so that the input can contain both inflow and outflow information. r t is the reset gate, z t is the update gate, is the candidate hidden state, h t is the hidden state at the current time step. σ represents the Sigmoid activation function, tanh represents the hyperbolic tangent activation function, and ⊙ represents element-wise multiplication. Different from the standard GRU, the gates here use graph operations to incorporate node-specific spatial context during the time state transition.

[0153] To enhance the feature representation ability, the present invention constructs a multi-layer GCGRU network and recursively extracts the spatio-temporal dependence of traffic inflow and outflow. In the GCGRU structure of the first layer, we input the fused inflow and outflow feature and the initialized hidden state and perform GRU operations on each time step of the feature to extract the spatio-temporal dependence of the fused inflow and outflow. In the output GCGRU structure, instead of performing GRU operations on the feature obtained in the first layer step by step in time, the output obtained at the last time step of the first layer is used as the new hidden state and expanded to the size of each time step, and the GCGRU of the second layer will operate on the input feature of all time steps and the expanded hidden state.

[0154] In the first layer of GCGRU, by processing sequential time steps, the hidden state is generated. In the second layer, the final hidden state h T is propagated to all time steps through unfolding and recursion:

[0155]

[0156] Among them is the output of the l-th layer of the GCGRU structure, is the set of all time-step hidden states of the l-th layer, is the initial hidden state of the (l - 1)-th layer.

[0157] Furthermore, as an optional implementation, based on hierarchical convolution and attention mechanism, feature fusion is performed on multi-scale spatio-temporal features to obtain spatio-temporal fusion features, which specifically includes:

[0158] S1051. Divide the multi-scale spatio-temporal features into multiple sub-channel spatio-temporal features;

[0159] S1052. Perform convolution processing on each sub-channel spatio-temporal feature respectively to obtain multiple sub-channel feature maps;

[0160] S1053. Based on the attention mechanism, perform feature fusion on the sub-channel feature maps to obtain spatio-temporal fusion features.

[0161] Specifically, traffic patterns exhibit heterogeneity at different spatio-temporal scales. To address this problem, the embodiments of the present invention adopt a multi-scale fusion strategy. Specifically, for the input feature map X ∈ R T×N×C , where C is the number of channels, N is the number of nodes, and T is the length of the time series, we evenly divide the input channels C into S sub-channels, and the number of channels for each sub-channel is C s . If C cannot be evenly divided by S, then C s is incremented by 1 to ensure that the sum of all sub-channels is equal to C. Each sub-channel is processed by convolution kernels of different scales, and the sizes of the convolution kernels are (s i , s i ), where s i is the scale parameter, and i ∈ [1, S]. These convolution operations can be expressed as:

[0162] H i = spilt(H f , S)

[0163] h i = H i W i + b i

[0164] Among them, is the sub-feature of H f , is the set of outputs of each time step in the GCGRU. and are the convolution kernel and the corresponding bias respectively.

[0165] To further enhance the expressive ability of features, an attention mechanism is applied to the output feature map of each sub-channel. Specifically, an attention map is generated through a 1×1 convolutional layer, and then the Softmax function is used for normalization along the node dimension. The attention mechanism can be expressed as:

[0166] α i = Softmax(W a h i + b a ), h i′ = α i ⊙ h i

[0167] where a i ∈ R 1×N×T represents the attention map of the i-th sub-channel. Applying the attention map to the feature map, h i obtains the weighted feature map.

[0168] Finally, the fused features are projected onto the prediction layer:

[0169]

[0170] where Concat represents the concatenation operation along the specified dimension, W o and b o are learnable weight matrices and biases.

[0171] Further as an optional implementation, the parameters of the dynamic interactive graph convolutional recurrent network are updated according to the two-way traffic flow prediction results and sample labels to obtain a trained two-way traffic flow prediction model, which specifically includes:

[0172] S1061. Taking the mean absolute error between the two-way traffic flow prediction result and the sample label as the loss value;

[0173] S1062. Updating the parameters of the dynamic interactive graph convolutional recurrent network according to the loss value, and returning to the step of inputting the two-way traffic flow time series samples into the dynamic interactive graph convolutional recurrent network until the preset convergence condition is reached, obtaining a trained two-way traffic flow prediction model.

[0174] Specifically, the embodiment of the present invention uses the mean absolute error MAE as the loss function, that is:

[0175]

[0176] where n represents the number of samples in the experiment, X i is the actual value of the traffic flow, is the corresponding predicted value.

[0177] Update the parameters of the dynamic interactive graph convolutional recurrent network through the backpropagation algorithm based on the calculated loss value, and then return to the step of inputting the two-way traffic flow time series samples into the dynamic interactive graph convolutional recurrent network for iterative training until the loss value is less than the preset threshold or the number of iterations reaches the preset number, and then the trained two-way traffic flow prediction model can be obtained.

[0178] To evaluate the prediction performance of the two-way traffic flow prediction model, the embodiments of the present invention select the mean absolute error (MAE) and the root mean square error (RMSE) as evaluation indicators. The smaller the values of MAE and RMSE are, the better the prediction effect is. The calculation formulas of the corresponding indicators are as follows:

[0179]

[0180] The present invention uses two datasets of different regions and different transportation modes. The subway dataset consists of the passenger travel records of the subway system in City A. The time range of the subway dataset is from January 1, 2019 to January 25, 2019. Due to operation restrictions, there is almost no passenger flow from 0:00 to 6:00, so the subway passenger flow data from 6:00 to 23:30 is selected as the target range. The taxi dataset consists of the taxi driving records collected in City B. The time period covered by the dataset is from April 1, 2016 to June 30, 2016, a total of 91 days. For other information, please refer to Table 1 below.

[0181] Table 1

[0182]

[0183] Among them, the time step refers to using the historical flow information of how many past time nodes to predict the historical flow information of how many future time nodes. Input the two datasets into the model to obtain the corresponding prediction results, and then calculate the corresponding evaluation indicators according to the results and the formulas, and compare with other models to observe the performance of the model (DIGCRN) of the present invention. The results are shown in Table 2 below.

[0184] Table 2

[0185]

[0186] It can be seen from the results in Table 2 that the model (DIGCRN) of the present invention is superior to other baseline models in terms of the MAE and RMSE indicators of the two datasets.

[0187] As Figure 4 shown is the comparison schematic diagram of the inflow prediction result and the actual value provided by the embodiment of the present invention. As Figure 5The following is a comparison diagram of the predicted outflow and the actual value provided by the embodiment of the present invention. It can be seen that the predicted inflow and outflow results of the embodiment of the present invention are highly consistent with the actual inflow and outflow.

[0188] In order to verify the effectiveness of each component of the DIGCRN model of the present invention, the present invention designed three ablation experiments, namely: (1) w / o TE: removing the time embedding layer in the model to verify the effectiveness of this layer; (2) w / o IGCN: replacing the IGCN layer in the model with a common GCN layer to separately predict the two-way traffic flow to verify the effectiveness of the two-way traffic flow feature fusion in the model; (3) w / o MO: removing the final multi-scale output layer of the model and replacing it with a common linear layer to verify the feature extraction ability of this layer. The experimental results are shown in Table 3 below.

[0189] Table 3

[0190]

[0191] Table 3 verifies that each component of the DIGCRN model proposed by the present invention is fully effective.

[0192] The above has described the method steps and experimental results of the embodiments of the present invention.

[0193] In traditional methods, the independent time and space modules are prone to cause information fragmentation and cannot capture the complete spatio-temporal heterogeneity in traffic flow. However, the present invention controls the fusion weight of spatio-temporal features in the graph convolutional network through a gating mechanism and introduces time embedding to enhance the time series of the original data, enabling the periodic law in the time dimension and the adjacency relationship in the space dimension to be optimized synergistically, significantly improving the efficiency and integrity of feature learning and effectively extracting spatio-temporal features.

[0194] Traditional methods only focus on total flow prediction and ignore the asymmetry of two-way traffic flow (the spatio-temporal differences and interdependencies between inflow and outflow). However, the present invention enables the spatial features of each node to dynamically capture the spatial transformation information of the oncoming traffic flow through a two-way coupled graph convolutional module, solving the problem that unidirectional prediction cannot coordinate the multimodal transport demand, significantly improving the matching degree between the prediction result and the actual resource scheduling, and reducing the risk of resource waste and congestion.

[0195] In summary, through targeted technological innovation, the present invention systematically solves the core problems of the prior art in incomplete capture of spatio-temporal heterogeneity and neglect of the asymmetry and interdependence of two-way traffic flow, providing effective assistance for tasks such as traffic scheduling and resource allocation at important transportation hubs.

[0196] Refer to Figure 6 , the embodiment of the present invention provides a two-way traffic flow prediction system based on a dynamic interaction graph convolutional recurrent network, including:

[0197] A sample generation module, which is used to obtain initial traffic flow data, conduct traffic flow statistics on the initial traffic flow data at a preset time interval to obtain two-way traffic flow time series samples and corresponding sample labels, and input the two-way traffic flow time series samples into a dynamic interactive graph convolutional recurrent network, where the dynamic interactive graph convolutional recurrent network includes a time embedding layer, an interactive graph convolutional layer, a graph convolutional gated recurrent layer, and a multi-scale output layer;

[0198] A time embedding module, which is used to perform time feature embedding on the two-way traffic flow time series samples through the time embedding layer to generate in-out flow feature data that fuses spatio-temporal features;

[0199] An interactive graph convolutional module, which is used to perform two-way feature interaction and fusion on the in-out flow feature data through the interactive graph convolutional layer to obtain two-way flow dependence features;

[0200] A graph convolutional gated recurrent module, which is used to extract spatio-temporal features from the two-way flow dependence features through the graph convolutional gated recurrent layer to obtain multi-scale spatio-temporal features;

[0201] A multi-scale output module, which is used to perform feature fusion on the multi-scale spatio-temporal features based on hierarchical convolution and attention mechanism through the multi-scale output layer to obtain spatio-temporal fusion features, and map the spatio-temporal fusion features to corresponding two-way traffic flow prediction results;

[0202] A parameter update module, which is used to update the parameters of the dynamic interactive graph convolutional recurrent network according to the two-way traffic flow prediction results and sample labels to obtain a trained two-way traffic flow prediction model;

[0203] A model prediction module, which is used to obtain real-time two-way traffic flow time series data, input the real-time two-way traffic flow time series data into the two-way traffic flow prediction model to obtain corresponding two-way traffic flow prediction data.

[0204] The content in the above method embodiments is applicable to the system embodiments of the present invention. The functions specifically implemented by the system embodiments of the present invention are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above method embodiments.

[0205] Refer to Figure 7 , an embodiment of the present invention provides a two-way traffic flow prediction device based on a dynamic interactive graph convolutional recurrent network, including:

[0206] At least one processor;

[0207] At least one memory, which is used to store at least one program;

[0208] When the at least one program is executed by the at least one processor, the at least one processor implements the above-mentioned two-way traffic flow prediction method based on a dynamic interaction graph convolutional recurrent network.

[0209] The content in the above method embodiments is applicable to the device embodiments of the present invention. The functions specifically implemented by the device embodiments of the present invention are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above method embodiments.

[0210] The embodiments of the present invention also provide a computer-readable storage medium, in which a program executable by a processor is stored. The program executable by the processor is used to execute the above-mentioned two-way traffic flow prediction method based on a dynamic interaction graph convolutional recurrent network when executed by the processor.

[0211] A computer-readable storage medium of the embodiments of the present invention can execute the two-way traffic flow prediction method based on a dynamic interaction graph convolutional recurrent network provided by the method embodiments of the present invention, can execute any combination of the implementation steps of the method embodiments, and has the corresponding functions and beneficial effects of the method.

[0212] The embodiments of the present invention also disclose a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device can read the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes Figure 1 the method shown.

[0213] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order mentioned in the operation diagrams. For example, depending on the functions / operations involved, two consecutive blocks shown may actually be executed substantially simultaneously or the above blocks can sometimes be executed in the reverse order. In addition, the embodiments presented and described in the flowcharts of the present invention are provided by way of example for the purpose of providing a more comprehensive understanding of the technology. The disclosed method is not limited to the operations and logical flows presented herein. Alternative embodiments are foreseeable, in which the order of various operations is changed and the sub-operations described as part of a larger operation are executed independently.

[0214] In addition, although the present invention has been described in the context of functional modules, it should be understood that, unless otherwise stated to the contrary, one or more of the above functions and / or features may be integrated in a single physical device and / or software module, or one or more functions and / or features may be implemented in separate physical devices or software modules. It should also be understood that a detailed discussion of the actual implementation of each module is not necessary for understanding the present invention. Rather, considering the attributes, functions, and internal relationships of the various functional modules in the devices disclosed herein, the actual implementation of such modules would be understood within the ordinary skills of an engineer. Thus, those skilled in the art can implement the present invention as set forth in the claims without undue experimentation. It should also be understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.

[0215] If the above functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the above methods in various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.

[0216] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a predefined sequence of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or in conjunction with such instruction execution systems, apparatus, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0217] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection (electronic device) having one or more wirings, a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable media can even be paper or other suitable media on which the above programs can be printed, because the above programs can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or otherwise processing as appropriate, and then storing them in a computer memory.

[0218] It should be understood that various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following techniques well-known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application-specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0219] In the foregoing description of this specification, the descriptions with reference to the terms "one embodiment / example", "another embodiment / example", or "certain embodiments / examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiments or examples are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0220] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the claims and their equivalents.

[0221] The above has specifically described the preferred embodiments of the present invention, but the present invention is not limited to the above embodiments. Those skilled in the art can also make various equivalent deformations or substitutions without departing from the spirit of the present invention, and these equivalent deformations or substitutions are all included in the scope defined by the claims of this application.

Claims

1. A two-way traffic flow prediction method based on a dynamic interactive graph convolutional recurrent network, characterized in that, It includes the following steps: Obtain initial traffic flow data, perform traffic flow statistics on the initial traffic flow data at a preset time interval to obtain a two-way traffic flow time series sample and a corresponding sample label, and input the two-way traffic flow time series sample into a dynamic interactive graph convolutional recurrent network, where the dynamic interactive graph convolutional recurrent network includes a time embedding layer, an interactive graph convolutional layer, a graph convolutional gated recurrent layer, and a multi-scale output layer; Perform time feature embedding on the two-way traffic flow time series sample through the time embedding layer to generate in-out flow feature data integrating spatio-temporal features; Perform two-way feature interaction and fusion on the in-out flow feature data through the interactive graph convolutional layer to obtain two-way flow dependence features; Perform spatio-temporal feature extraction on the two-way flow dependence features through the graph convolutional gated recurrent layer to obtain multi-scale spatio-temporal features; Perform feature fusion on the multi-scale spatio-temporal features through the multi-scale output layer based on hierarchical convolution and attention mechanism to obtain spatio-temporal fusion features, and map the spatio-temporal fusion features to corresponding two-way traffic flow prediction results; Update the parameters of the dynamic interactive graph convolutional recurrent network according to the two-way traffic flow prediction results and the sample labels to obtain a trained two-way traffic flow prediction model; Obtain real-time two-way traffic flow time series data, input the real-time two-way traffic flow time series data into the two-way traffic flow prediction model to obtain corresponding two-way traffic flow prediction data.

2. The two-way traffic flow prediction method based on a dynamic interactive graph convolutional recurrent network according to claim 1, wherein The step of performing traffic flow statistics on the initial traffic flow data at a preset time interval to obtain a two-way traffic flow time series sample and a corresponding sample label specifically includes: Aggregate the initial traffic flow data at the time interval and splice it in the last dimension to obtain a two-way flow tensor; Perform a sliding time window operation on the two-way flow tensor based on the time step to obtain two-way traffic flow data with multiple time steps; Determine the two-way traffic flow time series sample and the sample label according to the two-way traffic flow data; Wherein, the sample label is the actual two-way traffic flow value corresponding to the two-way traffic flow time series sample at the prediction time step.

3. A two-way traffic flow prediction method based on a dynamic interaction graph convolutional recurrent network according to claim 1, characterized in that The step of performing time feature embedding on the two-way traffic flow time series sample to generate in-out flow feature data integrating spatio-temporal features specifically includes: Perform daily cyclic encoding and weekly cyclic encoding on the time context of the two-way traffic flow time series sample in sequence to obtain time encoding information; Fuse the time encoding information with the two-way traffic flow time series sample to obtain the in-out flow feature data.

4. A two-way traffic flow prediction method based on a dynamic interaction graph convolutional recurrent network according to claim 1, characterized in that, The step of performing two-way feature interaction and fusion on the in-out flow feature data to obtain two-way flow dependence features specifically includes: Divide the in-out flow feature data into in-flow feature data and out-flow feature data; Input the in-flow feature data and the out-flow feature data into a graph convolutional neural network respectively to obtain a first in-flow feature and a first out-flow feature; Fuse the first inflow feature and the outflow feature data to obtain a first fused feature, and fuse the first outflow feature and the inflow feature data to obtain a second fused feature; Input the first fused feature and the second fused feature into the graph convolutional neural network respectively to obtain a second inflow feature and a second outflow feature; Concatenate the second inflow feature and the second fused feature to obtain updated inflow feature data, and concatenate the second outflow feature and the first fused feature to obtain updated outflow feature data; Obtain the two-way traffic flow dependence feature according to the updated inflow feature data and outflow feature data; Wherein, the graph convolutional neural network performs graph convolution operations on the input data by constructing a dynamic adjacency matrix.

5. A two-way traffic flow prediction method based on a dynamic interaction graph convolutional recurrent network according to claim 4, characterized in that, The update process of the graph convolutional gated recurrent layer is as follows: z t = σ(IGCN(h t ) + W z h t-1 + b z ) r t = σ(IGCN(h t ) + W r h t-1 + b r ) Among them, r t represents the reset gate, z t represents the update gate, represents the candidate hidden state, h t represents the hidden state at the current time step, h t-1 represents the hidden state at the previous time step, σ represents the Sigmoid activation function, tanh represents the hyperbolic tangent activation function, ⊙ represents element-wise multiplication, IGCN(h t ) represents the interactive graph convolution operation on h t , W z , W r and W h represent weight parameters, b z , b r and b h represent bias parameters.

6. The two-way traffic flow prediction method based on a dynamic interactive graph convolutional recurrent network according to claim 1, wherein The feature fusion of the multi-scale spatio-temporal features based on hierarchical convolution and attention mechanism to obtain spatio-temporal fusion features specifically includes: Divide the multi-scale spatio-temporal features into multiple sub-channel spatio-temporal features; Perform convolution processing on each of the sub-channel spatio-temporal features to obtain multiple sub-channel feature maps; Based on the attention mechanism, perform feature fusion on the sub-channel feature maps to obtain the spatio-temporal fusion features.

7. A two-way traffic flow prediction method based on a dynamic interactive graph convolutional recurrent network according to any one of claims 1 to 6, characterized in that, Updating the parameters of the dynamic interactive graph convolutional recurrent network according to the two-way traffic flow prediction result and the sample label to obtain a trained two-way traffic flow prediction model specifically includes: Taking the mean absolute error between the two-way traffic flow prediction result and the sample label as the loss value; Update the parameters of the dynamic interactive graph convolutional recurrent network according to the loss value, and return to the step of inputting the two-way traffic flow time series sample into the dynamic interactive graph convolutional recurrent network until the preset convergence condition is reached, and obtain the trained two-way traffic flow prediction model.

8. A two-way traffic flow prediction system based on a dynamic interactive graph convolutional recurrent network, characterized in that, It includes: A sample generation module, configured to obtain initial traffic flow data, perform traffic flow statistics on the initial traffic flow data at a preset time interval to obtain two-way traffic flow time series samples and corresponding sample labels, and input the two-way traffic flow time series samples into a dynamic interactive graph convolutional recurrent network, where the dynamic interactive graph convolutional recurrent network includes a time embedding layer, an interactive graph convolutional layer, a graph convolutional gated recurrent layer, and a multi-scale output layer; A time embedding module, configured to perform time feature embedding on the two-way traffic flow time series samples through the time embedding layer to generate inflow and outflow feature data that fuse spatio-temporal features; An interactive graph convolution module, configured to perform two-way feature interaction and fusion on the inflow and outflow feature data through the interactive graph convolutional layer to obtain a two-way traffic flow dependence feature; A graph convolutional gated recurrent module, configured to perform spatio-temporal feature extraction on the two-way traffic flow dependence feature through the graph convolutional gated recurrent layer to obtain multi-scale spatio-temporal features; A multi-scale output module, configured to perform feature fusion on the multi-scale spatio-temporal features based on hierarchical convolution and attention mechanism through the multi-scale output layer to obtain spatio-temporal fusion features, and map the spatio-temporal fusion features to corresponding two-way traffic flow prediction results; A parameter update module, configured to update parameters of the dynamic interactive graph convolutional recurrent network according to the two-way traffic flow prediction result and the sample label, so as to obtain a trained two-way traffic flow prediction model; A model prediction module, configured to obtain real-time two-way traffic flow time series data, and input the real-time two-way traffic flow time series data into the two-way traffic flow prediction model to obtain corresponding two-way traffic flow prediction data.

9. A two-way traffic flow prediction device based on a dynamic interactive graph convolutional recurrent network, characterized in that Comprising: At least one processor; At least one memory, configured to store at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements a two-way traffic flow prediction method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a program executable by a processor, characterized in that, The program executable by the processor, when executed by the processor, is used to execute a two-way traffic flow prediction method according to any one of claims 1 to 7.