Geographic traffic data processing method and device and electronic equipment
Through the mutual checks and spatial-temporal matrix decomposition of the two prediction models, the problem of insufficient space-time dependence in the existing traffic data processing methods is solved, the accuracy of traffic flow prediction and the accuracy of congestion warning are improved, and the more Effective road network path planning.
Patent Information
- Application Number
- CN202411405364.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-10-10
AI Technical Summary
The existing traffic data processing methods ignore the spatial and temporal coupling correlation and spatial and temporal variation, and cannot effectively reflect the actual spatial dependence between various sections, resulting in the need to improve the prediction results and accuracy.
The method of mutual verification of two prediction models is adopted. First, the first prediction model is used to predict, the second prediction model is used to reverse prediction based on the results, and the parameters are adjusted by comparing the similarity, and the optimal prediction result is finally output, combined with the space-time matrix. Decomposition and quantum LSTM, momentum update and comparison learning models for traffic flow prediction.
It improves the accuracy of traffic flow prediction results, enhances the ability to predict traffic congestion, ensures the accuracy of early warning and the effectiveness of road network path planning.
Smart Images

Figure CN119296317A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of traffic data processing, and in particular relates to a geographic traffic data processing method, device and electronic equipment. Background Art
[0002] With the rapid development of urbanization and motorization, traffic problems have become increasingly prominent, such as traffic congestion and traffic accidents. With the advent of the era of intelligent transportation, the use of traffic data has become more frequent, and more stringent requirements have been placed on high-quality traffic data. Big data processing of intelligent transportation data is currently a common method for processing geographic traffic data.
[0003] In the prior art, for example, a Chinese patent with patent number: CN111028511A discloses a traffic congestion warning method and device, which includes: calculating the vehicle ownership of a target road within a preset prediction period; searching from a historical data table for the lane driving speed corresponding to the vehicle ownership in the historical period at the same time as the prediction period of the target road; and determining the congestion level that matches the lane driving speed.
[0004] For another example: Chinese patent number CN111583639B discloses a road traffic congestion warning method and system, including performing feature classification based on the acquired multi-source traffic data, and constructing a corresponding feature membership function to obtain a first fuzzy weight; using an expert evaluation method to construct an artificial membership function for the multi-source traffic data, and calculating a second fuzzy weight; performing fuzzy weighted averaging on the feature membership function based on the fused fuzzy weight obtained by fusing the first fuzzy weight and the second fuzzy weight, defuzzifying the obtained weighted average membership function of different feature quantities, and obtaining multi-source fused traffic data; using a nuclear ultralimited learning machine group algorithm to construct a road traffic congestion model, and calculating an optimal road traffic congestion index; obtaining current multi-source traffic data, predicting the current congestion index, and warning whether the current road is congested by comparing it with the optimal road traffic congestion index.
[0005] For example: Chinese patent number CN113570862B is a large-scale traffic congestion warning method based on the XGboost algorithm, including: obtaining historical traffic flow data for a specified time period from a traffic database, distinguishing and labeling the congestion conditions of the events represented by each piece of historical traffic flow data, and 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 as a training set into the XGboost algorithm model for training, and after the training is completed, inputting the historical traffic flow data as a test set into the XGboost algorithm model to verify the accuracy; inputting the traffic flow data of the road to be predicted in a specified time period into the XGboost algorithm model, and outputting the result as an early warning of road network traffic congestion.
[0006] In the above-mentioned existing technologies, historical traffic data is used, and then a data prediction processing method is used to predict or compare whether congestion will occur at the current moment or in the future. Moreover, most of the existing traffic volume prediction methods ignore the temporal and spatial coupling correlation and temporal and spatial variability, and cannot reflect the actual spatial dependence between various road sections; the prediction results and prediction accuracy need to be improved. For this reason, we propose a geographic traffic data processing method, device and electronic device. Summary of the invention
[0007] The purpose of the present invention is to provide a geographic traffic data processing method, device and electronic device. By setting two prediction models, in specific use, a first prediction model is used to predict according to preprocessed real-time traffic flow time series data to obtain a prediction result; then a second prediction model is used to perform reverse prediction according to the first prediction result 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 prediction model and the second prediction model are adjusted and the prediction is performed again, and the first prediction result is finally output. Since the second prediction model is used for reverse prediction, the second prediction result obtained is compared with the original real-time traffic flow time series data to determine whether the first prediction result is accurate. If it is inaccurate, it is predicted again by adjusting the parameters until the optimal prediction result is output, thereby improving the accuracy of the output of the final prediction result.
[0008] The technical solution adopted by the present invention is as follows:
[0009] A method for processing geographic traffic data comprises the following steps:
[0010] Step 1: Obtain the 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 the 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 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 prediction results;
[0014] Step 5: Perform reverse prediction using the second prediction model based on the first prediction result to obtain a 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 is issued;
[0017] Step 8: Obtain the road network information of the congested area, and perform random path planning combined with the road network according to the congestion warning and the first prediction result.
[0018] Preferably, it is characterized in that: in the step 1, the traffic flow time series data is preprocessed by a data completion method to complete the data completion, which specifically includes the following steps:
[0019] Step 101: Construct the road network traffic data repair model of STMF: {y t ,y t-1 ,...,y2,y1}=f θ ({x ij}; G), where {x ij} is the traffic flow time series data before preprocessing; {y t ,y t-1 ,...,y2,y1} is the repaired traffic flow time series data; f θ (·) represents the repair model, θ is the model training parameter, and G is the structure of the road network;
[0020] Step 102: Matrix decomposition is then used to split y into a feature matrix storing spatial dimension information and a feature matrix storing time dimension information, and then the spatial and temporal characteristics of y and y are respectively mined, and low-rank reconstruction is performed 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 the road network structure features, which can assist matrix decomposition and reconstruction, and finally complete the regularization of the spatial feature matrix;
[0022] Step 104: Apply the gated recurrent unit (GRN) as a time regularizer of matrix decomposition to capture the time similarity, periodicity and trend of the elements in the incomplete matrix, use the sigmoid function (denoted by σ) as the activation function of the hidden state, and use the hyperbolic tangent function (denoted by tanh) as the activation function of the output, and finally use the alternating least squares method to complete the calculation of the road network traffic data repair model of the STMF, and finally 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 built, and the quantum variational circuit includes: a data coding layer (classical state-qubit state), a variational layer (dotted box rotation gate) and a quantum measurement layer (quantum-classical); data coding layer: classical data is converted into a quantum state through a single quantum bit unitary rotation; variational layer: composed of a controlled NOT gate (CNOT) and a single quantum bit rotation gate; quantum measurement layer: converting the quantum state into a classical data state;
[0024] In the quantum LSTM neural network model, the quantum variational circuit is connected to the traditional module; the quantum variational circuit receives two sets of parameters and outputs the measurement results; the traditional module of the neural network performs the optimization process and calculates a new set of parameters; finally, the pre-processed historical traffic flow time series data is used as input information to predict the traffic flow at a future point in time; and the prediction is verified, and finally the quantum LSTM neural network model is output after parameter adjustment.
[0025] Preferably, the second prediction model adopts a traffic prediction model based on momentum update and contrastive learning (MUCL), and the traffic prediction model based on momentum update and contrastive learning adopts 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 enhancement module is used to spatially enhance the original input future traffic flow time series data Y as the first prediction result to obtain two similar views Y and Y1, and the original input future traffic flow time series data Y and view Y1 are sent to a shared spatiotemporal encoder for joint training of the encoder; view Y1 is sent to a copy of the shared encoder, and the parameter momentum of the encoder is updated, and the traffic prediction model based on momentum update and contrastive learning adopts a training strategy of training-fine-tuning. During the fine-tuning process, after the encoder, a decoder module is used to decode the output of the encoder and generate a second prediction result.
[0026] Preferably, a road adaptive pruning module is first set to generate a new view by probabilistic deletion to focus on retaining the edges that contribute more to the semantics of the overall graph structure, thereby retaining key semantic information;
[0027] Then, a spatiotemporal encoder is set, 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 characteristics along the road network to capture the transfer pattern of traffic flow; at the same time, a soft threshold fusion method is considered to combine the output of the temporal attention and the output of the spatial graph convolution;
[0028] Then set up the momentum update module, the parameters of the target encoder are updated using momentum, the target network provides regression targets to the online network for training, and the parameters of the target encoder are updated using the moving average index;
[0029] Then, a contrastive learning module is set up to perform contrastive calculations on 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 constructed through the contrastive learning method, and the contrast loss in the contrastive calculation is completed through the loss function.
[0030] Finally, a decoder module is set, which includes a convolution unit and a hole convolution unit. The convolution unit processes short-term decoding, and the hole convolution unit processes long-term decoding. The convolution unit and the hole convolution unit are connected to generate the final prediction result of the decoder module.
[0031] Preferably, in step 6, when comparing the second prediction result with the real-time traffic flow time series data, the comparison is performed by difference, the traffic flow in each time series is differentiated, and the probability that the difference is within a set range is calculated as the similarity comparison result. If the similarity is greater than or equal to 70%, 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 section, and the congestion threshold is the maximum value of vehicles passing through the road section at a normal driving speed within a unit time.
[0033] Preferably, in step 8, during the path planning, the current vehicle is randomly assigned to different branch sections without exceeding the congestion threshold of the branch section, and the random path planning is finally completed.
[0034] A geographic traffic data processing device, the device includes a data collection mechanism and a data processing mechanism, the data collection mechanism includes a plurality of sensors arranged on a road network, the sensors are used to collect traffic flow time series data in real time, and send the traffic flow time series data to the data processing mechanism via a wireless network, the data processing mechanism includes a computer, a processing system is running on the computer, the computer completes the prediction and early warning of road congestion results 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 completes path planning at the same time.
[0035] An electronic device comprises a processor, a memory and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the geographic traffic data processing method as described in any one of claims 1 to 8.
[0036] The technical effects achieved by the present invention are:
[0037] In the present invention, two prediction models are set. In specific use, the first prediction model is used to predict according to the preprocessed real-time traffic flow time series data to obtain a prediction result; then the second prediction model is used to perform reverse prediction according to the first prediction result 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 prediction model and the second prediction model are adjusted and the prediction is performed again, and the first prediction result is finally output. Since the second prediction model is used for reverse prediction, the second prediction result obtained is compared with the original real-time traffic flow time series data to determine whether the first prediction result is accurate. If it is inaccurate, it is predicted again by adjusting the parameters until the optimal prediction result is output, thereby improving the accuracy of the output of the final prediction result. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a flow chart of a geographic traffic data processing method of the present invention;
[0039] Figure 2 It is a system block diagram of a geographic traffic data processing method of the present invention;
[0040] Figure 3 It is a system block diagram of a geographic traffic data processing device of the present invention. DETAILED DESCRIPTION
[0041] In order to make the purpose and advantages of the present invention more clearly understood, the present invention is specifically described below in conjunction with embodiments. It should be understood that the following text is only used to describe one or several specific embodiments of the present invention, and does not strictly limit the scope of protection of the specific claims of the present invention.
[0042] Embodiment 1:
[0043] like Figure 1-2 As shown, a geographic traffic data processing method comprises the following steps:
[0044] Step 1: Obtain the 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 the 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 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 prediction results;
[0048] Step 5: Perform reverse prediction using the second prediction model based on the first prediction result to obtain a 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 steps 3 to 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 is issued;
[0051] Step 8: Obtain the road network information of the congested area, and perform random path planning combined with the road network according to the congestion warning and the first prediction result.
[0052] In the present invention, two prediction models are set. In specific use, the first prediction model is used to predict according to the preprocessed real-time traffic flow time series data to obtain a prediction result; then the second prediction model is used to perform reverse prediction according to the first prediction result 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 prediction model and the second prediction model are adjusted and the prediction is performed again, and the first prediction result is finally output. Since the second prediction model is used for reverse prediction, the second prediction result obtained is compared with the original real-time traffic flow time series data to determine whether the first prediction result is accurate. If it is inaccurate, it is predicted again by adjusting the parameters until the optimal prediction result is output, thereby improving the accuracy of the output of the final prediction result.
[0053] In the present invention, it should be noted that the first prediction result and the second prediction result are both traffic flow time series data, specifically including the time and the number of vehicles passing through the detection node at the corresponding time. Therefore, it is possible to achieve reverse prediction based on the first prediction result to obtain the second prediction result.
[0054] Among them, in step 1, the traffic flow time series data is preprocessed by a data completion method to complete the data, which specifically includes the following steps:
[0055] Step 101: Construct the road network traffic data repair model of STMF: {y t ,y t-1 ,...,y2,y1}=fθ ({x ij}; G), where {x ij} is the traffic flow time series data before preprocessing; {y t ,y t-1 ,...,y2,y1} is the repaired traffic flow time series data; f θ (·) represents the repair model, θ is the model training parameter, and G is the structure of the road network;
[0056] Step 102: Matrix decomposition is then used to split y into a feature matrix storing spatial dimension information and a feature matrix storing time dimension information, and then the spatial and temporal characteristics of y and y are respectively mined, and low-rank reconstruction is performed 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 the road network structure features, which can assist matrix decomposition and reconstruction, and finally complete the regularization of the spatial feature matrix;
[0058] Step 104: Apply a gated recurrent unit (GRN) as a temporal regularizer of matrix decomposition to capture the temporal similarity, periodicity and trend of elements in the incomplete matrix, and use a sigmoid function (denoted by σ) as the activation function of the hidden state, and a hyperbolic tangent function (denoted by tanh) as the activation function of the output; in fact, due to fewer hyperparameters, GRN provides an effective structure for modeling the temporal characteristics of the feature matrix T, completes the training and iterative calculation of the model, and finally uses the alternating least squares method to complete the calculation of the road network traffic data repair model of the STMF, and finally outputs the repaired traffic flow time series data.
[0059] In the present invention, the spatial topological structure correlation characteristics and time dependence characteristics in the road network traffic data are considered at the same time, and a road network traffic data repair method based on space-time matrix decomposition (STMF) is proposed. Since the graph Laplace GL spatial regularizer and the gated recurrent network GRN temporal regularizer are introduced in the objective function of the matrix decomposition, the repair accuracy of the road network traffic data is effectively improved, and a feasible way is provided for repairing missing values in the incomplete traffic data matrix; the calculation results on the selected real road network data set show that the STMF model based on space-time matrix decomposition can better adapt to different missing scenarios and different missing rates than the existing mainstream benchmark models, and the 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 is made more accurate, and using more accurate traffic flow time series data for prediction makes the prediction result more accurate.
[0061] Among them, the first prediction model in step 2 adopts the quantum LSTM neural network model. Specifically, a quantum variational circuit is first built. The quantum variational circuit includes: a data coding layer (classical state-quantum bit state), a variational layer (dotted box rotation gate) and a quantum measurement layer (quantum-classical); data coding layer: classical data is converted into a quantum state through a single quantum bit unitary rotation; variational layer: composed of a controlled NOT gate (CNOT) and a single quantum bit rotation gate; quantum measurement layer: converting the quantum state into a classical data state; in the quantum LSTM neural network model, there are quantum variational circuits and traditional modules; the quantum variational circuit receives two sets of parameters and outputs the measurement results; the traditional module of the neural network executes the optimization process and calculates a new set of parameters; finally, the preprocessed historical traffic flow time series data is used as input information to predict the traffic flow at future points; and verification is performed, and finally the quantum LSTM neural network model is output after parameter adjustment;
[0062] In the present invention, the characteristics of quantum parallel computing are effectively utilized, the use of the LSTM neural network on the intrinsic relationship of the input sequence is explored, and the updating of the entire network structure is achieved by updating the relevant quantum parameters, so that the nonlinear approximation ability and generalization ability of the prediction model are improved.
[0063] In the present invention, the structural algorithm and network update rules of the quantum neural network are reconstructed, and the quantum variational circuit (VQC) and the long short-term memory neural network (LSTM) are integrated into a new prediction model, namely QLSTM; the QLSTM model is used to predict the traffic flow time series data, so that the accuracy of the predicted first result is more accurate.
[0064] Among them, the second prediction model adopts a traffic prediction model based on momentum update and contrastive learning (MUCL), and the traffic prediction model based on momentum update and contrastive learning adopts 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 enhancement module is used to spatially enhance the original input future traffic flow time series data Y as the first prediction result, and two similar views Y and Y1 are obtained. The original input future traffic flow time series data Y and view Y1 are sent to a shared spatiotemporal encoder for joint training of the encoder; view Y1 is sent to a replica of the shared encoder, and the parameter momentum of the encoder is updated to maintain the stability of the parameters and prevent model collapse; the traffic prediction model based on momentum update and contrastive learning adopts a training-fine-tuning training strategy. During the fine-tuning process, after the encoder, a decoder module is used to decode the output of the encoder and generate a second prediction result.
[0065] Among them, generating views that are similar but not identical to the original input through corresponding strategies is the top priority. First, a road adaptive pruning module is set up to generate new views through probabilistic deletion, focusing on retaining edges that contribute more to the semantics of the overall graph structure, thereby retaining key semantic information.
[0066] Then, a spatiotemporal encoder is set up. The spatiotemporal encoder 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 characteristics along the road network to capture the transfer pattern of traffic flow. At the same time, a soft threshold fusion method is considered to combine the output of the temporal attention and the output of the spatial graph convolution.
[0067] Then set up the momentum update module, the parameters of the target encoder are updated using momentum, the target network provides regression targets to the online network for training, and the parameters of the target encoder are updated using the moving average index;
[0068] Then, a contrastive learning module is set up to perform contrastive calculations on 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 constructed through the contrastive learning method, and the contrast loss in the contrastive calculation is completed through the loss function.
[0069] Finally, a decoder module is set up. The decoder module includes a convolution unit and a hole convolution unit. The convolution unit processes short-term decoding, and the hole convolution unit processes long-term decoding. The convolution unit and the hole convolution unit are connected to generate the final prediction result of the decoder module.
[0070] In the second prediction model disclosed in the present invention, a traffic sequence comparative learning and prediction method based on momentum update is disclosed. Similarly, this article introduces a road adaptive pruning module to delete roads far away from important nodes in the spatial graph. The difference is that the training network is divided into an online network and a target network, and the encoder in the target network uses momentum update to update parameters, so as to solve the problem of model collapse. In addition, the method proposed in the present invention uses a pre-training-fine-tuning strategy. The pre-training part adjusts the parameters of the online encoder to well capture the semantics of the original input, and the fine-tuning part evaluates the prediction effect of the entire model, and adjusts the network parameters on this basis; the use of this method improves the training efficiency and generalization ability to a certain extent, thereby improving the accuracy of reversely predicting the second result based on the first prediction result, so that the accuracy of the first prediction result can be accurately verified.
[0071] Among them, in step 6, when comparing the second prediction result with the real-time traffic flow time series data, the comparison is performed by making a difference, the traffic flow in each time series is subtracted, and the probability that the difference is within a set range is calculated 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 the present invention, by verifying the prediction result, the accuracy of the prediction result is greatly improved.
[0072] Among them, in step 7, the congestion threshold is calculated in advance based on the current road section, and the congestion threshold is the maximum value of vehicles passing through the road section at a normal driving speed per unit time.
[0073] In the specific present invention, the congestion thresholds of different road sections are different, which are determined according to the number of lanes in the road section, the distance between the front and rear vehicles, and the maximum speed limit of the road section. Specifically, the highest vehicle data passing through the road section at 80% of the maximum speed limit and at a safe distance per unit time is used as the congestion threshold.
[0074] Among them, in step 8, during the path planning, the current vehicle is randomly assigned to different branch sections without exceeding the congestion threshold of the branch section, and finally the random path planning is completed.
[0075] In the path planning of congested sections in the prior art, all vehicles are allowed to enter the corresponding roads. However, in actual use, when congested vehicles enter the corresponding roads, the corresponding roads will also be congested. In the present invention, vehicles are allowed to enter different roads and finally merge into the current road from different roads, which greatly alleviates the current congested section and also does not cause congestion on other roads, thereby ensuring that the entire road network is orderly and unobstructed.
[0076] Embodiment 2:
[0077] like Figure 3 As shown, a geographic traffic data processing device includes a data collection mechanism and a data processing mechanism. The data collection mechanism includes a plurality of sensors arranged on a road network. The sensors are used to collect traffic flow time series data in real time and send the traffic flow time series data to the data processing mechanism via a wireless network. The data processing mechanism includes a computer. A processing system runs on the computer. The computer completes the prediction and early warning of road congestion results and completes the path planning at the same time through the first prediction model, the second prediction model, the congestion threshold comparison module and the random road network path planning unit in the processing system.
[0078] Embodiment three:
[0079] An electronic device comprises a processor, a memory and a program or instruction stored in the memory and executable on the processor. When the program or instruction is executed by the processor, the steps of a geographic traffic data processing method are implemented.
[0080] The above is only a preferred embodiment of the present invention. It should be noted that, for those skilled in the art, several improvements and modifications can be made without departing from the principles of the present invention, and these improvements and modifications should also be considered as the protection scope of the present invention. The structures, devices and operating methods not specifically described and explained in the present invention shall be implemented according to the conventional means in the art unless otherwise specified and limited.
Claims
1. A geographic traffic data processing method, characterized in that: The following steps are involved: Step 1: Obtain the 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 the 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 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 prediction results; Step 5: Perform reverse prediction using the second prediction model based on the first prediction result to obtain a second prediction result; 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 is issued; Step 8: Obtain the road network information of the congested area, and perform random path planning combined with the road network according to the congestion warning and the first prediction result.
2. A geographic traffic data processing method according to claim 1, characterized in that: In step 1, the traffic flow time series data is preprocessed by a data completion method to complete the data completion, which specifically includes the following steps: Step 101: Construct the road network traffic data repair model of STMF: {y t ,y t-1 ,...,y2,y1}=f θ ({x ij }; G), where {x ij } is the traffic flow time series data before preprocessing; {y t ,y t-1 ,...,y2,y1} is the repaired traffic flow time series data; f θ (·) represents the repair model, θ is the model training parameter, and G is the structure of the road network; Step 102: Matrix decomposition is then used to split y into a feature matrix storing spatial dimension information and a feature matrix storing time dimension information, and then the spatial and temporal characteristics of y and y are respectively mined, 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 the road network structure features, which can assist matrix decomposition and reconstruction, and finally complete the regularization of the spatial feature matrix; Step 104: Apply the gated recursive unit as a time regularizer of matrix decomposition to capture the time similarity, periodicity and trend of the elements in the incomplete matrix, and use the sigmoid function as the activation function of the hidden state and the hyperbolic tangent function as the output activation function; finally, use the alternating least squares method to complete the calculation of the road network traffic data repair model of the STMF, and finally output the repaired traffic flow time series data.
3. A 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 built, and the quantum variational circuit includes: a data coding layer, a variational layer, and a quantum measurement layer; the data coding layer: classical data is converted into a quantum state through a single quantum bit unitary rotation; the variational layer: consists of a controlled NOT gate and a single quantum bit rotation gate; the quantum measurement layer: converts the quantum state into a classical data state; In the quantum LSTM neural network model, there are quantum variational circuits and traditional modules; 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, the pre-processed historical traffic flow time series data is used as input information to predict the traffic flow at a future point in time; and verification is performed, and finally the quantum LSTM neural network model is output after parameter adjustment.
4. A geographic traffic data processing method according to claim 1, characterized in that: The second prediction model adopts a traffic prediction model based on momentum update and contrastive learning, and the traffic prediction model based on momentum update and contrastive learning adopts 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 original input future traffic flow time series data Y as the first prediction result is spatially enhanced using an adaptive enhancement module to obtain two similar views Y and Y1, and the original input future traffic flow time series data Y and view Y1 are sent to a shared spatiotemporal encoder for joint training of the encoder; View Y1 is fed into a copy of the shared encoder; the traffic prediction model based on momentum update and contrastive learning adopts a training-fine-tuning training strategy. During the fine-tuning process, after the encoder, a decoder module is used to decode the output of the encoder and generate a second prediction result.
5. A geographic traffic data processing method according to claim 4, characterized in that: First, a road adaptive pruning module is set up to generate new views through probabilistic deletion, focusing on retaining edges that contribute more to the semantics of the overall graph structure, thereby retaining key semantic information. Then, a spatiotemporal encoder is set, 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 characteristics along the road network to capture the transfer pattern of traffic flow; at the same time, a soft threshold fusion method is considered to combine the output of the temporal attention and the output of the spatial graph convolution; Then set up the momentum update module, the parameters of the target encoder are updated using momentum, the target network provides regression targets to the online network for training, and the parameters of the target encoder are updated using the moving average index; Then, a contrastive learning module is set up to perform contrastive calculations on 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 constructed through the contrastive learning method, and the contrast loss in the contrastive calculation is completed through the loss function. Finally, a decoder module is set, which includes a convolution unit and a hole convolution unit. The convolution unit processes short-term decoding, and the hole convolution unit processes long-term decoding. The convolution unit and the hole convolution unit are connected to generate the final prediction result of the decoder module.
6. A geographic traffic data processing method according to claim 1, characterized in that: In step 6, when comparing the second prediction result with the real-time traffic flow time series data, the comparison is performed by difference, the traffic flow in each time series is differentiated, and the probability that the difference is within a set range is calculated as the similarity comparison result. If the similarity is greater than or equal to 70%, the first prediction result is the final output result.
7. A geographic traffic data processing method according to claim 1, characterized in that: In step 7, the congestion threshold is calculated in advance based on the current road section, and the congestion threshold is the maximum value of vehicles passing through the road section at a normal driving speed per unit time.
8. A geographic traffic data processing method according to claim 1, characterized in that: In step 8, during the path planning, the current vehicle is randomly assigned to different branch sections without exceeding the congestion threshold of the branch section, and the random path planning is finally completed.
9. A geographic traffic data processing device, characterized in that: The device includes a data acquisition mechanism and a data processing mechanism. The data acquisition mechanism includes a plurality of sensors arranged on a road network. The sensors are used to collect traffic flow time series data in real time and send the traffic flow time series data to the data processing mechanism via a wireless network. The data processing mechanism includes a computer. A processing system runs on the computer. The computer completes the prediction and early warning of road congestion results and completes path planning through the first prediction model, the second prediction model, the congestion threshold comparison module and the random road network path planning unit in the processing system.
10. An electronic device, characterized in that: It comprises a processor, a memory and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the geographic traffic data processing method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Traffic jam early warning method and device
CN111028511A
A method and system for early warning of road traffic congestion
CN111583639B
A method for early warning of large-scale traffic congestion based on XGboost algorithm
CN113570862B
Ultrasonic water meter data restoration method based on deep learning model
CN112132324A
Image processing method and system for traffic management
CN114219970A
Cited By
Multi-strategy improved traffic flow prediction method, equipment and medium
CN121148156A