Efficient space-time traffic flow prediction method

By constructing a spatio-temporal traffic flow prediction model and using encoders, decoders and pyramid memory networks to extract periodic features, the problem of insufficient spatio-temporal correlation in the existing technology is solved and more accurate traffic flow prediction is achieved.

CN118538029APending Publication Date: 2024-08-23DALIAN MARITIME UNIVERSITY
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202410679912.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-29
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Existing road traffic flow prediction methods fail to fully exploit spatiotemporal correlation features, resulting in inaccuracy and error problems in traffic flow prediction.

Method used

The spatiotemporal traffic flow prediction method is used to construct a spatiotemporal traffic flow prediction model by obtaining historical traffic flow time series data of road nodes. The encoder and decoder are combined with the pyramid memory network and the multi-layer attention module to extract periodic features and weight them. Fusion, frequency domain analysis is performed based on Fourier convolution module, and adaptive adjacency matrix is ​​obtained to achieve prediction.

Benefits of technology

It improves the accuracy and robustness of traffic flow prediction, comprehensively understands traffic dynamics, enhances prediction capabilities, and reduces errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118538029A
    Figure CN118538029A
Patent Text Reader

Abstract

The invention discloses an efficient space-time traffic flow prediction method. The method comprises the following steps: S1, obtaining historical traffic flow time sequence data of road nodes in a given road network graph structure; the historical traffic flow time sequence comprises a series of node speeds of the road nodes corresponding to the preset sampling time; dividing the historical traffic flow time sequence data into a spatio-temporal data training set and a spatio-temporal data prediction set according to a preset proportion; s2, constructing a space-time traffic flow prediction model, and training the space-time traffic flow prediction model according to the space-time data training set to obtain a space-time traffic flow prediction optimization model; and S3, on the basis of the space-time traffic flow prediction optimization model, current traffic flow time sequence data is predicted and concentrated according to the space-time data so as to realize prediction of future space-time traffic flow. According to the method, the problems of inaccuracy of traffic flow prediction, errors of long-term traffic flow prediction and the like caused by low time and space correlation degree and missing traffic flow data due to the fact that space-time correlation characteristics in the road traffic flow data are not fully excavated in the road traffic flow prediction of a traditional road traffic prediction method are solved.
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 an efficient spatiotemporal traffic flow prediction method. Background Art

[0002] Nowadays, intelligent transportation systems have been widely deployed and applied, and are expected to become the preferred solution to traffic problems such as traffic congestion. Intelligent transportation systems use modern information technology and communication technology to connect various transportation facilities and equipment and share information, so as to achieve all-round, efficient, and real-time monitoring and management of urban traffic operations, providing an effective means to improve traffic efficiency. Accurate and timely traffic flow forecasting is of great significance to the successful deployment of intelligent transportation systems. It can help road users make better travel decisions, alleviate traffic congestion, and improve traffic operation efficiency. However, due to the complex, nonlinear, non-stationary, and time-space related characteristics of traffic flow, traffic flow prediction has always been a difficult problem.

[0003] At present, the main methods for road traffic prediction include traditional time series prediction method, support vector machine, BP neural network, etc. Although these methods can obtain prediction data for road traffic flow, in road traffic flow prediction, the above models have not fully explored the spatiotemporal correlation characteristics in road traffic flow data, and there are problems such as low temporal and spatial correlation, inaccurate traffic flow prediction caused by missing traffic flow data, and error in long-term traffic flow prediction. Summary of the invention

[0004] The present invention provides an efficient spatiotemporal traffic flow prediction method to overcome the above technical problems.

[0005] In order to achieve the above object, the technical solution of the present invention is:

[0006] An efficient spatiotemporal traffic flow prediction method includes the following steps:

[0007] S1: Obtain the historical traffic flow time series data of road nodes in a given road network graph structure;

[0008] The historical traffic flow time series includes a series of node speeds at each road node corresponding to a preset sampling time;

[0009] and dividing the historical traffic flow time series data into a spatiotemporal data training set and a spatiotemporal data prediction set according to a preset ratio;

[0010] S2: constructing a spatiotemporal traffic flow prediction model, and training the spatiotemporal traffic flow prediction model according to the spatiotemporal data training set to obtain a spatiotemporal traffic flow prediction optimization model;

[0011] And the spatiotemporal traffic flow prediction model includes an acquisition module for acquiring the historical traffic flow time series of road nodes in a given road network graph structure;

[0012] An encoder unit for encoding a historical traffic flow sequence to obtain input sequence features, and the encoder unit is also used to receive a road node adaptive adjacency matrix obtained by a pyramid memory network unit during model training;

[0013] A multi-layer attention module for weighted fusion of input sequence features to obtain fused features;

[0014] Fourier convolution module for periodic feature extraction of fused features;

[0015] A pyramid memory network unit for obtaining an adaptive adjacency matrix of road nodes and matching node speed features based on periodic features;

[0016] and a decoder unit for realizing spatiotemporal traffic flow prediction based on an adaptive adjacency matrix and matching node speed characteristics;

[0017] S3: Based on the spatiotemporal traffic flow prediction optimization model, the current traffic flow time series data is concentrated according to the spatiotemporal data prediction to realize the prediction of future spatiotemporal traffic flow.

[0018] Furthermore, in S2, the spatiotemporal traffic flow prediction model is trained according to the data training set, specifically including the following steps:

[0019] S21: The traffic road network graph structure G given in the spatiotemporal data training set and the historical speed sequence {X1,X2,X3,… ...3,…,X3,…,X3,…,X3,…,X3,…,X3,…,X3,…, t} as input data;

[0020] The historical time series {X1,X2,X3,…,X t The traffic speed sequence {X t+1 ,X t+2 ,X t+3 ,…,X t+α} as training output label;

[0021] S22: transmitting the input data to the encoder unit through the acquisition module;

[0022] The encoder unit combines the road node adaptive adjacency matrix randomly given by the pyramid memory network unit The received input data is encoded with road node space and node speed to obtain node feature data {H1, H2, ..., H t};

[0023] S23: The node feature data {H1,H2,...,H t} perform weighted fusion to obtain the fusion feature H∈R N×h , where N represents the number of road nodes and h represents the dimension of the hidden state;

[0024] S24: Extract periodic features from the fused features through the Fourier convolution module to obtain periodic feature data H out ∈R N×h ; and the periodic characteristics include the node speed of each road node corresponding to the morning peak / evening peak on weekdays, weekends and holidays;

[0025] S25: obtaining a current adaptive adjacency matrix and a current node speed feature of a road node according to the periodic feature through a pyramid memory network unit, and storing the current node speed feature in a current storage database;

[0026] And the current storage database is specifically: if the current node speed feature is a data feature stored for the first time, then the current storage database before the data feature stored for the first time is an empty set;

[0027] If the current node speed feature is not the data feature stored for the first time, the current storage database is the collection of all data features stored before the data feature stored this time;

[0028] The obtained current node speed feature is subjected to a matrix multiplication operation with the weight matrix of the pyramid memory network unit to obtain a query result vector Q of the current node speed feature;

[0029] S26: Obtain the matching node speed feature of the node speed feature with the highest similarity score in the current storage database according to the query result vector Q.

[0030] Will match node velocity features The node feature data H at time t output by the encoder unit t Weighting is performed to obtain node feature weighted data

[0031] And the decoder unit weights the data according to the node features Get the prediction data for the next α moments with the current adaptive adjacency matrix;

[0032] Obtaining a current mean square error value between the predicted data and the actual traffic speed sequence in the spatiotemporal data training set, and determining whether the current mean square error value meets a preset error threshold;

[0033] If satisfied, it is confirmed that the currently trained spatiotemporal traffic flow prediction model is the spatiotemporal traffic flow prediction optimization model;

[0034] If it is not satisfied, the network parameter weights in the spatiotemporal traffic flow prediction model are adaptively updated, and the Chebyshev polynomial is used to adaptively adjust the road node adjacency matrix randomly given by the input encoder unit according to the current adaptive adjacency matrix To update, steps S22 to S25 are repeated.

[0035] Furthermore, the encoder unit and the decoder unit have the same structure and both include a graph convolutional network GCN and a gated recurrent unit GRU;

[0036] The difference between the encoder unit and the decoder unit is only the input data: that is, the input data of the encoder unit is the historical traffic flow time series obtained by the acquisition module and the road node adaptive adjacency matrix obtained by the pyramid memory network unit;

[0037] The input data of the decoder unit is the node feature weighted data The current adaptive adjacency matrix obtained with the pyramid memory network unit;

[0038] The node feature weighted data Matching node speed features obtained by the pyramid memory network unit The node feature data Ht at time t output by the encoder unit is weighted;

[0039] The graph convolutional network GCN is used to weight data according to historical traffic flow sequences or node features. To obtain the spatial features of road nodes, the expression of the graph convolutional network GCN is:

[0040]

[0041]

[0042]

[0043] Where: [X i ,H i-1 ]∈R N×(1+h) Indicates X i ∈R N×1 ,H t-1 ∈R N×h The result of the concatenation operation is the input of the graph convolutional network GCN; Θ represents the kernel function approximating the k-th order Chebyshev polynomial; *G represents the graph convolution operation; h represents the dimension of the hidden state; N represents the number of road nodes in the road network graph structure; H i-1represents the i-1th output of the encoder unit or decoder unit; X i represents the traffic flow data at the i-th moment; represents the adjacency matrix updated using Chebyshev polynomials; k represents the order of Chebyshev polynomials; E1,E2∈R N×d And d represents the feature dimension of the road node; E1 represents the node embedding of the road node; E2 represents the node embedding of the road target node;

[0044] The gated recurrent unit GRU is used to obtain historical traffic flow data sequence or node feature weighted data according to spatial features. The time feature of , and the obtained time feature is encoded or decoded to obtain the input sequence feature or the prediction data of the next α moments, the expression of the gated recurrent unit GRU is

[0045]

[0046]

[0047]

[0048] H i =(1-u i )☉H i-1 +u i ☉C i

[0049] Where: u i ,r i ,C i represents the update gate, reset gate and candidate state in the encoder unit or decoder unit respectively; H i represents the i-th output of the encoder unit or decoder unit; b u ,b r ,b C Represent the deviation values ​​of the update gate, reset gate and candidate state respectively; Represents an adjacency matrix of order k.

[0050] Furthermore, in S23, the node feature data {H1, H2, ..., H t The expression for weighted fusion is

[0051]

[0052]

[0053] Where: α i Represents the input node feature data The attention scores of αWith b α They represent the learnable weight value and bias value respectively; H represents the fusion feature after weighted fusion.

[0054] Furthermore, the method for extracting periodic features from fused features by Fourier convolution module in S24 is specifically as follows:

[0055] S241: Use discrete Fourier transform to convert the fusion feature H into frequency domain features

[0056] S242: Based on Chebyshev polynomials and multi-layer graph convolutional networks, frequency domain features Perform point-by-point product on each frequency component to obtain intermediate features in the frequency domain at different levels;

[0057] S243: Integrate the intermediate frequency domain features at different levels to obtain frequency domain integrated features

[0058] S244: Frequency domain integration features using inverse Fourier transform Perform inverse transformation to obtain periodic characteristic data H out .

[0059] Furthermore, the pyramid memory network unit in S25 includes a bottom-level memory network M1, a middle-level memory network {M2, M3, ..., M L-1} and high-level memory network M l ; and can randomly give the road node adaptive adjacency matrix

[0060] And the expression of the weight transformation method is

[0061]

[0062] Where: and Both represent M l With M l+1 The weight parameter matrix needs to be learned;

[0063] The bottom memory network M1 is used to extract the periodic features and obtain the first node speed feature;

[0064] The middle-level memory network {M2, M3, ..., M L-1} is used to perform feature fusion on the first node speed feature to obtain the second node speed feature;

[0065] The high-level memory network M lIt is used to perform feature fusion on the second node speed feature, obtain the current node speed feature and output the current adaptive adjacency matrix of the road node.

[0066] Furthermore, in S26, the matching node speed feature of the node speed feature with the highest similarity score in the current storage database is obtained according to the query result vector Q. Specifically:

[0067] S261: By transforming the periodic characteristic data H out Perform matrix multiplication with the weight matrix in the pyramid memory network unit to obtain the query result vector Q;

[0068] The query result vector Q is expressed as:

[0069] Q=H out *W q

[0070] Where: H out ∈R N×h represents the output after Fourier convolution transform; W q ∈R h×d represents the weight matrix; N represents the number of nodes; h represents the periodic feature data H out The dimension of ; d represents the dimension of the storage item;

[0071] S262: Obtain the similarity score between the query result vector Q and the speed characteristics of each node in the current storage database; the expression of the similarity score Si is:

[0072] Si=Q*Mem T

[0073] Where: Mem∈R M×d Represents the storage content in the current storage database; M represents the number of storage items in the memory network; d represents the dimension of each storage item;

[0074] S263: performing a normalization operation on the similarity score to obtain an attention score of each node speed feature, and selecting the node speed feature with the highest attention score as the optimal node speed feature;

[0075] The expression of the attention score is

[0076] α=softmax(Si)

[0077] S264: Obtain matching node velocity characteristics according to the optimal node velocity characteristics The acquisition of matching node speed characteristics The expression is

[0078]

[0079] Beneficial effects: The present invention provides an efficient spatiotemporal traffic flow prediction method, which constructs a spatiotemporal traffic flow prediction model, encodes the historical traffic flow sequence through the encoder unit to obtain the input sequence features, and obtains the fusion features by weighted fusion of the input sequence features through the multi-layer attention module, which more comprehensively considers the input sequence features and improves the expression ability of the input sequence features. The fusion features are extracted by the Fourier convolution module, and the extracted periodic features are converted into the frequency domain space, so that the complex waveforms and traffic flow signals in the time series data are analyzed in the frequency domain space, and then more abstract features in the input sequence features are extracted. information features to ensure a comprehensive understanding and accurate prediction of traffic flow dynamics; through the analysis of a large amount of historical traffic flow sequence information by the pyramid memory network unit, the most representative / typical periodic features are extracted as the basis for the analysis of input sequence features, thereby improving the prediction ability of input sequence features; and the spatiotemporal traffic flow prediction model is trained according to the spatiotemporal data training set to obtain the spatiotemporal traffic flow prediction optimization model; based on the spatiotemporal traffic flow prediction optimization model, the current traffic flow time series data in the spatiotemporal data prediction set is used to realize the prediction of future spatiotemporal traffic flow, which greatly improves the robustness and accuracy in processing traffic time series prediction tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0081] Figure 1 A flowchart of an efficient spatiotemporal traffic flow prediction method of the present invention;

[0082] Figure 2 Schematic diagram of the structure of the efficient spatiotemporal traffic flow prediction method in this embodiment;

[0083] Figure 3 is a schematic diagram of the structure of an encoder unit or a decoder unit in this embodiment;

[0084] Figure 4 Schematic diagram of the structure of the Fourier convolution module in this embodiment;

[0085] Figure 5 This is a schematic diagram of the structure of the pyramid memory network unit in this embodiment;

[0086] Figure 6 This is a schematic diagram of the static-dynamic road network diagram structure in this embodiment;

[0087] Figure 7 This is the core flow chart of the efficient spatiotemporal traffic flow prediction method in this embodiment. DETAILED DESCRIPTION

[0088] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0089] This embodiment provides an efficient spatiotemporal traffic flow prediction method. Figure 1 As shown, the following steps are included:

[0090] S1: Obtain the historical traffic flow time series data of road nodes in a given road network graph structure;

[0091] The historical traffic flow time series includes a series of node speeds at each road node corresponding to a preset sampling time; and the historical traffic flow time series data is divided into a spatiotemporal data training set and a spatiotemporal data prediction set according to a preset ratio;

[0092] S2: constructing a spatiotemporal traffic flow prediction model, and training the spatiotemporal traffic flow prediction model according to the spatiotemporal data training set to obtain a spatiotemporal traffic flow prediction optimization model;

[0093] like Figure 2 As shown, the spatiotemporal traffic flow prediction model includes an acquisition module for acquiring the historical traffic flow time series of road nodes in a given road network graph structure;

[0094] An encoder unit for encoding a historical traffic flow sequence to obtain input sequence features, and the encoder unit is also used to receive the road node adaptive adjacency matrix obtained by the pyramid memory network unit during model training to achieve the capture of spatial dependency and temporal dependency of the historical traffic flow sequence;

[0095] Specifically, Figure 3 As shown, the encoder unit and the decoder unit have the same structure, that is, multiple GCRU units connected in sequence, and both include a graph convolutional network GCN and a gated recurrent unit GRU; the GCRU unit integrates a graph convolutional network (GCN) and a gated recurrent unit (GRU) to capture the spatial and temporal correlation of specific nodes;

[0096] The difference between the encoder unit and the decoder unit is only the input data: that is, the input data of the encoder unit is the historical traffic flow time series obtained by the acquisition module and the road node adaptive adjacency matrix obtained by the pyramid memory network unit;

[0097] The input data of the decoder unit is the node feature weighted data The current adaptive adjacency matrix obtained with the pyramid memory network unit;

[0098] The node feature weighted data Matching node speed features obtained by the pyramid memory network unit The node feature data H at time t output by the encoder unit t The input of the GCRU unit in this embodiment includes: X i ∈R N×1 ,as well as t represents the number of encoder units, i.e. the number of time steps; and represents the adjacency matrix updated using Chebyshev polynomials. It is acquired through pyramidal memory network units;

[0099] In order to capture the hidden spatial correlation of historical traffic flow sequences, an adaptive adjacency matrix is ​​introduced to dynamically adjust the relationship between nodes.

[0100]

[0101] Among them, E1,E2∈R N×d And d represents the feature dimension of the road node; E1 represents the node embedding of the road node; E2 represents the node embedding of the road target node; and during the initial training, E1 and E2 are randomly given by the pyramid memory network unit;

[0102] The graph convolutional network GCN is used to obtain the spatial features of road nodes according to the historical traffic flow sequence. The expression of the graph convolutional network GCN is:

[0103]

[0104]

[0105] Where: [X i ,H i-1 ]∈R N×(1+h) Indicates X i ∈R N×1 ,H t-1 ∈RN×H The result of the concatenation operation is the input of the graph convolutional network GCN; Θ represents the kernel function approximating the k-th order Chebyshev polynomial; *G represents the graph convolution operation; h represents the dimension of the hidden state; N represents the number of road nodes in the road network graph structure; H i-1 represents the i-1th output of the encoder unit or decoder unit; X i represents the traffic flow data at the i-th moment; represents the adjacency matrix updated by Chebyshev polynomials; k represents the order of Chebyshev polynomials, and when k=0, the adaptive adjacency matrix is ​​represented by the identity matrix I, and when k=1, the adaptive adjacency matrix is ​​expressed by Chebyshev polynomials;

[0106] The gated recurrent unit GRU is used to obtain historical traffic flow data sequence or node feature weighted data according to spatial features. The time feature of the input sequence or the prediction data of the next α moments is obtained by encoding or decoding the obtained time feature;

[0107] The time correlation feature uses the gated recurrent unit GRU, which contains two gates: reset gate r i and update gate u i ,These two gates work together to help capture the time dependency relationships in the ,historical traffic flow data series, update their own states, and ,promote the prediction of the time series;

[0108] The expression of the gated recurrent unit GRU is:

[0109]

[0110]

[0111]

[0112] H i =(1-u i )☉H i-1 +u i ☉C i

[0113] Where: u i ,r i ,C i represents the update gate, reset gate and candidate state in the encoder unit or decoder unit respectively; H i The i-th output of the encoder unit or decoder unit represents the candidate hidden state, which is the extraction of the key features of the input traffic sequence; b u ,b r ,b CRepresent the deviation values ​​of the update gate, reset gate and candidate state respectively; represents the adaptive adjacency matrix of order k;

[0114] A multi-layer attention module for weighted fusion of input sequence features to obtain fused features;

[0115] Specifically, the node feature data {H1,H2,...,H t The expression for weighted fusion is

[0116]

[0117]

[0118] Where: α i Represents the input node feature data The attention scores of α With b α They represent the learnable weight value and bias value respectively; H represents the fusion feature after weighted fusion, which contains more comprehensive and rich information about the entire input traffic sequence and will be used for subsequent memory query operations;

[0119] Fourier convolution module for periodic feature extraction of fused features;

[0120] Specifically, Figure 4 As shown, in order to extract the periodic features of the traffic time series from the data output by the encoder unit, although the node representation can be obtained by aggregating the neighbor features of the node through multi-layer graph convolution in the time domain, the frequency domain has a larger amount of calculation and higher time complexity than the frequency domain, and it is relatively difficult to capture the periodic features in the input data. Therefore, in this embodiment, the Fourier transform is combined with the graph convolution to further obtain the representation of a certain node from the data output by the encoder unit by aggregating the neighbor nodes of each node, and extract the periodic features of the traffic time series, so as to more accurately capture the periodic changes in the traffic flow and enhance the model's ability to predict traffic;

[0121] In this embodiment, the time series is converted from the time domain to the frequency domain through Fourier transform, and decomposed into periodic components of different frequencies, so as to better understand the periodic law; the traffic time series has obvious periodicity: traffic data is usually affected by daily factors, for example, traffic flow may increase during peak hours in the morning and afternoon, and decrease at night. In addition to daily periodicity, traffic data may also be affected by weekly periodicity, for example, there may be different traffic patterns between weekends and weekdays. Some traffic data may also be affected by seasonality or holidays, for example, there may be special traffic patterns during holidays;

[0122] The method of extracting periodic features from fused features by Fourier convolution module is as follows: S241: using discrete Fourier transform to convert fused features H into frequency domain features Its expression is

[0123]

[0124] Among them, H∈R N×h represents the output of the attention module, N represents the number of nodes, h represents the dimension of the hidden state, F(·) represents the discrete Fourier transform, represents the result obtained after discrete Fourier transform of H;

[0125] S242: Based on Chebyshev polynomials and multi-layer graph convolutional networks, frequency domain features The frequency components of are multiplied point by point to obtain the intermediate features of the frequency domain at different levels, and the expression is:

[0126]

[0127] in, Represents the continuous product of the adjacency matrices of different layers of the multi-layer graph convolutional network from S order to 0 order; That is W (0) W (1) …W (S) It represents the continuous product of weight matrices of different layers from 0th order to Sth order; S represents the number of layers of the multi-layer graph convolutional network;

[0128] S243: Integrate the intermediate frequency domain features at different levels to obtain frequency domain integrated features

[0129] Specifically, the stacking of multiple layers of graph convolution in the frequency domain space can help the model learn node feature representations at different levels, thereby gradually extracting and abstracting more complex and abstract features in the historical node sequence data. Finally, this embodiment integrates the effects of adjacency matrices and weight matrices of different orders through cumulative summation operations to obtain This allows the model to simultaneously consider the impact of neighbor node information at different layers on the current node, and its expression is:

[0130]

[0131] S244: Frequency domain integration features using inverse Fourier transform Perform inverse transformation to obtain periodic characteristic data H out ;

[0132] Specifically, the obtained result is transformed back to the time domain by the inverse Fourier transform method to obtain H out∈R N×h , which represents the result of further extracting the periodic features of the input traffic sequence, and its expression is:

[0133]

[0134] Among them, F -1 (·) denotes discrete inverse Fourier transform;

[0135] A pyramid memory network unit for obtaining an adaptive adjacency matrix of road nodes and matching node speed features according to periodic features; the pyramid memory network unit comprises a bottom-level memory network M1, a middle-level memory network {M2, M3, ..., M L-1} and high-level memory network M l , and can randomly give the road node adaptive adjacency matrix

[0136] The bottom memory network M1 is used to extract the periodic features and obtain the first node speed feature;

[0137] The middle-level memory network {M2, M3, ..., M L-1} is used to perform feature fusion on the first node speed feature to obtain the second node speed feature;

[0138] The high-level memory network M l It is used to perform feature fusion on the second node speed feature, obtain the current node speed feature and output the current adaptive adjacency matrix of the road node.

[0139] Specifically, Figure 5 As shown, the pyramid memory network unit in this embodiment includes L layers, where L is the number of layers of the pyramid, and M is l Represents the memory matrix of the lth layer, l∈{1,2,…,L}; the dimension of the lth layer memory network is N l ×d l , where d l is the dimension of the storage items in the l-th layer memory network, N l is the number of storage items in the l-th layer memory network;

[0140] Among them, the bottom memory network M1: The lowest layer memory network is obtained by simple feature extraction from historical data during the model training process. It stores the basic features of more nodes, has relatively less feature content, and stores a relatively large number of nodes;

[0141] For the middle-level memory network, {M2,M3,…,M L-1} indicates that this embodiment integrates and refines low-level features into high-level features by learning weights. In the process of changing from the bottom-level network to the higher-level network, the number of stored nodes decreases, but the features of the stored nodes are richer and more specific, and contain more detailed pattern features on the road network;

[0142] The connection between the memory network of the lth layer and the l+1th layer adopts weight transformation. Specifically, for the memory network M of the lth layer l , after the feature fusion and refinement operation, the memory network M of the l+1th layer is obtained l+1 , the specific expression is:

[0143]

[0144] in, and The weight parameter matrix of the corresponding memory network is represented by the transformation of the two weight parameter matrices to obtain the memory network of the l+1th layer, and is represented in the form of a memory matrix; and are the parameters that need to be learned, and by learning these parameters, the model can adaptively adjust the weight parameter matrix to optimally integrate the feature representations of different levels; and for and have And a l1 l1 ,a l2 l2 ; An example is given below: Assume M l The dimension is 128×4, M l+1 The dimension is 64×8, then The dimension is 64×128, The dimension is 4×8, corresponding to a l1 ,b l1 ,a l2 ,b l2 ;

[0145] The input of the pyramid memory network unit in this embodiment is the output H of the Fourier convolution module out ∈R N×h , contains the information of the periodic characteristics of the input sequence. out ∈R N×h Pattern matching is performed with the highest-level and most representative node features obtained in the pyramid memory network unit, and the output is That is, the matching node speed feature, which represents the final output result H of the encoder t ​​The node embedding E1,E2∈R formed by the node features in the pyramid memory network is output simultaneously. N×d Adaptive adjacency matrix of nodes that make up the road;

[0146] The pyramid memory network unit is designed to solve the problem that the traditional gradient-based network model cannot effectively capture and save historical traffic information, including traffic relations between nodes, etc., which leads to the model's excessive reliance on the input data at the current moment for prediction when predicting future traffic flow, lacking a comprehensive understanding of past behavior, and causing information loss. In this embodiment, by analyzing historical traffic data, it is concluded that these data have repeated patterns, and there may also be highly similar feature representations between different sensor nodes. By extracting representative node feature representations, it is used as a basis for analyzing subsequent input sequences. Then the model of this embodiment will match the node feature representations stored in the extracted memory network and the node feature representations obtained by the encoder unit of the input sequence, and extract more representative and similar node feature representations from the memory network for subsequent traffic prediction. In this embodiment, a pyramid memory network unit is used. Among them, the lowest level memory network is responsible for extracting basic and local features, the middle layer receives and processes the feature representations from the lowest level and further extracts higher-level feature representations, and the top-level memory network extracts more abstract and global features. Such a pyramid-like memory network storage structure is used to store representative node features extracted from historical traffic data of roads, that is, traffic patterns. There are similar node features, that is, similar traffic patterns, between roads; therefore, it can be considered to be extended to road nodes with similar spatiotemporal characteristics.

[0147] A decoder unit for realizing spatiotemporal traffic flow prediction according to an adaptive adjacency matrix and matching node speed features; specifically, the decoder unit has the same structure as the decoder unit, that is, the decoder unit is used to match the node speed features. As the input of the decoder unit, it is combined with the adaptive adjacency matrix output and predicts the traffic speed sequence to be {X t+1 ,X t+2 ,X t+3 ,…,X t+α}, obtained by the following formula:

[0148] right

[0149] X i = inverse_transform(H i )

[0150] Where: inverse_transform() is the inverse transformation method, which transforms the hidden state H iPerform inverse transformation to obtain the predicted output result;

[0151] The structure of the decoder unit in this embodiment is the same as that of the encoder unit, both of which are composed of multiple graph convolutional recurrent units (GCRUs). Unlike the encoder, the input of the decoder is no longer the traffic time series, but the output H of the encoder unit in the previous time step. t And the hidden state (i.e. matching node velocity features ), the initial hidden state of the decoder unit The result output by the encoder get, contains the encoder's understanding and encoding information of the entire input sequence. The first decoder unit only receives the initial hidden state as input to generate its first time step output, which is called the "start marker". After that, when the decoder generates the output of each subsequent time step, it will use the output of the previous time step as the input of the current time step until the entire target sequence is generated. At the same time, the hidden state is updated at each time step and passed to the decoder unit of the next time step. The final prediction of the traffic speed sequence in the next α time moments is {X t+1 ,X t+2 ,X t+3 ,…,X t+α}.

[0152] In a specific embodiment, Figure 7 As shown, the spatiotemporal traffic flow prediction model is trained according to the data training set, specifically including the following steps:

[0153] S21: The traffic road network graph structure G given in the spatiotemporal data training set and the historical speed sequence {X1,X2,X3,… ...3,…,X3,…,X3,…,X3,…,X3,…,X3,…,X3,…, t} as input data;

[0154] The historical time series {X1,X2,X3,…,X t The traffic speed sequence {X t+1 ,X t+2 ,X t+3 ,…,X t+α} as training output label;

[0155] S22: transmitting the input data to the encoder unit through the acquisition module;

[0156] The encoder unit combines the road node adaptive adjacency matrix randomly given by the pyramid memory network unit The received input data is encoded with road node space and node speed to obtain node feature data {H1, H2, ..., Ht};

[0157] S23: The node feature data {H1,H2,...,H t} perform weighted fusion to obtain the fusion feature H∈R N×h , where N represents the number of road nodes and h represents the dimension of the hidden state;

[0158] S24: Extract periodic features from the fused features through the Fourier convolution module to obtain periodic feature data H out ∈R N×h ; and the periodic characteristics include the node speed of each road node corresponding to the morning peak / evening peak on weekdays, weekends and holidays;

[0159] S25: obtaining a current adaptive adjacency matrix and a current node speed feature of a road node according to the periodic feature through a pyramid memory network unit, and storing the current node speed feature in a current storage database;

[0160] Specifically, in a city’s traffic network, the content stored in the memory network can be the characteristics of traffic sensor nodes and historical traffic flow data. For each traffic sensor node, these contents can include the traffic flow distribution during its morning and evening peak hours, as well as information such as the average vehicle speed, traffic congestion, and accident rate during normal times. These node-level features can reflect the typical traffic flow pattern of the node in different time periods. By storing these contents, the memory network can help the model use previously learned knowledge in the prediction process to better understand the relationship and influence between different nodes in the traffic network.

[0161] And the current storage database is specifically: if the current node speed feature is a data feature stored for the first time, then the current storage database before the data feature stored for the first time is an empty set;

[0162] If the current node speed feature is not the data feature stored for the first time, the current storage database is the collection of all data features stored before the data feature stored this time;

[0163] The obtained current node speed feature is subjected to a matrix multiplication operation with the weight matrix of the pyramid memory network unit to obtain a query result vector Q of the current node speed feature;

[0164] S26: Obtain the matching node speed feature of the node speed feature with the highest similarity score in the current storage database according to the query result vector Q.

[0165] Specifically, according to the query result vector Q, the matching node speed feature of the node speed feature with the highest similarity score in the current storage database is obtained. Specifically:

[0166] S261: By transforming the periodic characteristic data H out Perform matrix multiplication with the weight matrix in the pyramid memory network unit to obtain the query result vector Q;

[0167] The query result vector Q is expressed as:

[0168] Q=H out *W q

[0169] Where: H out ∈R N×h Represents the output after Fourier convolution transform; W q ∈R h×d represents the weight matrix; N represents the number of nodes; h represents the periodic feature data H out The dimension of ; d represents the dimension of the storage item;

[0170] S262: Obtain the similarity score between the query result vector Q and the speed characteristics of each node in the current storage database; the expression of the similarity score Si is:

[0171] Si=Q*Mem T

[0172] Where: Mem∈R M×d Represents the storage content in the current storage database; M represents the number of storage items in the memory network; d represents the dimension of each storage item;

[0173] S263: performing a normalization operation on the similarity score to obtain an attention score of each node speed feature, and selecting the node speed feature with the highest attention score as the optimal node speed feature;

[0174] The expression of the attention score is

[0175] α=softmax(Si)

[0176] S264: Obtain matching node velocity characteristics according to the optimal node velocity characteristics The acquisition of matching node speed characteristics The expression is

[0177]

[0178] Will match node velocity features The node feature data H at time t output by the encoder unit tWeighting is performed to obtain node feature weighted data

[0179] Specifically, using the key information obtained from the memory network The final hidden state H of the enhanced encoder t , to obtain node feature weighted data So as to better guide the model to make predictions, the expression is:

[0180]

[0181] Where: Indicates the result H of the encoder output t ∈R N×h The expansion and enhancement of

[0182] And the results Input into the decoder unit of module ⑤ for decoding to obtain the final prediction result.

[0183] And the decoder unit weights the data according to the node features Get the prediction data for the next α moments with the current adaptive adjacency matrix;

[0184] Obtaining a current mean square error value between the predicted data and the actual traffic speed sequence in the spatiotemporal data training set, and determining whether the current mean square error value meets a preset error threshold;

[0185] If satisfied, it is confirmed that the currently trained spatiotemporal traffic flow prediction model is the spatiotemporal traffic flow prediction optimization model;

[0186] If it is not satisfied, the network parameter weights in the spatiotemporal traffic flow prediction model are adaptively updated, and the Chebyshev polynomial is used to adaptively adjust the road node adjacency matrix randomly given by the input encoder unit according to the current adaptive adjacency matrix To update, steps S22 to S25 are repeated.

[0187] S3: Based on the spatiotemporal traffic flow prediction optimization model, the current traffic flow time series data is concentrated according to the spatiotemporal data prediction to realize the prediction of future spatiotemporal traffic flow.

[0188] In summary, in this embodiment, by giving the historical time series {X1, X2, X3, …, X t} and the traffic road network graph structure G, predict the traffic speed data {X t+1 ,X t+2 ,X t+3 ,…,X t+α}, the prediction relationship is expressed as follows:

[0189]

[0190] Among them, F(·) represents the method used for traffic prediction, and θ represents the parameter weights that need to be learned in the prediction process;

[0191] Traffic prediction based on unknown road network structure is realized according to the prediction relationship: given a historical time series {X1,X2,X3,…,X t}, predict the traffic speed data sequence {X t+1 ,X t+2 ,X t+3 ,…,X t+α}, the traffic road network graph structure G needs to be obtained through learning, and the problem is expressed as follows:

[0192]

[0193] Wherein, F(·) represents the method for traffic prediction, i.e., the spatiotemporal traffic flow prediction optimization model in this embodiment, and G and θ are the road network graph structure and parameter weights obtained through learning.

[0194] like Figure 6 As shown above Figure 6 (a) represents a given static road graph structure, where the nodes correspond to the intersections in the road structure and the nodes on the right correspond to Figure 6 (c) is the speed of each node at different times under the road network graph structure, where times t1 and t2 represent the historical traffic speed sequences of the corresponding nodes, which are {9, 3, 2, 11, 10} and {10, 2, 3, 10, 12} respectively, and times t3 and t4 represent the predicted traffic speeds of each node obtained in combination with the road network graph structure, {7, 2, 2, 9, 8} and {6, 2, 3, 8, 9}.

[0195] Figure 6 (b) indicates that the Figure 6 (d) Given a historical traffic speed sequence, the potential road network structure obtained through learning, where the thickness of the line between nodes indicates the strength of the relationship between node intersections. The thicker the line, the closer the relationship between nodes, and vice versa. By learning the traffic speeds of each node at historical time t1 and t2 {9,3,2,11,10} and {10,2,3,10,12}, the traffic speeds at future time t3 and t4 are predicted to be {8,3,2,7,8} and {7,3,3,6,9}.

[0196] In this embodiment, a spatiotemporal traffic flow prediction model is constructed, the historical traffic flow sequence is encoded by the encoder unit to obtain the input sequence features, the input sequence features are weighted and fused by the multi-layer attention module to obtain the fusion features, the input sequence features are considered more comprehensively, and the expression ability of the input sequence features is improved. The fusion features are extracted by the Fourier convolution module, and the extracted periodic features are converted into the frequency domain space, so that the complex waveforms and traffic flow signals in the time series data are analyzed in the frequency domain space, and then more abstract information features in the input sequence features are extracted to ensure a comprehensive understanding and accurate prediction of the traffic flow dynamics; a large amount of historical traffic flow sequence information is analyzed by the pyramid memory network unit, and the most representative / typical periodic features are extracted as the analysis basis of the input sequence features, so as to improve the prediction ability of the input sequence features; and the spatiotemporal traffic flow prediction model is trained according to the spatiotemporal data training set to obtain the spatiotemporal traffic flow prediction optimization model; based on the spatiotemporal traffic flow prediction optimization model, the current traffic flow time series data in the spatiotemporal data prediction set is used to predict the future spatiotemporal traffic flow, which greatly improves the robustness and accuracy of the traffic time series prediction task.

[0197] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. An efficient spatiotemporal traffic flow prediction method, characterized in that: The following steps are involved: S1: Obtain the historical traffic flow time series data of road nodes in a given road network graph structure; The historical traffic flow time series includes a series of node speeds at each road node corresponding to a preset sampling time; and dividing the historical traffic flow time series data into a spatiotemporal data training set and a spatiotemporal data prediction set according to a preset ratio; S2: constructing a spatiotemporal traffic flow prediction model, and training the spatiotemporal traffic flow prediction model according to the spatiotemporal data training set to obtain a spatiotemporal traffic flow prediction optimization model; And the spatiotemporal traffic flow prediction model includes an acquisition module for acquiring the historical traffic flow time series of road nodes in a given road network graph structure; An encoder unit for encoding a historical traffic flow sequence to obtain input sequence features, and the encoder unit is also used to receive a road node adaptive adjacency matrix obtained by a pyramid memory network unit during model training; A multi-layer attention module for weighted fusion of input sequence features to obtain fused features; Fourier convolution module for periodic feature extraction of fused features; A pyramid memory network unit for obtaining an adaptive adjacency matrix of road nodes and matching node speed features based on periodic features; and a decoder unit for realizing spatiotemporal traffic flow prediction based on an adaptive adjacency matrix and matching node speed characteristics; S3: Based on the spatiotemporal traffic flow prediction optimization model, the current traffic flow time series data is concentrated according to the spatiotemporal data prediction to realize the prediction of future spatiotemporal traffic flow.

2. The efficient spatiotemporal traffic flow prediction method according to claim 1, characterized in that: In S2, the spatiotemporal traffic flow prediction model is trained according to the data training set, specifically comprising the following steps: S21: The traffic road network graph structure G given in the spatiotemporal data training set and the historical speed sequence {X1, X2, X3, ... ... t } as input data; The historical time series {X1, X2, X3, …, X t The traffic speed sequence {X t+1 , X t+2 , X t+3 , …, X t+α } as training output label; S22: transmitting the input data to the encoder unit through the acquisition module; The encoder unit combines the road node adaptive adjacency matrix randomly given by the pyramid memory network unit The received input data is encoded with road node space and node speed to obtain node feature data {H1, H2, ..., H t }; S23: The node feature data {H1, H2, ..., H t } perform weighted fusion to obtain the fusion feature H∈R N×h , where N represents the number of road nodes and h represents the dimension of the hidden state; S24: Extract periodic features from the fused features through the Fourier convolution module to obtain periodic feature data H out ∈R N×h ; and the periodic characteristics include the node speed of each road node corresponding to the morning peak / evening peak on weekdays, weekends and holidays; S25: obtaining a current adaptive adjacency matrix and a current node speed feature of a road node according to the periodic feature through a pyramid memory network unit, and storing the current node speed feature in a current storage database; And the current storage database is specifically: if the current node speed feature is a data feature stored for the first time, then the current storage database before the data feature stored for the first time is an empty set; If the current node speed feature is not the data feature stored for the first time, the current storage database is the collection of all data features stored before the data feature stored this time; The obtained current node speed feature is subjected to a matrix multiplication operation with the weight matrix of the pyramid memory network unit to obtain a query result vector Q of the current node speed feature; S26: Obtain the matching node speed feature of the node speed feature with the highest similarity score in the current storage database according to the query result vector Q. Will match node velocity features The node feature data H at time t output by the encoder unit t Weighting is performed to obtain node feature weighted data And the decoder unit weights the data according to the node features Get the prediction data for the next α moments with the current adaptive adjacency matrix; Obtaining a current mean square error value between the predicted data and the actual traffic speed sequence in the spatiotemporal data training set, and determining whether the current mean square error value meets a preset error threshold; If satisfied, it is confirmed that the currently trained spatiotemporal traffic flow prediction model is the spatiotemporal traffic flow prediction optimization model; If it is not satisfied, the network parameter weights in the spatiotemporal traffic flow prediction model are adaptively updated, and the Chebyshev polynomial is used to adaptively adjust the road node adjacency matrix randomly given by the input encoder unit according to the current adaptive adjacency matrix To update, steps S22 to S25 are repeated.

3. The efficient spatiotemporal traffic flow prediction method according to claim 2, characterized in that: The encoder unit and the decoder unit have the same structure and both include a graph convolutional network GCN and a gated recurrent unit GRU; The difference between the encoder unit and the decoder unit is only the input data: that is, the input data of the encoder unit is the historical traffic flow time series obtained by the acquisition module and the road node adaptive adjacency matrix obtained by the pyramid memory network unit; The input data of the decoder unit is the node feature weighted data The current adaptive adjacency matrix obtained with the pyramid memory network unit; The node feature weighted data Matching node speed features obtained by the pyramid memory network unit The node feature data H at time t output by the encoder unit t Weighted The graph convolutional network GCN is used to weight data according to historical traffic flow sequences or node features. To obtain the spatial features of road nodes, the expression of the graph convolutional network GCN is: Where: [X i , H i-1 ]∈R N×(1+h) Indicates X i ∈R N×1 , H t-1 ∈R N×h The result of the concatenation operation is the input of the graph convolutional network GCN; Θ represents the kernel function approximating the k-th order Chebyshev polynomial; *G represents the graph convolution operation; h represents the dimension of the hidden state; N represents the number of road nodes in the road network graph structure; H i-1 represents the i-1th output of the encoder unit or decoder unit; X i represents the traffic flow data at the i-th moment; represents the adjacency matrix updated using Chebyshev polynomials; k represents the order of Chebyshev polynomials; E1, E2∈R N×d And d represents the feature dimension of the road node; E1 represents the node embedding of the road node; E2 represents the node embedding of the road target node; The gated recurrent unit GRU is used to obtain historical traffic flow data sequence or node feature weighted data according to spatial features. The time feature of , and the obtained time feature is encoded or decoded to obtain the input sequence feature or the prediction data of the next α moments, the expression of the gated recurrent unit GRU is H i =(1-u i )⊙H i-1 +u i ⊙C i Where: u i , r i , C i represents the update gate, reset gate and candidate state in the encoder unit or decoder unit respectively; H i represents the i-th output of the encoder unit or decoder unit; b u , b r , b C Represent the deviation values ​​of the update gate, reset gate and candidate state respectively; Represents an adjacency matrix of order k.

4. The efficient spatiotemporal traffic flow prediction method according to claim 2, characterized in that: In S23, a multi-layer attention module is used to analyze the node feature data {H1, H2, ..., H t The expression for weighted fusion is Where: α i Represents the input node feature data The attention scores of W α With b α They represent the learnable weight value and bias value respectively; H represents the fusion feature after weighted fusion.

5. The efficient spatiotemporal traffic flow prediction method according to claim 2, characterized in that: The method for extracting periodic features from fused features by using a Fourier convolution module described in S24 is specifically as follows: S241: Use discrete Fourier transform to convert the fusion feature H into frequency domain features S242: Based on Chebyshev polynomials and multi-layer graph convolutional networks, frequency domain features Perform point-by-point product on each frequency component to obtain intermediate features in the frequency domain at different levels; S243: Integrate the intermediate frequency domain features at different levels to obtain frequency domain integrated features S244: Frequency domain integration features using inverse Fourier transform Perform inverse transformation to obtain periodic characteristic data H out .

6. The efficient spatiotemporal traffic flow prediction method according to claim 2, characterized in that: The pyramid memory network unit in S25 includes a bottom-level memory network M1, a middle-level memory network {M2, M3, ..., M L-1 } and high-level memory network M l , and can randomly give the road node adaptive adjacency matrix And the expression of the weight transformation method is Where: and Both represent M l With M l+1 The weight parameter matrix needs to be learned; The bottom memory network M1 is used to extract the periodic features and obtain the first node speed feature; The middle-level memory network {M2, M3, ..., M L-1 } is used to perform feature fusion on the first node speed feature to obtain the second node speed feature; The high-level memory network M l It is used to perform feature fusion on the second node speed feature, obtain the current node speed feature and output the current adaptive adjacency matrix of the road node.

7. The efficient spatiotemporal traffic flow prediction method according to claim 2, characterized in that: In S26, the matching node speed feature of the node speed feature with the highest similarity score in the current storage database is obtained according to the query result vector Q. Specifically: S261: By transforming the periodic characteristic data H out Perform matrix multiplication with the weight matrix in the pyramid memory network unit to obtain the query result vector Q; The query result vector Q is expressed as: Q=H out *W q Where: H out ∈R N×h represents the output after Fourier convolution transform; W q ∈R h×d represents the weight matrix; N represents the number of nodes; h represents the periodic feature data H out The dimension of ; d represents the dimension of the storage item; S262: Obtain the similarity score between the query result vector Q and the speed characteristics of each node in the current storage database; the expression of the similarity score Si is: If = Q*Mem T Where: Mem∈R M×d Represents the storage content in the current storage database; M represents the number of storage items in the memory network; d represents the dimension of each storage item; S263: performing a normalization operation on the similarity score to obtain an attention score of each node speed feature, and selecting the node speed feature with the highest attention score as the optimal node speed feature; The expression of the attention score is α = softmax(Si) S264: Obtain matching node velocity characteristics according to the optimal node velocity characteristics The acquisition of matching node speed characteristics The expression is

Citation Information

Cited By

  • Geographic traffic data processing method and device and electronic equipment

    CN119296317A

  • Freight traffic prediction method and device based on topological network spatio-temporal evolution

    CN120013380A

  • Freight flow prediction method and device based on spatiotemporal evolution of topological network

    CN120013380B

  • Road traffic operation state prediction method, system and equipment

    CN121747331A