A geographic traffic data processing method, device and electronic equipment
By setting up a quantum LSTM and a traffic prediction model based on momentum updates, combined with reverse prediction and parameter adjustment, the problem of ignoring spatiotemporal dependence in existing technologies is solved, achieving more accurate traffic flow prediction and congestion warning, and optimizing road network traffic flow.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 内蒙古交通集团有限公司
- Filing Date
- 2024-10-10
- Publication Date
- 2026-05-29
AI Technical Summary
Existing traffic data processing methods ignore spatiotemporal coupling correlation and spatiotemporal variability, resulting in insufficient prediction results and accuracy, and failing to effectively reflect the actual spatial dependence between different road segments.
Two prediction models are used: the first prediction model uses a quantum LSTM neural network for prediction, and the second prediction model uses a traffic prediction model based on momentum update and contrastive learning. The accuracy of the prediction results is ensured through back-forward prediction and parameter adjustment.
It improved the accuracy of traffic flow prediction results and reduced road congestion through stochastic path planning, thus optimizing traffic flow in the road network.
Smart Images

Figure CN119296317B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of traffic data processing technology, and specifically relates to a geographic traffic data processing method, apparatus, and electronic device. Background Technology
[0002] With the rapid development of urbanization and motorization, traffic problems are becoming increasingly prominent, such as traffic congestion and traffic accidents. With the advent of the era of intelligent transportation, the use of traffic data is becoming more frequent, and more stringent demands are being placed on high-quality traffic data. Big data processing of intelligent transportation data is a common method for processing geographic traffic data.
[0003] In the prior art, for example, Chinese patent with patent number CN111028511A discloses a traffic congestion early warning method and device. The method includes: calculating the number of vehicles on the target road during a preset prediction period; searching from a historical data table for the historical time period of the target road at the same time during the prediction period and the lane driving speed corresponding to the number of vehicles; and determining the congestion level that matches the lane driving speed.
[0004] For example, Chinese patent CN111583639B discloses a method and system for early warning of road traffic congestion. The method includes: classifying features based on acquired multi-source traffic data and constructing corresponding feature membership functions to obtain a first fuzzy weight; constructing an artificial membership function for the multi-source traffic data using an expert evaluation method and calculating a second fuzzy weight; performing a fuzzy weighted average of the feature membership functions based on the fused fuzzy weight obtained by fusing the first and second fuzzy weights; defuzzifying the weighted average membership function of different feature quantities to obtain multi-source fused traffic data; constructing a road traffic congestion model using a kernel-over-limit learning machine group algorithm to calculate the optimal road traffic congestion index; acquiring current multi-source traffic data, predicting the current congestion index, and providing an early warning of whether the current road is congested by comparing it with the optimal road traffic congestion index.
[0005] For example, Chinese patent CN113570862B describes a method for early warning of large-scale traffic congestion based on the XGboost algorithm. This method includes: obtaining historical traffic flow data for a specified time period from a traffic database; distinguishing and labeling the congestion situation represented by each historical traffic flow data point; dividing the labeled historical traffic flow data into a training set and a test set; constructing an XGboost algorithm model; inputting the historical traffic flow data (used as the training set) into the XGboost algorithm model for training; inputting the historical traffic flow data (used as the test set) into the XGboost algorithm model after training to verify accuracy; and inputting the traffic flow data of the road to be predicted during a specified time period into the XGboost algorithm model, with the output serving as an early warning of road network traffic congestion.
[0006] The aforementioned existing technologies all use historical traffic data and then employ a data prediction processing method to predict or compare whether congestion will occur at the current or future time. Moreover, most existing traffic volume prediction methods ignore the spatiotemporal coupling correlation and spatiotemporal variability, and cannot reflect the actual spatial dependence between different road segments. As a result, the prediction results and prediction accuracy need to be improved. To address this, we propose a geographic traffic data processing method, device, and electronic equipment. Summary of the Invention
[0007] The purpose of this invention is to provide a geographic traffic data processing method, apparatus, and electronic device. By setting two prediction models, in specific use, a first prediction model is used to predict based on preprocessed real-time traffic flow time-series data to obtain a prediction result. Then, based on the first prediction result, a second prediction model is used for reverse prediction to obtain a second prediction result. The second prediction result is compared with the real-time traffic flow time-series data. If the similarity is greater than or equal to a comparison threshold, the first prediction result is the final output result. If the similarity is less than the comparison threshold, the parameters of both the first and second prediction models are adjusted, and prediction is performed again to finally output the first prediction result. Because the second prediction model is used for reverse prediction, comparing the obtained second prediction result with the original real-time traffic flow time-series data completes the determination of whether the first prediction result is accurate. If it is inaccurate, parameters are adjusted and prediction is performed again until the optimal prediction result is output, thus improving the accuracy of the final prediction result.
[0008] The specific technical solution adopted by this invention is as follows:
[0009] A method for processing geographic traffic data includes the following steps:
[0010] Step 1: Obtain traffic flow time-series data of the target area road network within a set historical time period, and preprocess the traffic flow time-series data;
[0011] Step 2: First, construct and output the first prediction model and the second prediction model simultaneously based on historical traffic time series data;
[0012] Step 3: Obtain real-time traffic flow time-series data and preprocess the real-time traffic flow time-series data using the same preprocessing method as in Step 1;
[0013] Step 4: Use the first prediction model to make predictions based on the preprocessed real-time traffic flow time-series data to obtain the prediction results;
[0014] Step 5: Based on the first prediction result, use the second prediction model to perform reverse prediction to obtain the second prediction result;
[0015] Step 6: Compare the second prediction result obtained in step 5 with the real-time traffic flow time series data obtained in step 3. If the similarity is greater than or equal to the comparison threshold, the first prediction result is the final output result. If the similarity is less than the comparison threshold, adjust the parameters of the first prediction model and the second prediction model and repeat steps 3 to 6.
[0016] Step 7: Output the final first prediction result and analyze the first prediction result. If the future traffic flow data in the first prediction result exceeds the congestion threshold, a congestion warning will be issued.
[0017] Step 8: Obtain road network information for congested areas, and perform random path planning based on congestion warnings and the first prediction results, taking into account the road network.
[0018] Preferably, the method is characterized in that: in step 1, the traffic flow time-series data is preprocessed using a data completion method to complete the data, specifically including the following steps:
[0019] Step 101: Construct the STMF road network traffic data repair model: {y t y t-1 ,...,y2,y1}=f θ ({x ij};G), where, {x ij} represents the time-series traffic flow data before preprocessing; {y t y t-1 ,...,y2,y1} represents the repaired traffic flow time series data; f θ (·) represents the repair model, θ is the model training parameters, and G is the structure of the road network;
[0020] Step 102: Next, matrix decomposition is used to split the matrix into a feature matrix storing spatial dimension information and a feature matrix storing temporal dimension information. Then, the spatial and temporal characteristics of the matrix are mined and reconstructed in low rank to generate a complete matrix; finally, the spatiotemporal matrix decomposition is completed.
[0021] Step 103: Construct a similarity graph by connecting adjacent data points, and use Graph Laplacian GL to mine road network structure features, which can assist in matrix decomposition and reconstruction, and finally complete the regularization of spatial feature matrix;
[0022] Step 104: Apply gated recurrent units (GRNs) as time regularizers for matrix factorization to capture the temporal similarity, periodicity, and trend of elements in the incomplete matrix. Use the sigmoid function (denoted by σ) as the activation function for the hidden state and the hyperbolic tangent function (denoted by tanh) as the activation function for the output. Finally, use alternating least squares to complete the calculation of the STMF road network traffic data repair model and output the repaired traffic flow time series data.
[0023] Preferably, the first prediction model in step 2 adopts a quantum LSTM neural network model. Specifically, a quantum variational circuit is first constructed, which includes: a data encoding layer (classical state-qubit state), a variational layer (dashed box rotation gate), and a quantum measurement layer (quantum-classical); the data encoding layer converts classical data into quantum state through unitary rotation of a single qubit; the variational layer consists of a controlled NOT gate (CNOT) and a single qubit rotation gate; the quantum measurement layer converts the quantum state into a classical data state.
[0024] In the quantum LSTM neural network model, a quantum variational circuit is connected to a traditional module; the quantum variational circuit receives two sets of parameters and outputs measurement results; the traditional module of the neural network performs an optimization process and calculates a new set of parameters; finally, using preprocessed historical traffic flow time series data as input information, it predicts traffic flow at future points in time; and verifies the prediction, and finally outputs the quantum LSTM neural network model after parameter adjustment.
[0025] Preferably, the second prediction model employs a momentum update and contrastive learning-based traffic prediction model (MUCL), which uses an online network-target network framework. The MUCL-based traffic prediction model consists of a road adaptive pruning module, a shared spatiotemporal encoder, a momentum update module, and a contrast module. First, the adaptive augmentation module spatially augments the original input future traffic flow time-series data Y, which serves as the first prediction result, to obtain two similar views Y and Y1. The original input future traffic flow time-series data Y and view Y1 are then fed into a shared spatiotemporal encoder for joint encoder training. View Y1 is fed into a copy of the shared encoder, and the encoder's parameters are updated using momentum. The MUCL-based traffic prediction model employs a training-fine-tuning strategy. During fine-tuning, after the encoder, a decoder module decodes the encoder's output and generates the second prediction result.
[0026] Preferably, a road adaptive pruning module is first set up, which generates a new view by probabilistic deletion, focusing on retaining the edges that contribute significantly to the semantics of the overall graph structure, thus preserving key semantic information;
[0027] Then, a spatiotemporal encoder is set up, which includes a temporal attention module and a spatial graph convolution module. The temporal attention module is used to capture the temporal correlation in the traffic map, and the spatial graph convolution module is used to model the propagation of traffic flow features along the road network to capture the traffic flow transfer pattern. At the same time, a soft thresholding fusion method is considered to combine the output of the temporal attention module and the output of the spatial graph convolution module.
[0028] Then, a momentum update module is set up. The parameters of the target encoder are updated using momentum. The target network provides the regression target to the online network for training. The parameters of the target encoder are updated using the moving average exponential.
[0029] Then, a contrastive learning module is set up to compare and calculate the embedding E of the original input future traffic flow time series data Y and the embedding E1 of the enhanced view Y1. A loss function is then constructed using the contrastive learning method, and the contrastive loss in the contrast calculation is completed through the loss function.
[0030] Finally, a decoder module is set up, which includes convolutional units and dilated convolutional units. The convolutional units handle short-term decoding, and the dilated convolutional units handle long-term decoding. The convolutional units and the dilated convolutional units are connected to generate the final prediction result of the decoder module.
[0031] Preferably, in step 6, during the comparison between the second prediction result and the real-time traffic flow time series data, the comparison is performed by subtracting the traffic flow in each time series and calculating the probability that the difference is within a set range, which is used as the similarity comparison result. If the similarity is greater than or equal to 70%, then the first prediction result is the final output result.
[0032] Preferably, in step 7, the congestion threshold is calculated in advance based on the current road segment, and the congestion threshold is the maximum number of vehicles passing through the road segment at normal driving speed per unit time.
[0033] Preferably, in step 8, during route planning, the current vehicles are randomly assigned to different branch road segments without exceeding the congestion threshold of the branch road segments, thus completing the random route planning.
[0034] A geographic traffic data processing device includes a data acquisition unit and a data processing unit. The data acquisition unit includes several sensors installed on a road network. The sensors are used to collect real-time traffic flow time-series data and send the traffic flow time-series data to the data processing unit via a wireless network. The data processing unit includes a computer running a processing system. The computer uses a first prediction model, a second prediction model, a congestion threshold comparison module, and a random road network path planning unit in the processing system to predict and warn of road congestion results, and simultaneously perform path planning.
[0035] An electronic device includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the geographic traffic data processing method as described in any one of claims 1-8.
[0036] The technical effects achieved by this invention are as follows:
[0037] In this invention, two prediction models are set up. In specific use, the first prediction model is used to make predictions based on preprocessed real-time traffic flow time-series data to obtain a prediction result. Then, based on the first prediction result, the second prediction model is used to make a reverse prediction to obtain a second prediction result. The second prediction result is compared with the real-time traffic flow time-series data. If the similarity is greater than or equal to the comparison threshold, the first prediction result is the final output result. If the similarity is less than the comparison threshold, the parameters of the first and second prediction models are adjusted and prediction is performed again to finally output the first prediction result. Since the second prediction model is used for reverse prediction, the second prediction result is compared with the original real-time traffic flow time-series data to determine whether the first prediction result is accurate. If it is not accurate, the parameters are adjusted and prediction is performed again until the optimal prediction result is output, thus improving the accuracy of the final prediction result. Attached Figure Description
[0038] Figure 1 This is a flowchart of a geographic traffic data processing method according to the present invention;
[0039] Figure 2 This is a system block diagram of a geographic traffic data processing method according to the present invention;
[0040] Figure 3 This is a system block diagram of a geographic traffic data processing device according to the present invention. Detailed Implementation
[0041] To make the objectives and advantages of this invention clearer, the invention will be specifically described below with reference to embodiments. It should be understood that the following text is merely used to describe one or more specific embodiments of the invention and does not strictly limit the scope of protection specifically claimed by the invention.
[0042] Example 1:
[0043] like Figure 1-2 As shown, a geographic traffic data processing method includes the following steps:
[0044] Step 1: Obtain traffic flow time-series data of the target area road network within a set historical time period, and preprocess the traffic flow time-series data;
[0045] Step 2: First, construct and output the first prediction model and the second prediction model simultaneously based on historical traffic time series data;
[0046] Step 3: Obtain real-time traffic flow time-series data and preprocess the real-time traffic flow time-series data using the same preprocessing method as in Step 1;
[0047] Step 4: Use the first prediction model to make predictions based on the preprocessed real-time traffic flow time-series data to obtain the prediction results;
[0048] Step 5: Based on the first prediction result, use the second prediction model to perform reverse prediction to obtain the second prediction result;
[0049] Step 6: Compare the second prediction result obtained in Step 5 with the real-time traffic flow time series data obtained in Step 3. If the similarity is greater than or equal to the comparison threshold, the first prediction result is the final output result. If the similarity is less than the comparison threshold, adjust the parameters of the first prediction model and the second prediction model and repeat Step 3 to Step 6.
[0050] Step 7: Output the final first prediction result and analyze the first prediction result. If the future traffic flow data in the first prediction result exceeds the congestion threshold, a congestion warning will be issued.
[0051] Step 8: Obtain road network information for congested areas, and perform random path planning based on congestion warnings and the first prediction results, taking into account the road network.
[0052] In this invention, two prediction models are set up. In specific use, the first prediction model is used to make predictions based on preprocessed real-time traffic flow time-series data to obtain a prediction result. Then, based on the first prediction result, the second prediction model is used to make a reverse prediction to obtain a second prediction result. The second prediction result is compared with the real-time traffic flow time-series data. If the similarity is greater than or equal to the comparison threshold, the first prediction result is the final output result. If the similarity is less than the comparison threshold, the parameters of the first and second prediction models are adjusted and prediction is performed again to finally output the first prediction result. Since the second prediction model is used for reverse prediction, the second prediction result is compared with the original real-time traffic flow time-series data to determine whether the first prediction result is accurate. If it is not accurate, the parameters are adjusted and prediction is performed again until the optimal prediction result is output, thus improving the accuracy of the final prediction result.
[0053] In this invention, it should be noted that both the first and second prediction results are time-series traffic flow data, specifically including the time and the number of vehicles passing through the detection node at the corresponding time. Therefore, it is possible to reverse-predict based on the first prediction result to obtain the second prediction result.
[0054] In step 1, the traffic flow time-series data is preprocessed using a data completion method to complete the data. This includes the following steps:
[0055] Step 101: Construct the STMF road network traffic data repair model: {y t y t-1 ,...,y2,y1}=fθ ({x ij};G), where, {x ij} represents the time-series traffic flow data before preprocessing; {y t y t-1 ,...,y2,y1} represents the repaired traffic flow time series data; f θ (·) represents the repair model, θ is the model training parameters, and G is the structure of the road network;
[0056] Step 102: Next, matrix decomposition is used to split the matrix into a feature matrix storing spatial dimension information and a feature matrix storing temporal dimension information. Then, the spatial and temporal characteristics of the matrix are mined and reconstructed in low rank to generate a complete matrix; finally, the spatiotemporal matrix decomposition is completed.
[0057] Step 103: Construct a similarity graph by connecting adjacent data points, and use Graph Laplacian GL to mine road network structure features, which can assist in matrix decomposition and reconstruction, and finally complete the regularization of spatial feature matrix;
[0058] Step 104: A gated recurrent unit (GRN) is applied as a time regularizer for matrix factorization to capture the temporal similarity, periodicity, and trend of elements in the incomplete matrix. The sigmoid function (denoted by σ) is used as the activation function for the hidden state, and the hyperbolic tangent function (denoted by tanh) is used as the activation function for the output. In fact, due to the small number of hyperparameters, the GRN provides an effective structure for modeling the temporal characteristics of the feature matrix T, completing the training and iterative calculation of the model. Finally, the alternating least squares method is used to complete the calculation of the STMF road network traffic data repair model, and the final output is the repaired traffic flow time series data.
[0059] This invention simultaneously considers the spatial topological correlation characteristics and temporal dependency characteristics of road network traffic data, and proposes a road network traffic data repair method based on Spatiotemporal Matrix Factorization (STMF). By introducing a Graph Laplace GL spatial regularizer and a Gated Recurrent Network (GRN) temporal regularizer into the objective function of matrix factorization, the repair accuracy of road network traffic data is effectively improved, providing a feasible approach for repairing missing values in incomplete traffic data matrices. The computational results on the selected real road network dataset show that, compared with existing mainstream benchmark models, the STMF model based on Spatiotemporal Matrix Factorization can better adapt to different missing scenarios and different missing rates, and its missing data repair performance has better robustness.
[0060] Furthermore, by repairing the traffic flow time-series data, the acquired real-time traffic flow time-series data becomes more accurate. Using more accurate traffic flow time-series data for prediction results in more precise predictions.
[0061] In step 2, the first prediction model employs a quantum LSTM neural network model. Specifically, a quantum variational circuit is first constructed, comprising: a data encoding layer (classical state-qubit state), a variational layer (dashed box rotation gate), and a quantum measurement layer (quantum-classical). The data encoding layer converts classical data into quantum states through unitary rotation of a single qubit. The variational layer consists of controlled-NOT gates (CNOT) and single-qubit rotation gates. The quantum measurement layer converts quantum states into classical data states. The quantum LSTM neural network model includes both the quantum variational circuit and a traditional module. The quantum variational circuit receives two sets of parameters and outputs the measurement results. The traditional module of the neural network performs an optimization process and calculates a new parameter set. Finally, preprocessed historical traffic flow time-series data is used as input to predict traffic flow at future points in time. The prediction is then validated, and the final output is a quantum LSTM neural network model after parameter adjustment.
[0062] In this invention, the characteristics of quantum parallel computing are effectively utilized to explore the application of the intrinsic relationship of the input sequence in the LSTM neural network. The entire network structure is updated by updating the relevant quantum parameters, thereby improving the nonlinear approximation ability and generalization ability of the prediction model.
[0063] In this invention, the structure algorithm and network update rules of the quantum neural network are reconstructed, and the quantum variational circuit (VQC) and long short-term memory neural network (LSTM) are integrated into a new prediction model, namely QLSTM. The QLSTM model is used to predict traffic flow time series data, so that the accuracy of the first prediction result is more accurate.
[0064] The second prediction model employs a momentum update and contrastive learning-based traffic prediction model (MUCL), which utilizes an online network-target network framework. The MUCL model consists of a road adaptive pruning module, a shared spatiotemporal encoder, a momentum update module, and a contrastive module. First, the adaptive augmentation module spatially augments the original input future traffic flow time-series data Y, which serves as the first prediction result, resulting in two similar views, Y and Y1. The original input future traffic flow time-series data Y and view Y1 are then fed into a shared spatiotemporal encoder for joint encoder training. View Y1 is fed into a copy of the shared encoder, and the encoder's parameters are updated with momentum to maintain parameter stability and prevent model collapse. The MUCL model employs a training-fine-tuning strategy. During fine-tuning, a decoder module is used after the encoder to decode the encoder's output and generate the second prediction result.
[0065] Among them, generating a view that is similar to but not exactly the same as the original input through corresponding strategies is of paramount importance. First, an adaptive road pruning module is set up. Through probabilistic deletion, a new view is generated that focuses on retaining the edges that contribute significantly to the semantics of the overall graph structure, thus preserving key semantic information.
[0066] Then, a spatiotemporal encoder is set up, which includes a temporal attention module and a spatial graph convolution module. The temporal attention module is used to capture the temporal correlation in the traffic map, and the spatial graph convolution module is used to model the propagation of traffic flow features along the road network to capture the traffic flow transfer pattern. At the same time, a soft thresholding fusion method is considered to combine the output of the temporal attention module and the output of the spatial graph convolution module.
[0067] Then, a momentum update module is set up. The parameters of the target encoder are updated using momentum. The target network provides the regression target to the online network for training. The parameters of the target encoder are updated using the moving average exponential.
[0068] Then, a contrastive learning module is set up to compare and calculate the embedding E of the original input future traffic flow time series data Y and the embedding E1 of the enhanced view Y1. A loss function is then constructed using the contrastive learning method, and the contrastive loss in the contrast calculation is completed through the loss function.
[0069] Finally, the decoder module is set up. The decoder module includes convolutional units and dilated convolutional units. The convolutional units handle short-term decoding, and the dilated convolutional units handle long-term decoding. The convolutional units and dilated convolutional units are connected to produce the final prediction result of the decoder module.
[0070] The second prediction model disclosed in this invention presents a traffic sequence contrastive learning and prediction method based on momentum updates. Similarly, this paper introduces a road adaptive pruning module to remove roads far from important nodes in the spatial graph. The difference is that the training network is divided into an online network and a target network. The encoder in the target network uses momentum updates to update its parameters, thereby addressing the model collapse problem. Furthermore, the proposed method employs a pre-training-fine-tuning strategy. The pre-training part adjusts the parameters of the online encoder to better capture the semantics of the original input, while the fine-tuning part evaluates the overall prediction performance of the model and adjusts the network parameters accordingly. This method improves training efficiency and generalization ability to a certain extent, thereby increasing the accuracy of predicting the second result based on the first prediction result, thus enabling precise verification of the accuracy of the first prediction result.
[0071] In step 6, during the comparison between the second prediction result and the real-time traffic flow time series data, the comparison is performed by subtracting the traffic flow in each time series and calculating the probability that the difference is within a set range, which is used as the similarity comparison result. If the similarity is greater than or equal to 70%, the first prediction result is the final output result. In this invention, by verifying the prediction result, the accuracy of the prediction result is greatly improved.
[0072] In step 7, the congestion threshold is calculated in advance for the current road segment. The congestion threshold is the maximum number of vehicles passing through the road segment at normal driving speed per unit time.
[0073] In this invention, the congestion threshold varies for different road sections. Specifically, it is determined by the number of lanes in the road section, the distance between vehicles, and the maximum speed limit of the road section. Specifically, it is the highest number of vehicles passing through the road section within a unit of time at 80% of the maximum speed limit and under the premise of a safe distance between vehicles.
[0074] In step 8, during route planning, the current vehicles are randomly assigned to different branch road segments without exceeding the congestion threshold of the branch road segments, thus completing the random route planning.
[0075] In existing technologies for route planning in congested road sections, all vehicles are directed to enter the corresponding roads. However, in actual use, when congested vehicles enter the corresponding roads, it causes the corresponding roads to become congested as well. In this invention, vehicles are directed to enter different roads and then merge back into the current road from the different roads, which greatly alleviates the current congestion and also prevents other roads from becoming congested, thus ensuring the orderly and smooth flow of the entire road network.
[0076] Example 2:
[0077] like Figure 3 As shown, a geographic traffic data processing device includes a data acquisition unit and a data processing unit. The data acquisition unit includes several sensors installed on the road network. The sensors are used to collect real-time traffic flow time-series data and send the traffic flow time-series data to the data processing unit via a wireless network. The data processing unit includes a computer running a processing system. The computer completes road congestion prediction and early warning through a first prediction model, a second prediction model, a congestion threshold comparison module, and a random road network path planning unit in the processing system, and simultaneously completes path planning.
[0078] Example 3:
[0079] An electronic device includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of a geographic traffic data processing method.
[0080] The above description is merely a preferred embodiment 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. Structures, devices, and operating methods not specifically described or explained in this invention are implemented according to conventional methods in the art unless otherwise specified or limited.
Claims
1. A method for processing geographic traffic data, characterized in that: Includes the following steps: Step 1: Obtain traffic flow time-series data of the target area road network within a set historical time period, and preprocess the traffic flow time-series data; Step 2: First, construct and output the first prediction model and the second prediction model simultaneously based on historical traffic time series data; Step 3: Obtain real-time traffic flow time-series data and preprocess the real-time traffic flow time-series data using the same preprocessing method as in Step 1; Step 4: Use the first prediction model to make predictions based on the preprocessed real-time traffic flow time-series data to obtain the prediction results; Step 5: Based on the first prediction result, use the second prediction model to perform reverse prediction to obtain the second prediction result; The second prediction model adopts a traffic prediction model based on momentum update and contrastive learning, which uses an online network-target network framework. The traffic prediction model based on momentum update and contrastive learning consists of a road adaptive pruning module, a shared spatiotemporal encoder, a momentum update module, and a contrast module. First, the adaptive augmentation module is used to spatially augment the original input future traffic flow time series data Y, which is the first prediction result, to obtain two similar views Y and Y1. The original input future traffic flow time series data Y and view Y1 are then fed into a shared spatiotemporal encoder for joint training of the encoder. View Y1 is then fed into a copy of the shared encoder; the traffic prediction model based on momentum update and contrastive learning adopts a training-fine-tuning strategy. During the fine-tuning process, after the encoder, a decoder module is used to decode the encoder's output and generate a second prediction result. The road adaptive pruning module is set up to generate a new view through probabilistic deletion, focusing on retaining edges that contribute significantly to the semantics of the overall graph structure, thus preserving key semantic information. Then, a spatiotemporal encoder is set up, which includes a temporal attention module and a spatial graph convolution module. The temporal attention module is used to capture the temporal correlation in the traffic map, and the spatial graph convolution module is used to model the propagation of traffic flow features along the road network to capture the traffic flow transfer pattern. At the same time, a soft thresholding fusion method is considered to combine the output of the temporal attention module and the output of the spatial graph convolution module. Then, a momentum update module is set up. The parameters of the target encoder are updated using momentum. The target network provides the regression target to the online network for training. The parameters of the target encoder are updated using the moving average exponential. Then, a contrastive learning module is set up to compare and calculate the embedding E of the original input future traffic flow time series data Y and the embedding E1 of the enhanced view Y1. A loss function is then constructed using the contrastive learning method, and the contrastive loss in the contrast calculation is completed through the loss function. Finally, a decoder module is set up, which includes convolutional units and dilated convolutional units. The convolutional units handle short-term decoding, and the dilated convolutional units handle long-term decoding. The convolutional units and the dilated convolutional units are connected to generate the final prediction result of the decoder module. Step 6: Compare the second prediction result obtained in step 5 with the real-time traffic flow time series data obtained in step 3. If the similarity is greater than or equal to the comparison threshold, the first prediction result is the final output result. If the similarity is less than the comparison threshold, adjust the parameters of the first prediction model and the second prediction model and repeat steps 3 to 6. Step 7: Output the final first prediction result and analyze the first prediction result. If the future traffic flow data in the first prediction result exceeds the congestion threshold, a congestion warning will be issued. Step 8: Obtain road network information for congested areas, and perform random path planning based on congestion warnings and the first prediction results, taking into account the road network.
2. The geographic traffic data processing method according to claim 1, characterized in that: In step 1, the traffic flow time-series data is preprocessed using a data completion method to complete the data, specifically including the following steps: Step 101: Construct the STMF road network traffic data repair model: {y t y t-1 ,...,y2,y1}=f θ ({x) ij };G), where {x ij } represents the time-series traffic flow data before preprocessing; {y t y t-1 ,...,y2,y1} represents the repaired traffic flow time series data; f θ (·) represents the repair model, θ is the model training parameters, and G is the structure of the road network; Step 102: Next, matrix decomposition is used to split the matrix into feature matrices storing spatial dimension information and feature matrices storing temporal dimension information. Then, the spatial and temporal characteristics of the matrices are mined separately, and low-rank reconstruction is performed to generate a complete matrix; finally, the spatiotemporal matrix decomposition is completed. Step 103: Construct a similarity graph by connecting adjacent data points, and use Graph Laplacian GL to mine road network structure features, which can assist in matrix decomposition and reconstruction, and finally complete the regularization of spatial feature matrix; Step 104: Apply gated recursive units as time regularizers for matrix factorization to capture the temporal similarity, periodicity, and trend of elements in the incomplete matrix, and use the sigmoid function as the activation function for the hidden state and the hyperbolic tangent function as the activation function for the output; finally, use alternating least squares method to complete the calculation of the STMF road network traffic data repair model, and finally output the repaired traffic flow time series data.
3. The geographic traffic data processing method according to claim 1, characterized in that: The first prediction model in step 2 adopts a quantum LSTM neural network model. Specifically, a quantum variational circuit is first constructed, which includes a data encoding layer, a variational layer, and a quantum measurement layer. The data encoding layer converts classical data into quantum states through unitary rotation of a single qubit. The variational layer consists of controlled NOT gates and single-qubit rotation gates. The quantum measurement layer converts the quantum states into classical data states. The quantum LSTM neural network model consists of a quantum variational circuit and a traditional module. The quantum variational circuit receives two sets of parameters and outputs the measurement results. The traditional module of the neural network performs an optimization process and calculates a new set of parameters. Finally, using preprocessed historical traffic flow time series data as input information, the model predicts traffic flow at future points in time and verifies the prediction. After parameter adjustment, the quantum LSTM neural network model is output.
4. The geographic traffic data processing method according to claim 1, characterized in that: In step 6, during the comparison between the second prediction result and the real-time traffic flow time series data, the comparison is performed by subtracting the traffic flow in each time series and calculating the probability that the difference is within a set range, which is used as the similarity comparison result. If the similarity is greater than or equal to 70%, the first prediction result is the final output result.
5. The geographic traffic data processing method according to claim 1, characterized in that: In step 7, the congestion threshold is calculated in advance for the current road segment. The congestion threshold is the maximum number of vehicles passing through the road segment at normal driving speed per unit time.
6. The geographic traffic data processing method according to claim 1, characterized in that: In step 8, during route planning, the current vehicles are randomly assigned to different branch road segments without exceeding the congestion threshold of the branch road segments, thus completing the random route planning.
7. A geographic traffic data processing device, characterized in that: The device operates the steps of the geographic traffic data processing method as described in any one of claims 1-6. The device includes a data acquisition mechanism and a data processing mechanism. The data acquisition mechanism includes several sensors installed on the road network. The sensors are used to collect real-time traffic flow time-series data and send the traffic flow time-series data to the data processing mechanism via a wireless network. The data processing mechanism includes a computer running a processing system. The computer completes road congestion result prediction and early warning through a first prediction model, a second prediction model, a congestion threshold comparison module, and a random road network path planning unit in the processing system, and simultaneously completes path planning.
8. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the geographic traffic data processing method as described in any one of claims 1-6.