Traffic flow prediction method and system based on embedding physical information deep neural network
Patent Information
- Application Number
- CN202510743394.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-05
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2045-06-05
AI Technical Summary
[0006]本发明所要解决的技术问题是:针对城市复杂路网中交通流动态演化与非线性传播的难题,突破传统方法在物理一致性、复杂场景适应性及实时性上的局限,提出一种融合物理信息神经网络与交通流演化规律的交通流量预测方法,通过将交通流物理模拟方程(如流量守恒、车辆传递规则)作为约束嵌入神经网络训练,构建模型与数据双驱动的混合框架,以提高预测精度、保障结果符合交通流理论,并增强对动态场景的适应能力
[0062] 1. It achieves deep collaborative optimization between physical laws and data-driven approaches.
Smart Images

Figure CN120452198B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of interdisciplinary technology of intelligent transportation systems and deep learning, specifically relating to a method and system for intelligent traffic flow prediction based on an embedded physical simulation neural network. Background Technology
[0002] With the increasing complexity of urban transportation systems, short-term traffic flow prediction has become a key technology for intelligent traffic management. Traditional traffic prediction methods are mainly divided into two categories: model-driven and data-driven, but both have significant limitations:
[0003] Traditional model-driven methods rely on physical models (such as macroscopic fluid dynamics models) built upon macroscopic traffic flow theories (e.g., flow conservation equations, velocity-density relationships), providing predictive results with clear physical interpretability. However, these methods typically depend on simplifying assumptions (e.g., uniform grid partitioning, constant traffic parameters), making them ill-suited to the complex topologies of urban road networks (e.g., intersection signal control, dynamic lane function switching, ramp merging), and lacking the ability to characterize nonlinear traffic dynamics (e.g., congestion propagation, sudden events), leading to the accumulation of long-term prediction errors.
[0004] Data-driven methods, such as deep learning and spatiotemporal graph neural networks, can capture complex traffic patterns by mining spatiotemporal dependencies in historical data, and their prediction accuracy is high when data is abundant. However, they rely on large-scale labeled data, and their performance drops sharply when detector coverage is insufficient or data is missing. Furthermore, they lack physical constraints, which may generate predictions that violate traffic flow theory (such as density exceeding congestion thresholds, sudden changes in flow, etc.), leading to reduced credibility. The models also have poor interpretability, making it difficult to provide reliable decision-making basis for traffic management.
[0005] Some studies have attempted to combine physical models with machine learning, such as using physical models to generate initial predictions and then correcting the residuals through neural networks, or directly using the model output as feature input to a neural network. However, these methods still have some problems: such as the physical model and the data-driven module being trained in isolation, failing to achieve joint parameter optimization; the differential form of the traffic flow equation not being embedded in the neural network, resulting in insufficient constraints from physical laws; and insufficient modeling capabilities for dynamic scenarios such as signal control and variable lanes in urban road networks. Summary of the Invention
[0006] The technical problem to be solved by this invention is to address the challenges of dynamic evolution and nonlinear propagation of traffic flow in complex urban road networks. It aims to overcome the limitations of traditional methods in terms of physical consistency, adaptability to complex scenarios, and real-time performance. The invention proposes a traffic flow prediction method that integrates physical information neural networks with traffic flow evolution laws. By embedding physical simulation equations of traffic flow (such as flow conservation and vehicle transmission rules) as constraints into the neural network training, a hybrid framework driven by both model and data is constructed to improve prediction accuracy, ensure that the results conform to traffic flow theory, and enhance adaptability to dynamic scenarios.
[0007] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:
[0008] This invention proposes a traffic flow intelligent prediction method based on an embedded physical simulation neural network, which includes the following steps:
[0009] S1. Discretize the target road network based on the traffic flow physical model to generate dynamic grid partitioning and topological connection relationships;
[0010] S2. Real-time acquisition of traffic flow data from detectors in the road network, short-term traffic state prediction through physical evolution equations, and obtaining grid density and traffic flow at future times;
[0011] S3. Construct a deep neural network model, whose input is historical traffic flow data and traffic state predicted by the physical model, and whose output is the traffic flow prediction result at future time.
[0012] S4. During the training of the neural network, the traffic flow conservation equation and vehicle transmission rules are used as physical constraints, and the data fitting error and physical law residuals are jointly optimized through the loss function.
[0013] S5. Based on the trained model, realize the dynamic identification and prediction of traffic flow density, flow rate and congestion propagation status.
[0014] Furthermore, the discretization modeling in step S1 specifically includes:
[0015] S101. Based on the differences in road type and number of lanes, a variable-length grid partitioning strategy is adopted to non-uniformly discretize urban expressways and ground roads. The expressway grid is set with a fixed length and the length of the ramp merging area to achieve fine modeling of traffic flow changes. The ground road grid length is dynamically adjusted according to the intersection spacing. Static parameters including the number of lanes, free flow velocity, and congestion density are defined for each grid, as well as dynamic parameters including real-time density and traffic flow.
[0016] S102. Integrate signal control logic into the intersection grid, dynamically adjust vehicle transfer rules between grids through signal phase, establish a flow transfer equation, and introduce signal control constraints into the flow transfer equation:
[0017]
[0018] in Represents the grid density, v f q represents the free-flow velocity. max This represents the maximum traffic capacity of the road section. Representing congestion density, δ represents signal phase, and for each grid i, the density is iteratively updated according to the following formula with a time step Δt:
[0019]
[0020] in Δx represents the grid density at time t+1. i Let i be the length of grid i. This represents the flow rate of the (i-1)th grid at time t. This represents the flux of the i-th grid at time t, and the initial density. From detector data, the equations are solved to obtain the grid-level density and flow prediction sequences for future time periods.
[0021] Furthermore, step S2 involves short-term traffic state prediction using physical evolution equations, specifically including:
[0022] 1) Calculate grid density evolution using traffic flow conservation equations:
[0023]
[0024] in, Represents the grid density, Δx i Let t represent the length of grid i, and t represent time, i = 1, 2, ..., N. Inter-grid flow;
[0025] 2) Based on the intersection signal timing, adjust the upper limit of the grid output flow rate, with the following constraints:
[0026]
[0027] in Represents the grid density, v f This represents the free-flow velocity. This represents the maximum traffic capacity of the road section. δ represents congestion density, and δ represents signal phase.
[0028] Furthermore, the deep neural network model in step S3 is a Physical Information Neural Network (PINN), whose input features include:
[0029] 1) Historical detector data: includes grid density, flow rate, and average velocity within a time window;
[0030] 2) Physical model prediction data: including grid density and flow prediction values for future time periods;
[0031] 3) Road network topology features: including adjacency matrix encoding of grid connection relationships, and additional lane number, signal phase state edge attributes;
[0032] At the network architecture level, the encoder employs a spatiotemporal graph convolution module, extracting temporal features through gated convolution, and the graph convolution aggregates spatial associations as: H (l+1) =ReLU(Θ*(H) (l) W t )+b), where W t Θ is the temporal convolution kernel, Θ is the graph convolution parameter matrix; b is the weight coefficient, used to adjust the intensity of information exchange between nodes;
[0033] The physical constraint layer in the decoder output prediction value Then, the residuals of the traffic flow equations are calculated as follows:
[0034]
[0035] in Here is the predicted density value for grid i. Here is the predicted flow rate for grid i;
[0036] The loss function uses the combined optimization of the data fitting error and the physical law residuals, with the data term being the mean square error between the predicted and actual values:
[0037]
[0038] The physical terms are obtained by weighted summation of the equation residuals:
[0039]
[0040] Where α and β are empirical weighting coefficients, α = 0.7 and β = 0.3. This represents the deviation between the predicted results and the conservation laws of the traffic flow model. This represents the difference between the predicted results and the actual traffic flow.
[0041] Furthermore, the loss function in step S4 is defined as:
[0042]
[0043] in, The mean square error between the predicted and actual values. The residual constraints of the physical evolution equations are λ1 and λ2, which are dynamic weights. The degree of non-compliance of the equations is calculated by automatic differentiation.
[0044] Residual constraints of physical evolution equations include:
[0045] Flow conservation equation residuals:
[0046] Vehicle transfer rule residuals:
[0047] Furthermore, step S4 involves training the physical information neural network and the dynamic parameters of the physical model through joint optimization. The specific process is as follows:
[0048] First, the detector's historical data X obs Compared with the physical model prediction data X ctm Perform standardization processing and calculate the standardization parameter μ. ρ , σ ρ and μ q , σ q Generate normalized input
[0049] Subsequently, a spatiotemporal graph convolutional encoder is constructed, which extracts temporal features using gated temporal convolutional kernels and aggregates the spatial correlations of adjacent grids through graph convolutional layers to output the hidden state. The decoder concatenates the hidden state with the physical model predictions and maps them to the density and flow predictions for future time steps through a fully connected layer. And calculate the physical constraint residuals:
[0050]
[0051] Among them, v f q represents the free-flow velocity. max This represents the maximum traffic capacity of the road section. δ represents congestion density, and δ represents signal phase.
[0052] The model training employs a two-stage alternating optimization strategy:
[0053] In the first stage, the physical model parameters are fixed, and the Adam optimizer is used to update the neural network parameters to minimize the weighted loss function.
[0054] In the second stage, the neural network parameters are fixed, the physical model parameters are updated using the L-BFGS optimizer, and the free flow velocity and blockage density are adjusted through backpropagation of the physical residuals. The process is iterated until the loss function converges.
[0055] Furthermore, the traffic flow prediction results in step S5 include:
[0056] 1) Grid-level density and flow heatmap for future moments;
[0057] 2) The spatiotemporal evolution trends of congestion propagation paths and bottleneck areas;
[0058] Among them, grids whose density growth rate exceeds a threshold are identified as potential congestion sources. A spatiotemporal propagation analysis algorithm is used to track the density evolution of their upstream and downstream grids, generating a diffusion heatmap.
[0059] Furthermore, the present invention also proposes an electronic system comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the steps of the method described in the present invention.
[0060] Finally, the present invention provides a computer-readable storage medium storing computer instructions for causing the computer to perform the steps of the method described in the present invention.
[0061] Compared with the prior art, the technical solution of the present invention has the following beneficial technical effects:
[0062] 1. It achieves deep collaborative optimization between physical laws and data-driven approaches.
[0063] Traditional traffic prediction methods, while model-driven techniques (such as CTM) can ensure consistency with physical laws, are insufficient in characterizing the dynamic characteristics of complex road networks; while pure data-driven methods (such as deep learning) perform well with sufficient data, they are prone to generating predictions that violate traffic theory due to the lack of physical constraints. This invention ensures that the prediction results conform to physical theory by strictly embedding traffic flow conservation equations, and at the same time uses neural networks to capture nonlinear spatiotemporal correlations, thereby improving prediction accuracy and reliability.
[0064] 2. Enhanced dynamic adaptability to complex urban traffic scenarios.
[0065] Existing methods typically require recalibrating model parameters or constructing independent sub-models when dealing with dynamic scenarios such as signalized intersections and tidal flow lanes, leading to a significant increase in computational complexity and insufficient real-time performance. This invention integrates dynamic mesh generation with signal control logic, supporting rapid response to lane function switching and unexpected events (such as construction closures) without requiring model reconstruction, enabling the model to handle heterogeneous traffic scenarios within a unified framework.
[0066] 3. Supports the generation of control decisions based on multi-objective optimization.
[0067] Traditional traffic control strategies often face a trade-off between safety and efficiency: for example, while variable speed limit control can reduce the impact range of accidents, it may create new bottlenecks; dynamic lane management can guide traffic flow to avoid risk areas, but it can easily lead to a decrease in lane resource utilization. This invention constructs a reward function that integrates multiple dimensions such as mean speed and standard deviation by using a high-precision density-flow field output by a physical information neural network. This provides refined input for reinforcement learning control strategies and establishes a balance mechanism between accident prevention, traffic efficiency improvement, and resource optimization. Attached Figure Description
[0068] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0069] Figure 1 This is the overall system architecture diagram of the present invention.
[0070] Figure 2 This is a schematic diagram of the dynamic mesh division of the present invention.
[0071] Figure 3 This is a diagram of the physical information neural network structure in this invention.
[0072] Figure 4 This is a flowchart of the model-data collaborative training process in this invention. Detailed Implementation
[0073] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0074] This invention proposes a traffic flow prediction method based on a physical information neural network. By transforming the discrete form of the traffic flow equation into a continuous constraint embedded in the neural network loss function, a hybrid framework that deeply integrates the model and data is constructed, balancing prediction accuracy, physical consistency, and scenario adaptability. Specifically, it includes the following steps:
[0075] 1) Road network discretization and traffic flow physical simulation.
[0076] Based on differences in road function and number of lanes, the grid length is dynamically adjusted. For expressways, the grid length is set to a fixed 500m, with a 200m grid for ramp merging areas to achieve refined modeling of sudden traffic changes. For surface roads, the grid length is dynamically adjusted based on intersection spacing: if the distance between adjacent signalized intersections is less than 800m, the grid is divided according to half the intersection spacing; if it is greater than 800m, the grid is divided with a maximum length of 400m. Subsequently, static parameters such as the number of lanes, free-flow velocity, and congestion density, as well as dynamic parameters such as real-time density and traffic flow, are defined for each grid.
[0077] The grid of each approach lane at the intersection is bound to the signal phase, and then a phase switching function is defined, which is 1 for green light and 0 for red light. Signal control constraints are then introduced into the flow transmission equation:
[0078]
[0079] Where q max This represents the maximum traffic capacity of the road segment. For each grid i, the density is iteratively updated according to the following formula with a time step of 10 seconds:
[0080]
[0081] Where Δx i Let i be the length of the grid and the initial density. Data is derived from detector data. Solving the equations yields a grid-level density and flow prediction sequence for the next 15 minutes.
[0082] 2) Construction of physical information neural network.
[0083] First, the input features are designed. The historical detection data time window τ = 12 steps, i.e., the measured data of the past 2 minutes, is organized into tensors according to a grid. It includes three channels: density, flow rate, and velocity; the physical simulation prediction data is set as the physical model prediction results for the next 15 minutes, and is constructed as follows. It includes two channels: density and flow; topological feature encoding uses the adjacency matrix A(t)∈{0,1} N*N It represents the grid connection relationship and adds side attributes such as the number of lanes and signal phase status.
[0084] At the network architecture level, the encoder employs a spatiotemporal graph convolution module, extracting temporal features through gated convolution, and the graph convolution aggregates spatial associations as: H (l+1) =ReLU(Θ*(H) (l) W t )+b), where W t Θ is the temporal convolution kernel, Θ is the graph convolution parameter matrix, and b is the weight coefficient used to adjust the intensity of information exchange between nodes.
[0085] The physical constraint layer in the decoder output prediction value Then, the residuals of the traffic flow equations are calculated as follows:
[0086]
[0087] in Here is the predicted density value for grid i. Let be the predicted flow rate for grid i.
[0088] The loss function uses the combined optimization of the data fitting error and the physical law residuals, with the data term being the mean square error between the predicted and actual values:
[0089]
[0090] The physical terms are obtained by weighted summation of the equation residuals:
[0091]
[0092] Where α = 0.7 and β = 0.3 are empirical weighting coefficients.
[0093] The dynamic weights were initially set to λ1:λ2 = 3:1 to prioritize data fitting, and were gradually adjusted to 1:1 later to strengthen physical constraints.
[0094] 3) Model training and prediction.
[0095] This is achieved by jointly optimizing the dynamic parameters of the physical information neural network (PINNs) and the physical model.
[0096] First, the detector's historical data X obs Compared with the physical model prediction data X ctm Perform standardization processing and calculate the standardization parameter μ. ρ , σ ρ and μ q , σ q Generate normalized input
[0097] Subsequently, a spatiotemporal graph convolutional encoder was constructed, utilizing gated temporal convolutional kernels. Extract temporal features and apply them through graph convolutional layers. Aggregate the spatial associations of adjacent meshes and output the hidden state. The decoder compares the hidden state H with the physics model prediction X. ctm The data is stitched together and mapped through a fully connected layer to predict future density and flow rates. And calculate the physical constraint residuals:
[0098]
[0099] The training process employs a two-stage alternating optimization strategy: the first stage fixes the physical model parameters θ. CTM ={υ f , ρ jam Using the Adam optimizer with an initial learning rate η = 10 -3 Update neural network parameters θ NN Minimize the weighted loss function Among the data items Physics term is The weighting coefficients are dynamically adjusted from λ1:λ2 = 3:1 to λ1:λ2 = 1:1; in the second stage, θ is fixed. NN Update θ using the L-BFGS optimizer CTM The free flow velocity and blockage density are adjusted by backpropagation of the physical residuals, and the iteration continues until the loss function converges.
[0100] After training is complete, the model synchronously outputs the grid-level density, flow rate, and propagation path for the next 15 minutes. For any time t, if the density growth rate of grid i... These are then marked as potential congestion sources, and their density evolution is tracked through a spatiotemporal propagation analysis algorithm to generate a congestion diffusion heatmap.
[0101] The final prediction results are mapped onto the road network, with density levels represented by color gradients and arrows superimposed to indicate traffic flow direction, forming a visual decision support interface.
[0102] Example 1: The following specific example will be used to further illustrate the process flow of the method of the present invention. Figure 1 The system architecture diagram of the present invention includes the following steps:
[0103] Step 1: Road network discretization and traffic flow physical simulation modeling. Dynamic grid generation: The main line of the expressway is divided into a 500-meter baseline grid, and the merging zone of ramps is compressed to 200 meters to capture traffic flow changes in a more refined manner; the grid length of the ground roads is dynamically adjusted according to the intersection spacing (300-600 meters), and a dynamic adjacency matrix is set for tidal lanes, with the weight coefficients automatically switching according to peak hours (0.8 weight for inbound direction during morning peak and 0.7 weight for outbound direction during evening peak). Figure 2This paper presents a grid-based intersection management method for refined traffic flow management and analysis. The intersection is divided into multiple directions and lanes, with each direction further subdivided into different lane types, such as straight, left turn, and right turn. Specifically, the four main directions of the intersection are marked W (West), E (East), S (South), and N (North), and each direction is further subdivided into multiple sub-areas based on vehicle travel intentions. For example, in the West direction (W), there are two main roads, W1 and W2, each subdivided into straight (WIL, WIR), left turn (WIA, WIB), and right turn (WIMR, WIM) lanes. Similarly, the East direction (E) also has two main roads, E1 and E2, each containing corresponding straight, left turn, and right turn lanes. The North-South directions (S and N) follow the same grid-based principle, ensuring that each travel direction and intention has a clearly defined path.
[0104] Model parameter initialization, mesh transmission model parameters: free flow velocity v f =60km / h, blockage density ρ jam =140veh / km, real-time density and flow are initialized using detector data. The signal control grid is subject to phase timing constraints (green light start delay ≤ 3 seconds, yellow light time fixed at 3 seconds), and the grid density is dynamically updated based on the traffic flow conservation equation.
[0105]
[0106] Where T step =10s, l i Where is the grid length. Under signal phase constraints, the upper limit of the grid output flow rate is: α(t)∈{0,1} is the signal phase state function (1 for green light, 0 for red light). A grid-level density and flow prediction sequence for the next 15 minutes is generated through iterative calculation.
[0107] Step two involves the fusion and preprocessing of multi-source traffic data. Historical data is collected from 5-minute granularity flow data from Weibo detectors and signal phase logs accurate to 0.1 seconds. Real-time data is generated by roadside units pushing grid status every 30 seconds and using floating car FPS trajectories to invert the velocity field. By mapping the floating car trajectories to the grid network, cubic spline interpolation is used to fill time gaps and achieve spatiotemporal alignment of the data. Abnormal data with negative flow or excessive congestion density values are repaired based on the traffic flow continuity equation. Finally, density and flow are normalized.
[0108] Step 3: Design of the physical information neural network architecture. (Reference) Figure 3 As shown, Figure 3This diagram illustrates the structure of Physical Information Neural Networks (PINNs), a deep learning model designed to improve the accuracy and physical consistency of traffic flow predictions. The network consists of an input layer, hidden layers, and an output layer. The input layer receives various raw data, including spatial coordinates, timestamps, and historical traffic state data, as input nodes (e.g., I1, I2, ..., Im), which collectively constitute the network's information source. Next, the data is processed through multiple layers of fully connected neurons in the hidden layer. The diagram shows two hidden layers, where each neuron is connected to all nodes in the previous layer. The neurons undergo activation function transformation to extract complex patterns and features from the input data, enabling the network to learn non-linear relationships between data. Finally, the information processed by the last hidden layer is passed to the output layer. The output nodes O1, O2, ..., On are responsible for generating predictions of future traffic density, flow rate, and other parameters.
[0109] In physical information neural networks, in addition to traditional data fitting errors, physical state loss is specifically introduced to ensure that the model's prediction results conform to known physical laws. This not only allows the model to make accurate predictions based on historical data, but also enables it to make inferences using physical knowledge when data is insufficient, thereby improving the model's robustness and generalization ability, making it an effective tool for solving the problem of predicting traffic conditions in complex urban road networks.
[0110] The input layer is configured with a main input channel and an auxiliary input channel. The main input channel uses the density and flow sequences from the past 12 time steps, while the auxiliary input channel uses density and flow values predicted by the physical model for the next 15 minutes, concatenated to form an additional feature vector. The graph attention layer uses a dynamic weight matrix between grids for calculation; the spatiotemporal convolutional layer uses a 3-level dilated temporal convolution with the number of channels set to [64, 128, 256]; the physical constraint module calculates the residual term of the traffic flow equation after the decoder outputs the predicted value, with the residual loss weight set to 0.5. The output layer consists of three parts: Sigmoid activation outputs the density prediction result, Tanh activation mapping outputs the flow prediction, and Softmax generates grid-level classification probabilities to output the congestion probability prediction.
[0111] Step 4, Collaborative Training and Optimization. Model training employs a two-stage alternating training strategy. In Stage 1, the physical model parameters are fixed, and the network weights are updated using the Adam optimizer, with the learning rate decaying by 50% every 10 epochs. In Stage 2, the network parameters are frozen, and the physical model parameters are optimized using L-BFGS, iterating until the residual convergence. The termination condition is that the data reconstruction loss is less than 0.02, the physical residual loss is less than 0.01, the maximum number of training epochs is set to 300, and the early stopping threshold is 20 epochs.
[0112] Figure 4This paper details the collaborative training process of Physical Information Neural Networks (PINNs) in traffic flow prediction. Starting with road network discretization and physical model initialization, the process involves data acquisition and preprocessing, PINN construction, and a two-stage collaborative optimization phase. In the first stage, the physical model parameters are fixed, and the Adam optimizer is used to update the network weights to minimize the weighted loss function. In the second stage, the neural network parameters are fixed, and the physical parameters are adjusted using the L-BFGS optimizer to minimize the physical residual loss. These two stages alternate until the loss converges. Subsequently, the system enters a closed-loop control and feedback phase, outputting prediction results and generating control strategies. Real-time monitoring and control are implemented. If the deviation exceeds 15%, incremental learning is initiated; otherwise, prediction and feedback continue, and model parameters are fine-tuned to ensure prediction accuracy and physical consistency. Ultimately, this achieves accurate prediction and effective management of traffic conditions in complex urban road networks.
[0113] Step 5: Closed-loop control strategy generation and execution. A multi-objective optimization modeling method is adopted, using signal period (discrete values of 40 / 60 / 80 / 100 / 120 seconds), tidal lane sign (0 / 1), and speed limit gear (40 / 60 / 80 km / h) as decision variables. The objective function is constructed to minimize the comprehensive control cost function.
[0114] min(5·∑T delay +3·maxQ queue +1·|Δν limit |);
[0115] Simultaneously, constraints are applied to ensure that the density prediction value does not exceed 0.9ρ_jam and the phase difference error is ≤5 seconds. The real-time control interface includes a dual-mode execution mechanism. In normal mode, control instructions are sent to the infrastructure every 5 minutes via V2I communication. In emergency mode, when the grid density exceeds the threshold (>126veh / km) for 3 consecutive minutes, a second-level response instruction is immediately triggered (forced ramp closure and downstream speed limit reduction by 40%). The system integrates an online self-learning mechanism. By monitoring the difference between the actual queue length and the predicted value in real time (an update is triggered when the deviation is >15%), an incremental learning strategy is adopted to freeze the GRU layer parameters and fine-tune the CNN convolution kernel based on the latest 30 minutes of data (learning rate 10^-5) until the loss function converges to below the threshold of 0.005, thereby achieving dynamic optimization of the control model.
[0116] Example 2: This example proposes an electronic system, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the steps of the method described in this invention.
[0117] Example 3: This example proposes a computer-readable storage medium storing computer instructions, which are used to cause the computer to perform the steps of the method described in this invention.
[0118] It should be noted that the processing flows of Embodiments 2 and 3 correspond to the specific steps of the method provided in the embodiments of the present invention, and have the corresponding functional modules and beneficial effects of the method. Technical details not described in detail in this embodiment can be found in the method provided in the embodiments of the present invention.
[0119] The program code used to implement the methods of this application may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0120] In the context of this application, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0121] The above embodiments are merely illustrative of the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. Any modifications made to the technical solutions based on the technical concept proposed in this invention shall fall within the scope of protection of this invention.
Claims
1. A traffic flow prediction method based on a deep neural network embedded with physical information, characterized in that, Includes the following steps: S1. Discretize and model the target road network based on the traffic flow physical model, generating dynamic grid partitioning and topological connectivity; specifically including: S101. Based on the differences in road type and number of lanes, a variable-length grid partitioning strategy is adopted to non-uniformly discretize urban expressways and ground roads. The expressway grid is set with a fixed length and the length of the ramp merging area to achieve fine modeling of traffic flow changes. The ground road grid length is dynamically adjusted according to the intersection spacing. Static parameters including the number of lanes, free flow velocity, and congestion density are defined for each grid, as well as dynamic parameters including real-time density and traffic flow. S102. Integrate signal control logic in the intersection grid, dynamically adjust the vehicle transmission rules between grids through signal phase, establish the flow transmission equation, and introduce signal control constraints into the flow transmission equation. Establish the flow transfer equation and introduce signal control constraints into it, specifically: , in Represents grid density, Represents free flow velocity. This represents the maximum traffic capacity of the road section. Representing congestion density, δ represents signal phase, and for each grid i, the density is iteratively updated according to the following formula with a time step ∆t: , in Represents the grid density at time t+1. Let i be the length of grid i. This represents the flow rate of the (i-1)th grid at time t. This represents the flux of the i-th grid at time t, and the initial density. From detector data, the equations are solved to obtain the grid-level density and flow prediction sequences for future time periods. ; S2. Real-time acquisition of traffic flow data from detectors in the road network, short-term traffic state prediction using physical evolution equations, to obtain grid density and flow rate at future times; wherein, the physical evolution equations include traffic flow conservation equations, and the upper limit of grid output flow rate is corrected by combining intersection signal timing; specifically including: 1) Calculate grid density evolution using traffic flow conservation equations: , in, Represents grid density, Let be the length of grid i, and t represent time. Inter-grid flow; 2) Based on the intersection signal timing, adjust the upper limit of the grid output flow rate, with the following constraints: , in, Indicates the free flow velocity. This represents the maximum traffic capacity of the road section. δ represents congestion density and signal phase; S3. Construct a deep neural network model, whose inputs are historical traffic flow data, traffic conditions predicted by the physical model, and road network topology features, and whose output is the traffic flow prediction results for future times. S4. During the training of the neural network model, the traffic flow conservation equation and vehicle transmission rules are used as physical constraints. The loss function is used to jointly optimize the data fitting error and the physical law residual. The model training adopts a two-stage alternating optimization strategy: In the first stage, the physical model parameters are fixed, and the Adam optimizer is used to update the neural network parameters to minimize the weighted loss function; In the second stage, the neural network parameters are fixed, and the L-BFGS optimizer is used to update the physical model parameters. The free flow velocity and congestion density are adjusted through the backpropagation of the physical residuals, and the iteration continues until the loss function converges. S5. Based on the trained model, realize the dynamic identification and prediction of traffic flow density, flow rate and congestion propagation status.
2. The method according to claim 1, characterized in that, The deep neural network model in step S3 is a Physical Information Neural Network (PINN), whose input features include: 1) Historical detector data: includes grid density, flow rate, and average velocity within a time window; 2) Physical model prediction data: including grid density and flow prediction values for future time periods; 3) Road network topology features: including adjacency matrix encoding of grid connection relationships, and additional attributes such as the number of lanes and signal phase state; At the network architecture level, the encoder employs a spatiotemporal graph convolution module, extracting temporal features through gated convolution, and aggregating spatial associations through graph convolution: ,in For temporal convolution kernels, Let be the graph convolution parameter matrix, and b be the weight coefficient used to adjust the intensity of information exchange between nodes; The physical constraint layer in the decoder output prediction value Then, the residuals of the traffic flow equations are calculated as follows: ; wherein is the density prediction value for grid i, is the flow prediction value for grid i; The loss function uses the combined optimization of the data fitting error and the physical law residuals, with the data term being the mean square error between the predicted and actual values: ; The physical terms are obtained by weighted summation of the equation residuals: ; Where α and β are empirical weighting coefficients, , This represents the deviation between the predicted results and the conservation laws of the traffic flow model. This represents the difference between the predicted results and the actual traffic flow.
3. The method of claim 1, wherein, The loss function in step S4 is defined as follows: , wherein, is the mean squared error of the predicted value and the true value, is the residual constraint of the physical evolution equation, and λ1and λ2are dynamic weights calculated by automatic differentiation to measure the degree of equation satisfaction.
4. The method of claim 3, wherein, Residual constraints of physical evolution equations include: Flow conservation equation residual: , Vehicle delivery rule residual: , where represents the grid density, t represents time, is the flow between grids, represents the free flow speed, q max is the maximum capacity of the link, represents the congestion density.
5. The method of claim 1, wherein, Step S4 involves training the physical information neural network and the dynamic parameters of the physical model through joint optimization. The specific process is as follows: First, the detector's historical data Compared with physical model prediction data Perform standardization processing and calculate standardization parameters. and Generate normalized input ; Subsequently, a spatiotemporal graph convolutional encoder is constructed, which extracts temporal features using gated temporal convolutional kernels and aggregates the spatial correlations of adjacent grids through graph convolutional layers to output the hidden state. The decoder concatenates the hidden state with the physical model predictions and maps them to the density and flow predictions for future time steps through a fully connected layer. And calculate the physical constraint residuals: , in, q represents the free-flow velocity. max This represents the maximum traffic capacity of the road section. δ represents congestion density, and δ represents signal phase.
6. The method of claim 1, wherein, The traffic flow prediction results in step S5 include: 1) Grid-level density and flow heatmaps for future moments; 2) The spatiotemporal evolution trends of congestion propagation paths and bottleneck areas; Among them, grids whose density growth rate exceeds the threshold are identified as potential congestion sources. The density evolution of their upstream and downstream grids is tracked through a spatiotemporal propagation analysis algorithm to generate a diffusion heatmap.
7. A computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-6.
8. An electronic system comprising a memory, a processor and a computer program stored on the memory and loadable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Traffic jam prediction method and device
CN118486161A