Traffic flow prediction method under high data missing rate condition and related equipment
By constructing a spatiotemporal embedding encoder and reconstruction module for the traffic flow prediction model, the spatiotemporal dependence and heterogeneity problems of traffic flow prediction under high data missing rate are solved, and more efficient prediction results are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CENT SOUTH UNIV
- Filing Date
- 2026-04-03
- Publication Date
- 2026-05-01
AI Technical Summary
Existing traffic flow prediction methods struggle to effectively model spatiotemporal dependencies and heterogeneity under conditions of high data missing rates, resulting in poor prediction performance.
A traffic flow prediction model is constructed, including a spatiotemporal embedding encoder, a spatiotemporal reconstruction module, and a spatiotemporal prediction module. Data reconstruction and prediction are performed through node embedding representation, and model parameters are optimized using a loss function to avoid reliance on prior knowledge and error accumulation in the interpolation stage.
Under high missing rate conditions, the model has stronger robustness and applicability, can effectively model spatiotemporal dependencies and heterogeneity, improve prediction accuracy and robustness, and avoid error accumulation.
Smart Images

Figure CN121963490A_ABST
Abstract
Description
A traffic flow prediction method and related equipment under high data missing rate conditions Technical Field
[0001] This invention relates to the field of intelligent transportation technology, and in particular to a traffic flow prediction method and related equipment under conditions of high data missing rate. Background Technology
[0002] With social development and continuous urbanization, the number of motor vehicles continues to grow, and urban transportation systems are facing increasingly severe congestion problems. Traffic congestion not only reduces urban traffic efficiency but also leads to a series of problems such as energy waste, environmental pollution, and traffic safety risks. To improve urban traffic efficiency and optimize traffic resource allocation, intelligent transportation systems have become an important development direction for modern urban traffic management. Within intelligent transportation systems, traffic prediction technology, by predicting traffic flow trends over a future period, can provide crucial decision support for traffic signal control, route planning, traffic congestion management, and public transportation scheduling.
[0003] Traffic flow prediction tasks typically refer to inferring the state of traffic flow within a certain future time range by mining the spatiotemporal variation patterns contained in historical traffic data.
[0004] With the development of urban traffic sensing technology, various sensing devices such as geomagnetic sensors, induction coil detectors, video surveillance equipment, and vehicle-to-everything (V2X) devices are ubiquitous in urban road networks. These devices can continuously generate large-scale traffic operation data, providing a rich data foundation for traffic flow prediction models.
[0005] Most existing traffic flow prediction methods are based on the assumption of data completeness. These methods model the spatiotemporal dependencies and heterogeneity of traffic flow to uncover spatiotemporal patterns in its evolution. However, these methods require complete and continuous input data. In actual traffic data collection, due to factors such as sensor equipment failures, communication errors, data interpretation delays, and complex collection environments, traffic data often suffers from varying degrees of data gaps. Data gaps disrupt the spatiotemporal structure of traffic flow data, affecting the effectiveness of spatiotemporal prediction models. Specifically, missing values interfere with the stability of the spatiotemporal relationships learned by the model, potentially forming a "pseudo-spatiotemporal structure," thus affecting the modeling effect of spatiotemporal dependencies. Furthermore, missing values introduce unreasonable spatiotemporal biases, making it difficult for the model to accurately characterize the spatiotemporal differentiation of traffic flow, thereby reducing its ability to perceive spatiotemporal heterogeneity.
[0006] In recent years, some studies have begun to explore traffic flow prediction methods that can tolerate missing data, which can be mainly divided into two categories: two-stage methods of "imputation + prediction" and global modeling methods that adapt to missing values. The former usually first uses traditional statistical or deep learning methods to impute missing data, and then trains a traffic flow prediction model based on the imputed data. However, this type of method usually relies on certain domain knowledge for model design, and the overall process is relatively complex. In addition, since the data imputation process and the prediction process are independent of each other, the error generated in the imputation stage is easily amplified in the prediction stage, thus causing the overall prediction result to deviate from the optimal solution. This error accumulation phenomenon will be more significant, especially under high missing value conditions. Global modeling methods that adapt to missing values fully perceive effective spatiotemporal information from a global perspective, which alleviates the noise interference caused by missing data to a certain extent. However, when this type of method is trained and applied on large-scale traffic networks, its computational complexity is extremely high. At the same time, under high missing value conditions, this type of model has not fully taken into account spatiotemporal dependence and spatiotemporal heterogeneity modeling, making it difficult to fully reconstruct and predict the real evolution of traffic flow. Summary of the Invention
[0007] This invention provides a traffic flow prediction method and related equipment under high data missing rate conditions. Its purpose is to solve the problem that existing traffic flow prediction methods are difficult to efficiently and effectively model spatiotemporal dependencies and spatiotemporal heterogeneity under high data missing rate conditions.
[0008] To achieve the above objectives, this invention provides a traffic flow prediction method under conditions of high data missing rate, comprising: Step 1, acquiring training urban traffic flow data, training road environment data, and training time data; Step 2, training a constructed traffic flow prediction model using the training urban traffic flow data, training road environment data, and training time data, and updating the parameters of the traffic flow prediction model using a constructed loss function to obtain a trained traffic flow prediction model; Step 3, inputting historical traffic flow data, historical road environment data, and historical time data of the target city into the trained traffic flow prediction model for prediction to obtain traffic flow data for a future period; The traffic flow prediction model includes a spatiotemporal embedding encoder for extracting node embedding representations from road environment data and time data, a traffic flow spatiotemporal reconstruction module for reconstructing urban traffic flow data based on node embedding representations, and a traffic flow spatiotemporal prediction module for predicting traffic flow based on urban traffic flow data and node embedding representations.
[0009] Furthermore, prior to step 2, the process includes: calculating the maximum and minimum values of non-missing values in the urban traffic flow data used for training, and standardizing each non-missing value based on the maximum and minimum values to obtain standardized traffic flow data; calculating the maximum and minimum values of the road environment data used for training, and standardizing the road environment data based on the maximum and minimum values to obtain standardized road environment data; calculating the maximum and minimum values of the time data used for training, and standardizing the time data based on the maximum and minimum values to obtain standardized time data; and constructing a mask matrix based on the standardized traffic flow data, the mask matrix being used to describe the data missing state.
[0010] Furthermore, the spatiotemporal embedding encoder includes a first fully connected layer, a second fully connected layer, and an extension unit: the first fully connected layer is used to extract static environmental representations from the standardized road environment data; the second fully connected layer is used to extract dynamic environmental representations from the standardized temporal data; and the extension unit is used to combine the extended dynamic environmental representations with the static environmental representations to obtain node embedding representations.
[0011] Furthermore, the traffic flow spatiotemporal reconstruction module includes a third fully connected layer, a fourth fully connected layer, a first gated linear unit layer, a first linear spatial autoregressive attention operator, a first-order learning mapping network layer, and a filling layer. The third fully connected layer is used to construct a first query vector based on node embedding representations. The fourth fully connected layer is used to construct a first key vector based on node embedding representations and a mask matrix. The first gated linear unit is used to construct a first value vector based on node embedding representations and standardized traffic flow data. The first linear spatial autoregressive attention operator is used to construct an autoregressive spatiotemporal representation of traffic flow based on the first query vector, the first key vector, and the first value vector. The first-order learning mapping network layer is used to construct autoregressive traffic flow data based on the autoregressive spatiotemporal representation of traffic flow and node embedding representations. The filling layer is used to fill in historical traffic flow data based on the mask matrix and the autoregressive traffic flow data to obtain the reconstructed traffic flow data.
[0012] Furthermore, the expression for constructing the autoregressive spatiotemporal representation of traffic flow based on the first query vector, the first key vector, and the first value vector is as follows: ;in, This represents the autoregressive spatiotemporal representation of traffic flow. This represents the autoregressive attention operator in linear space. This represents the first query vector. Represents the first key vector. Represents the first value vector. This represents a vector whose values are all 1s. This indicates that it is used to extract the diagonal elements of a matrix. This represents the Hadamard product operator.
[0013] Furthermore, by filling in the historical traffic flow data with the mask matrix and autoregressive traffic flow data, the expression for the reconstructed traffic flow data is obtained as follows: ;in, This represents the reconstructed traffic flow data. Represents the mask matrix, Represents historical traffic flow data. This represents autoregressive traffic flow data.
[0014] Furthermore, the traffic flow spatiotemporal prediction module includes a fifth fully connected layer, a sixth fully connected layer, a seventh fully connected layer, a second gated linear unit layer, a second linear spatial autoregressive attention operator, and a second-order learning mapping network layer: the fifth fully connected layer is used to construct a second query vector based on node embedding representations; the sixth fully connected layer is used to construct a second key vector based on node embedding representations; the seventh fully connected layer is used to construct an embedding representation of traffic flow data based on the reconstructed traffic flow data; the second gated linear unit layer is used to construct a second value vector based on the embedding representations of traffic flow data and node embedding representations; the second linear spatial autoregressive attention operator is used to construct a traffic flow spatiotemporal representation based on the second query vector, the second key vector, and the second value vector; and the second-order learning mapping network layer is used to predict traffic flow data for a future period based on the traffic flow spatiotemporal representation and node embedding representation.
[0015] Furthermore, the expression for the loss function is: ;in, Indicates the loss value. This indicates an adjustable hyperparameter. L1 norm operator, Represents historical traffic flow data The mask matrix, Represents real future traffic flow data The mask matrix, This represents predicted future traffic flow data. This represents autoregressive traffic flow data.
[0016] This invention also provides a traffic flow prediction device under high data missing rate conditions, applying a traffic flow prediction method under high data missing rate conditions. The traffic flow prediction device includes: an acquisition module for acquiring training urban traffic flow data, training road environment data, and training time data; a training module for training a constructed traffic flow prediction model using the training urban traffic flow data, training road environment data, and training time data, and updating the parameters of the traffic flow prediction model using a constructed loss function to obtain a trained traffic flow prediction model; and a prediction module for inputting historical traffic flow data, historical road environment data, and historical time data of the target city into the trained traffic flow prediction model to predict traffic flow data for a future period. The traffic flow prediction model includes a spatiotemporal embedding encoder for extracting node embedding representations from road environment data and time data, a traffic flow spatiotemporal reconstruction module for reconstructing urban traffic flow data based on node embedding representations, and a traffic flow spatiotemporal prediction module for predicting traffic flow based on urban traffic flow data and node embedding representations.
[0017] The present invention also provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement a traffic flow prediction method under conditions of high data missing rate.
[0018] The above-mentioned solution of the present invention has the following beneficial effects: The traffic flow prediction model constructed by the present invention includes a spatiotemporal embedding encoder for extracting node embedding representations from road environment data and time data, a traffic flow spatiotemporal reconstruction module for reconstructing urban traffic flow data based on node embedding representations, and a traffic flow spatiotemporal prediction module for predicting traffic flow based on urban traffic flow data and node embedding representations. Compared with the prior art, the present invention does not rely on the assumption of data completeness, has the ability to learn and model data with high missing rate, and has stronger robustness and applicability. By jointly learning and modeling traffic flow data reconstruction and spatiotemporal prediction, the prior knowledge dependence and error accumulation in the imputation stage are effectively avoided, thereby solving the problem that existing traffic flow prediction methods are difficult to efficiently and effectively model spatiotemporal dependence and spatiotemporal heterogeneity under high data missing rate conditions.
[0019] Other beneficial effects of the present invention will be described in detail in the following detailed description section. Attached Figure Description
[0020] Figure 1 is a flowchart of an embodiment of the present invention; Figure 2 is a structural diagram of the spatiotemporal embedding encoder and the traffic flow spatiotemporal reconstruction module in an embodiment of the present invention; Figure 3 is a structural diagram of the traffic flow spatiotemporal prediction module in an embodiment of the present invention; Figure 4 is a structural diagram of the traffic flow prediction device in an embodiment of the present invention; Figure 5 is a structural diagram of the terminal device in an embodiment of the present invention. Detailed Implementation
[0021] To make the technical problems, solutions, and advantages of this invention clearer, a detailed description will be provided below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0022] In the description of this invention, it should be noted that the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0023] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a locking connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0024] Furthermore, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0025] This invention addresses existing problems by providing a traffic flow prediction method and related equipment under conditions of high data missing rate.
[0026] As shown in Figure 1, an embodiment of the present invention provides a traffic flow prediction method under conditions of high data missing rate, including: Step 1, acquiring training urban traffic flow data, training road environment data, and training time data; Step 2, training the constructed traffic flow prediction model using the training urban traffic flow data, training road environment data, and training time data, and updating the parameters of the traffic flow prediction model using the constructed loss function to obtain the trained traffic flow prediction model; Step 3, inputting the historical traffic flow data, historical road environment data, and historical time data of the target city into the trained traffic flow prediction model for prediction to obtain traffic flow data for a future period of time.
[0027] Specifically, as shown in Figure 2, the traffic flow prediction model includes a spatiotemporal embedding encoder for extracting node embedding representations from road environment data and time data, a traffic flow spatiotemporal reconstruction module for reconstructing urban traffic flow data based on node embedding representations, and a traffic flow spatiotemporal prediction module for predicting traffic flow based on urban traffic flow data and node embedding representations.
[0028] Specifically, this embodiment of the invention is based on the Large ST public dataset, and selects the GBA regional traffic flow from January 1 to December 31, 2019 as the real dataset for the embodiment. The dataset includes 2352 traffic flow monitoring stations, with a time resolution of 15 minutes, and the original data has a missing rate of about 3%. The method provided by this embodiment of the invention is specifically explained through this dataset.
[0029] Preferably, before step 2, the method further includes: calculating the maximum and minimum values of non-missing values in the urban traffic flow data used for training, and standardizing each non-missing value based on the maximum and minimum values to obtain standardized traffic flow data; calculating the maximum and minimum values of the road environment data used for training, and standardizing the road environment data based on the maximum and minimum values to obtain standardized road environment data; calculating the maximum and minimum values of the time data used for training, and standardizing the time data based on the maximum and minimum values to obtain standardized time data; and constructing a mask matrix based on the standardized traffic flow data, wherein the mask matrix is used to describe the data missing state.
[0030] Specifically, the system acquires GBA regional traffic flow data containing missing values, acquires Alpha Earth ground observation representation data corresponding to traffic flow monitoring stations for the client's road environment, and acquires time and week data corresponding to the traffic flow data as time data. The urban traffic flow data is divided into training set, validation set and test set, where the training set is used to update the parameters of the traffic flow prediction model, the validation set is used to check the convergence of the model, and the test set is used to evaluate the prediction performance of the model.
[0031] This invention calculates the maximum and minimum values of non-missing values in the traffic flow data of the training set, and then standardizes each non-missing value in the urban traffic flow data based on the maximum and minimum values. The standardization calculation formula is as follows: ;in, Represents the standardized non-missing values. Indicates the maximum value. Represents the minimum value, standardized traffic flow data. Standardized results of multiple non-missing values In this embodiment of the invention, standardized traffic flow data is used as historical traffic flow data for model testing, verification, and subsequent use. This indicates the number of traffic flow monitoring points. , Indicates the length of the communication sequence. .
[0032] This invention constructs a mask matrix based on standardized traffic flow data. The mask matrix is used to describe the data missing state, and the formula is as follows: ;in, Indicates the first Traffic flow monitoring points at Traffic flow at any given time express For non-missing values, express This is a missing value.
[0033] This invention employs a traffic flow data standardization method to standardize road environment data and time data, resulting in standardized road environment data. and time data ,in, This represents the dimension of road environmental variables. The dimension of the time variable.
[0034] Specifically, as shown in Figure 2, the spatiotemporal embedding encoder includes a first fully connected layer, a second fully connected layer, and an extension unit: the first fully connected layer is used to extract static environmental representations from the standardized road environment data; the second fully connected layer is used to extract dynamic environmental representations from the standardized time data; and the extension unit is used to combine the extended dynamic environmental representations with the static environmental representations to obtain node embedding representations.
[0035] More specifically, embodiments of the present invention utilize standardized road environment data from the first fully connected layer. The formula for extracting static environment characteristics is: ;in, This represents a self-learned spatial embedding representation. The dimension representing the embedded representation. , All represent the learnable parameters in the first fully connected layer. The feature concatenation operator is represented; the formula for extracting dynamic environment representations from standardized time data using the second fully connected layer is: ;in, , All represent learnable parameters in the second fully connected layer; the dynamic environment representation is extended using extension units. Post-static environment characterization Combining these, the formula for the node embedding representation is obtained as follows: ;in, This represents the node embedding representation.
[0036] Specifically, as shown in Figure 2, the traffic flow spatiotemporal reconstruction module includes a third fully connected layer, a fourth fully connected layer, a first gated linear unit layer, a first linear spatial autoregressive attention operator, a first-ary learning mapping network layer, and a filling layer. The third fully connected layer is used to construct a first query vector based on node embedding representations. The fourth fully connected layer is used to construct a first key vector based on node embedding representations and a mask matrix. The first gated linear unit is used to construct a first value vector based on node embedding representations and standardized traffic flow data. The first linear spatial autoregressive attention operator is used to construct an autoregressive spatiotemporal representation of traffic flow based on the first query vector, the first key vector, and the first value vector. The first-ary learning mapping network layer is used to construct autoregressive traffic flow data based on the autoregressive spatiotemporal representation of traffic flow and node embedding representations. The filling layer is used to fill in historical traffic flow data based on the mask matrix and the autoregressive traffic flow data to obtain reconstructed traffic flow data.
[0037] More specifically, in this embodiment of the invention, the formula for constructing the first query vector by embedding node representations into the third fully connected layer is as follows: ;in, This represents the first query vector. This represents a matrix where all values are 1. , All represent learnable parameters in the third fully connected layer; the formula for constructing the first key vector by inputting the node embedding representation and mask matrix into the fourth fully connected layer is: ;in, Represents the first key vector. , All represent learnable parameters in the fourth fully connected layer; the expression for constructing the first value vector by inputting the node embedding representation and standardized traffic flow data into the first gated linear unit is: ;in, This represents the autoregressive spatiotemporal representation of traffic flow. , , , All represent the learnable parameters in the first gated linear unit. This represents the Hadamard product operator. The formula for constructing an autoregressive spatiotemporal representation of traffic flow by inputting the first query vector, the first key vector, and the first value vector into the first linear spatial autoregressive attention operator is as follows: ;in, This represents the autoregressive spatiotemporal representation of traffic flow. This represents the autoregressive attention operator in linear space. This represents the first query vector. Represents the first key vector. Represents the first value vector. This represents a vector whose values are all 1s. This represents the Hadamard product operator. The positive definite random feature of the first query vector is expressed as follows: ; The positive definite random characteristic of the first key vector is expressed as follows: ; This is used to extract the diagonal elements of a matrix, and its calculation expression is: In the formula, and They represent queries respectively. s and keys The row element, All follow a normal distribution random numbers, A vector whose values are all 1. The dimension representing the random feature. Represents the exponential kernel function. The expression for constructing autoregressive traffic flow data by inputting the autoregressive spatiotemporal representation of traffic flow and the node embedding representation into the first-order learning mapping network layer is as follows: ; ; ;in, Indicates the first Autoregressive traffic flow data from individual traffic flow monitoring points Indicates the first Node embedding representation of each traffic flow monitoring point Indicates the first Autoregressive spatiotemporal representation of traffic flow at each traffic flow monitoring point , Both represent shared learnable parameters in the first cloud learning mapping network layer, which can generate mapping parameters for each traffic flow monitoring point based on the node embedding representation of each traffic flow monitoring point.
[0038] The mask matrix and autoregressive traffic flow data are input into the imputation layer to impute the historical traffic flow data, resulting in the following expression for the reconstructed traffic flow data: ;in, This represents the reconstructed traffic flow data. Represents the mask matrix, This represents autoregressive traffic flow data; in this embodiment of the invention, because It is spatiotemporally dynamic, and the generated... It is also spatiotemporally dynamic, allowing for efficient modeling of spatiotemporal heterogeneity.
[0039] Specifically, as shown in Figure 3, the traffic flow spatiotemporal prediction module includes a fifth fully connected layer, a sixth fully connected layer, a seventh fully connected layer, a second gated linear unit layer, a second linear spatial autoregressive attention operator, and a second-order learning mapping network layer. The fifth fully connected layer is used to construct a second query vector based on node embedding representations; the sixth fully connected layer is used to construct a second key vector based on node embedding representations; the seventh fully connected layer is used to construct an embedding representation of traffic flow data based on the reconstructed traffic flow data; the second gated linear unit layer is used to construct a second value vector based on the embedding representations of traffic flow data and node embedding representations; the second linear spatial autoregressive attention operator is used to construct a traffic flow spatiotemporal representation based on the second query vector, the second key vector, and the second value vector; and the second-order learning mapping network layer is used to predict traffic flow data for a future period based on the traffic flow spatiotemporal representation and node embedding representation.
[0040] More specifically, in this embodiment of the invention, the expression for constructing the second query vector by embedding node representations into the fifth fully connected layer is as follows: ;in, This represents the second query vector. , All represent the learnable parameters in the fifth fully connected layer; the expression for constructing the second key vector by inputting the node embedding representation into the sixth fully connected layer is: ;in, Represents the second key vector. , All represent learnable parameters in the sixth fully connected layer; the expression for constructing an embedded representation of the traffic flow data by inputting the reconstructed traffic flow data into the seventh fully connected layer is: ;in, This represents the embedded representation of traffic flow data. , All represent learnable parameters in the seventh fully connected layer; the expression for constructing the second value vector by inputting the embedded representation of traffic flow data and the embedded representation of nodes into the second gated linear unit layer is: ;in, Represents the second value vector. , , , All represent learnable parameters in the second gated linear unit layer; the expression for constructing a spatiotemporal representation of traffic flow by inputting the second query vector, the second key vector, and the second value vector into the second linear spatial autoregressive attention operator is as follows: ;in, Representing the spatiotemporal characterization of traffic flow, The linear spatial attention operator is used to input the spatiotemporal representation of traffic flow and the node embedding representation into the second-order learning mapping network layer to predict traffic flow data over a future period. The expression is as follows: ; ; ;in, Indicates the first Future traffic flow forecasts for each traffic flow monitoring point Indicates the first Spatiotemporal representation of traffic flow at each traffic flow monitoring point , The shared learnable parameters in the second-order learning mapping network layer enable the generation of mapping parameters for each traffic flow monitoring point based on the node embedding representation of each traffic flow monitoring point. , .
[0041] It is worth noting that, For the exponent kernel The theoretical approximation is comparable to the quadratic complexity of traditional spatial attention. The linear spatial autoregressive attention operator provided in this embodiment of the invention has only linear complexity. , In global spatiotemporal dependency modeling methods, the linear space autoregressive attention operator has a significant efficiency advantage.
[0042] In this embodiment of the invention, the network parameters of the optimized model are trained and iterated until the loss function value in the validation set reaches the minimum value, thus obtaining a trained traffic flow prediction model.
[0043] Specifically, the expression for the loss function is: ;in, Indicates the loss value. This indicates an adjustable hyperparameter. , L1 norm operator, Represents historical traffic flow data The mask matrix, Represents real future traffic flow data The mask matrix, This represents predicted future traffic flow data. This represents autoregressive traffic flow data.
[0044] In this embodiment of the invention, the error calculated by the loss function is passed to each learnable parameter in the traffic flow prediction model based on the backpropagation algorithm, and the Adam optimizer is applied to update these parameters.
[0045] This invention presents three missing scenarios. Based on a test set, the prediction performance of this invention and existing traffic flow prediction methods under these three missing scenarios is compared and analyzed to verify the effectiveness of the method provided by this invention.
[0046] The comparison methods include: ① Gated Recurrent Unit (GRU); ② Spatial-Temporal Graph Convolutional Network (STGCN); ③ Adaptive Graph Convolutional Recurrent Network (AGCRN); ④ Spatial Temporal Compressed Sensing Prediction Network (STCSPN). Specific steps include: designing three high data missing scenarios with a data missing rate of 80%: point-like missing data, temporal block missing data, and spatiotemporal block missing data, respectively simulating three real-world data missing situations: short-term failure of a single sensor, long-term sensor downtime, and regional communication failure. Point-like missing data is expressed by the formula: In the formula, Indicates the first Traffic flow monitoring stations at The probability of missing time-matter data. Indicates expectation as The Bernoulli distribution. Time block missing is expressed by the formula: This formula indicates that the first... Traffic flow monitoring stations at The probability of missing data at any given time, and in The probability of missing data at any given moment is not independent, and the missing data exhibits a certain temporal continuity. The missing spatiotemporal block can be expressed by the formula: In the formula, Indicates the first The set of monitoring stations spatially adjacent to a traffic flow monitoring station, the formula shows that the first... Traffic flow monitoring stations at The probability of missing data at any given time, and in The probability of missing time-series data and in The probability of missing data from neighboring sites in time and space is not independent, and the missing data exhibits a certain degree of spatiotemporal continuity; the mean absolute error (MAE), root mean square error (RMSE), and coefficient of determination (R²) are used to measure this. 2 As an evaluation metric, the prediction results of each model are compared using the following formula: ; ; In the formula, and These represent the actual and predicted values of future traffic flow in the test set ES, respectively. for The mask matrix, express The smaller the average values of MAE and RMSE, the better the R. 2 The larger the value, the higher the prediction accuracy of the traffic flow prediction model. Table 1 below shows the comparison results of the prediction accuracy of the embodiments of this invention and the comparative methods in a scenario with 80% point-like missing data: Table 1
[0047] By comparing the prediction error and accuracy of the embodiments of the present invention and the comparative methods in the traffic flow prediction task under the scenario of 80% missing time blocks, the present method outperforms the other four comparative methods in all three evaluation indicators; the comparison results of the prediction accuracy of the embodiments of the present invention and the comparative methods under the scenario of 80% missing time blocks are shown in Table 2 below: Table 2
[0048] By comparing the prediction error and accuracy of the embodiments of the present invention and the comparative methods in the traffic flow prediction task under the scenario of 80% missing time blocks, the present method outperforms the other four comparative methods in all three evaluation indicators; the comparison results of the prediction accuracy of the embodiments of the present invention and the comparative methods under the scenario of 80% missing time blocks are shown in Table 3 below: Table 3
[0049] By comparing the prediction error and accuracy of the embodiments of the present invention and the comparative methods in the traffic flow prediction task under the scenario of 80% spatiotemporal block missing, the present method is significantly better than the other four comparative methods in all three evaluation indicators.
[0050] As can be seen from Tables 1, 2 and 3, the method provided by the embodiments of the present invention can achieve the best prediction effect in various scenarios with high data missing rate, and has strong robustness and excellent prediction performance, which can better meet the needs of urban traffic dynamic operation monitoring.
[0051] In summary, the traffic flow prediction model constructed in this embodiment includes a spatiotemporal embedding encoder for extracting node embedding representations from road environment data and time data, a traffic flow spatiotemporal reconstruction module for reconstructing urban traffic flow data based on node embedding representations, and a traffic flow spatiotemporal prediction module for predicting traffic flow based on urban traffic flow data and node embedding representations. Compared with the prior art, this embodiment does not rely on the assumption of data completeness, has the ability to learn and model data with high missing rates, and has stronger robustness and applicability. By jointly learning and modeling traffic flow data reconstruction and spatiotemporal prediction, it effectively avoids the reliance on prior knowledge and error accumulation in the imputation stage, thereby solving the problem that existing traffic flow prediction methods are difficult to efficiently and effectively model spatiotemporal dependencies and spatiotemporal heterogeneity under high data missing rate conditions.
[0052] As shown in Figure 4, this embodiment of the invention also provides a traffic flow prediction device 100 under high data missing rate conditions, corresponding to the traffic flow prediction method under high data missing rate conditions described in the previous embodiment. The traffic flow prediction device 100 includes: an acquisition module 101, used to acquire training urban traffic flow data, training road environment data, and training time data; a training module 102, used to train a constructed traffic flow prediction model using the training urban traffic flow data, training road environment data, and training time data, and to update the parameters of the traffic flow prediction model using a constructed loss function to obtain a trained traffic flow prediction model; and a prediction module 103, used to input historical traffic flow data, historical road environment data, and historical time data of the target city into the trained traffic flow prediction model for prediction to obtain traffic flow data for a future period of time. The traffic flow prediction model includes a spatiotemporal embedding encoder for extracting node embedding representations from road environment data and time data, a traffic flow spatiotemporal reconstruction module for reconstructing urban traffic flow data based on node embedding representations, and a traffic flow spatiotemporal prediction module for predicting traffic flow based on urban traffic flow data and node embedding representations.
[0053] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0054] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0055] This invention also provides a terminal device, as shown in FIG5. The terminal device D10 of this embodiment includes: at least one processor D100 (only one processor is shown in FIG5), a memory D101, and a computer program D102 stored in the memory D101 and executable on the at least one processor D100. When the processor D100 executes the computer program D102, it implements the above-described traffic flow prediction method under high data missing rate conditions.
[0056] The terminal device D10 can be a desktop computer, laptop, handheld computer, server, server cluster, or cloud server, etc. This terminal device may include, but is not limited to, a processor D100 and a memory D101. Those skilled in the art will understand that Figure 5 is merely an example of the terminal device D10 and does not constitute a limitation on the terminal device D10. It may include more or fewer components than shown, or combine certain components, or different components; for example, it may also include input / output devices, network access devices, etc.
[0057] The processor D100 can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0058] In some embodiments, the memory D101 may be an internal storage unit of the terminal device D10, such as a hard disk or memory of the terminal device D10. In other embodiments, the memory D101 may be an external storage device of the terminal device D10, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on the terminal device D10. Furthermore, the memory D101 may include both internal and external storage units of the terminal device D10. The memory D101 is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory D101 can also be used to temporarily store data that has been output or will be output.
[0059] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0060] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0061] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A traffic flow prediction method under conditions of high data missing rate, characterized in that, include: Step 1: Obtain training urban traffic flow data, training road environment data, and training time data; Step 2: Train the constructed traffic flow prediction model using the training urban traffic flow data, the training road environment data, and the training time data, and update the parameters of the traffic flow prediction model using the constructed loss function to obtain the trained traffic flow prediction model; Step 3: Input the historical traffic flow data, historical road environment data, and historical time data of the target city into the trained traffic flow prediction model for prediction to obtain traffic flow data for a future period; The traffic flow prediction model includes a spatiotemporal embedding encoder for extracting node embedding representations from road environment data and time data, a traffic flow spatiotemporal reconstruction module for reconstructing urban traffic flow data based on node embedding representations, and a traffic flow spatiotemporal prediction module for predicting traffic flow based on urban traffic flow data and the node embedding representations.
2. The traffic flow prediction method under high data missing rate conditions according to claim 1, characterized in that, Before step 2, the method further includes: calculating the maximum and minimum values of non-missing values in the training urban traffic flow data, and standardizing each non-missing value based on the maximum and minimum values to obtain standardized traffic flow data; calculating the maximum and minimum values of the training road environment data, and standardizing the training road environment data based on the maximum and minimum values to obtain standardized road environment data; calculating the maximum and minimum values of the training time data, and standardizing the training time data based on the maximum and minimum values to obtain standardized time data; and constructing a mask matrix based on the standardized traffic flow data, wherein the mask matrix is used to describe the data missing state.
3. The traffic flow prediction method under high data missing rate conditions according to claim 2, characterized in that, The spatiotemporal embedding encoder includes a first fully connected layer, a second fully connected layer, and an extension unit: the first fully connected layer is used to extract static environmental representations from standardized road environment data; the second fully connected layer is used to extract dynamic environmental representations from standardized time data; and the extension unit is used to expand the dynamic environmental representations and combine them with the static environmental representations to obtain node embedding representations.
4. The traffic flow prediction method under high data missing rate conditions according to claim 3, characterized in that, The traffic flow spatiotemporal reconstruction module includes a third fully connected layer, a fourth fully connected layer, a first gated linear unit layer, a first linear spatial autoregressive attention operator, a first meta-learning mapping network layer, and a filling layer. The third fully connected layer is used to construct a first query vector based on the node embedding representation. The fourth fully connected layer is used to construct a first key vector based on the node embedding representation and the mask matrix. The first gated linear unit is used to construct a first value vector based on the node embedding representation and the standardized traffic flow data. The first linear spatial autoregressive attention operator is used to construct an autoregressive spatiotemporal representation of traffic flow based on the first query vector, the first key vector, and the first value vector. The first meta-learning mapping network layer is used to construct autoregressive traffic flow data based on the autoregressive spatiotemporal representation of traffic flow and the node embedding representation. The filling layer is used to fill in historical traffic flow data based on the mask matrix and the autoregressive traffic flow data to obtain reconstructed traffic flow data.
5. The traffic flow prediction method under high data missing rate conditions according to claim 4, characterized in that, The expression for constructing the autoregressive spatiotemporal representation of traffic flow based on the first query vector, the first key vector, and the first value vector is as follows: ;in, This represents the autoregressive spatiotemporal representation of traffic flow. This represents the autoregressive attention operator in linear space. This represents the first query vector. Represents the first key vector. Represents the first value vector. This represents a vector whose values are all 1s. This indicates that it is used to extract the diagonal elements of a matrix. This represents the Hadamard product operator.
6. The traffic flow prediction method under high data missing rate conditions according to claim 4, characterized in that, Based on the mask matrix and the autoregressive traffic flow data, the historical traffic flow data is filled in to obtain the expression for the reconstructed traffic flow data as follows: ;in, This represents the reconstructed traffic flow data. Represents the mask matrix, Represents historical traffic flow data. This represents autoregressive traffic flow data.
7. The traffic flow prediction method under high data missing rate conditions according to claim 4, characterized in that, The traffic flow spatiotemporal prediction module includes a fifth fully connected layer, a sixth fully connected layer, a seventh fully connected layer, a second gated linear unit layer, a second linear spatial autoregressive attention operator, and a second meta-learning mapping network layer: the fifth fully connected layer is used to construct a second query vector based on the node embedding representation; the sixth fully connected layer is used to construct a second key vector based on the node embedding representation; The seventh fully connected layer is used to construct an embedded representation of the traffic flow data based on the reconstructed traffic flow data; the second gated linear unit layer is used to construct a second value vector based on the embedded representation of the traffic flow data and the node embedded representation. The second linear spatial autoregressive attention operator is used to construct a spatiotemporal representation of traffic flow based on the second query vector, the second key vector, and the second value vector. The second grammatical learning mapping network layer is used to predict traffic flow data over a future period based on the traffic flow spatiotemporal representation and the node embedding representation.
8. The traffic flow prediction method under high data missing rate conditions according to claim 1, characterized in that, The expression for the loss function is: ;in, Indicates the loss value. This indicates an adjustable hyperparameter. L1 norm operator, Represents historical traffic flow data The mask matrix, Represents real future traffic flow data The mask matrix, This represents predicted future traffic flow data. This represents autoregressive traffic flow data.
9. A traffic flow prediction device under high data missing rate conditions, characterized in that, The traffic flow prediction method under high data missing rate conditions as described in any one of claims 1-8, the traffic flow prediction device comprising: an acquisition module for acquiring training urban traffic flow data, training road environment data, and training time data; a training module for training a constructed traffic flow prediction model using the training urban traffic flow data, the training road environment data, and the training time data, and updating the parameters of the traffic flow prediction model using a constructed loss function to obtain a trained traffic flow prediction model; and a prediction module for inputting historical traffic flow data, historical road environment data, and historical time data of a target city into the trained traffic flow prediction model for prediction to obtain traffic flow data for a future period; the traffic flow prediction model comprising a spatiotemporal embedding encoder for extracting node embedding representations from road environment data and time data, a traffic flow spatiotemporal reconstruction module for reconstructing urban traffic flow data based on node embedding representations, and a traffic flow spatiotemporal prediction module for predicting traffic flow based on urban traffic flow data and the node embedding representations.
10. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the traffic flow prediction method under high data missing rate conditions as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Urban road traffic missing data interpolation method and related equipment
CN115599779A
Traffic flow prediction method and system containing missing data
CN115700628A
Traffic prediction method and system based on self-supervised learning
CN118277815A
Traffic flow data interpolation and prediction method based on multi-task pre-training fine-tuning normal form
CN119903953A