Road traffic operation state prediction method, system and equipment
By constructing a road network topology map and integrating diverse traffic data, combined with physical guidance feature sets and model correction, the spatial correlation and external factor neglect problems in traffic flow prediction in existing technologies have been solved, achieving higher accuracy and robustness in traffic state prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-28
- Publication Date
- 2026-03-27
AI Technical Summary
Existing traffic flow prediction methods struggle to effectively capture the complex nonlinearities and spatiotemporal dependencies in traffic data, neglect the spatial correlation information of road network topology, and fail to fully consider the impact of external factors such as large vehicles and weather conditions on traffic, resulting in insufficient prediction accuracy and robustness in complex real-world scenarios.
By constructing a road network topology map, combining spatiotemporal feature extraction module, external feature extraction module and LSTM traffic volume prediction module, integrating multi-dimensional traffic data and external features, and using physical guidance feature set and physical guidance meta-model to correct the predicted values, the prediction results are ensured to conform to the basic laws of traffic flow.
It improves prediction accuracy and robustness in complex real-world scenarios, and can better simulate the operation mechanism of traffic systems, especially maintaining high accuracy and reliability under conditions of large vehicles and severe weather.
Smart Images

Figure CN121747331A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent transportation, and in particular to a method, system and device for predicting road traffic operation status. Background Technology
[0002] With the acceleration of urbanization, traffic congestion is becoming increasingly serious. Accurate and efficient traffic flow forecasting is crucial for intelligent traffic management, route planning, and travel services. Accurate forecasts can help traffic management departments alleviate traffic congestion in advance, provide travelers with optimal route suggestions, and thus effectively improve road utilization efficiency.
[0003] Existing traffic volume prediction methods are mainly divided into two categories: methods based on traditional time series models and methods based on deep learning. Traditional methods, such as autoregressive integral moving average models, struggle to capture the complex nonlinearities and spatiotemporal dependencies in traffic data. In recent years, deep learning models, especially recurrent neural networks (RNNs) and their variants such as long short-term memory networks (LSTMs), have achieved significant results in time series prediction, effectively learning long-term dependencies over time.
[0004] However, a transportation network is essentially a graph structure, where the traffic status of each road segment is not only related to its own historical status but also significantly influenced by the status of adjacent road segments. Traditional RNN / LSTM models have limitations in handling this spatial correlation; they typically treat each monitoring point as an independent entity, ignoring the spatial correlation information inherent in the road network's topology.
[0005] Furthermore, most existing methods rely on purely historical traffic flow data (such as traffic volume and vehicle speed), neglecting key external factors. For example, the proportion of large vehicles (trucks, buses, etc.) significantly alters the actual road capacity and traffic dynamics, serving as a crucial endogenous variable contributing to traffic bottlenecks and the "moving roadblock" effect. Weather conditions (such as rain, snow, and fog) directly reduce capacity and alter congestion patterns by influencing road friction and driver behavior. Current methods combining convolution and LSTM often fall short in terms of depth and efficiency in spatial feature extraction, or fail to deeply integrate the aforementioned key multi-dimensional external factors with spatiotemporal features, resulting in room for improvement in prediction accuracy and robustness in complex real-world scenarios.
[0006] Therefore, there is a need for a road traffic operation status prediction method, system, and equipment that has stronger spatial correlation and higher prediction accuracy and robustness in complex real-world scenarios. Summary of the Invention
[0007] The purpose of this invention is to overcome the limitations of existing technologies in terms of spatial correlation and the insufficient prediction accuracy and robustness in complex real-world scenarios, and to provide a method, system and device for predicting road traffic operation status.
[0008] To achieve the above-mentioned objectives, the present invention provides the following technical solution:
[0009] A method for predicting road traffic operation status includes the following steps: S1: Obtain historical multi-dimensional traffic data of the target road network, and preprocess the historical multi-dimensional traffic data to form a standardized traffic data sequence; wherein, the multi-dimensional traffic data includes traffic data, external feature data and road network data; the external feature data includes the proportion of large vehicles and weather data; S2: Construct a road network topology map based on the road network data; S3: Input the standardized traffic data sequence and the road network topology map into the pre-constructed traffic prediction model for model training, and output the trained traffic prediction model after training is completed; The traffic prediction model includes a spatiotemporal feature extraction module, an external feature extraction module, a multi-feature fusion module, an LSTM traffic volume prediction module, and an output module. S4: Input the real-time traffic data to be predicted into the trained traffic prediction model, and output the predicted traffic operation status of the target road segment in the future target time period; the predicted traffic operation status includes the predicted flow rate, the predicted speed, and the predicted congestion level. S5: Generate a physical guidance feature set based on traffic flow theory, and construct a physical guidance meta-model based on the physical guidance feature set; S6: Use the predicted values and corresponding actual values of the standardized traffic data sequence as a training set to train the physical guidance meta-model, and output the trained physical guidance meta-model after training is completed. S7: Input the traffic operation status prediction value into the pre-trained physical guidance meta-model and output the corrected traffic operation status prediction value.
[0010] As a preferred embodiment of the present invention, step S1 includes the following steps: S11: Obtain historical multi-dimensional traffic data of the target road network from edge devices at different nodes of the target road network; S12: Perform data cleaning processing on the traffic data and external feature data in the historical multi-dimensional traffic data; S13: Normalize the historical multivariate traffic data after data cleaning and processing to the [0,1] interval to form standardized data; S14: Construct the standardized data into a standardized traffic data sequence according to the preset time step.
[0011] As a preferred embodiment of the present invention, step S2 includes the following steps: S21: Construct an n*n physical adjacency matrix based on the road network data; The road network data includes road network structure data and node distances; n is the number of nodes; in the physical adjacency matrix, if nodes i and j are adjacent, the corresponding elements... =1, otherwise =0, i,j ∈[1,n]; S22: Construct an n*n distance matrix for the target road network based on the node distances; S23: Combine the physical adjacency matrix and the distance matrix to construct an n*n graph adjacency matrix; the expression for the graph adjacency matrix is: , Where D is the graph adjacency matrix. Let i be the elements corresponding to nodes i and j in the graph adjacency matrix. The distance between nodes i and j; S24: Normalize the graph adjacency matrix and output the road network topology graph.
[0012] As a preferred embodiment of the present invention, the traffic prediction model includes a spatiotemporal feature extraction module, an external feature extraction module, a multi-feature fusion module, an LSTM traffic volume prediction module, and an output module. The spatiotemporal feature extraction module includes three sets of convolutional layers, which are used to sequentially perform temporal dimension convolution, multi-layer spatial dependency establishment, and predictive feature extraction, and output spatiotemporal features; wherein, the convolutional layers aggregate the features of all nodes through the graph adjacency matrix, and the multi-layer stacking enhances the learning ability; The external feature extraction module includes two fully connected layers, which are used to sequentially complete complex feature learning and predictive feature extraction, and output external features. The multi-feature fusion module is used to calculate the traffic flow correlation matrix of each node according to the Pearson correlation coefficient calculation method, and to perform weighted processing on the spatiotemporal features and external features according to the correlation matrix, and then fuse the weighted spatiotemporal features and external features to output the fused features; The LSTM traffic volume prediction module includes two layers of LSTM units, which are used to learn traffic temporal features based on the fused features; wherein, the first layer of LSTM units is used to extract short-term local dependencies, and the second layer of LSTM units is used to extract long-term complex temporal dependencies. The output module includes two fully connected layers, which are used to progressively map the learned traffic temporal features and output traffic operation status predictions.
[0013] As a preferred embodiment of the present invention, step S5 includes the following steps: S51: Calculate the physical consistency index of the target road network based on traffic flow theory; the physical consistency index includes speed-flow consistency, density consistency, and congestion difference; S52: Calculate the physical rationality score of the traffic operation status prediction value; the physical rationality score includes the flow rationality score, speed rationality score and congestion rationality score; S53: Calculate the traffic condition identification features and capacity utilization of the target road network; S54: The cross-effect characteristics of integrating time features, weather features, and physical features; the cross-effect characteristics include peak period physical influence factors, time-physical consistency coordination factors, and periodic physical model deviation factors; The peak-hour physical impact factor is used to analyze the degree of anomaly in the flow-velocity relationship during peak hours; The time-physical consistency reconciliation factor is used to assess the reconciliation and consistency between traffic forecast results and historical time patterns. The periodic physical pattern deviation factor is used to assess the degree of deviation between traffic prediction results and periodic physical patterns. S55: Output a physical guidance feature set; wherein, the physical guidance feature set includes traffic operation status prediction values, physical derived features, time features, and cross-interaction features; the physical derived features include the physical consistency index, the physical rationality score, the traffic status identification features, and the capacity utilization rate; the time features include the time features of each set time period; S56: Construct a physical guidance meta-model based on the physical guidance feature set.
[0014] As a preferred embodiment of the present invention, the calculation of the periodic physical mode deviation factor includes the following steps: Establish a periodic expectation model based on the hourly angular encoding hour_angel: Flow expectation model: ; Velocity expectation model: ; Calculate the actual ratio of the current forecast value to the 80th percentile of historical data, and compare the absolute differences between the actual ratio and the expected ratio for both flow and speed: , , Calculate the absolute values of flow rate deviation and velocity deviation separately: , , Calculate the periodic physical mode deviation factor : , in, The expected proportion of traffic. The expected ratio of speed; The absolute difference between the actual and expected traffic ratios. Forecast traffic volume The 80th percentile of historical traffic data; The absolute difference between the actual speed ratio and the expected speed ratio; This is the predicted speed value; The 80th percentile of historical speed data; This represents the absolute value of the flow deviation. This represents the absolute value of the speed deviation.
[0015] As a preferred embodiment of the present invention, the physical guidance meta-model includes a feature engineering layer, a model learning layer, a physical constraint layer, and a loss function connected in sequence. ; The feature engineering layer is used to generate a physical guidance feature vector based on the physical guidance feature set; The model learning layer includes three parallel gradient boosting tree models, used to respectively correct flow, speed, and congestion. The physical constraint layer is used to apply final physical constraints to the model output; loss function The expression is: , in, The error between the predicted value and the actual value, For physical consistency error, These are the weighting coefficients.
[0016] As a preferred embodiment of the present invention, the final physical constraints include range constraints, relational constraints, and consistency constraints; The range constraints include: Flow range constraint: 0 ≤ Flow forecast value ≤ Set a reasonable flow threshold; Speed range constraint: Set minimum reasonable speed ≤ predicted speed ≤ free flow speed; Congestion range constraint: The congestion prediction value ∈ a set reasonable congestion range; The relational constraints include: Adjustments based on consistency between speed-flow rate and congestion-speed relationship; When the difference between the predicted congestion level and the actual congestion level is greater than 0.3, the congestion level is corrected according to the following formula: , When the difference between the predicted congestion level and the physical congestion level is ∈ [0.1, 0.3], the congestion level is corrected according to the following formula: , in, This is the final output congestion prediction value. Physical congestion level, This is a predicted congestion level. The consistency constraints include: The estimated density is calculated based on the final flow rate and velocity. When the estimated density exceeds the set unreasonable high density threshold, it is judged as a state of physical incoordination. If the physical relationship is not in harmony, increase the speed prediction value by a set percentage; determine whether the increased speed prediction value is greater than or equal to the set minimum reasonable speed. If the requirements are not met, the predicted speed value is set to the minimum reasonable speed, and the current predicted speed value is output. If the requirements are met, output the current speed prediction value.
[0017] A road traffic operation status prediction system, the system being used to execute a road traffic operation status prediction method as described above, comprising a data acquisition module, a basic prediction module, and a physical guidance element module that are interconnected. The data acquisition module includes several edge acquisition devices installed on the target road network; The basic prediction module is used to perform preprocessing and preliminary prediction based on the data acquired by the data acquisition module; The physical guidance module is used to physically correct the preliminary prediction results of the basic prediction module and output the traffic operation status prediction value.
[0018] A road traffic operation status prediction device includes at least one processor and a memory communicatively connected to the at least one processor; the memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to perform a road traffic operation status prediction method as described above.
[0019] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention comprehensively considers traffic data, the proportion of large vehicles, weather data, and road network data to establish a standardized traffic data sequence and road network topology map, which are then fed into a traffic prediction model for training. This enables a more comprehensive simulation of the operation mechanism of the real traffic system, resulting in higher prediction accuracy and stronger model robustness when facing special traffic flow patterns caused by large vehicles or severe weather, or when data quality is poor or abnormal scenarios occur. At the same time, a physical guidance feature set and a physical guidance meta-model are introduced to perform physical co-correction on the predicted values, ensuring that the final output predicted values strictly conform to the basic laws of traffic flow. Attached Figure Description
[0020] Figure 1 This is a flowchart illustrating a road traffic operation status prediction method according to Embodiment 1 of the present invention; Figure 2 This is a flowchart illustrating a road traffic operation status prediction method according to Embodiment 3 of the present invention; Figure 3 This is a schematic diagram of the traffic prediction model in the road traffic operation status prediction method described in Embodiment 3 of the present invention; Figure 4 This is a schematic diagram of the spatiotemporal feature extraction module in a road traffic operation status prediction method according to Embodiment 3 of the present invention; Figure 5 This is a schematic diagram of the external feature extraction module in the road traffic operation status prediction method according to Embodiment 3 of the present invention; Figure 6 This is a schematic diagram of the traffic volume prediction module in a road traffic operation status prediction method according to Embodiment 3 of the present invention; Figure 7 This is a schematic diagram of the fully connected output module in the road traffic operation status prediction method described in Embodiment 3 of the present invention; Figure 8 This is a schematic diagram of the physical guidance meta-model in the road traffic operation state prediction method described in Embodiment 3 of the present invention; Figure 9 This is a schematic diagram of the structure of a road traffic operation status prediction device according to Embodiment 5 of the present invention. Detailed Implementation
[0021] The present invention will be further described in detail below with reference to experimental examples and specific embodiments. However, this should not be construed as limiting the scope of the above-mentioned subject matter of the present invention to the following embodiments; all technologies implemented based on the content of the present invention fall within the scope of the present invention.
[0022] Example 1 A method for predicting road traffic operation status includes the following steps: S1: Obtain historical multivariate traffic data of the target road network, and preprocess the historical multivariate traffic data to form a standardized traffic data sequence; wherein, the multivariate traffic data includes traffic data, external feature data and road network data; the external feature data includes the proportion of large vehicles and weather data.
[0023] S2: Construct a road network topology map based on the road network data.
[0024] S3: Input the standardized traffic data sequence and the road network topology map into the pre-constructed traffic prediction model for model training, and output the trained traffic prediction model after training is completed.
[0025] The traffic prediction model includes a spatiotemporal feature extraction module, an external feature extraction module, a multi-feature fusion module, an LSTM traffic volume prediction module, and an output module.
[0026] S4: Input the real-time traffic data to be predicted into the trained traffic prediction model and output the traffic operation status prediction value of the target road segment in the future target time period; the traffic operation status prediction value includes the flow prediction value, speed prediction value and congestion prediction value.
[0027] S5: Generate a physical guidance feature set based on traffic flow theory, and construct a physical guidance meta-model based on the physical guidance feature set.
[0028] S6: Use the predicted values and corresponding actual values of the standardized traffic data sequence as a training set to train the physical guidance meta-model, and output the trained physical guidance meta-model after training is completed.
[0029] S7: Input the traffic operation status prediction value into the pre-trained physical guidance meta-model and output the corrected traffic operation status prediction value.
[0030] Example 2 This embodiment is a specific implementation of the road traffic operation status prediction method described in Embodiment 1, including the following steps: S1: Obtain historical multivariate traffic data of the target road network, and preprocess the historical multivariate traffic data to form a standardized traffic data sequence; wherein, the multivariate traffic data includes traffic data, external feature data and road network data; the external feature data includes the proportion of large vehicles and weather data.
[0031] S11: Obtain historical multi-dimensional traffic data of the target road network from edge devices at different nodes of the target road network.
[0032] S12: Perform data cleaning processing on the traffic data and external feature data in the historical multi-dimensional traffic data.
[0033] S13: Normalize the historical multivariate traffic data after data cleaning and processing to the [0,1] interval to form standardized data.
[0034] S14: Construct the standardized data into a standardized traffic data sequence according to the preset time step.
[0035] S2: Construct a road network topology map based on the road network data.
[0036] S21: Construct an n*n physical adjacency matrix based on the road network data.
[0037] The road network data includes road network structure data and node distances; n is the number of nodes; in the physical adjacency matrix, if nodes i and j are adjacent, the corresponding elements... =1, otherwise =0, i,j ∈[1,n].
[0038] S22: Construct an n*n distance matrix for the target road network based on the node distances.
[0039] S23: Combine the physical adjacency matrix and the distance matrix to construct an n*n graph adjacency matrix; the expression for the graph adjacency matrix is: , Where D is the graph adjacency matrix. Let i be the elements corresponding to nodes i and j in the graph adjacency matrix. Let be the node distance between nodes i and j.
[0040] S24: Normalize the graph adjacency matrix and output the road network topology graph.
[0041] S3: Input the standardized traffic data sequence and the road network topology map into the pre-constructed traffic prediction model for model training, and output the trained traffic prediction model after training is completed.
[0042] Furthermore, the traffic prediction model includes a spatiotemporal feature extraction module, an external feature extraction module, a multi-feature fusion module, an LSTM traffic volume prediction module, and an output module.
[0043] The spatiotemporal feature extraction module includes three sets of convolutional layers, which are used to sequentially perform temporal dimension convolution, multi-layer spatial dependency establishment, and predictive feature extraction, and output spatiotemporal features; wherein, the convolutional layers aggregate the features of all nodes through the graph adjacency matrix, and the multi-layer stacking enhances the learning ability.
[0044] The external feature extraction module includes two fully connected layers, which are used to sequentially complete complex feature learning and predictive feature extraction, and output external features.
[0045] The multi-feature fusion module is used to calculate the traffic flow correlation matrix of each node according to the Pearson correlation coefficient calculation method, and to perform weighted processing on the spatiotemporal features and external features according to the correlation matrix, and then fuse the weighted spatiotemporal features and external features to output the fused features.
[0046] The LSTM traffic volume prediction module includes two layers of LSTM units, which are used to learn traffic temporal features based on the fused features; wherein, the first layer of LSTM units is used to extract short-term local dependencies, and the second layer of LSTM units is used to extract long-term complex temporal dependencies.
[0047] The output module includes two fully connected layers, which are used to progressively map the learned traffic temporal features and output traffic operation status predictions.
[0048] Furthermore, the traffic prediction model uses a binary cross-entropy loss function and an AdamW optimizer as its optimizer.
[0049] This invention models road network topology using a convolutional network-based spatiotemporal feature extraction module, effectively capturing the spatial diffusion and impact of traffic flow. It also captures long-term trends and periodic changes in traffic data over time using an LSTM-based traffic volume prediction module. These two modules are linked together to achieve deep fusion and joint learning of spatiotemporal features. Simultaneously, the model processes multiple traffic parameters such as flow rate, vehicle speed, and congestion level, enabling it to learn the intrinsic relationships between different variables, resulting in more comprehensive and reliable predictions.
[0050] S4: Input the real-time traffic data to be predicted into the trained traffic prediction model and output the traffic operation status prediction value of the target road segment in the future target time period; the traffic operation status prediction value includes the flow prediction value, speed prediction value and congestion prediction value.
[0051] S5: Construct a physical guidance feature set based on traffic flow theory, and build a physical guidance meta-model based on the physical guidance feature set.
[0052] S51: Calculate the physical consistency index of the target road network based on traffic flow theory.
[0053] Furthermore, the physical consistency indicators include speed-flow consistency, density consistency, and congestion difference; their expressions are as follows: Speed-flow consistency , When Q <capacity*0.3, , When Q >= capacity * 0.3, , Density Consistency , , , Congestion Difference = Predicted Congestion - Calculated Congestion = .
[0054] in, For free flow velocity; This represents the calculated expected traffic flow speed, and capacity is the road capacity. It is a density value obtained by calculating the number of vehicles per unit length; Density predictions based on flow velocity; This is the predicted flow rate. The speed is the predicted value; L represents the farthest distance that the edge device can detect. The calculated congestion level is calculated as: free-flow speed / actual speed. This represents the predicted congestion level.
[0055] S52: Calculate the physical rationality score of traffic operation status prediction values.
[0056] Furthermore, the physical rationality score includes a flow rationality score, a speed rationality score, and a congestion rationality score; its expression is: Traffic rationality score: when > When a reasonable traffic threshold is set, the traffic reasonableness score is 0.1.
[0057] when When ∈[0, road capacity], the traffic flow rationality score = 0.9 + 0.1 .
[0058] when When ∈(road capacity, set reasonable flow threshold), the flow reasonableness score = 0.9-0.4 ( -Road capacity) / (Set a reasonable traffic flow threshold -Road capacity).
[0059] Speed rationality rating: when > Free flow velocity or When the minimum reasonable speed is set, the speed reasonableness score is 0.1.
[0060] When the minimum reasonable speed is set ≤ When the velocity is less than or equal to the free-flow velocity, the velocity rationality score is 0.5+. / Free flow velocity.
[0061] Congestion Reasonableness Score: When the congestion level is within the set reasonable congestion level range, the congestion level reasonableness score = / Free flow velocity.
[0062] Otherwise, the congestion rationality score is 0.1.
[0063] S53: Calculate the traffic condition identification features and capacity utilization rate of the target road network.
[0064] S54: The cross-effect characteristics of integrating time features, weather features, and physical features.
[0065] Furthermore, the cross-effect characteristics include peak-period physical influence factors, time-physical consistency coordination factors, and periodic physical model deviation factors.
[0066] The peak-hour physical influence factor is used to analyze the degree of anomaly in the flow-velocity relationship during peak hours.
[0067] The time-physical consistency reconciliation factor is used to assess the reconciliation between traffic forecast results and historical time patterns.
[0068] The periodic physical pattern deviation factor is used to assess the degree of deviation between traffic prediction results and periodic physical patterns.
[0069] Furthermore, the calculation of the periodic physical mode deviation factor includes the following steps: Establish a periodic expectation model based on the hourly angular encoding hour_angel: Flow expectation model: .
[0070] Velocity expectation model: .
[0071] Calculate the actual ratio of the current forecast value to the 80th percentile of historical data, and compare the absolute differences between the actual ratio and the expected ratio for both flow and speed: , , Calculate the absolute values of flow rate deviation and velocity deviation separately: , , Calculate the periodic physical mode deviation factor : , in, The expected proportion of traffic. The expected ratio of speed; The absolute difference between the actual and expected traffic ratios. The 80th percentile of historical traffic data; The absolute difference between the actual speed ratio and the expected speed ratio; The 80th percentile of historical speed data.
[0072] S55: Output a physical guidance feature set; wherein, the physical guidance feature set includes traffic operation status prediction values, physical derived features, time features, and cross-interaction features; the physical derived features include the physical consistency index, the physical rationality score, the traffic status identification features, and the capacity utilization rate; the time features include the time features of each set time period.
[0073] S56: Construct a physical guidance meta-model based on the physical guidance feature set.
[0074] Furthermore, the physical guidance meta-model includes a feature engineering layer, a model learning layer, and a physical constraint layer connected in sequence.
[0075] The feature engineering layer is used to convert the original physical guidance feature set into a physical guidance feature vector.
[0076] The model learning layer includes three parallel gradient boosting tree models, used to correct flow, speed, and congestion respectively.
[0077] The physical constraint layer is used to apply final physical constraints to the model output.
[0078] Furthermore, the loss function of the physical guidance meta-model The expression is: , in, The error between the predicted value and the actual value, For physical consistency error, These are the weighting coefficients.
[0079] Furthermore, the final physical constraints include range constraints, relational constraints, and consistency constraints.
[0080] The range constraints include: Traffic range constraint: 0 ≤ traffic prediction value ≤ Set a reasonable traffic threshold.
[0081] Speed range constraint: Set minimum reasonable speed ≤ predicted speed ≤ free flow speed.
[0082] Congestion range constraint: The congestion prediction value ∈ a set reasonable congestion range.
[0083] The relational constraints include: Consistent adjustments based on speed-flow and congestion-speed relationships.
[0084] When the difference between the predicted congestion level and the actual congestion level is greater than 0.3, the congestion level is corrected according to the following formula: , When the difference between the predicted congestion level and the physical congestion level is ∈ [0.1, 0.3], the congestion level is corrected according to the following formula: , in, This is the final output congestion prediction value. Physical congestion level, This represents the predicted congestion level.
[0085] The consistency constraints include: The estimated density is calculated based on the final flow rate and velocity. When the estimated density exceeds the set unreasonable high density threshold, it is judged as a state of physical incoordination.
[0086] If the physical relationship is not in harmony, increase the speed prediction value by a set percentage; then determine whether the increased speed prediction value is greater than or equal to the set minimum reasonable speed.
[0087] If the requirements are not met, the predicted speed value is set to the minimum reasonable speed, and the current predicted speed value is output.
[0088] If the requirements are met, output the current speed prediction value.
[0089] This invention makes fuller use of the spatiotemporal correlation and multivariate characteristics of traffic data through Conv-LSTM, and combines it with the gradient boosting tree model to finely correct the initial prediction error through a rich set of physical features. The two complement each other and can achieve higher prediction accuracy and stronger generalization ability.
[0090] S6: Use the predicted values and corresponding actual values of the standardized traffic data sequence as a training set to train the physical guidance meta-model, and output the trained physical guidance meta-model after training is completed.
[0091] S7: Input the traffic operation status prediction value into the pre-trained physical guidance meta-model and output the corrected traffic operation status prediction value.
[0092] This invention employs physical constraint correction, enabling the method to effectively prevent absurd predictions from the model even in situations with poor data quality or abnormal scenarios, thereby improving system reliability. This method can provide accurate future traffic status information for urban traffic management, highway traffic management, and navigation services, and has significant practical application value.
[0093] Example 3 This embodiment is another specific implementation of the road traffic operation status prediction method described in Embodiment 1, such as... Figure 2 As shown, it includes the following steps: S1: Data Acquisition and Preprocessing. The historical multi-source traffic data involved in this embodiment mainly includes traffic data, external feature data, and road network data. Specifically, it includes the following steps: (1) Data collection The traffic data is primarily based on edge devices (cameras, edge computing devices, radar, etc.) pre-installed at various detection nodes in the target road network, which acquire real-time traffic flow, average speed, and congestion levels at each node. Traffic flow and average speed are collected in real-time by radar, while congestion levels are obtained in real-time by image recognition technology using camera images captured on edge devices.
[0094] The external feature data mainly includes two aspects: the proportion of large vehicles and weather data. The large vehicle proportion data is obtained by marking three-axle and above trucks as large vehicles in the vehicle classification data collected by the camera, and calculating the proportion of large vehicles to all vehicles at each node. Since the weather conditions vary between nodes, the real-time weather conditions of each node are obtained, and based on the degree of their influence, four influencing factors—visibility, rainfall, temperature, and humidity—are selected as external environmental features for model training.
[0095] The road network data includes road network topology data and node distances, which are obtained based on the installation location of edge devices.
[0096] (2) Data cleaning For missing or obviously unreasonable outliers caused by equipment failure, the mean before and after is used for interpolation and replacement.
[0097] (3) Normalization The historical multivariate traffic data, after data cleaning and processing, is normalized to the [0,1] interval to form standardized data.
[0098] (4) Output The standardized data is constructed into a standardized traffic data sequence according to a preset time step.
[0099] S2: Construct a road network topology map.
[0100] (1) Construct the physical adjacency matrix Each key detection point in the road network is defined as a graph node. An initial connectivity matrix is constructed based on the actual road connectivity. If a vehicle can directly travel from node i to node j, then ,otherwise Where i,j∈ {1,2,...,n}, and n is the number of nodes detected in the road network.
[0101] (2) Construct the distance matrix Obtain the physical distances between all nodes and construct them into an ordered connection matrix. ,in Let represent the actual physical distance from node i to node j, where i,j ∈ {1,2,...,n}.
[0102] (3) Graph connection matrix Graph connection matrix Finally, an n*n adjacency matrix is constructed. Let i be the elements corresponding to nodes i and j in the graph adjacency matrix.
[0103] (4) Normalization .
[0104] in, () indicates normalization.
[0105] (5) Output Output the road network topology map, which is an n*n matrix.
[0106] S3: Construct a traffic prediction model based on CONV-LSTM.
[0107] Model structure as follows Figure 3 As shown, it mainly includes a spatiotemporal feature extraction module, an external feature extraction module, a multi-feature fusion module, an LSTM traffic volume prediction module, and an output module.
[0108] Spatiotemporal feature extraction module: The input consists of historical data on traffic flow, average speed, and congestion level for each node, as well as the road network topology map constructed in S2, used for extracting spatiotemporal features. The specific steps are as follows: (1) Input data processing. Historical data on traffic flow, average speed, and congestion level for each node in the training set are used as input data for the spatiotemporal feature extraction module, and the road network topology map is used as the parameter for the module. To facilitate simultaneous processing of all nodes by the spatiotemporal feature extraction module, the input data is first processed from... Heisei ,in Indicates the step size. This indicates the number of nodes; 3 represents the historical data across three dimensions.
[0109] (2) Based on the graph connection matrix in the S2 road network topology graph, construct the edge index edge_index and edge weight edge_weight of the graph; where the edge index represents the connection relationship of all edges. For example, if edge_index[n]=[i,j] exists in the edge index, it means that node i and node j are directly connected; the edge weight represents the weight of each edge, that is, the value of the graph connection matrix edge_weight[n].
[0110] (3) Input data is processed in the form described in step (1) of this module and then passed to the spatiotemporal feature extraction module. The specific structure is as follows: Figure 4 As shown, convolution is performed according to the batch size.
[0111] The first convolutional layer primarily performs convolutions along the time dimension. It captures the propagation of traffic characteristics at different time granularities between nodes within a short period, such as traffic flow and congestion, from one node to another, including propagation speed and direction. Simultaneously, it identifies short-term traffic trends, captures their periodic patterns, and enhances noise robustness. Therefore, before inputting into the first convolutional layer, the data must be dimensionally adjusted, shifting the time step dimension and traffic node dimension to the last two dimensions.
[0112] The second convolutional layer primarily establishes multi-layer spatial dependencies. It focuses more on the propagation of traffic characteristics between adjacent nodes and the mutual influence between various traffic features. Therefore, the second convolutional layer expands its dimensions to obtain more complex spatial relationships.
[0113] The third convolutional layer primarily extracts predictive features. It refines the core paths of traffic characteristic propagation, weakens irrelevant features and noise, and weights relevant features.
[0114] Each convolutional layer finds the neighbors of each node based on the edge_index, and aggregates the neighbor features of all nodes by weighting them with edge_weight, stacking multiple layers to enhance learning ability.
[0115] Since updating the parameters of the previous layer can easily cause the input distribution of the subsequent layer to shift, BatchNorm3d is used between layers to normalize all feature channels, calculate the mean and variance independently, and normalize in the time, node, and depth dimensions to make the data distribution more stable and avoid certain gradient problems.
[0116] By combining the linear features of convolution and adding activation layers between layers, complex nonlinear patterns can be learned, which can effectively enhance the model's expressive power. The ReLU function is used, which gives it advantages such as fast training and solving the gradient vanishing problem.
[0117] To avoid overfitting, this embodiment also uses Dropout3d to randomly discard some features after the first two convolutional layers, forcing the network to learn more robust feature combinations and enhancing the model's generalization ability.
[0118] (4) Output the captured spatiotemporal features.
[0119] External feature extraction module: The collected external features mainly include two aspects: the proportion of large vehicles at each node and weather conditions. Weather conditions include four dimensions: visibility, rainfall, temperature, and humidity. The specific steps are as follows: (1) Input data processing. External features [proportion of large vehicles, visibility, rainfall, temperature, humidity] are processed according to a fixed step size from... Heisei .
[0120] in, Indicates the step size. This indicates the total number of nodes. 5 represents the historical data for five dimensions: the proportion of large vehicles, visibility, rainfall, temperature, and humidity.
[0121] (2) The input data is processed in the form described in step (1) of this module and then passed to the external feature extraction module. The specific structure is as follows: Figure 5 As shown: This module uses two fully connected layers to expand the data dimensions while creating a feature interaction space to capture higher-order correlations. The first fully connected layer expands the data dimensions to 32, providing more space for feature selection and allowing the network to learn more complex feature relationships. The second fully connected layer compresses the information, reducing it to 5 dimensions, eliminating redundant information and retaining the most predictive features.
[0122] Furthermore, activation and dropout layers are used between the two fully connected layers to enhance the model's ability to learn complex nonlinear relationships and its generalization capabilities. This prevents the network from becoming over-specialized and ensures that the external feature extraction module is both powerful and robust, truly learning the general impact of weather conditions on traffic flow.
[0123] (3) Output the captured external features.
[0124] Multi-feature fusion module The specific working steps of this module are as follows: (1) Calculate the correlation between spatiotemporal features and external features. Calculate the Pearson correlation coefficients between each node's traffic flow, the proportion of large vehicles at the target node on that day, visibility, rainfall, temperature, humidity, and the target node, and construct a [database / structure]. The correlation matrix, where when i,j∈{1,2,...,n}, The Pearson correlation coefficient between traffic flow at node i and traffic flow at node j is given. When i ∈ {1,2,...,n}, j=n+1, the Pearson correlation coefficient between traffic flow at node i and the percentage of large vehicles at that node on that day is given. When i ∈ {1,2,...,n}, j=n+2, the Pearson correlation coefficient between traffic flow at node i and visibility at that node on that day is given. When i ∈ {1,2,...,n}, j=n+3, the Pearson correlation coefficient between traffic flow at node i and rainfall at that node on that day is given. When i ∈ {1,2,...,n}, j=n+4, the Pearson correlation coefficient between traffic flow at node i and temperature at that node on that day is given. When i ∈ {1,2,...,n}, j=n+5, the Pearson correlation coefficient between traffic flow at node i and humidity at that node on that day is given.
[0125] (2) Normalization The correlation matrix is normalized row by row using the Min-Max normalization formula, which restricts the spatiotemporal influence features and external features of each node to the same dimension. The normalization formula is as follows: , in, This represents the minimum value in the i-th row. This represents the maximum value in the i-th row.
[0126] (3) Matrix partitioning The normalized correlation matrix is divided into the first n columns of spatiotemporal feature correlation matrices. The correlation matrix of external features in the last (mn) columns .
[0127] (4) Spatiotemporal feature weighting processing Spatiotemporal feature extraction results The structure is Spatiotemporal feature correlation matrix The structure is [ Therefore, in the second dimension of the spatiotemporal feature extraction results ( Weighting of spatiotemporal features in terms of dimension: .
[0128] in, This represents matrix multiplication.
[0129] Specifically, for the b-th batch and the t-th time step, the spatiotemporal feature correlation matrix... The structure is n*64, where n represents the number of detection nodes, and the spatiotemporal feature correlation matrix is... The structure is n*n, and for any detection node i, its weighted features are:
[0130] in, This represents the original spatiotemporal feature vector of detection node i at batch b and time step t. Let represent the original spatiotemporal feature vector of detection node i at batch b and time step t after weighted processing. i∈ {1,2,...,n}.
[0131] (5) Weighted processing of external features External feature extraction results The structure is External feature correlation matrix The structure is [ Therefore, in the second dimension of the external feature extraction result ( Weighting of external features in dimensional dimension: , in, This is for the Hadamard product operation.
[0132] Specifically, for the b-th batch and the t-th time step, the external feature correlation matrix... The weighted feature is n*5, where n represents the number of detection nodes. For any detection node i, its weighted feature is:
[0133] in, Let represent the original external feature vector of detection node i at batch b and time step t. Let represent the original external feature vector of detection node i at batch b and time step t after weighted processing. i∈ {1,2,...,n}.
[0134] (6) Multi-feature fusion The `torch.cat` concatenation function is used to concatenate two features along the feature dimension. This method preserves all features, ensuring both the specialized learning capabilities of each feature and enabling deeper feature interaction during subsequent model training. The resulting fused feature structure is... .
[0135] LSTM Traffic Prediction Module The fused feature sequence is input into the LSTM traffic volume prediction module. The LSTM traffic volume prediction module primarily uses the LSTM gating mechanism to learn the long-term dependency patterns of the sequence over time. Its final hidden state contains a summary of the spatiotemporal features of the entire input sequence. This includes the following steps: (1) Data preparation. The multi-feature fusion data is used as the input data for the LSTM traffic volume prediction module. Before being input into the prediction model, the data is flattened and adjusted in the last two dimensions. This ensures that the model can see the complete state of all nodes at each time step during training.
[0136] (2) Model Prediction. The input data is processed in the form described in step (1) of this module and then fed into the LSTM traffic volume prediction module. The specific structure is as follows: Figure 6 As shown: In this embodiment, a two-layer LSTM unit with 128 neurons is used to learn traffic temporal features. The first layer of the LSTM unit aims to extract short-term local dependencies, such as congestion changes between adjacent time steps and simple trend detection. The second layer of the LSTM unit, based on the first layer, extracts long-term and complex temporal dependencies, such as the cumulative effect of the entire sequence, complex periodic patterns, and multi-feature co-evolutionary features.
[0137] A Dropout layer is used between two LSTM units to randomly mask some connections, preventing neuron co-adaptation and improving the model's generalization ability. Since the LSTM unit itself is a complex nonlinear system, there is no need for activation layers to learn nonlinear patterns.
[0138] Fully connected output module like Figure 7 As shown, based on the temporal characteristics of LSTM, the last time step data of the LSTM traffic volume prediction module is used for subsequent training. The fully connected output module mainly uses two fully connected layers to perform progressive mapping of the output. The first layer selects the most important patterns for prediction, learns the combination relationships of different temporal patterns, and transforms the learned temporal features into a representation more suitable for the prediction task. The second layer performs dimensionality compression and multi-task output, removes redundancy, calculates an independent prediction score for each node, and shares weights. This gradual dimensionality compression avoids problems such as information loss and gradient anomalies (easily getting trapped in local optima) caused by direct dimensionality compression. Here, `output_dim` represents the data output dimension, i.e. .
[0139] A ReLU activation function is used between the two fully connected layers to introduce non-linearity, enhancing expressive power and mitigating the vanishing gradient problem. Dropout is used to randomly mask neurons, forcing redundancy and preventing overfitting. The Sigmoid function is used to normalize the output data.
[0140] S4: CONV-LSTM prediction model training.
[0141] The prepared training samples (standardized traffic data sequences and corresponding future true values) are input into the prediction model. The binary cross-entropy loss function is used to measure the difference between the predicted and true values. The AdamW optimizer is used to minimize the loss function, and all trainable parameters in the model (such as weights W, LSTM gate parameters, etc.) are updated through backpropagation. Early stopping strategies can be employed during training to prevent overfitting.
[0142] S5: CONV-LSTM model prediction.
[0143] Once the model training is complete and satisfactory accuracy has been achieved, it can be used for actual prediction. The latest real-time traffic data sequence, after undergoing the same preprocessing as S1, along with the road network topology... Figure 1 The input is fed into the trained model for prediction. When predicting the output, it is necessary to... By restoring the dimensions of each traffic feature, the congestion level of traffic flow and average speed at each node at the next time step can be obtained.
[0144] S6: Constructing the Guided Feature Set In this embodiment, the guiding feature set includes: (1) 3D basic prediction features This feature directly uses the predicted flow, speed, and congestion values.
[0145] (2) 10-dimensional physical derivative features Features of physical consistency indices, rationality scores, and suggested corrections are derived from traffic flow theory calculations. Specifically, these include: ①Flow-capacity ratio: Flow rate / road capacity, reflecting the road load level.
[0146] ② Physical congestion: Free-flow velocity / Actual velocity, calculated based on the basic traffic flow formula.
[0147] ③ Estimated density: flow rate / speed, calculated based on the basic relationship between the three parameters of traffic flow.
[0148] ④ Congestion Difference: Predicted Congestion - Calculated Congestion = .
[0149] in, This is a predicted congestion level. This is the predicted speed value; This represents the free-flow velocity.
[0150] ⑤ Speed-flow consistency : When Q <capacity*0.3, .
[0151] When Q >= capacity * 0.3, .
[0152] , in, The predicted speed of the traffic flow; This indicates the expected speed of the calculation. Here, represents the predicted traffic flow; and capacity represents the road capacity. Based on the above formula, the absolute difference between the actual speed and the expected speed is calculated, and normalized using free-flow velocity. The closer the calculated result is to 1, the better the speed-flow relationship matches the theoretical expectation.
[0153] ⑥ Density uniformity: , , , in, It is a density value obtained by calculating the number of vehicles per unit length; Density predictions based on flow velocity; Here, L represents the predicted traffic value, indicating the furthest distance that the edge device can detect. The absolute difference between two density values is calculated, and the larger of the two values is used as a benchmark for normalization. Normalization is performed when the two densities are equal. The value equals 1, the greater the difference, The closer the value is to 0.
[0154] ⑦ Traffic flow rationality assessment: In this embodiment, the maximum reasonable traffic flow is set to 1.2 times the traffic capacity. When the traffic flow exceeds the maximum reasonable value (120% capacity), it is considered extremely unreasonable and a very small base score of 0.1 is given. When the traffic flow is between 100% and 120% of the capacity, the score decreases linearly from 0.9 to 0.5. The closer to the maximum traffic flow, the lower the score. When the traffic flow is between 0 and 100% of the capacity, the score increases linearly from 0.9 to 1.0. The larger the traffic flow, the higher the score.
[0155] ⑧ Speed reasonableness score: In this embodiment, speeds below the minimum reasonable speed or exceeding the free-flow speed are considered abnormal and scored 0.1. When the speed is within the reasonable range, the score is the sum of the base score of 0.5 and the speed / free-flow speed ratio. The higher the speed, the higher the score.
[0156] ⑨ Congestion Reasonableness Score: In this embodiment, the evaluation is based on a preset reasonable range (1.0, 5.0); when the congestion level is within the set reasonable congestion level range, the congestion reasonableness score = / Otherwise, the congestion rationality score is 0.1.
[0157] ⑩ Capacity utilization rate: .
[0158] (3) 8-dimensional time features Because traffic patterns are highly periodic, traditional numerical coding easily disrupts this continuity. Therefore, sine and cosine functions are used to encode the 24-hour cycle as a continuous value. Based on practical traffic management experience, it is divided into hour_sin, hour_cos, day_sin, day_cos, day_of_week, is_weekend, month, is_holiday, etc.
[0159] (4) 3D cross features In this embodiment, the cross-interaction characteristics include peak-period physical influence factors, time-physical consistency coordination factors, and periodic physical mode deviation factors.
[0160] Peak Hour Physical Influence Factor: To calculate the degree of anomaly in the flow-speed relationship during peak hours, first determine whether it is currently the morning or evening peak period. If it is not a peak period, return zero directly. If it is a peak period, classify according to the predicted traffic flow level: when the flow exceeds 70% of the road capacity, the theoretically expected speed should be reduced to 40% of the free-flow speed; when the flow is at a moderate level, the expected speed should be 60% of the free-flow speed. Next, calculate the ratio of the actual speed to the free-flow speed, and finally obtain the absolute difference between the actual speed ratio and the theoretically expected speed ratio as the anomaly index.
[0161] This method aims to identify anomalies that deviate from typical traffic flow patterns during peak hours. When traffic volume is high but speed is abnormally high during peak hours, it may indicate a bias in the prediction model; when traffic volume is moderate but speed is abnormally low, it may suggest a sudden accident or unusual congestion.
[0162] Time-Physical Consistency Coordination Factor: This factor assesses the consistency between traffic forecasts and historical time patterns. First, current time characteristics (hour and weekend / holiday status) are extracted, and typical traffic patterns for the same time period are retrieved from historical data. Two key ratios are calculated: the historical flow-to-capacity ratio (the ratio of median flow to 80th percentile flow) and the historical speed ratio (the ratio of median speed to 80th percentile speed). Next, the corresponding ratios for the current forecasts are calculated, and the degree of consistency is assessed by comparing the relative deviations of the current ratios with the typical ratios. The flow consistency and speed consistency are calculated separately and averaged. Finally, a special adjustment is made for weekend periods, multiplying the consistency by 0.9 to reflect the different characteristics of weekend traffic patterns.
[0163] This method aims to verify the reasonableness of traffic forecast results over time and prevent forecasts that are significantly inconsistent with historical patterns. When the predicted flow or speed differs significantly from typical patterns for the same period, the consistency index decreases, suggesting that the forecast results may need to be reassessed.
[0164] Periodic physical pattern deviation factor: This factor assesses the degree of deviation between traffic prediction results and periodic physical patterns, detecting whether the predicted values deviate from typical traffic behavior patterns based on time periods. Specifically, in this embodiment, the calculation of the periodic physical pattern deviation factor includes the following steps: First, use the sine value encoding of hours. Sum and cosine value encoding Calculate hour angle code Convert discrete hour codes into continuous time angles: , Based on this perspective, two periodic expectation models are established: Flow expectation model: ; Velocity expectation model: ; The flow rate ratio is higher during the morning peak hours (adjusted using a sine function), while the speed ratio is lower during the morning peak hours (adjusted inversely using a sine function). Calculate the actual ratio of the current forecast to the 80th percentile of historical data, and compare the absolute differences between the actual and expected ratios for both flow and speed: , , Calculate the absolute values of flow rate deviation and velocity deviation separately: , , Final periodic physical mode deviation factor The average of the two: , in, The expected proportion of traffic. The expected ratio of speed; The absolute difference between the actual and expected traffic ratios. The 80th percentile of historical traffic data; The absolute difference between the actual speed ratio and the expected speed ratio; The value is the 80th quantile of historical speed data. This method aims to identify anomalies in prediction results that do not conform to daily cyclical patterns. By establishing expected traffic patterns based on a 24-hour cycle, it is possible to detect predictions that significantly deviate from typical cyclical behavior during specific time periods. When the deviation value is large, it indicates that the prediction results may be problematic, or that abnormal conditions have occurred in actual traffic.
[0165] S7: Constructing a Physical Guidance Metamodel The physical guidance metamodel in this embodiment adopts a multi-layered architecture, such as... Figure 8 As shown, it specifically includes: I. Feature Engineering Layer This layer is responsible for converting the original input into a physically guided feature vector. The specific steps are as follows: (1) Input reception and verification Receive the basic prediction value: It receives timestamp information and performs data validity checks.
[0166] (2) Physical parameter loading Load from road database Physical parameters such as capacity should be used. If precise parameters are unavailable, historical data should be used for calibration or empirical estimation.
[0167] (3) Feature calculation Based on the guiding feature set constructed using S6, 10-dimensional physical derived features, 8-dimensional temporal features, and 3-dimensional cross features are calculated. These 3-dimensional basic traffic predictions are then combined with the calculated 21-dimensional derived features to output a final 24-dimensional feature vector, namely the physical guiding feature vector. By fusing physically guided features, the essential characteristics of traffic flow can be better captured, improving the accuracy and interpretability of machine learning models in traffic state recognition, congestion prediction, and anomaly detection. This feature engineering method provides richer input information for traffic prediction systems, enabling models to learn reasonable patterns that conform to physical constraints.
[0168] II. Model Learning Layer (1) Model structure. This layer is based on the three-model parallel architecture of LightGBM, using three independent gradient boosting tree models to handle flow, speed and congestion correction respectively.
[0169] Traffic correction model: Specifically learns traffic correction patterns, takes 24-dimensional features as input, and outputs traffic correction amount.
[0170] Velocity Correction Model: Specifically learns velocity correction patterns, takes 24-dimensional features as input, and outputs velocity correction amount.
[0171] Congestion Correction Model: Specifically learns congestion correction patterns, takes 24-dimensional features as input, and outputs congestion correction amount.
[0172] This approach addresses multi-objective prediction by training a dedicated model for each traffic indicator. Compared to a single multi-output model, this independent modeling method better captures the unique patterns and feature relationships of each target variable, improving prediction accuracy. During training, validation set monitoring and early stopping mechanisms ensure model generalization ability, resulting in three models that can work collaboratively.
[0173] (2) Model training. The training set and the validation set are divided according to the validation ratio; then the hyperparameters are optimized for the current target; finally, the model is trained using the LightGBM framework, and an early stopping mechanism is used to prevent overfitting.
[0174] (3) Decision threshold learning mechanism: The splitting threshold is automatically learned by maximizing information gain. Different models learn different feature importance patterns, and the threshold is dynamically adjusted according to the data distribution.
[0175] III. Physical Constraint Layer This layer is used to apply final physical constraints to the model output to ensure the reasonableness of the results.
[0176] Input: The corrected predicted values output by the model; Handling: Scope constraints, relational constraints, consistency constraints; Output: Final, physically reasonable traffic parameter predictions.
[0177] (1) Scope constraints Two-way constraints are applied to traffic flow forecasting, with a lower limit of 0 (traffic flow cannot be negative) and an upper limit of 1.2 times the road capacity (allowing for moderate overload); minimum speed and free-flow speed boundaries are set for speed forecasting to ensure that speed values are within a reasonable range; congestion forecasting is limited to a score range of 1.0 to 5.0.
[0178] (2) Relationship constraints Calculate the physical congestion level based on velocity (the ratio of free-flow velocity to actual velocity), and then compare the original congestion level prediction with the physical congestion level. A three-level correction strategy is applied based on the magnitude of the difference: a strong correction is applied when the difference is greater than 0.3. The physical relationship is the primary factor; a moderate correction is applied when the difference is between 0.1 and 0.3. To balance the physical relationship with the original prediction; when the difference is less than 0.1, the original prediction is maintained, respecting the model output; among which, This is the final output congestion prediction value. Physical congestion level, This represents the predicted congestion level.
[0179] (3) Consistency constraints The estimated density is calculated based on the final flow rate and speed. When the estimated density exceeds 200 vehicles / km (an unreasonably high density threshold), it is considered a state of physical inconsistency. In this case, the speed value is adjusted upward by 10%, but it is ensured not to fall below the minimum speed limit. By increasing the speed value, the flow rate-speed-density relationship is restored to a reasonable range.
[0180] By making appropriate adjustments, the basic physical coordination of flow, speed, and density can be restored, ensuring that the final prediction results conform to both data patterns and the basic constraints of traffic flow theory, thereby improving the practical usability and physical reliability of the prediction results.
[0181] S8: Training the Physics-Guided Metamodel (1) Prepare the training dataset. Use the predicted values and corresponding actual values of the traffic prediction model training set as the physical guidance meta-model training set. Use a mixed dataset of 80% reasonable predictions and 20% unreasonable predictions, and use time-series cross-validation to maintain time dependence.
[0182] (2) Construct a physical guidance feature set and calculate the physical consistency index and rationality score.
[0183] (3) The meta-model is trained using a physics-guided loss function that combines prediction error and physical consistency error.
[0184] (4) Use time-series cross-validation to select the optimal model parameters.
[0185] (5) Save the trained meta-model and feature standardization parameters.
[0186] S9: Output and Application The traffic prediction values obtained from S6 are output to the physical guidance meta-model for correction, and the corrected final traffic prediction values are then used. Output to traffic guidance systems, navigation application platforms, or traffic control centers to achieve proactive traffic guidance and control.
[0187] Example 4 A road traffic operation status prediction system, the system being used to execute a road traffic operation status prediction method as described in any of the above embodiments, comprising a data acquisition module, a basic prediction module, and a physical guidance element module that are interconnected.
[0188] The data acquisition module includes several edge acquisition devices installed on the target road network, including cameras, edge computing, radar, etc.
[0189] The basic prediction module is used to preprocess and make preliminary predictions based on the data acquired by the data acquisition module.
[0190] The physical guidance module is used to physically correct the preliminary prediction results of the basic prediction module and output the traffic operation status prediction value.
[0191] Example 5 like Figure 9 As shown, a road traffic operation status prediction device includes at least one processor, a memory communicatively connected to the at least one processor, and at least one input / output interface communicatively connected to the at least one processor. The memory stores instructions executable by the at least one processor, which, when executed, enables the at least one processor to perform a road traffic operation status prediction method as described in the foregoing embodiments. The input / output interface may include a display, keyboard, mouse, and USB interface for inputting and outputting data.
[0192] Furthermore, the road traffic operation status prediction device can be a desktop computer, mobile phone, tablet computer, wearable road traffic operation status prediction device, or other road traffic operation status prediction device capable of deep information recognition.
[0193] Furthermore, the processor may include one or more processing cores. The processor connects various parts within the road traffic operation status prediction device using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in memory, and by calling data stored in memory. Optionally, the processor may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor and may be implemented separately through a communication chip.
[0194] The memory may include random access memory (RAM) or read-only memory (ROM). The memory can be used to store instructions, programs, code, code sets, or instruction sets, such as instructions or code sets used to implement a road traffic operation state prediction method provided in this application embodiment. The memory may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function, instructions for implementing the various method embodiments described above, etc. The data storage area may also store data created during the use of the road traffic operation state prediction device (such as a modulation sequence-depth mapping table, image data, spectrogram data, etc.).
[0195] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory, magnetic disks, or optical disks.
[0196] When the integrated units of the present invention are implemented as software functional units and sold or used as independent products, they can also be stored in a computer-readable storage medium. The computer-readable storage medium stores program code, which can be called by a processor to execute the methods described in the above method embodiments. Based on this understanding, the technical solution of the embodiments of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes electronic memories such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium includes a non-transitory computer-readable storage medium. The computer-readable storage medium has storage space for program code that executes any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code can be compressed, for example, in an appropriate form.
[0197] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for predicting road traffic operation status, characterized in that, Includes the following steps: S1: Obtain historical multi-dimensional traffic data of the target road network, and preprocess the historical multi-dimensional traffic data to form a standardized traffic data sequence; wherein, the multi-dimensional traffic data includes traffic data, external feature data and road network data; the external feature data includes the proportion of large vehicles and weather data; S2: Construct a road network topology map based on the road network data; S3: Input the standardized traffic data sequence and the road network topology map into the pre-constructed traffic prediction model for model training, and output the trained traffic prediction model after training is completed; The traffic prediction model includes a spatiotemporal feature extraction module, an external feature extraction module, a multi-feature fusion module, an LSTM traffic volume prediction module, and an output module. S4: Input the real-time traffic data to be predicted into the trained traffic prediction model, and output the predicted traffic operation status of the target road segment in the future target time period; the predicted traffic operation status includes the predicted flow rate, the predicted speed, and the predicted congestion level. S5: Generate a physical guidance feature set based on traffic flow theory, and construct a physical guidance meta-model based on the physical guidance feature set; S6: Use the predicted values and corresponding actual values of the standardized traffic data sequence as a training set to train the physical guidance meta-model, and output the trained physical guidance meta-model after training is completed. S7: Input the traffic operation status prediction value into the pre-trained physical guidance meta-model, and output the corrected traffic operation status prediction value.
2. The method for predicting road traffic operation status according to claim 1, characterized in that, S1 includes the following steps: S11: Obtain historical multi-dimensional traffic data of the target road network from edge devices at different nodes of the target road network; S12: Perform data cleaning processing on the traffic data and external feature data in the historical multi-dimensional traffic data; S13: Normalize the historical multivariate traffic data after data cleaning and processing to the [0,1] interval to form standardized data; S14: Construct the standardized data into a standardized traffic data sequence according to the preset time step.
3. The method for predicting road traffic operation status according to claim 1, characterized in that, S2 includes the following steps: S21: Construct an n*n physical adjacency matrix based on the road network data; The road network data includes road network structure data and node distances; n is the number of nodes; in the physical adjacency matrix, if nodes i and j are adjacent, the corresponding elements... =1, otherwise =0, i,j ∈[1,n]; S22: Construct an n*n distance matrix for the target road network based on the node distances; S23: Combine the physical adjacency matrix and the distance matrix to construct an n*n graph adjacency matrix; the expression for the graph adjacency matrix is: , Where D is the graph adjacency matrix. Let i be the elements corresponding to nodes i and j in the graph adjacency matrix. The distance between nodes i and j; S24: Normalize the graph adjacency matrix and output the road network topology graph.
4. The method for predicting road traffic operation status according to claim 3, characterized in that, The traffic prediction model includes a spatiotemporal feature extraction module, an external feature extraction module, a multi-feature fusion module, an LSTM traffic volume prediction module, and an output module. The spatiotemporal feature extraction module includes three sets of convolutional layers, which are used to sequentially perform temporal dimension convolution, multi-layer spatial dependency establishment, and predictive feature extraction, and output spatiotemporal features; wherein, the convolutional layers aggregate the features of all nodes through the graph adjacency matrix, and the multi-layer stacking enhances the learning ability; The external feature extraction module includes two fully connected layers, which are used to sequentially complete complex feature learning and predictive feature extraction, and output external features. The multi-feature fusion module is used to calculate the traffic flow correlation matrix of each node according to the Pearson correlation coefficient calculation method, and to perform weighted processing on the spatiotemporal features and external features according to the correlation matrix, and then fuse the weighted spatiotemporal features and external features to output the fused features; The LSTM traffic volume prediction module includes two layers of LSTM units, which are used to learn traffic temporal features based on the fused features; wherein, the first layer of LSTM units is used to extract short-term local dependencies, and the second layer of LSTM units is used to extract long-term complex temporal dependencies. The output module includes two fully connected layers, which are used to progressively map the learned traffic temporal features and output traffic operation status predictions.
5. The method for predicting road traffic operation status according to claim 1, characterized in that, S5 includes the following steps: S51: Calculate the physical consistency index of the target road network based on traffic flow theory; the physical consistency index includes speed-flow consistency, density consistency, and congestion difference; S52: Calculate the physical rationality score of the traffic operation status prediction value; the physical rationality score includes the flow rationality score, speed rationality score and congestion rationality score; S53: Calculate the traffic condition identification features and capacity utilization of the target road network; S54: The cross-effect characteristics of integrating time features, weather features, and physical features; the cross-effect characteristics include peak period physical influence factors, time-physical consistency coordination factors, and periodic physical model deviation factors; The peak-hour physical impact factor is used to analyze the degree of anomaly in the flow-velocity relationship during peak hours; The time-physical consistency reconciliation factor is used to assess the reconciliation and consistency between traffic forecast results and historical time patterns. The periodic physical pattern deviation factor is used to assess the degree of deviation between traffic prediction results and periodic physical patterns. S55: Output a physical guidance feature set; wherein, the physical guidance feature set includes traffic operation status prediction values, physical derived features, time features, and cross-interaction features; the physical derived features include the physical consistency index, the physical rationality score, the traffic status identification features, and the capacity utilization rate; the time features include the time features of each set time period; S56: Construct a physical guidance meta-model based on the physical guidance feature set.
6. The method for predicting road traffic operation status according to claim 5, characterized in that, The calculation of the periodic physical mode bias factor includes the following steps: Establish a periodic expectation model based on the hourly angular encoding hour_angel: Flow expectation model: ; Velocity expectation model: ; Calculate the actual ratio of the current forecast value to the 80th percentile of historical data, and compare the absolute differences between the actual ratio and the expected ratio for both flow and speed: , , Calculate the absolute values of flow rate deviation and velocity deviation separately: , , Calculate the periodic physical mode deviation factor : , in, The expected proportion of traffic. The expected ratio of speed; The absolute difference between the actual and expected traffic ratios. Forecast traffic volume The 80th percentile of historical traffic data; The absolute difference between the actual speed ratio and the expected speed ratio; This is the predicted speed value; The 80th percentile of historical speed data; This represents the absolute value of the flow deviation. This represents the absolute value of the speed deviation.
7. The method for predicting road traffic operation status according to claim 5, characterized in that, The physical guidance metamodel includes a feature engineering layer, a model learning layer, a physical constraint layer, and a loss function connected in sequence. ; The feature engineering layer is used to generate a physical guidance feature vector based on the physical guidance feature set; The model learning layer includes three parallel gradient boosting tree models, used to respectively correct flow, speed, and congestion. The physical constraint layer is used to apply final physical constraints to the model output; loss function The expression is: , in, The error between the predicted value and the actual value, For physical consistency error, These are the weighting coefficients.
8. The method for predicting road traffic operation status according to claim 7, characterized in that, The final physical constraints include range constraints, relational constraints, and consistency constraints; The range constraints include: Flow range constraint: 0 ≤ Flow forecast value ≤ Set a reasonable flow threshold; Speed range constraint: Set minimum reasonable speed ≤ predicted speed ≤ free flow speed; Congestion range constraint: The congestion prediction value ∈ a set reasonable congestion range; The relational constraints include: Adjustments based on consistency between speed-flow rate and congestion-speed relationship; When the difference between the predicted congestion level and the actual congestion level is greater than 0.3, the congestion level is corrected according to the following formula: , When the difference between the predicted congestion level and the physical congestion level is ∈ [0.1, 0.3], the congestion level is corrected according to the following formula: , in, This is the final output congestion prediction value. Physical congestion level, This is a predicted congestion level. The consistency constraints include: The estimated density is calculated based on the final flow rate and velocity. When the estimated density exceeds the set unreasonable high density threshold, it is judged as a state of physical incoordination. If the physical relationship is not in harmony, increase the speed prediction value by a set percentage; determine whether the increased speed prediction value is greater than or equal to the set minimum reasonable speed. If the requirements are not met, the predicted speed value is set to the minimum reasonable speed, and the current predicted speed value is output. If the requirements are met, output the current speed prediction value.
9. A road traffic operation status prediction system, characterized in that, The system is used to execute a road traffic operation state prediction method according to any one of claims 1 to 8, comprising a data acquisition module, a basic prediction module, and a physical guidance element module that are interconnected. The data acquisition module includes several edge acquisition devices installed on the target road network; The basic prediction module is used to perform preprocessing and preliminary prediction based on the data acquired by the data acquisition module; The physical guidance module is used to physically correct the preliminary prediction results of the basic prediction module and output the traffic operation status prediction value.
10. A road traffic operation status prediction device, characterized in that, It includes at least one processor and a memory communicatively connected to the at least one processor; the memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to perform a road traffic operation state prediction method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Traffic speed prediction method based on traffic flow data fusion and system
CN113808396A
Efficient space-time traffic flow prediction method
CN118538029A
Method and device for identifying and repairing abnormal data of time sequence traffic flow
CN118865689A
Traffic flow prediction method
CN119516771A
Traffic flow prediction method based on graph diffusion and dynamic graph fusion
CN120636177A