Time Series Prediction Method, Device, Medium and Equipment in the Scenario of Missing Data
By constructing a traffic graph structure and reconstructing missing data using multi-scale convolutional models and spatio-time graph convolution networks, the time series prediction accuracy problem in data loss scenarios is solved, and higher prediction accuracy is achieved.
Patent Information
- Application Number
- CN202510473533.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-04-16
AI Technical Summary
In the time series prediction in the data missing scenario, the interpolation of missing values causes the model to capture incorrect timing dependencies, resulting in low prediction accuracy.
By building a traffic graph structure, using missing mask information and feature extraction, combining multi-scale convolutional models and spatiotemporal graph convolution networks, missing data is reconstructed, space-time dependencies under complete data are established, and prediction accuracy is improved.
It effectively reduces the model prediction error caused by data loss and improves the accuracy of time series prediction in data loss scenarios.
Smart Images

Figure CN119988948B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of artificial intelligence, and particularly to a time series prediction method, device, medium and equipment in a data missing scenario. Background Art
[0002] Currently, the prediction task of multivariate time series is generally applied to traffic scenarios. Time series prediction is to predict their future values based on a set of past historical observation data and guide subsequent operations according to the predicted values. However, in real life, due to some accidents, such as equipment failures, acquisition errors, or difficult data acquisition, etc., the data is always incomplete, that is, there is data missing, and these incomplete data will cause large errors in subsequent time series prediction work.
[0003] In the prior art, the processing method of missing data is usually to use existing interpolation methods to interpolate the missing values, and then use the interpolated data to perform downstream prediction tasks. However, when this approach is applied to a time series prediction model, the interpolated values corresponding to the missing values may cause the model to capture incorrect time series dependencies, and error accumulation will also occur in multi-step prediction, resulting in a low accuracy of time series prediction.
[0004] Therefore, how to improve the accuracy of time series prediction in a data missing scenario has become an urgent problem to be solved. Summary of the Invention
[0005] In view of the above technical problems, the technical solution adopted by the present invention is a time series prediction method in a data missing scenario, and the time series prediction method in the data missing scenario includes:
[0006] S101, determining missing mask information corresponding to the target traffic data according to the missing situation of each acquisition data in the target traffic data, where the target traffic data includes acquisition data of N target traffic parameters at T acquisition time points respectively, and each acquisition data includes acquisition sub-data corresponding to D acquisition dimensions respectively, and N, T, and D are all integers greater than one.
[0007] S102, respectively performing feature extraction on the target traffic data and the missing mask information to obtain a first fusion feature vector corresponding to the target traffic data and a second fusion feature vector corresponding to the missing mask information.
[0008] S103, using each target traffic parameter as a graph node, and using the acquisition data of each target traffic parameter at T acquisition time points as the information of the corresponding graph node, to construct a traffic graph structure corresponding to the target traffic data.
[0009] S104. Obtain the predefined adjacency matrix and the reference adjacency matrix corresponding to the traffic graph structure according to the traffic graph structure.
[0010] S105. Determine the correlation matrix corresponding to the traffic graph structure according to the second fusion feature vector and the reference adjacency matrix.
[0011] S106. Obtain the missing reconstructed traffic data according to the correlation matrix, the first fusion feature vector, the predefined adjacency matrix, and the trained graph convolutional network.
[0012] S107. Input the missing reconstructed traffic data into the trained time series prediction model to obtain the predicted traffic data corresponding to the target traffic data.
[0013] The present invention also provides a time series prediction device in a data missing scenario. The time series prediction device includes:
[0014] A mask generation module, configured to determine the missing mask information corresponding to the target traffic data according to the missing conditions of each acquisition data in the target traffic data, where the target traffic data includes the acquisition data of N target traffic parameters at T acquisition time points respectively, and each acquisition data includes the acquisition sub-data corresponding to D acquisition dimensions respectively, and N, T, and D are all integers greater than one.
[0015] A feature extraction module, configured to perform feature extraction on the target traffic data and the missing mask information respectively to obtain the first fusion feature vector corresponding to the target traffic data and the second fusion feature vector corresponding to the missing mask information.
[0016] A graph construction module, configured to use each target traffic parameter as a graph node, and use the acquisition data of each target traffic parameter at T acquisition time points as the information of the corresponding graph node to construct the traffic graph structure corresponding to the target traffic data.
[0017] A first matrix acquisition module, configured to obtain the predefined adjacency matrix and the reference adjacency matrix corresponding to the traffic graph structure according to the traffic graph structure.
[0018] A second matrix acquisition module, configured to determine the correlation matrix corresponding to the traffic graph structure according to the second fusion feature vector and the reference adjacency matrix.
[0019] A data reconstruction module, configured to obtain the missing reconstructed traffic data according to the correlation matrix, the first fusion feature vector, the predefined adjacency matrix, and the trained graph convolutional network.
[0020] A time series prediction module, configured to input the missing reconstructed traffic data into the trained time series prediction model to obtain the predicted traffic data corresponding to the target traffic data.
[0021] The present invention also provides a non-transitory computer-readable storage medium, in which at least one instruction or at least one program segment is stored, and the at least one instruction or at least one program segment is loaded and executed by a processor to implement the time series prediction method in the above data missing scenario.
[0022] The present invention also provides an electronic device, including a processor and the above non-transitory computer-readable storage medium.
[0023] Compared with the prior art, the present invention has obvious beneficial effects. By means of the above technical solutions, a time series prediction method in a data missing scenario provided by the present invention can achieve considerable technological progressiveness and practicability, and has wide utilization value in the industry. It has at least the following beneficial effects:
[0024] The degree of completion of the missing value is characterized by the missing mask information. When introducing the missing mask information features into the target traffic data through the time series prediction model, the model prediction error caused by data missing is effectively reduced. By combining the features of different scales learned by the multi-scale convolution model with the time series features, the prediction accuracy is improved. The missing values are reconstructed through the spatio-temporal graph convolutional network to establish the spatio-temporal dependence relationship under the complete data, avoiding the construction of incorrect spatio-temporal dependence relationships in the case of incomplete data. Then, the missing reconstructed traffic data is applied to the time series prediction task, thereby improving the accuracy of time series prediction in the data missing scenario. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0026] Figure 1 It is a schematic flowchart of a time series prediction method in a data missing scenario provided by Embodiment 1 of the present invention;
[0027] Figure 2 It is a schematic structural diagram of a time series prediction device in a data missing scenario provided by Embodiment 2 of the present invention. DETAILED DESCRIPTION
[0028] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts fall within the protection scope of the present invention.
[0029] Example 1
[0030] This Example 1 provides a time series prediction method in a data missing scenario. Refer to Figure 1 , which is a schematic flowchart of a time series prediction method in a data missing scenario provided by an embodiment of the present invention, including:
[0031] S101. According to the missing situation of each acquisition data in the target traffic data, determine the missing mask information corresponding to the target traffic data, where the target traffic data includes the acquisition data of N target traffic parameters at T acquisition time points respectively, and each acquisition data includes the acquisition sub-data corresponding to D acquisition dimensions respectively, and N, T, and D are all integers greater than one.
[0032] S102. Respectively perform feature extraction on the target traffic data and the missing mask information to obtain a first fusion feature vector corresponding to the target traffic data and a second fusion feature vector corresponding to the missing mask information.
[0033] S103. Use each target traffic parameter as a graph node, and use the acquisition data of each target traffic parameter at T acquisition time points as the information of the corresponding graph node to construct a traffic graph structure corresponding to the target traffic data.
[0034] S104. According to the traffic graph structure, obtain a predefined adjacency matrix and a reference adjacency matrix corresponding to the traffic graph structure.
[0035] S105. According to the second fusion feature vector and the reference adjacency matrix, determine a correlation matrix corresponding to the traffic graph structure.
[0036] S106. According to the correlation matrix, the first fusion feature vector, the predefined adjacency matrix, and the trained graph convolutional network, obtain the missing reconstructed traffic data.
[0037] S107. Input the missing reconstructed traffic data into the trained time series prediction model to obtain the predicted traffic data corresponding to the target traffic data.
[0038] Among them, the target traffic parameters may include road section flow parameters, traffic density parameters, road network parameters, etc. Each target traffic parameter corresponds to D acquisition dimensions. For target traffic parameters with less than D acquisition dimensions, they can be extended to D acquisition dimensions by filling in preset values. For example, when the target traffic parameter is the road section flow parameter, the acquisition dimensions may include the number of vehicles passing through the road section in D acquisition time periods, etc.
[0039] The acquisition time points can be set customarily. In this example, the acquisition time points can be determined according to a fixed period, that is, the time interval between adjacent acquisition time points is a fixed period.
[0040] Specifically, the target traffic parameters can be represented by a tensor of size N×T×D, and the missing mask information can be represented by a matrix of size N×T to indicate data missing information. If a certain target traffic parameter has no data collected at a certain time point, that is, a data missing situation occurs, then the element value corresponding to this target traffic parameter and this time point in the missing mask information is the first mask value; otherwise, it is the second mask value. The first mask value can be 0, and the second mask value can be 1, thus clearly and intuitively presenting the integrity of the target traffic data, providing a clear indication for subsequent processing of missing data, and facilitating targeted data filling or analysis.
[0041] For the target traffic data, key features are extracted through a specific algorithm or model and combined to form the first fusion feature vector to fuse the key feature information under different parameters, time points, and dimensions in the target traffic data, which is used to characterize important information such as the operating state and change trend of the traffic system reflected by the target traffic data.
[0042] The same algorithm or model is used to extract features from the missing mask information to obtain the second fusion feature vector to fuse the key feature information of the data missing pattern and distribution, which is used to characterize the data missing situation.
[0043] The first fusion feature vector and the second fusion feature vector convert high-dimensional data into low-dimensional feature vectors, enabling subsequent models to process data more efficiently, avoiding problems such as excessive computational burden and overfitting caused by too high data dimensions, and highlighting the core features of the data, which helps to improve the performance and prediction accuracy of the model.
[0044] By constructing a traffic graph structure, the relationships between different target traffic parameters and at different time points can be intuitively displayed, providing a structured representation form for subsequent analysis and processing, and helping to more effectively mine and analyze complex patterns and associations in traffic data using the structural properties of the graph.
[0045] The predefined adjacency matrix is a matrix generated according to a preset rule, which is used to describe the fixed relationships between nodes (i.e., target traffic parameters) in the traffic graph structure. The reference adjacency matrix is obtained through a more in-depth analysis of the traffic graph structure, which can more accurately capture the complex relationships between nodes in the traffic graph structure, considering factors such as the similarity and correlation between node information (i.e., time series data of traffic parameters), and providing a relationship description that is more in line with the actual situation for subsequent calculations and analysis.
[0046] The correlation matrix is calculated by combining the second fusion feature vector and the reference adjacency matrix. The elements in the matrix represent the degree of correlation between different target traffic parameters considering data missing. By comprehensively considering data missing and node relationships, the correlation degree between different traffic parameters can be measured more accurately, providing key information for understanding the mutual influence between parameters in the traffic system and the relationship stability in the case of data missing.
[0047] The graph convolutional network is used to process graph-structured data. By performing convolutional operations on the nodes of the traffic graph structure, information transfer and feature extraction between nodes are realized, so as to infer and reconstruct the missing traffic data by using the correlation matrix, the first fusion feature vector and the predefined adjacency matrix, giving full play to the advantages of graph-structured data and improving the accuracy and rationality of data filling.
[0048] The time series prediction model is used to predict time series data, and can learn the time-dependent relationships and patterns in the time series data. Thus, according to the missing and reconstructed traffic data, the traffic parameter values at different future time points can be predicted, helping the traffic management department to make plans and decisions in advance. The time series prediction model is, for example, a recurrent neural network and its variants.
[0049] It should be noted that, in order to enhance the spatial receptive field and temporal receptive field of the model, the iteration round can be initialized to 0. After obtaining the missing and reconstructed traffic data and the second fusion feature vector, the missing and reconstructed traffic data can be used as the target traffic data, the second fusion feature vector can be used as the missing mask information, and the iteration round is incremented by 1. Then return to execute steps S101 to S107 until the iteration round meets the preset round. In this embodiment, the preset round can be set to 3. In addition, skip connections can be introduced between multiple iteration rounds to capture deeper hidden information.
[0050] In a specific implementation manner, S102 includes the following steps:
[0051] S1021, input the target traffic data and the missing mask information into the trained time series feature extraction model respectively, and obtain the first time series feature vector corresponding to the target traffic data and the second time series feature vector corresponding to the missing mask information.
[0052] S1022, input the target traffic data and the missing mask information into the trained multi-scale convolutional model respectively, and obtain the first multi-scale feature vector corresponding to the target traffic data and the second multi-scale feature vector corresponding to the missing mask information.
[0053] S1023, according to the first time series feature vector and the first multi-scale feature vector corresponding to the target traffic data, obtain the first fusion feature vector corresponding to the target traffic data.
[0054] S1024. Obtain a second fusion feature vector corresponding to the missing mask information based on the second temporal feature vector and the second multi-scale feature vector corresponding to the missing mask information.
[0055] Among them, the trained temporal feature extraction model and the trained multi-scale convolutional model can process the target traffic data and the missing mask information in parallel.
[0056] Specifically, the multi-scale convolutional model can perform convolution operations on the input data using several convolutional kernels of different sizes to obtain output results corresponding to each convolutional kernel. In this embodiment, the number of convolutional kernels is set to K. Input the target traffic data into the trained multi-scale convolutional model to obtain K first convolutional results corresponding to the target traffic data. Perform a concatenation operation on the K first convolutional results in the channel dimension to obtain a concatenated vector corresponding to the target traffic data. Input the missing mask information into the trained multi-scale convolutional model to obtain K second convolutional results corresponding to the missing mask information. Perform max pooling on the K second convolutional results to obtain a second multi-scale feature vector corresponding to the missing mask information. In this embodiment, K can be set to 3, and the sizes of the three convolutional kernels can be 1×3, 1×5, and 1×7.
[0057] Multiply the concatenated vector and the second multi-scale feature vector point by point to obtain a first multi-scale feature vector corresponding to the target traffic data. The multi-scale convolutional model can explicitly capture the temporal correlations at different time scales, enabling the model to observe the input data sequence at different time scales. The small-scale subsequences extracted by the smaller convolutional kernels can retain more fine-grained details, while the large-scale subsequences extracted by the larger convolutional kernels can capture the slowly changing trends.
[0058] The multi-scale convolutional model only focuses on the collected data at the collection time points of the non-missing part to calculate new features, thereby avoiding the interference of the missing part on the prediction model. At the same time, the missing mask information learns sufficient information during the convolution process of the multi-scale convolutional model, so that the missing mask information can be updated, that is, the second multi-scale feature vector can be obtained.
[0059] The time series prediction model can be implemented using a multi-layer perceptron based on direct multi-step prediction.
[0060] In a specific implementation manner, the trained temporal feature extraction model is a trained bidirectional long short-term memory model.
[0061] S1021 includes the following steps:
[0062] Input the target traffic data into the trained bidirectional long short-term memory model to obtain a first forward temporal vector and a first backward temporal vector.
[0063] Add the first forward time series vector and the first backward time series vector point by point to obtain the first reference time series vector.
[0064] Input the missing mask information into the trained bidirectional long short-term memory model to obtain the second forward time series vector and the second backward time series vector.
[0065] Add the second forward time series vector and the second backward time series vector point by point to obtain the second reference time series vector.
[0066] Multiply the first reference time series vector and the second reference time series vector point by point to obtain the first time series feature vector, and use the second reference time series vector as the second time series feature vector.
[0067] Among them, the bidirectional long short-term memory model contains two independent long short-term memory models. One is used to process the forward information of the sequence, that is, the information from the past to the present, and the other is used to process the backward information of the sequence, that is, the information from the future to the present. Such a bidirectional propagation mechanism enables the model to extract context information at each acquisition time point. When processing time series containing missing values, using such a feature extraction method helps to capture the global dependencies of the data and is beneficial for the model to more comprehensively understand the long-term time dependencies of the time series.
[0068] Specifically, input the target traffic data into the trained bidirectional long short-term memory model to obtain the first forward time series vector and the first backward time series vector, that is, obtain the forward hidden state and the backward hidden state corresponding to the target traffic data. Combine the forward hidden state and the backward hidden state by point-by-point addition to obtain the final hidden state corresponding to the target traffic data, that is, the first reference time series vector. The first reference time series vector not only captures the slope information of the history but also considers the important information of future time points, providing rich context for subsequent predictions.
[0069] Similarly, the second reference time series vector corresponding to the missing mask information can be obtained. The second reference time series vector can be regarded as an update of the missing mask information. To reduce the impact of missing values on feature extraction, adjust the target traffic data through the result of point-by-point multiplication of the first reference time series vector and the second reference time series vector, thereby obtaining the first time series feature vector. This process performs feature reconstruction and information fusion on the data, aiming to optimize the accuracy of feature extraction.
[0070] In a specific implementation manner, S1023 includes the following steps:
[0071] Process the first time series feature vector through the first preset activation function to obtain the first processing result.
[0072] Process the first multi-scale feature vector through a second preset activation function to obtain a second processing result.
[0073] Multiply the first processing result and the second processing result point by point to obtain a first fused feature vector.
[0074] Among them, the first preset activation function can adopt the sigmoid activation function, and the second preset activation function can adopt the tanh activation function.
[0075] Specifically, in order to better fuse the first time-series feature vector and the first multi-scale feature vector, that is, to fuse the information flows of the global dependence and local dependence of the time series corresponding to the target traffic data, this embodiment uses a gating mechanism for fusion processing, which consists of two parallel activation functions. The tanh activation function acts as a filter, and the sigmoid activation function is used to control the amount of information passed to the subsequent module.
[0076] In a specific implementation manner, S1024 includes the following steps:
[0077] Process the second time-series feature vector through the first preset activation function to obtain a third processing result.
[0078] Process the second multi-scale feature vector through the second preset activation function to obtain a fourth processing result.
[0079] Add the third processing result and the fourth processing result point by point to obtain a second fused feature vector.
[0080] Among them, the third processing result and the fourth processing result are fused by the method of point-by-point addition.
[0081] In a specific implementation manner, S104 includes the following steps:
[0082] According to the traffic map structure, determine a predefined adjacency matrix through the Pearson correlation coefficient.
[0083] Among them, the Pearson correlation coefficient can refer to a statistical index that measures the degree of linear correlation between two variables. According to the Pearson correlation coefficient between nodes, the degree of association between nodes is determined, and an initial adjacency matrix is constructed accordingly.
[0084] In an implementation manner, if there is corresponding road network information for the target traffic data, the initial adjacency matrix can be directly constructed according to the road network information.
[0085] Specifically, after obtaining the initial adjacency matrix A, it is necessary to calculate the degree matrix B of the initial adjacency matrix, then the predefined adjacency matrix P = I + B -1 / 2 AB -1 / 2 , where I is a diagonal matrix with a size of N×N and a value of 1.
[0086] In a specific implementation, S104 includes the following steps:
[0087] According to the traffic graph structure, determine the reference adjacency matrix through the trained graph learning layer.
[0088] Among them, the graph learning layer can learn the relationships between nodes in the traffic graph structure. By training the graph learning layer on the traffic graph structure data, the potential associations between nodes can be automatically captured, and thus a matrix reflecting the node relationships, that is, the reference adjacency matrix, can be output.
[0089] The trained graph learning layer can adaptively generate the adjacency matrix through two learnable embedding matrices. It should be noted that in order to reduce the computational cost of the graph convolution model and reduce the influence of noise, the implementer can introduce a node sparsification strategy, that is, for any node, only the most Y neighbor nodes of this node are retained, and Y can be set by the implementer himself.
[0090] In a specific implementation, S105 includes the following steps:
[0091] S1051, according to the second fusion feature vector and the reference adjacency matrix, determine the deviation matrix corresponding to the reference adjacency matrix.
[0092] S1052, according to the reference adjacency matrix and the deviation matrix, determine the correlation matrix corresponding to the traffic graph structure.
[0093] Among them, the deviation matrix is used to measure the deviation degree of the reference adjacency matrix after considering the data missing situation represented by the second fusion feature vector. It can be understood that if the deviation value at a certain position is large, it means that the data missing has a great influence on the relationship between this pair of nodes. On the contrary, if the deviation value is small, it means that the data missing has a small influence on the relationship between this pair of nodes.
[0094] The correlation matrix comprehensively considers the actual relationships between nodes represented by the reference adjacency matrix and the influence of data missing represented by the deviation matrix on these relationships, and more accurately reflects the correlation degree between each target traffic parameter in the traffic graph structure in the case of data missing. In subsequent missing data reconstruction and time series prediction, the correlation matrix can provide more reliable information to help the model better capture the relationships between parameters, thereby improving the prediction accuracy.
[0095] In a specific implementation, S1051 includes the following steps:
[0096] Multiply the second fusion feature vector by the transpose of the second fusion feature vector to obtain the deviation matrix corresponding to the reference adjacency matrix.
[0097] Among them, according to the second fusion feature vector in the current graph diffusion process, that is, the updated missing mask information, the transmission intensity of the global message is corrected, so as to be used as the offset matrix of the adjacency matrix.
[0098] In a specific implementation manner, S1052 includes the following steps:
[0099] Multiply the deviation matrix by a preset global parameter to obtain a multiplication result.
[0100] Add the multiplication result to the reference adjacency matrix to obtain a correlation matrix.
[0101] Among them, the global parameter is learnable by the model and can be used to control the strength of correctness. To better fuse the global spatial correlation and the local spatial deviation, the deviation matrix is multiplied by a preset global parameter to obtain a multiplication result, and then the multiplication result is added to the reference adjacency matrix to obtain a correlation matrix.
[0102] In a specific implementation manner, the trained graph convolutional network includes a first graph convolution branch and a second graph convolution branch. The first graph convolution branch corresponds to a first model parameter and a first bias parameter, and the second graph convolution branch corresponds to a second model parameter and a second bias parameter.
[0103] S106 includes the following steps:
[0104] Calculate the in-degree matrix and out-degree matrix corresponding to the correlation matrix.
[0105] Determine the first reconstructed data according to the correlation matrix, the in-degree matrix and out-degree matrix corresponding to the correlation matrix, the first model parameter, the first bias parameter, and the first fusion feature vector.
[0106] Determine the second reconstructed data according to the predefined adjacency matrix, the second model parameter, the second bias parameter, and the first fusion feature vector.
[0107] Add the first reconstructed data and the second reconstructed data to obtain the missing reconstructed traffic data.
[0108] Among them, the first reconstructed data X1 can be expressed as (R -1 G + S -1 G T )ZW1 + B1, where R -1 is the out-degree matrix, S -1 is the in-degree matrix, G is the correlation matrix, Z is the first fusion feature vector, W1 is the first model parameter, and B1 is the first bias parameter.
[0109] The second reconstructed data X2 can be expressed as PZW2 + B2, where P is the predefined adjacency matrix, W2 is the second model parameter, and B2 is the second bias parameter.
[0110] As described above, in this embodiment, the degree of completion of the missing value is characterized by the missing mask information. When introducing the features of the missing mask information into the target traffic data through the time series prediction model, the model prediction error caused by data missing is effectively reduced. By combining the features learned by the multi-scale convolution model at different scales with the time series features, the prediction accuracy is improved. By reconstructing the missing values through the spatio-temporal graph convolution network, the spatio-temporal dependence relationship under the complete data is established, avoiding the construction of incorrect spatio-temporal dependence relationships in the case of incomplete data. Then, the missing reconstructed traffic data is applied to the time series prediction task, thereby improving the accuracy of time series prediction in the data missing scenario.
[0111] Embodiment 2
[0112] Embodiment 2 of the present invention provides a time series prediction device in a data missing scenario. Refer to Figure 2 , the time series prediction device in the data missing scenario includes:
[0113] A mask generation module 201, configured to determine the missing mask information corresponding to the target traffic data according to the missing situation of each acquisition data in the target traffic data, where the target traffic data includes the acquisition data of N target traffic parameters at T acquisition time points respectively, and each acquisition data includes the acquisition sub-data corresponding to D acquisition dimensions respectively, and N, T, and D are all integers greater than one.
[0114] A feature extraction module 202, configured to perform feature extraction on the target traffic data and the missing mask information respectively, to obtain a first fusion feature vector corresponding to the target traffic data and a second fusion feature vector corresponding to the missing mask information.
[0115] A graph construction module 203, configured to use each target traffic parameter as a graph node, and use the acquisition data of each target traffic parameter at T acquisition time points as the information corresponding to the corresponding graph node, to construct a traffic graph structure corresponding to the target traffic data.
[0116] A first matrix acquisition module 204, configured to obtain a predefined adjacency matrix and a reference adjacency matrix corresponding to the traffic graph structure according to the traffic graph structure.
[0117] A second matrix acquisition module 205, configured to determine a correlation matrix corresponding to the traffic graph structure according to the second fusion feature vector and the reference adjacency matrix.
[0118] A data reconstruction module 206, configured to obtain the missing reconstructed traffic data according to the correlation matrix, the first fusion feature vector, the predefined adjacency matrix, and the trained graph convolution network.
[0119] The time series prediction module 207 is used to input the missing reconstructed traffic data into the trained time series prediction model to obtain the predicted traffic data corresponding to the target traffic data.
[0120] In a specific implementation manner, the feature extraction module 202 includes:
[0121] The time series feature extraction sub-module is used to input the target traffic data and the missing mask information into the trained time series feature extraction model respectively to obtain the first time series feature vector corresponding to the target traffic data and the second time series feature vector corresponding to the missing mask information.
[0122] The multi-scale feature extraction sub-module is used to input the target traffic data and the missing mask information into the trained multi-scale convolutional model respectively to obtain the first multi-scale feature vector corresponding to the target traffic data and the second multi-scale feature vector corresponding to the missing mask information.
[0123] The first feature fusion sub-module is used to obtain the first fusion feature vector corresponding to the target traffic data according to the first time series feature vector and the first multi-scale feature vector corresponding to the target traffic data.
[0124] The second feature fusion sub-module is used to obtain the second fusion feature vector corresponding to the missing mask information according to the second time series feature vector and the second multi-scale feature vector corresponding to the missing mask information.
[0125] In a specific implementation manner, the trained time series feature extraction model is a trained bidirectional long short-term memory model.
[0126] The time series feature extraction sub-module includes:
[0127] The first feature extraction unit is used to input the target traffic data into the trained bidirectional long short-term memory model to obtain the first forward time series vector and the first backward time series vector.
[0128] The first aggregation sub-unit is used to add the first forward time series vector and the first backward time series vector point by point to obtain the first reference time series vector.
[0129] The second feature extraction unit is used to input the missing mask information into the trained bidirectional long short-term memory model to obtain the second forward time series vector and the second backward time series vector.
[0130] The second aggregation unit is used to add the second forward time series vector and the second backward time series vector point by point to obtain the second reference time series vector.
[0131] The time series vector determination unit is used to multiply the first reference time series vector and the second reference time series vector point by point to obtain the first time series feature vector, and use the second reference time series vector as the second time series feature vector.
[0132] In a specific embodiment, the first feature fusion sub-module includes:
[0133] A first activation unit, configured to process the first time-series feature vector through a first preset activation function to obtain a first processing result.
[0134] A second activation unit, configured to process the first multi-scale feature vector through a second preset activation function to obtain a second processing result.
[0135] A first fusion unit, configured to multiply the first processing result and the second processing result point by point to obtain a first fusion feature vector.
[0136] In a specific embodiment, the second feature fusion sub-module includes:
[0137] A third activation unit, configured to process the second time-series feature vector through the first preset activation function to obtain a third processing result.
[0138] A fourth activation unit, configured to process the second multi-scale feature vector through the second preset activation function to obtain a fourth processing result.
[0139] A second fusion unit, configured to add the third processing result and the fourth processing result point by point to obtain a second fusion feature vector.
[0140] In a specific embodiment, the first matrix acquisition module 204 includes:
[0141] A matrix predefined sub-module, configured to determine a predefined adjacency matrix according to the traffic map structure through the Pearson correlation coefficient.
[0142] In a specific embodiment, the second matrix acquisition module 205 includes:
[0143] A deviation matrix acquisition sub-module, configured to determine a deviation matrix corresponding to the reference adjacency matrix according to the second fusion feature vector and the reference adjacency matrix.
[0144] A correlation matrix acquisition sub-module, configured to determine a correlation matrix corresponding to the traffic map structure according to the reference adjacency matrix and the deviation matrix.
[0145] In a specific embodiment, the deviation matrix acquisition sub-module includes:
[0146] A deviation matrix calculation unit, configured to multiply the second fusion feature vector by the transpose of the second fusion feature vector to obtain a deviation matrix corresponding to the reference adjacency matrix.
[0147] In a specific embodiment, the correlation matrix acquisition sub-module includes:
[0148] A global parameter adjustment unit for multiplying a deviation matrix by a preset global parameter to obtain a multiplication result.
[0149] A correlation matrix calculation unit for adding the multiplication result and a reference adjacency matrix to obtain a correlation matrix.
[0150] In a specific embodiment, the trained graph convolutional network includes a first graph convolution branch and a second graph convolution branch. The first graph convolution branch corresponds to a first model parameter and a first bias parameter, and the second graph convolution branch corresponds to a second model parameter and a second bias parameter.
[0151] The data reconstruction module 206 includes:
[0152] A degree matrix calculation sub-module for calculating an in-degree matrix and an out-degree matrix corresponding to the correlation matrix.
[0153] A first reconstruction sub-module for determining first reconstructed data according to the correlation matrix, the in-degree matrix and the out-degree matrix corresponding to the correlation matrix, the first model parameter, the first bias parameter and a first fusion feature vector.
[0154] A second reconstruction sub-module for determining second reconstructed data according to a predefined adjacency matrix, the second model parameter, the second bias parameter and the first fusion feature vector.
[0155] A missing data reconstruction sub-module for adding the first reconstructed data and the second reconstructed data to obtain missing reconstructed traffic data.
[0156] It should be noted that the information interaction, execution process, etc. between the above modules, due to being based on the same concept as the method embodiment of the present invention, for their specific functions and the technical effects brought, reference can be specifically made to the method embodiment part, and details will not be elaborated here.
[0157] Embodiment III
[0158] Embodiment III of the present invention provides a non-transitory computer-readable storage medium, in which at least one instruction or at least one program segment is stored, and at least one instruction or at least one program segment is loaded and executed by a processor to implement the steps of:
[0159] S101. According to the missing situation of each collected data in the target traffic data, determine the missing mask information corresponding to the target traffic data, where the target traffic data includes the collected data of N target traffic parameters at T collection time points respectively, and each collected data includes the collected sub-data corresponding to D collection dimensions respectively, and N, T, and D are all integers greater than one.
[0160] S102. Extract features from the target traffic data and the missing mask information respectively to obtain a first fused feature vector corresponding to the target traffic data and a second fused feature vector corresponding to the missing mask information.
[0161] S103. Use each target traffic parameter as a graph node, and use the collected data at the T acquisition time points corresponding to each target traffic parameter as the information of the corresponding graph node to construct a traffic graph structure corresponding to the target traffic data.
[0162] S104. According to the traffic graph structure, obtain a predefined adjacency matrix and a reference adjacency matrix corresponding to the traffic graph structure.
[0163] S105. Determine a correlation matrix corresponding to the traffic graph structure according to the second fused feature vector and the reference adjacency matrix.
[0164] S106. Obtain the missing reconstructed traffic data according to the correlation matrix, the first fused feature vector, the predefined adjacency matrix, and the trained graph convolutional network.
[0165] S107. Input the missing reconstructed traffic data into the trained time series prediction model to obtain the predicted traffic data corresponding to the target traffic data.
[0166] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above method embodiments. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided in the present application can include non-volatile and volatile memories.
[0167] Those skilled in the art can clearly understand that for the convenience and brevity of description, only the above-mentioned division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, 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.
[0168] Embodiment 4
[0169] The fourth embodiment of the present invention provides an electronic device, which includes a processor and the non-transitory computer-readable storage medium in the third embodiment of the present invention.
[0170] The above are only the preferred embodiments of the present invention and do not impose any form of limitation on the present invention. Although the present invention has been disclosed above with the preferred embodiments, it is not intended to limit the present invention. Any person skilled in the relevant art can make some changes or modifications to equivalent embodiments by using the disclosed technical content within the scope of the technical solution of the present invention. However, as long as the content does not depart from the technical solution of the present invention, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention still fall within the scope of the technical solution of the present invention.
Claims
1. A time series prediction method in the scenario of data loss, characterized in that The time series prediction method includes: S101. Determine the missing mask information corresponding to the target traffic data according to the missing situation of each collected data in the target traffic data, where the target traffic data includes the collected data of N target traffic parameters at T collection time points, and each collected data includes the collected sub-data corresponding to D collection dimensions respectively, and N, T, and D are all integers greater than one; S102. Extract features from the target traffic data and the missing mask information respectively to obtain a first fusion feature vector corresponding to the target traffic data and a second fusion feature vector corresponding to the missing mask information, where the first fusion feature vector is used to characterize the operating state and change trend of the traffic system reflected by the target traffic data, and the second fusion feature vector is used to characterize the missing situation of the target traffic data; S103. Use each target traffic parameter as a graph node, and use the collected data of each target traffic parameter at T collection time points as the information of the corresponding graph node to construct a traffic graph structure corresponding to the target traffic data, where the traffic graph structure is used to characterize the relationship between different target traffic parameters and at different time points, and the target traffic parameters at least include a road section flow parameter, a traffic density parameter, and a road network parameter; S104. According to the traffic graph structure, obtain a predefined adjacency matrix and a reference adjacency matrix corresponding to the traffic graph structure, where the predefined adjacency matrix is used to characterize the fixed relationship between nodes in the traffic graph structure, and the reference adjacency matrix is used to characterize the similarity and correlation between nodes in the traffic graph structure; S105. Determine a correlation matrix corresponding to the traffic graph structure according to the second fusion feature vector and the reference adjacency matrix, where the correlation matrix is used to characterize the degree of association between different target traffic parameters; S106. Obtain the missing reconstructed traffic data according to the correlation matrix, the first fusion feature vector, the predefined adjacency matrix, and the trained graph convolutional network; S107. Input the missing reconstructed traffic data into the trained time series prediction model to obtain the predicted traffic data corresponding to the target traffic data.
2. The time series prediction method in the data missing scenario according to claim 1, characterized in that, S102 includes the following steps: S1021. Input the target traffic data and the missing mask information into the trained time series feature extraction model respectively to obtain a first time series feature vector corresponding to the target traffic data and a second time series feature vector corresponding to the missing mask information; S1022. Input the target traffic data and the missing mask information into the trained multi-scale convolutional model respectively to obtain a first multi-scale feature vector corresponding to the target traffic data and a second multi-scale feature vector corresponding to the missing mask information; S1023. Obtain a first fusion feature vector corresponding to the target traffic data according to the first time series feature vector and the first multi-scale feature vector corresponding to the target traffic data; S1024. Obtain a second fusion feature vector corresponding to the missing mask information based on the second temporal feature vector and the second multi-scale feature vector corresponding to the missing mask information.
3. The time series prediction method in the data missing scenario according to claim 2, wherein, The trained temporal feature extraction model is a trained bidirectional long short-term memory model; S1021 includes the following steps: Input the target traffic data into the trained bidirectional long short-term memory model to obtain a first forward temporal vector and a first backward temporal vector; Add the first forward temporal vector and the first backward temporal vector point by point to obtain a first reference temporal vector; Input the missing mask information into the trained bidirectional long short-term memory model to obtain a second forward temporal vector and a second backward temporal vector; Add the second forward temporal vector and the second backward temporal vector point by point to obtain a second reference temporal vector; Multiply the first reference temporal vector and the second reference temporal vector point by point to obtain the first temporal feature vector, and use the second reference temporal vector as the second temporal feature vector.
4. The time series prediction method in the data missing scenario according to claim 2, wherein S1023 includes the following steps: Process the first temporal feature vector through a first preset activation function to obtain a first processing result; Process the first multi-scale feature vector through a second preset activation function to obtain a second processing result; Multiply the first processing result and the second processing result point by point to obtain the first fusion feature vector.
5. The time series prediction method in the data missing scenario according to claim 4, wherein S1024 includes the following steps: Process the second temporal feature vector through a first preset activation function to obtain a third processing result; Process the second multi-scale feature vector through a second preset activation function to obtain a fourth processing result; Add the third processing result and the fourth processing result point by point to obtain the second fusion feature vector.
6. The time series prediction method in the data missing scenario according to claim 1, characterized in that S105 includes the following steps: S1051. Determine a deviation matrix corresponding to the reference adjacency matrix according to the second fusion feature vector and the reference adjacency matrix; S1052. Determine a correlation matrix corresponding to the traffic graph structure according to the reference adjacency matrix and the deviation matrix.
7. The time series prediction method in the data missing scenario according to claim 1, wherein The trained graph convolutional network includes a first graph convolution branch and a second graph convolution branch. The first graph convolution branch corresponds to a first model parameter and a first bias parameter, and the second graph convolution branch corresponds to a second model parameter and a second bias parameter; S106 includes the following steps: Calculate an in-degree matrix and an out-degree matrix corresponding to the correlation matrix; Determine first reconstructed data according to the correlation matrix, the in-degree matrix and the out-degree matrix corresponding to the correlation matrix, the first model parameter, the first bias parameter, and the first fusion feature vector; Determine second reconstructed data according to the predefined adjacency matrix, the second model parameter, the second bias parameter, and the first fusion feature vector; Add the first reconstructed data and the second reconstructed data to obtain the missing reconstructed traffic data.
8. A time series prediction device in a data missing scenario, characterized in that, The time series prediction device includes: A mask generation module, configured to determine missing mask information corresponding to the target traffic data according to the missing conditions of each acquisition data in the target traffic data, where the target traffic data includes acquisition data of N target traffic parameters at T acquisition time points, and each acquisition data includes acquisition sub-data corresponding to D acquisition dimensions respectively, and N, T, and D are all integers greater than one; A feature extraction module, configured to perform feature extraction on the target traffic data and the missing mask information respectively, to obtain a first fusion feature vector corresponding to the target traffic data and a second fusion feature vector corresponding to the missing mask information, where the first fusion feature vector is used to characterize the operating state and change trend of the traffic system reflected by the target traffic data, and the second fusion feature vector is used to characterize the missing condition of the target traffic data; A graph construction module, configured to use each target traffic parameter as a graph node, and use the acquisition data of each target traffic parameter at T acquisition time points as the information of the corresponding graph node, to construct a traffic graph structure corresponding to the target traffic data, where the traffic graph structure is used to characterize the relationship between different target traffic parameters and at different time points, and the target traffic parameters at least include a road section flow parameter, a traffic density parameter, and a road network parameter; A first matrix acquisition module, configured to obtain a predefined adjacency matrix and a reference adjacency matrix corresponding to the traffic graph structure according to the traffic graph structure, where the predefined adjacency matrix is used to characterize the fixed relationship between nodes in the traffic graph structure, and the reference adjacency matrix is used to characterize the similarity and correlation between nodes in the traffic graph structure; A second matrix acquisition module, configured to determine a correlation matrix corresponding to the traffic graph structure according to the second fusion feature vector and the reference adjacency matrix, where the correlation matrix is used to characterize the degree of association between different target traffic parameters; A data reconstruction module, configured to obtain missing reconstructed traffic data according to the correlation matrix, the first fusion feature vector, the predefined adjacency matrix, and a trained graph convolutional network; A time series prediction module, configured to input the missing reconstructed traffic data into a trained time series prediction model to obtain predicted traffic data corresponding to the target traffic data.
9. A non-transitory computer-readable storage medium storing at least one instruction or at least one program segment, characterized in that, The at least one instruction or the at least one program is loaded and executed by a processor to implement the time series prediction method in the data missing scenario as described in any one of claims 1-7.
10. An electronic device, characterized in that, Comprising a processor and the non-transitory computer-readable storage medium described in claim 9.
Citation Information
Patent Citations
Traffic network coding representation learning method based on mask pattern attention mechanism
CN117690289A
Missing traffic flow data interpolation method of GAN network based on transmission periodicity
CN119007433A