A road traffic management method and system based on digital twin
Through digital twin -based road traffic management methods, the car flow and maintenance rate data are used for feature extraction and reasoning network prediction, which solves the accuracy and real -time problems of traffic status monitoring and prediction in existing technologies, and realizes high -precision transportation. Status prediction and management support.
Patent Information
- Application Number
- CN202411526453.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-10-30
AI Technical Summary
The existing road traffic management methods are difficult to achieve real-time and accurate traffic status monitoring and future traffic flow forecasting, especially under road conditions with complex traffic changes.
The road traffic management method based on digital twins is adopted, and the average values and maintenance rate data of the traffic section and the control road section are used to combine and perform feature extraction, loaded to the reasoning network for prediction to determine the traffic status of the target road section.
The average vehicle flow of the target road section and the accurate prediction of the maintenance time, improved the reasoning accuracy of the traffic status, and supported real -time traffic data visualization and management decision -making.
Smart Images

Figure CN119049291B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and specifically, to a road traffic management method and system based on digital twins. Background Art
[0002] With the acceleration of urbanization and the continuous increase in the number of motor vehicles, urban traffic congestion is becoming increasingly serious, which puts higher demands on traffic management. Traditional traffic management methods often rely on manual experience and on-site surveys, which are difficult to reflect road traffic conditions in real time and accurately, and even more difficult to predict future traffic flow trends, thus limiting traffic management efficiency and the scientific nature of decision-making.
[0003] In order to meet this challenge, the development of intelligent transportation systems (ITS) and digital twin technology in recent years has provided new ideas and solutions for traffic management. By integrating a variety of sensors, communication technologies and information processing technologies, intelligent transportation systems can realize real-time monitoring and data analysis of traffic flow, providing rich data support for traffic managers. Digital twin technology, by building a virtual image of the physical world, can accurately simulate and predict the real traffic system, providing a powerful tool for traffic planning and optimization. However, although intelligent transportation systems and digital twin technology have shown great potential in the field of traffic management, they still face many challenges in practical applications. Especially in terms of traffic flow prediction, existing prediction methods are often based on a single data source and simple statistical models, which makes it difficult to fully capture the complex changes and dynamic characteristics of road traffic flow, resulting in limited prediction accuracy and unable to meet the needs of traffic management for high-precision and real-time prediction. Summary of the invention
[0004] The purpose of the present invention is to provide a road traffic management method and system based on digital twins.
[0005] This application is implemented as follows:
[0006] In the first aspect, an embodiment of the present application provides a road traffic management method based on digital twins, including: obtaining a first vehicle flow mean statistical sequence and a first maintenance rate statistical sequence of a target section in a first monitoring period, and obtaining a second vehicle flow mean statistical sequence and a second maintenance rate statistical sequence of a control section in a second monitoring period, wherein the control section and the target section are sections of the same road, and the first monitoring period is different from the second monitoring period; merging the first vehicle flow mean statistical sequence and the second vehicle flow mean statistical sequence to extract representation information to obtain a first representation vector, and merging the first maintenance rate statistical sequence and the second maintenance rate statistical sequence to extract representation information to obtain a second characterization vector; combining the first characterization vector and the first maintenance rate statistical sequence and loading them into the first inference network for inference to obtain the target traffic flow mean of the target section at the target monitoring time; combining the second characterization vector and the first traffic flow mean statistical sequence and loading them into the second inference network for inference to determine the traffic flow maintenance time of the target section at the target monitoring time according to the inference result of the second inference network; determining the target traffic state of the target section at the target monitoring time according to the target traffic flow mean and the traffic flow maintenance time; based on the target traffic state at the target monitoring time, updating the display information of the target section in the preset digital twin model.
[0007] In a second aspect, the present application provides a computer system comprising: one or more processors; a memory; one or more computer programs; wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, and when the one or more computer programs are executed by the processors, the method as described above is implemented.
[0008] The beneficial effects of the present application include at least: the present application is based on extracting characterization information after merging the first traffic flow mean statistical sequence of the target section in the first monitoring period and the second traffic flow mean statistical sequence of the control section in the second monitoring period, so as to obtain a first characterization vector of the traffic flow evolution characteristics of the same road where the target section and the control section are located, and then the first characterization vector and the first maintenance rate statistical sequence are combined and loaded into the first inference network, and the first inference network can obtain an accurate target traffic flow mean by combining the traffic flow evolution characteristics of the road and the actual maintenance time of the first maintenance rate statistical sequence, and in addition, the first maintenance rate statistical sequence of the target section in the first monitoring period and the second maintenance rate statistical sequence of the control section in the second monitoring period are merged to extract characterization information By taking, a second characterization vector of the evolution characteristics of the maintenance time of the same road where the target section and the control section are located can be obtained, and then the second characterization vector and the first traffic flow mean statistical sequence are combined and loaded into the second reasoning network. The second reasoning network can combine the maintenance time variation characteristics of the road and the actual traffic flow mean of the first traffic flow mean statistical sequence to obtain an accurate traffic flow maintenance time based on the reasoning result, and determine the target traffic state of the target section at the target monitoring time based on the target traffic flow mean and the traffic flow maintenance time. Because the target traffic state is divided into the target traffic flow mean and the traffic flow maintenance time for separate reasoning, and the reasoning accuracy of the target traffic flow mean and the traffic flow maintenance time is high, the reasoning accuracy of the target traffic state can be increased, which helps to achieve accurate data visualization.
[0009] Other features will be described in part in the following description. Those skilled in the art will discover these features in part upon inspection of the following content and drawings, or may learn these features through production or use. The features of the present application may be implemented and obtained by practicing or using various aspects of the methods, tools, and combinations listed in the detailed examples described below. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.
[0011] Figure 1 This is a flow chart of a road traffic management method based on digital twins provided in an embodiment of the present application.
[0012] Figure 2 It is a schematic diagram of the composition of a computer system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0013] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the embodiments of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application. The execution subject of the road traffic management method based on digital twins in the embodiments of the present application is a computer system, including but not limited to servers, personal computers, laptops, tablet computers, smart phones, etc. Figure 1 As shown, the method includes:
[0014] Step S100: Obtain a first traffic flow mean statistical sequence and a first maintenance rate statistical sequence of the target section in the first monitoring period, and obtain a second traffic flow mean statistical sequence and a second maintenance rate statistical sequence of the control section in the second monitoring period, wherein the control section and the target section are sections of the same road, and the first monitoring period is different from the second monitoring period.
[0015] In step S100, the computer system collects the mean and maintenance rate data of the traffic flow of a specific road section (the target road section and its control road section) in different time periods. It can integrate a series of data processing and storage functions, and can automatically capture and analyze traffic flow data from multiple data sources. These data sources may include but are not limited to videos or images taken by traffic monitoring cameras, and real-time statistics of traffic flow are calculated through video analysis technology; electromagnetic induction devices laid under the road surface can detect the number and speed of passing vehicles. Vehicle location and movement trajectory information is provided from vehicles equipped with GPS devices. Or multiple data sources integrated by third-party traffic data providers provide processed traffic flow statistics.
[0016] In step S100, the target road section is a road section that the traffic management department pays special attention to or predicts to have a high demand. Then, other road sections on the same road as the target road section are selected as control road sections. The control road section is close to the target road section in geographical location so that the trend of traffic flow changes is similar. In addition, the control road section has similar lane numbers, road types (such as main roads, secondary roads) and traffic flow characteristics as the target road section. For example, if the target road section is a busy main road in the city center, the control road section can be selected from another main road on the same road, adjacent in geographical location and with similar traffic conditions.
[0017] The monitoring period refers to the time range for collecting traffic flow data. In step S100, two different monitoring periods need to be set: the first monitoring period is for the target road section, and the second monitoring period is for the control road section. The two periods do not overlap, but can be flexibly adjusted according to actual needs.
[0018] The first monitoring cycle is set to the past week (Monday to Sunday), covering both weekdays and weekends, to fully reflect the daily traffic flow changes on the target road section.
[0019] The second monitoring period may be another period of time that is different from the monitoring period of the target road section but has a similar time span, such as the same period of the past two weeks, to capture the traffic flow characteristics of the control road section at different time points.
[0020] The traffic flow mean statistical series refers to the series of average traffic flow values counted at certain time intervals (such as every hour or every half hour) during the monitoring period. By integrating data from various data sources and calculating the average traffic flow value in each time interval, the traffic flow mean statistical series is formed.
[0021] For example, for the first monitoring period (the past week) of the target road section, the computer system counts the traffic flow once every hour, and obtains 7 days × 24 hours = 168 traffic flow data points, which constitute the first traffic flow mean statistical sequence. Each element in the sequence represents the average number of vehicles passing through the target road section within that hour. The maintenance rate refers to the proportion of traffic flow that remains relatively stable (i.e., fluctuates within a certain range) within a certain period of time. In step S100, the computer system calculates the maintenance rate statistical sequence. This can, for example, set a threshold value to determine whether the traffic flow is stable. The calculation method of the maintenance rate may vary depending on the actual application, but a basic calculation method can be: for each time interval, calculate the difference between the actual traffic flow and the traffic flow of the previous time interval. If the difference is within the preset threshold range, it is considered that the traffic flow remains stable within the time interval, and the maintenance rate is increased by 1; finally, the total number of maintenance times is divided by the total number of time intervals to obtain the maintenance rate of the time interval.
[0022] For example, the traffic flow change threshold is set to ±10%. If the traffic flow change does not exceed the threshold within a certain hour, the maintenance rate for that hour is recorded as valid. The computer system traverses the entire monitoring cycle and obtains a maintenance rate sequence, in which each element represents the maintenance rate of the corresponding time interval.
[0023] After collecting the first traffic flow mean statistical sequence and the first maintenance rate statistical sequence of the target road section, and the second traffic flow mean statistical sequence and the second maintenance rate statistical sequence of the control road section, the computer system integrates these data into a unified database. The database design should take into account the structured storage, efficient retrieval and security requirements of the data. In addition, for the convenience of subsequent analysis, the computer system may also pre-process the data, such as outlier processing and data smoothing, to ensure the quality of the data input into the inference model.
[0024] Step S200: After merging the first vehicle flow mean statistical sequence and the second vehicle flow mean statistical sequence, characterization information is extracted to obtain a first characterization vector; after merging the first maintenance rate statistical sequence and the second maintenance rate statistical sequence, characterization information is extracted to obtain a second characterization vector.
[0025] In step S200, the computer system first receives the first vehicle flow mean statistical sequence, the second vehicle flow mean statistical sequence, the first maintenance rate statistical sequence, and the second maintenance rate statistical sequence from step S100. Subsequently, the system performs data processing and feature extraction according to the following process: the computer system merges the first vehicle flow mean statistical sequence and the second vehicle flow mean statistical sequence to form a new sequence containing the vehicle flow mean data in different monitoring periods of the two road sections. Similarly, the first maintenance rate statistical sequence and the second maintenance rate statistical sequence are also merged into a new maintenance rate statistical sequence.
[0026] For example, suppose the first traffic flow mean statistical sequence is T1={t 11 ,t 12 ,...,t 1n}, which represents the hourly traffic flow mean of the target road section in the first monitoring period; the second traffic flow mean statistical sequence is T2={t 21 ,t 22 ,...,t 2m}, represents the hourly traffic flow mean of the control section in the second monitoring period. The combined traffic flow mean statistical sequence is T merged ={t 11 ,t 12 ,...,t 1n ,t 21 ,t 22 ,...,t 2m For the maintenance rate statistical sequence, the merging process is similar, and the merged maintenance rate statistical sequence R is obtained merged .
[0027] The merged data can be preprocessed, such as data cleaning (removing outliers, filling missing values), normalization (scaling the data to the same scale), etc., to ensure the effectiveness of the subsequent feature extraction process.
[0028] For the combined traffic flow mean statistical sequence T merged ,The computer system uses a variety of methods to extract representation information to construct a first representation vector. These methods may include time-frequency analysis, wavelet transform, convolutional neural network (CNN) automatic feature extraction, etc.
[0029] For example, first, for T merged Perform short-time Fourier transform (STFT) or wavelet transform to obtain the characteristic representation of the time series in the frequency domain. These characteristics can reveal the periodic changes and trend components of traffic flow. mergedReshape into a two-dimensional array suitable for CNN input (for example, convert the one-dimensional time series into a matrix through a sliding window), and then input it into the pre-trained CNN model. The CNN model automatically learns and extracts high-level features of the time series through structures such as convolutional layers and pooling layers. Assuming that the output layer of the CNN model contains 128 neurons, the output of each neuron can be regarded as a feature value. These feature values are combined to form the first representation vector V1={v 11 ,v 12 ,...,v 1128}.
[0030] For the combined maintenance rate statistical sequence R merged ,The feature extraction process may be relatively simple because the maintenance rate data for example focuses more on statistical characteristics rather than complex time series patterns. However, in order to maintain consistency with the feature vector of the traffic flow data, the system can still adopt a similar method for processing.
[0031] For example, first calculate R merged The basic statistics of the maintenance rate data, such as mean, variance, skewness, kurtosis, etc., can reflect the overall distribution characteristics of the maintenance rate data. In order to further capture the nonlinear relationship of the maintenance rate data, the statistical features can be used as input and processed by a simple fully connected neural network (MLP). The output layer of the MLP also contains a certain number of neurons, and the output of each neuron constitutes part of the second representation vector. Assume that after statistical feature extraction and (optional) MLP processing, the second representation vector V2={v 21 ,v 22 ,...,v 264} (Note that the dimensions here are exemplary and the actual dimensions may be determined based on specific applications and requirements).
[0032] Finally, the computer system obtains two characterization vectors: the first characterization vector V1 and the second characterization vector V2. These two vectors capture the key features of the mean and maintenance rates of traffic flow in different sections and different monitoring periods. In subsequent steps, these feature vectors will be used as inputs to the inference model to predict the future mean and maintenance time of traffic flow on the target section.
[0033] Step S200 converts the original time series data into feature vectors with rich information by combining the traffic flow mean statistical series and maintenance rate statistical series of different road sections and different monitoring periods, and extracting the representation information using a variety of methods. This process not only provides high-quality input data for the subsequent reasoning model, but also significantly improves the model's ability to capture dynamic changes in traffic flow.
[0034] Step S300: The first characterization vector and the first maintenance rate statistical sequence are combined and loaded into the first inference network for inference to obtain the target traffic flow mean value of the target road section at the target monitoring time.
[0035] In step S300, the computer system combines the first characterization vector extracted in the previous step with the first maintenance rate statistical sequence, and loads them as input data into a specially designed first inference network for inference analysis to predict the mean traffic flow of the target road section at a specific time in the future (target monitoring time).
[0036] In order to construct the input of the inference network, the computer system first combines the first representation vector V1 and the first maintenance rate statistical sequence R1. Since the dimensions and data types of the two may be different, the system can perform some preprocessing steps, such as data normalization and dimension matching, to ensure the consistency and validity of the input data. For example, suppose the first representation vector V1 is a vector containing 128 elements, that is, V1=[v 11 ,v 12 ,…,v 1128 ], each element represents a feature extracted from the traffic flow mean statistical sequence by a certain feature extraction method (such as convolutional neural network). The first maintenance rate statistical sequence R1 is a time series, which contains the maintenance rate data of the target road section in the recent period of time, for example, R1=[r 11 ,r 12 ,…,r 1t ], where t is the length of the time series.
[0037] To combine the two data sets, the computer system can choose to convert the maintenance rate statistics sequence R1 into a fixed-length feature vector (if its length is variable), or input it into the inference network as a separate input channel in parallel with the first representation vector V1. To simplify the explanation, it is assumed that R1 has been converted into a vector V with the same dimension as V1 by some means (such as taking the average, maximum value, or using a recurrent neural network processing). R1 =[v r1 ,v r2 ,…,v r128 ].
[0038] Then, the system converts V1 and V R1 Splice to form a new combined vector V c =[V1,V R1 ]=[v 11 ,v 12 ,…,v 1128 ,v r1 ,v r2 ,…,v r128] as the input to the first inference network. The first inference network is a machine learning model that is specially trained to learn from the input data and predict the future mean traffic volume of the target road segment. This model can be any neural network architecture suitable for processing regression problems, such as multi-layer perceptron (MLP), convolutional neural network (CNN), long short-term memory network (LSTM) or their variants.
[0039] Considering the time series characteristics of traffic flow data, the LSTM network is selected as the core component of the first inference network. The LSTM network architecture may contain multiple LSTM layers, each followed by a fully connected layer (Dense layer) for feature transformation and output prediction. To prevent overfitting, the network may also contain a Dropout layer to randomly discard the output of some neurons.
[0040] During the training phase, the LSTM network receives a large amount of labeled historical traffic flow average and maintenance rate data as input, and adjusts the network parameters through the back propagation algorithm to minimize the error between the predicted value and the true value (such as the mean square error MSE). After the training is completed, the network learns to extract useful features from the input data and predict the future traffic flow average.
[0041] In the inference phase (i.e., step S300), the computer system combines the vector V c Input into the trained LSTM network. The network processes the input data through its internal neurons and connection weights, and finally outputs a predicted value, which is the target traffic flow mean of the target road section at the target monitoring time.
[0042] Assume that the output layer of the LSTM network is a Dense layer containing a single neuron to which a linear activation function is applied (since this is a regression problem, no nonlinear activation is required). The output of the network y pred It can be directly interpreted as the predicted mean traffic volume.
[0043] For example, the calculation formula is: pred =f(W·V c + b);
[0044] Where f is the linear activation function, W is the weight matrix of the last layer of the network, b is the bias term, and Vc is the combined vector of the input.
[0045] Step S300 predicts the mean traffic volume of the target road section at a certain moment in the future by combining the first characterization vector and the first maintenance rate statistical sequence and inputting them into the first inference network for inference analysis. This process makes full use of the evolution characteristics of the historical traffic volume mean data and the current maintenance rate status information, and achieves high-precision prediction through the trained LSTM network.
[0046] Step S400: The second characterization vector and the first traffic flow mean statistical sequence are combined and loaded into the second inference network for inference, and the traffic flow maintenance time of the target road section at the target monitoring time is determined according to the inference result of the second inference network.
[0047] In step S400, the computer system combines the second characterization vector extracted in the previous step with the first traffic flow mean statistical sequence, and loads it into the second inference network as input data. Through the inference analysis of the network, the predicted value of the traffic flow maintenance time of the target section at the target monitoring time is finally obtained. Before step S400, the system has completed the extraction of the second characterization vector V2 and the sorting of the first traffic flow mean statistical sequence T1. The second characterization vector V2 captures the historical evolution characteristics of the traffic flow maintenance time of the target section and its control section, while the first traffic flow mean statistical sequence T1 reflects the actual traffic flow situation of the target section within a certain monitoring period.
[0048] In order to construct the input of the second inference network, the computer system first needs to appropriately combine the second representation vector V2 and the first traffic flow mean statistical sequence T1. Since the data types and dimensions of the two may be different, the system needs to perform a series of preprocessing steps, such as data normalization, feature selection or conversion, sequence truncation or padding, etc., to ensure the consistency and validity of the input data.
[0049] For example, suppose the second representation vector V2 is a vector containing 64 elements, that is, V2=[v 21 ,v 22 ,…,v 264 ], each element represents a feature extracted from the traffic flow maintenance rate statistical sequence by a certain feature extraction method (such as time series analysis combined with machine learning algorithm). The first traffic flow mean statistical sequence T1 is a time series that records the hourly traffic flow mean of the target road section in the first monitoring period, for example, T1=[t 11 ,t 12 ,…,t 1n ], where n is the length of the time series.
[0050] In order to combine the two data sets, the computer system can choose to convert T1 into a feature representation compatible with the dimension of V2. However, since T1 is time series data, direct conversion to a fixed-length vector can lose important timing information. Therefore, a more reasonable approach is to use T1 as a separate input channel and input it into the second inference network in parallel with V2, or use a network structure that can process variable-length sequences (such as recurrent neural networks RNN, long short-term memory networks LSTM, etc.).
[0051] But to simplify the explanation, assume that T1 has been converted into a fixed-length vector representation V by some means (such as encoding it using a recurrent neural network) T1 =[v t1 ,v t2 ,…,v t64 ] so that its dimensions match those of V2.
[0052] Then, the system converts V2 and V T1 Splice to form a new combined vector V c2 =[V2,V T1 ]=[v 21 ,v 22 ,…,v 264 ,v t1 ,v t2 ,…,v t64 ], as the input of the second inference network.
[0053] The second inference network is a machine learning model that is specially trained to learn from input data and predict the duration of traffic flow on the target road segment. Similar to the first inference network, this model can be any neural network architecture that is suitable for processing regression problems and can capture sequence data, such as recurrent neural networks (RNNs), long short-term memory networks (LSTMs), gated recurrent units (GRUs) or their variants.
[0054] Considering that the prediction of traffic flow maintenance time also depends on the characteristics of time series data, the LSTM network is selected as the core of the second reasoning network. The LSTM network effectively solves the gradient vanishing or gradient exploding problems that are prone to occur in traditional RNN networks when training long sequences through its internal "gate" mechanism (forget gate, input gate, output gate).
[0055] The LSTM network architecture may contain one or more LSTM layers, each followed by one or more fully connected layers (Dense layers) to output predicted values. In order to further improve the generalization ability of the model and avoid overfitting, the network can also include a Dropout layer to randomly discard the output of some neurons. During the training phase, the LSTM network receives a large amount of labeled historical traffic flow maintenance time and related feature data as input, and optimizes the network parameters through the back propagation algorithm to minimize the error between the predicted maintenance time and the actual maintenance time (such as the mean square error MSE). After the training is completed, the network has learned the ability to predict the future traffic flow maintenance time from the input data.
[0056] In the inference phase (i.e., step S400), the computer system combines the vector V c2Input into the trained LSTM network. The network processes and analyzes the input data through its internal LSTM units and fully connected layers, and finally outputs a predicted value, that is, the traffic flow maintenance time of the target road section at the target monitoring time.
[0057] Assume that the output layer of the LSTM network is a Dense layer containing a single neuron to which a linear activation function is applied (since this is a regression problem). The output y pd Directly interpreted as the predicted traffic flow maintenance time (unit can be hours, minutes, etc.). For example, the calculation formula is: pd =f(W out ·h t +b out );
[0058] Where f is the linear activation function (here is the identity function), W out is the weight matrix of the output layer, b out is the bias term, and h t is the output state of the last time step of the LSTM network (or a summary representation that aggregates information from all time steps in some way).
[0059] Step S400 predicts the traffic flow maintenance time of the target road section at the target monitoring time by combining the second characterization vector and the first traffic flow mean statistical sequence (or its coded representation) and inputting them into the second inference network for inference analysis. This process makes full use of the evolution characteristics of the historical traffic flow maintenance time data and the current traffic flow mean state information, and achieves high-precision prediction through the trained LSTM network.
[0060] Step S500: Determine the target traffic state of the target road section at the target monitoring time according to the target traffic flow mean and the traffic flow maintenance time.
[0061] In step S500, the computer system comprehensively determines the traffic status of the target road section at the target monitoring time according to the target traffic flow mean value and traffic flow maintenance time predicted in steps S300 and S400 respectively.
[0062] In order to accurately evaluate the traffic status of the target road section, a traffic status assessment model needs to be integrated into the computer system. This model can be rule-based or a hybrid model that combines machine learning and expert knowledge. In the rule-based model, the system compares the predicted mean traffic flow and maintenance time with these thresholds based on preset thresholds and conditions to determine the traffic status level. In the hybrid model, the system can use machine learning algorithms to learn the relationship between traffic status and characteristics such as traffic flow and maintenance time from historical data, and perform real-time assessment based on this. Regardless of which model is used, the core of the evaluation process is to compare the predicted mean traffic flow and maintenance time with the preset traffic status standards. These standards are, for example, based on the principles and practical experience of traffic engineering, and are intended to reflect the impact of different traffic flows and durations on road capacity, safety, and comfort. For example, assume that a simplified rule-based traffic status assessment model is adopted, which defines the following traffic status levels and their corresponding evaluation criteria:
[0063] Smooth state: The traffic volume is low and maintained for a stable period of time, indicating that the road is smooth and there is no congestion. The specific standard can be set as the average traffic volume is lower than a certain threshold (such as the traffic volume per hour is less than or equal to 3,000 vehicles) and maintained for a long time (such as more than 80% of the monitoring period).
[0064] Mild congestion: Traffic volume begins to increase, but has not yet formed severe congestion, and the duration may fluctuate. The standard can be set as the average traffic volume within a medium range (such as 3,001 to 5,000 vehicles per hour) and the duration is relatively stable (such as 60% to 80% of the monitoring period).
[0065] Moderate congestion: the traffic volume increases significantly, the road capacity is greatly affected, and the congestion phenomenon is more obvious. The standard can be set as a high average traffic volume (such as 5001 to 7000 vehicles per hour), and a short but continuous duration (such as 40% to 60% of the monitoring period).
[0066] Severe congestion: The traffic volume is extremely high, the road is almost paralyzed, and the congestion is extremely serious. The standard can be set as an extremely high average traffic volume (such as more than 7,000 vehicles per hour) and a long duration (such as more than 40% of the monitoring period).
[0067] After the evaluation is completed, the computer system will output the evaluation results to the digital twin model and update the traffic status display information of the target road section. In this way, the traffic management department and the public can understand the traffic conditions of the target road section in real time and make corresponding decisions and actions. For example, the traffic management department can adjust the timing of traffic lights, increase police force to divert traffic, or issue traffic warning information based on the traffic status evaluation results to alleviate traffic congestion and improve road traffic efficiency.
[0068] Step S500 accurately determines the traffic status of the target road section at the target monitoring time by comprehensively analyzing the predicted target traffic flow mean and traffic flow maintenance time, combined with the preset traffic status evaluation standard or model. This process not only relies on accurate prediction data, but also requires scientific and reasonable evaluation models and rich traffic management knowledge support.
[0069] Step S600: Based on the target traffic status at the target monitoring time, update the display information of the target road section in the preset digital twin model.
[0070] In step S600, the computer system dynamically updates the target road section display information in the preset digital twin model according to the target traffic state at the target monitoring time determined in step S500, so that traffic managers and the public can understand the actual situation of road traffic in real time and make corresponding decisions and actions. This process can refer to the existing technology. As an example, the operation process of step S600 can be roughly divided into the following steps:
[0071] Receiving target traffic status information: The computer system first receives the target traffic status information from step S500, including the target monitoring time, the target road section identifier, and the corresponding traffic status level (such as unblocked, light congestion, moderate congestion, severe congestion, etc.).
[0072] Locate the target road section in the digital twin model: The computer system finds the corresponding virtual image of the target road section in the digital twin model based on the target road section identifier. This involves, for example, traversing and matching the road network in the digital twin model to determine the specific location and range of the target road section.
[0073] Update display information: Once the target road section is located, the computer system will update the display information of the road section in the digital twin model based on the received target traffic status information. This includes but is not limited to changing the color, brightness, icon or label of the road section to intuitively reflect the current traffic status.
[0074] To explain the implementation of step S600 in more detail, an example may be given:
[0075] Assume that the digital twin model uses a color coding method to represent different traffic conditions. Among them, green represents a smooth state, yellow represents a lightly congested state, orange represents a moderately congested state, and red represents a severely congested state. In step S500, the computer system has determined that the traffic state of the target road section at the target monitoring time is moderately congested.
[0076] Color coding mapping: First, the computer system maintains a mapping table between color coding and traffic status, for example: green: unobstructed; yellow: light congestion; orange: moderate congestion; red: severe congestion.
[0077] After receiving the traffic status information of moderate congestion, the computer system looks up the mapping table and finds the corresponding color code as orange. Then, it traverses the road network in the digital twin model, locates the target road section, and changes its color to orange. After the update is completed, the graphical interface of the digital twin model will immediately reflect the change. Traffic managers and the public can quickly understand the real-time traffic status of the target road section by observing the color change of the road section on the interface.
[0078] The application of digital twin models in road traffic management is not limited to the update of display information. It can also be integrated with other systems (such as traffic signal control systems, emergency response systems, etc.) to achieve more intelligent traffic management. For example: when the digital twin model detects severe congestion on a certain road section, it can automatically trigger the adjustment strategy of the traffic signal control system and optimize the timing scheme of the traffic lights to alleviate congestion. At the same time, the digital twin model can also be integrated with the emergency response system. When a traffic accident or other emergency is detected, the relevant departments are immediately notified and the emergency plan is initiated. In addition, the digital twin model can also provide strong support for traffic planning and design. By simulating different traffic flows, road layouts, and traffic management strategies, traffic planners can conduct multiple experiments and optimizations in a virtual environment to find the best solution.
[0079] Step S600 achieves intuitive display and timely feedback of traffic status by updating the target road section display information in the digital twin model in real time. This step not only improves the efficiency and accuracy of traffic management, but also provides the public with more convenient and reliable traffic information services.
[0080] As an implementation manner, step S200, merging the first vehicle flow mean statistical sequence and the second vehicle flow mean statistical sequence to extract representation information to obtain a first representation vector, may specifically include:
[0081] Step S210: merging the first vehicle flow mean statistical sequence and the second vehicle flow mean statistical sequence to obtain a first vehicle flow information array;
[0082] Step S220: filtering the first vehicle flow information array using different filter matrices to obtain a plurality of first filter arrays with the same number of channels;
[0083] Step S230: respectively combining the array units of the same sequence in each first filter array to obtain a plurality of first sequence arrays, and extracting characterization information from the plurality of first sequence arrays to obtain a first characterization vector.
[0084] In step S210, the primary task of the computer system is to merge the traffic flow mean statistical sequences from different monitoring periods and sections into a unified data structure for subsequent processing. Specifically, the system needs to read the first traffic flow mean statistical sequence (recorded as T1) and the second traffic flow mean statistical sequence (recorded as T2) collected in step S100, and then merge them into a two-dimensional array, that is, the first traffic flow information array in matrix form. For example, assuming that the first traffic flow mean statistical sequence T1 is the traffic flow mean recorded every hour in the first monitoring period (such as within a week) of the target section, it can be expressed as: ; where t 1i represents the mean traffic volume in the i-th hour of the first monitoring period, and n is the total number of hours in the first monitoring period (e.g., 168 hours, corresponding to one week).
[0085] Similarly, the second traffic flow mean statistical sequence T2 is the traffic flow mean recorded every hour in the second monitoring period (such as another time period) of the reference road section, which can be expressed as: ; Wherein, t2j represents the mean traffic flow in the jth hour of the second monitoring period, and m is the total number of hours in the second monitoring period, which may be different from n.
[0086] When merging the two sequences, if the time spans of the two monitoring cycles are not completely consistent, the computer system can align them by interpolation, truncation, or filling with zero values. To simplify the explanation, assume that the two sequences have been aligned in some way (such as selecting a time period common to the two cycles) and have the same length (i.e., m=n). The merged first vehicle flow information array can be expressed as:
[0087] ;
[0088] This is a 2×n matrix, where the rows represent different road sections (target sections and control sections) and the columns represent the average traffic flow in the corresponding time period.
[0089] After merging the traffic flow mean statistical sequence, the next step is to filter (i.e., convolution) the two-dimensional array. In step S220, the computer system uses multiple different filter matrices to perform filtering operations on the first traffic flow information array to obtain multiple first filter arrays with the same number of channels. Since the first traffic flow information array is two-dimensional, and the filter matrix is designed to be one-dimensional (for one-dimensional signal filtering) or two-dimensional (for two-dimensional image filtering), in practical applications, it is necessary to convert the two-dimensional array into a one-dimensional vector (flattened by column priority or row priority) before performing filtering operations, or design a special two-dimensional filter matrix to directly process the two-dimensional array. However, to simplify the explanation, it is assumed here that the filtering operation can be directly applied to the two-dimensional array, and two one-dimensional filter arrays are obtained as outputs respectively.
[0090] In step S230, the computer system combines the array elements of the same sequence in each first filter array to form multiple first sequential arrays. These sequential arrays contain information from different filter channels and reflect multiple aspects of vehicle flow data. Next, the system extracts representation information from these sequential arrays to obtain a first representation vector that integrates all useful information.
[0091] For example, suppose there are two filter arrays: low-pass filter array f low =[f low,1 ,f low,2 ,…,f low,n ] and high-pass filter array f high =[f high,1 ,f high,2 ,…,f high,n ]. The two arrays have the same length (both n), and each element corresponds to a time point in the original traffic flow information array.
[0092] When combining these two filter arrays, you can simply place them side by side to form a new two-dimensional array (or view them as two parallel vectors), but in fact, in this step, you are more concerned about how to integrate this information into a representation vector. Therefore, it is more common to concatenate these two vectors directly:
[0093] Combination vector = [f low ,f high ]=[f low,1 ,…,f low,n ,f high,1 ,…,f high,n ];
[0094] In practical applications, more complex feature fusion methods such as weighted summation, principal component analysis (PCA), autoencoders, etc. can be used to further process the combined vector to obtain a more representative first representation vector. To simplify the explanation, a simple weighted fusion method can be assumed. Assuming the weight of the low-pass filter vector is α and the weight of the high-pass filter vector is 1−α (where 0≤α≤1), the first representation vector can be calculated as:
[0095] First characterization vector = α·f low +(1−α)·f high ;
[0096] In practical applications, the selection of weights may be based on the training results of the machine learning model, or optimized through methods such as cross-validation.
[0097] In addition, more advanced feature extraction methods may include using deep learning models (such as convolutional neural networks (CNN), recurrent neural networks (RNN) or their variants (LSTM / GRU)) to automatically learn and extract representation vectors. These models are able to learn complex feature representations from raw data without the need to manually design feature extractors or filters.
[0098] For example, the first vehicle flow information array (or its converted one-dimensional form) can be used as input to a pre-trained CNN model. The CNN model automatically learns and extracts features useful for the prediction task through a combination of convolutional layers, pooling layers, and fully connected layers, and finally outputs a fixed-length representation vector as the first representation vector. This method can capture the spatial and temporal dependencies in the data and is particularly effective for processing time series data.
[0099] In summary, step S200 converts the original traffic flow data into a representation vector that integrates a variety of useful information by combining the three sub-steps of traffic flow mean statistical sequence, filtering operation and characterization information extraction. This representation vector will be used as the input of the subsequent reasoning network to predict the traffic status of the target road section.
[0100] As an implementation manner, step S230, extracting representation information from a plurality of first sequential arrays to obtain a first representation vector, may include:
[0101] Step S231: loading a plurality of first sequence arrays one by one into a first time series analysis network for linear transformation, and obtaining first intermediate representation arrays corresponding to each first sequence array;
[0102] Step S232: weighting each first intermediate representation array to obtain a focusing coefficient corresponding to each first intermediate representation array, and fusing each first intermediate representation array according to the focusing coefficient to obtain a first representation vector.
[0103] In step S230, the computer system performs complex feature extraction and fusion processing on multiple first sequential arrays to generate a first characterization vector that can fully reflect the characteristics of the vehicle flow data.
[0104] In step S231, the computer system inputs the multiple first order arrays (each array corresponds to the output of a filter channel) obtained in step S220 into the first time series analysis network (TSAN, Time Series Analysis Network) one by one. TSAN is a neural network specially designed for processing time series data, which can capture the long-term dependencies and dynamic change characteristics in the time series through its internal structure. Before the first order array is input into TSAN, some preprocessing operations such as standardization and normalization can be performed to ensure that the data of different channels are compared and analyzed on the same scale.
[0105] For example, suppose there are three first-order arrays, from low-pass filtering, band-pass filtering, and high-pass filtering channels, denoted by f low 、f band and f high Each array is a one-dimensional vector with a length of n, corresponding to each time point in the original traffic flow information array.
[0106] The computer system sends these three arrays to TSAN one by one. TSAN may contain multiple convolutional layers, pooling layers, and fully connected layers. Taking the convolutional layer as an example, it performs a local weighted sum operation on the input array to extract local features. Assuming the weight matrix of the first convolutional layer is W1 and the bias vector is b1, the convolution operation can be expressed as: Feature Figure 1 =σ(W1∗f+b1); where ∗ represents the convolution operation and σ is the activation function (such as ReLU). This step generates a new feature map, which is a linear transformation of the input array. Similar linear transformations and nonlinear activation operations are performed on other layers in TSAN (such as pooling layers and fully connected layers), and finally a first intermediate representation array is generated (it may still be a one-dimensional vector, but the length and meaning are different from the input array). This process is repeated for each first order array to generate the corresponding first intermediate representation array.
[0107] In step S232, after obtaining multiple first intermediate representation arrays, the computer system needs to decide how to effectively fuse them into a unified first representation vector. This step involves two key operations, for example, weight allocation and feature fusion. Weight allocation is used to determine the importance of each intermediate representation array in the final representation vector; feature fusion is to merge the weighted intermediate representation arrays into a whole.
[0108] To achieve this process, the computer system can use methods such as attention mechanism or gating mechanism to dynamically calculate the focusing coefficient (also called attention weight or gating signal). For example, suppose there are three first intermediate representation arrays, denoted as h low 、h band and h high , which are obtained by processing the first order array through TSAN.
[0109] First, the computer system uses a mechanism to calculate the focusing coefficient of each intermediate representation array. Here we take the self-attention mechanism as an example. The self-attention mechanism allows the model to refer to information at other positions in the input sequence when processing information at a certain position. But here, the process is simplified and only the static weights of each intermediate representation array are calculated. One method is to use a small neural network (such as a multi-layer perceptron MLP) to learn these weights. The input of the MLP is the intermediate representation array, and the output is a scalar value (which becomes the focusing coefficient after softmax normalization). Let the parameter of the MLP be θ, then for a certain intermediate representation array h i , its focusing coefficient α i It can be calculated as: i =softmax(MLPθ(h i )); The softmax function is used to ensure that the sum of all focusing coefficients is 1, thus forming a probability distribution.
[0110] After obtaining the focusing coefficients, the computer system applies them to the corresponding intermediate representation array and performs a weighted sum operation to generate a first representation vector: First representation vector = ∑α i ⋅h i .
[0111] This vector combines information from different filter channels, with the contribution of each channel determined by its focusing coefficient. In this way, the computer system can effectively extract and fuse the representation information of traffic flow data from multiple perspectives, providing strong support for subsequent reasoning and prediction tasks.
[0112] Step S230 generates a first characterization vector by performing time series analysis and feature fusion processing on multiple first order arrays. This process not only utilizes advanced machine learning techniques and algorithms (such as TSAN, attention mechanism, etc.), but also fully considers the interaction and weight distribution between different filter channels. The characterization vector extracted in this way can fully reflect the dynamic change characteristics and internal laws of vehicle flow data, providing a solid data foundation for subsequent traffic status prediction.
[0113] As an implementation manner, there are multiple reference sections, and the second monitoring periods corresponding to the reference sections are different. Based on this, step S210, merging the first vehicle flow mean statistical sequence and the second vehicle flow mean statistical sequence to obtain a first vehicle flow information array, may include:
[0114] Step S211: merging the second vehicle flow mean statistical sequences corresponding to each reference road section according to the time sequence of each second monitoring period to obtain an initial vehicle flow information array;
[0115] Step S212: determining the adding position of the first vehicle flow mean statistical sequence in the initial vehicle flow information array according to the time sequence of the first monitoring period and each second monitoring period;
[0116] Step S213: adding the first vehicle flow mean statistical sequence to the initial vehicle flow information array according to the adding position, to obtain the first vehicle flow information array.
[0117] In step S211, the computer system needs to process the second traffic flow mean statistical sequences of multiple control sections, each of which corresponds to a different monitoring period. Since the timing of the monitoring period may be inconsistent, it is not feasible to directly merge these sequences. Therefore, the system first needs to reorganize these sequences according to the timing of each second monitoring period to ensure that they can be aligned or approximately aligned in time for subsequent processing.
[0118] For example, suppose there are three control sections A, B, and C, which correspond to different second monitoring periods. The second monitoring period of section A is from last Monday to Sunday (denoted as T A The second monitoring period of section B is the first ten days of this month (denoted as T B ), and T A The second monitoring period of section C is a specific period of time last month (denoted as T C ), and T A and T B Are different.
[0119] The traffic flow mean statistical series in each monitoring period are arranged in chronological order, for example, T A The traffic flow mean statistical sequence is {t A1 ,t A2 ,…,t A168} (Assuming logging is done every hour, there are 168 hours in a week).
[0120] The task of the computer system is to first align these sequences in time. Since the monitoring periods are not exactly the same, alignment can be done by interpolation, truncation, or zero filling. However, to simplify the explanation, it is assumed that "soft alignment" is achieved by selecting a time period common to all monitoring periods. For example, a few consecutive days that are included in all monitoring periods are selected as the alignment basis.
[0121] After alignment, the system merges these sequences into an initial traffic flow information array. Since the monitoring cycle lengths of different road sections may be different, the merging can retain the complete time range of each sequence, or intercept a common time window. Here, assuming that a common time window is intercepted, the merged initial traffic flow information array may be as follows (with rows as road section identifiers and columns as time points):
[0122] ;
[0123] Where n is the number of time points in the common time window.
[0124] In step S212, after merging the second traffic flow mean statistical sequences of all control sections, the computer system needs to determine how to insert the first traffic flow mean statistical sequence of the target section (referred to as T1) into the initial traffic flow information array. The key to this step is to find the time correspondence between the first monitoring period and each second monitoring period, so as to place T1 in the correct position. For example, assuming that the first monitoring period of the target section is from Monday to Sunday this week (referred to as T1), its traffic flow mean statistical sequence is {t 11 ,t 12 ,…,t 1168 Since T1 may not be completely consistent with the time range in the initial traffic information array (even if it has been "soft aligned"), the system needs to find the best match between them. This involves, for example, comparing the timestamps of the two sequences and finding a reasonable insertion position.
[0125] If the first monitoring period overlaps with one or more of the second monitoring periods, the system can select the overlapping part as the insertion reference. If there is no direct overlap, the system can select a second monitoring period that is closest to the first monitoring period as a reference, or simulate the corresponding relationship through some time transformation (such as linear interpolation, time scaling, etc.).
[0126] To simplify the explanation, assuming that the first monitoring cycle has a direct correspondence with the time period in the initial traffic flow information array (for example, both are based on weekly time units and have similar starting dates), the system can directly place T1 in a new row of the initial traffic flow information array and arrange it in parallel with the data of the control section.
[0127] After determining the location of adding the first traffic flow mean statistical sequence, the computer system inserts it into the initial traffic flow information array to form the final first traffic flow information array. This array now contains the traffic flow mean data of the target road section and all control road sections in the same time frame, providing a rich data source for subsequent feature extraction and inference prediction.
[0128] For example, continuing with the previous example, assume that the system has determined that T1 should be inserted into a new row of the initial vehicle flow information array. Then, the merged first vehicle flow information array will be as follows:
[0129] ;
[0130] This array is a four-dimensional matrix (or a three-dimensional tensor if the continuity of the time series is considered), where the first dimension represents the road segment (including the target road segment and the control road segment), the second dimension represents the time (that is, the various time points in the common time window), and the third dimension (not explicitly shown in this simplified example) may represent other feature dimensions (if any). However, in actual applications, since the main focus is on the single feature of the mean traffic flow, for example, this array can be treated as a two-dimensional matrix.
[0131] When the number of control sections increases and the corresponding monitoring periods are different, the merging operation of step S210 becomes particularly complicated. Through the careful processing of steps S211, S212 and S213, the computer system can merge the first traffic flow mean statistical sequence of the target section and the second traffic flow mean statistical sequence of multiple control sections into a unified first traffic flow information array. This process not only requires the system to have efficient data processing capabilities, but also needs to be able to flexibly deal with time differences and data missing problems between different monitoring cycles. Through "soft alignment" and insertion operations, the system can generate a traffic flow data set containing rich information, laying a solid foundation for subsequent feature extraction and inference prediction.
[0132] As an implementation mode, step S300, combining the first characterization vector and the first maintenance rate statistical sequence and loading them into the first inference network for inference to obtain the target traffic flow mean of the target road section at the target monitoring time, may include:
[0133] Step S310: Acquire first road parameter data corresponding to the target road section;
[0134] Step S320: extracting characterization information from the first road parameter data to obtain a third characterization vector;
[0135] Step S330: The third characterization vector, the first characterization vector, and the first maintenance rate statistical sequence are combined and loaded into the first inference network for inference to obtain the target traffic flow mean of the target road section at the target monitoring time.
[0136] In step S310, the computer system collects road parameter data related to the target road segment. These parameter data include, but are not limited to, road type (such as expressway, urban main road, secondary road, etc.), number of lanes, road width, design speed, traffic sign and line settings, surrounding land use conditions, etc. These data are crucial for understanding the physical characteristics of the road and its impact on traffic flow.
[0137] For example, assuming that the target road segment is a main urban road, its road parameter data may include:
[0138] Road type: urban trunk road; number of lanes: six lanes in both directions; road width: 3.5 meters per lane, 2 meters in the central isolation zone; design speed: 60 km / h; traffic sign and marking settings: including speed limit signs, lane indicator arrows, no U-turn signs, etc.; surrounding land use: mainly commercial and residential areas on both sides, with a small number of schools and hospitals. The computer system obtains these road parameter data by accessing the database of the traffic management department or calling the API interface, providing a basis for subsequent analysis.
[0139] In step S320, after obtaining the road parameter data, the computer system needs to convert these unstructured text or numerical data into numerical feature vectors that can be processed by the machine learning model. This process involves, for example, feature encoding, normalization, one-hot encoding, embedding, and other technologies. The purpose is to abstract the road parameter data into a series of numerical indicators that can reflect the characteristics of the road, so as to facilitate subsequent fusion analysis with the traffic flow data. For example, taking the number of lanes as an example, it is assumed that the value range of the number of lanes is 1 to 12 (considering the actual situation, this range can be adjusted according to the specific application scenario). The computer system can directly process the number of lanes as a numerical feature without the need for additional encoding steps. However, for classification features such as road types, one-hot encoding or embedding representation methods are required for conversion. Taking one-hot encoding as an example, it is assumed that road types are divided into four types: highway, urban arterial, collector, and local street. Then the road type "urban trunk road" can be encoded as a four-dimensional vector [0, 1, 0, 0], where the second bit is 1, indicating that the road belongs to the category of urban trunk roads. For more complex road parameters, such as surrounding land use, natural language processing (NLP) technology or expert knowledge base can be used for feature extraction. For example, land use types can be divided into multiple categories such as commercial, residential, educational, and medical, and a weight value (based on historical data of traffic generation or expert evaluation) is assigned to each category, and finally a weighted land use feature vector is obtained. In practical applications, directly encoding and converting all these road parameters in detail can lead to excessive feature dimensions and redundant information. Therefore, computer systems, for example, use feature selection or dimensionality reduction techniques (such as principal component analysis PCA, linear discriminant analysis LDA, etc.) to optimize the feature set and obtain a concise and effective third representation vector.
[0140] Assume that the third characterization vector obtained after feature selection and dimensionality reduction is: third characterization vector = [lane number code, road type code, design speed normalized value, …, land use weighted feature].
[0141] This vector comprehensively reflects multiple important road parameter information of the target road section, providing strong support for subsequent fusion analysis with traffic flow data.
[0142] In step S330, the computer system combines the third characterization vector, the first characterization vector and the first maintenance rate statistical sequence extracted in the previous step to form a comprehensive input vector containing rich information. Then, the comprehensive input vector is loaded into the first inference network for inference analysis to predict the target traffic flow mean of the target road section at the target monitoring time.
[0143] The first inference network is, for example, a specially trained machine learning model that can learn from the input data the complex relationship between the mean traffic flow and road parameters, historical traffic flow data, and maintenance rate. This model may be a deep neural network (such as convolutional neural network CNN, recurrent neural network RNN, long short-term memory network LSTM, etc.) or other types of regression models (such as support vector regression SVR, random forest regression, etc.). For example, assuming that the first characterization vector has been extracted through the previous step S200, denoted as V1; the third characterization vector is obtained through step S320, denoted as V3; the first maintenance rate statistical sequence is denoted as R1 (if it is a time series and the length is long, it can be converted into a fixed-length vector or feature set in some way).
[0144] The computer system combines these vectors into a comprehensive input vector, denoted as X: vecX=[V1,V3,R1′], where R1′ represents the vector representation of the first maintenance rate statistical sequence after possible processing (such as taking the average, maximum value, using RNN encoding, etc.).
[0145] The system then inputs X into the first inference network. This network may have been trained using a large amount of historical data and has learned to predict the future mean traffic flow from similar comprehensive input vectors. During the inference process, the neurons inside the network activate the corresponding connection weights according to the pattern of the input data, and calculate the output value through forward propagation, that is, the predicted mean traffic flow of the target section at the target monitoring time. Assume that the first inference network is a multi-layer perceptron (MLP) model, whose last layer is a single neuron output layer, and the activation function is a linear function (because this is a regression problem). Let the network parameters be θ (including weights and biases), then the predicted mean traffic flow y can be expressed as:
[0146] y=σ(W out ·h out +b out );
[0147] Among them, σ is the linear activation function (actually the identity function here), W out is the weight matrix of the output layer, b out is the bias term, h outis the output of the hidden layer (the specific calculation process of multiple hidden layers is omitted here to simplify the explanation).
[0148] Finally, the computer system outputs the predicted target traffic flow mean y for use in subsequent steps.
[0149] Step S300 integrates the road parameter data, traffic flow characterization information and maintenance rate statistical series of the target road section, and uses the trained first inference network for inference prediction, thereby realizing an accurate prediction of the mean traffic flow of the target road section at a specific moment. This process not only relies on high-quality input data and advanced machine learning models, but also requires a deep understanding of the field of road traffic management and a careful design of data features.
[0150] As an implementation mode, step S400, after combining the second characterization vector and the first traffic flow mean statistical sequence, is loaded into a second inference network for inference, and the traffic flow maintenance time of the target road section at the target monitoring time is determined according to the inference result of the second inference network, including:
[0151] Step S410: Acquire second road parameter data corresponding to the target road section;
[0152] Step S420: extracting characterization information from the second road parameter data to obtain a fourth characterization vector;
[0153] Step S430: The fourth characterization vector, the second characterization vector and the first traffic flow mean statistical sequence are combined and loaded into the second inference network for inference, and the traffic flow maintenance time of the target road section at the target monitoring time is determined according to the inference result of the second inference network.
[0154] In step S410, the computer system needs to obtain road parameter data related to the target road section from the traffic management database or real-time data acquisition system. These parameters reflect the physical characteristics, design standards, surrounding environment and traffic facility configuration of the road, and can refer to the above-mentioned related description.
[0155] After obtaining the road parameter data, the computer system needs to convert these unstructured or raw data into numerical feature vectors that can be understood by the machine learning model. This process involves operations such as data cleaning, feature encoding, normalization or standardization to ensure the consistency and comparability of the data. For example, for the above road parameter data, the computer system can perform the following processing:
[0156] Road type: converted into a vector through One-Hot Encoding, such as [0, 0, 1] (assuming that the encoding set contains three types of roads: urban streets, suburban roads, highways and their ancillary facilities).
[0157] Number of lanes and lane width: Used directly as numerical features and can be normalized to match the scale of other features.
[0158] Design speed: It is also a numerical feature, but can be segmented or converted into a categorical feature (such as low speed, medium speed, high speed) according to actual conditions.
[0159] Slope: As a continuous numerical feature, it can be segmented or left as is based on its influence.
[0160] Intersection control type: converted to a vector via one-hot encoding.
[0161] Surrounding traffic facilities: Create binary features through feature engineering (such as whether there are emergency parking strips, gas stations, etc.).
[0162] Historical traffic flow pattern: This is a more complex feature. Key indicators (such as peak duration, flow fluctuation range, etc.) can be extracted and converted into numerical features through time series analysis, seasonal decomposition and other methods.
[0163] After the processing is completed, a fourth characterization vector containing multiple numerical features is obtained, such as:
[0164] The fourth characterization vector = [road type code, normalized value of the number of lanes, normalized value of lane width, design speed classification code, slope value, intersection control type code, ...].
[0165] In step S430, the computer system combines the fourth characterization vector, the second characterization vector and the first traffic flow mean statistical sequence extracted in the previous step to form a comprehensive input vector. Then, the comprehensive input vector is loaded into the trained second inference network, and the traffic flow maintenance time prediction value of the target road section at the target monitoring time is calculated through the network's forward propagation process.
[0166] For example, assuming that the second characterization vector has been extracted through step S200, recorded as V2; the fourth characterization vector is obtained through step S420, recorded as V4; the first traffic flow mean statistical sequence is recorded as T1 (if it is a time series and the length is long, it can be converted into a fixed-length vector or feature set by some method (such as time window sliding average, RNN encoding, etc.)). The computer system combines these vectors into a comprehensive input vector X input :X input =[V2,V4,T1′]. Wherein, T1′ represents the vector representation of the first traffic flow mean statistical sequence that may have been processed (such as time window aggregation, feature extraction, etc.).
[0167] Then, the system will X inputInput to the second inference network. This network may be a complex deep learning model, such as a recurrent neural network (RNN), a long short-term memory network (LSTM), a gated recurrent unit (GRU) or its variants, or a hybrid model combining a convolutional neural network (CNN) and RNN. The design of the model depends on the characteristics of the data and the complexity of the prediction task.
[0168] Assume that the second inference network is an LSTM network, which is composed of multiple LSTM layers stacked together, and each LSTM layer may be followed by a Dropout layer to reduce overfitting. The last layer of the network is a fully connected layer (Dense layer) that uses a linear activation function to output the predicted traffic flow duration.
[0169] During the training phase, the LSTM network optimizes its internal parameters (weights and biases) through the back-propagation algorithm and gradient descent (or its variants) to minimize the error (such as mean square error MSE) between the predicted maintenance time and the actual maintenance time. The training data includes historical traffic flow data, road parameter data, and corresponding traffic flow maintenance time labels.
[0170] In the inference phase (i.e., step S430), the LSTM network receives the comprehensive input vector X input , through its internal LSTM unit, it captures the long-term dependencies in the time series data and conducts a comprehensive analysis in combination with the road parameter characteristics. Finally, the network outputs a predicted value, which indicates the duration of the traffic flow on the target road section at the target monitoring time.
[0171] Step S400 comprehensively considers the road parameter data of the target road section, the characteristic representation of the traffic flow, and the statistical sequence of the historical traffic flow mean, and uses the trained second inference network to perform inference prediction, thereby achieving an accurate prediction of the traffic flow maintenance time of the target road section at a certain moment in the future. This process not only relies on high-quality input data and advanced machine learning models, but also requires a deep understanding of the field of road traffic management and careful design of data features. By continuously optimizing the model structure and parameter settings, the prediction accuracy and generalization ability can be further improved, providing more reliable and effective decision support for road traffic management based on digital twins.
[0172] As an implementation mode, step S430, after combining the fourth characterization vector, the second characterization vector, and the first traffic flow mean statistical sequence, is loaded into the second inference network for inference, and the traffic flow maintenance time of the target road section at the target monitoring time is determined according to the inference result of the second inference network, including:
[0173] Step S431: combining the fourth characterization vector, the second characterization vector and the first vehicle flow mean statistical sequence to obtain a joint feature;
[0174] Step S432: loading the joint features into the second inference network, classifying the joint features according to the fully connected mapping component of the second inference network, and obtaining an inference confidence sequence, wherein the inference confidence sequence represents the confidence values of multiple candidate approximation algorithms;
[0175] Step S433: determining a target approximation algorithm from a plurality of candidate approximation algorithms according to the inference confidence sequence, and loading the start monitoring time of the first monitoring cycle, the target monitoring time, and each monitoring time between the start monitoring time and the target monitoring time into the target approximation algorithm to obtain a plurality of target maintenance times;
[0176] Step S434: Obtain the traffic flow maintenance time of the target road section at the target monitoring time according to the sum of multiple target maintenance times.
[0177] In step S431, the computer system combines the fourth characterization vector (representing the road parameter characteristics of the target road section), the second characterization vector (representing the historical evolution characteristics of the traffic flow maintenance time) and the first traffic flow mean statistical sequence (representing the actual traffic flow situation of the target road section within a certain monitoring period) extracted in the previous step to form a joint feature containing rich information. This process involves data splicing, alignment and possible feature conversion to ensure that data from different sources can be processed and analyzed under the same framework.
[0178] For example, suppose the fourth characterization vector is V4, which is a vector containing multiple numerical features, such as road type code, number of lanes, design speed, etc.; the second characterization vector is V2, which is a feature set extracted from the traffic flow maintenance rate statistical sequence through time series analysis, filtering operations and other steps; the first traffic flow mean statistical sequence is T1, which is a one-dimensional array that records the hourly traffic flow mean of the target section during the first monitoring period.
[0179] To combine data from these three different dimensions, a computer system can perform the following operations:
[0180] Data preprocessing: First, process T1 and convert it into a format compatible with V4 and V2 dimensions. If T1 is a time series with a long length, it can be converted into a fixed-length vector T1′ by sliding the time window, downsampling, or encoding (such as using RNN, CNN, etc. for feature extraction).
[0181] Data concatenation: Then, the processed T1′ is concatenated with V4 and V2 to form a new joint feature vector X c :Xc=[V4,V2,T1′].
[0182] This vector contains road parameter characteristics, traffic flow maintenance time characteristics and actual traffic flow mean characteristics, providing comprehensive data support for subsequent reasoning.
[0183] In step S432, the computer system combines the feature vector X c Input into the second inference network. This network is a specially trained machine learning model that can perform nonlinear transformation and classification processing on input features through internal fully connected mapping components (such as the hidden layer of the multi-layer perceptron MLP). Unlike traditional classification tasks, the "classification" here does not refer to dividing samples into predefined category labels, but to selecting the most suitable one from multiple candidate approximation algorithms to approximate the traffic flow maintenance time change curve of the target road section. Specifically, the fully connected mapping component of the second inference network outputs an inference confidence sequence (or confidence distribution), each element of which corresponds to a confidence value of a candidate approximation algorithm. These confidence values reflect the network's evaluation of the applicability of different approximation algorithms under the current input features.
[0184] For example, suppose the second inference network is an MLP model with multiple hidden layers. c When input into the network, the data first enters the network through the input layer and passes through each hidden layer in turn. In each hidden layer, the data is linearly transformed by the weight matrix and nonlinear factors are introduced through activation functions (such as ReLU, sigmoid, or tanh). Finally, before the output layer, the network can use a softmax function to ensure that the sum of the confidence values of all candidate approximation algorithms is 1, thus forming a probability distribution. This distribution is the inference confidence sequence, which characterizes the network's confidence in each candidate approximation algorithm under the current traffic conditions. Assume that the set of candidate approximation algorithms includes exponential functions, power functions, and custom nonlinear functions (such as logistic growth models). The inference confidence sequence may be as follows:
[0185] Reasoning confidence sequence = [exponential function confidence, power function confidence, custom function confidence];
[0186] For example, if the network believes that under the current traffic conditions, the exponential function can most accurately approximate the changing trend of traffic flow maintenance time, the confidence value of the exponential function will be higher than that of the other two candidate algorithms.
[0187] In step S433, the computer system determines the target approximation algorithm based on the inference confidence sequence obtained in step S432. Specifically, the candidate approximation algorithm with the highest confidence is selected as the target approximation algorithm. Then, the starting monitoring time of the first monitoring cycle, the target monitoring time, and the traffic flow data (or related features) of each monitoring point between these two times (such as every hour or every half hour) are loaded into the target approximation algorithm, and multiple target maintenance times (i.e., the time period during which the traffic flow between each monitoring point and the target monitoring time is expected to maintain the current level) are obtained through calculation by the algorithm.
[0188] For example, suppose the inference confidence sequence shows that the exponential function has the highest confidence, so the computer system selects the exponential function as the target approximation algorithm. Next, the system needs to determine the starting monitoring time (denoted as t0) and the target monitoring time (denoted as tn) of the first monitoring cycle, and obtain the traffic flow data or related features of all monitoring points between these two times.
[0189] However, in practical applications, since it may not be possible to directly obtain the exact traffic flow data for each monitoring point in the future, the traffic flow data or features here refer to historical data or predicted values based on current data. To simplify the explanation, it is assumed that these predicted values have been obtained in some way (such as a time series prediction model). The system then loads these predicted values into the exponential function as input. The general form of the exponential function is: y(t)=a·e bt +c; where y(t) represents the traffic flow at time t (or some indicator related to traffic flow), and a, b, and c are the parameters to be fitted. However, in this scenario, the parameters of the entire time series are not directly fitted, but the known data points are used to estimate the traffic flow change trend near the target monitoring time, and the target maintenance time is calculated based on this.
[0190] Specifically, it can be assumed that near the target monitoring time (such as a few hours before and after), the traffic flow will maintain a relatively stable rate of change (that is, the b value is close to a constant). Then, based on this assumption and the properties of the exponential function, the time period from the current moment to the target monitoring moment during which the traffic flow is expected to maintain the current level is estimated. The "maintaining the current level" here is a relatively vague concept. In practical applications, a threshold can be defined according to specific needs (such as the traffic flow change does not exceed a certain percentage). When the predicted traffic flow change exceeds this threshold, the maintenance time is considered to have ended.
[0191] In order to calculate the target maintenance time more accurately, an iteration or search method can be used, for example, starting from the current moment, the time window is gradually advanced forward and the corresponding traffic flow prediction value is calculated until the prediction value exceeds the set threshold. In this way, multiple target maintenance times can be obtained (one maintenance time for each time window).
[0192] In step S434, the computer system accumulates the multiple target maintenance times calculated in step S433 (if they overlap or are continuous) or takes the average value (if they are independent estimation results for different time periods) to obtain the final traffic flow maintenance time prediction value. This prediction value reflects the length of time that the traffic flow of the target road section is expected to remain relatively stable from the current time to the target monitoring time. For example, assuming that k target maintenance time segments [t1, t2], [t3, t4], …, [t 2k−1 ,t 2k ] (Note that the time intervals here are open interval representations and for the sake of simplicity, it is assumed that there is no overlap between them). The final traffic flow maintenance time D can be obtained by calculating the total length of these time segments. In actual applications, the situation may be more complicated. For example, if there is overlap or continuity between time segments, corresponding adjustments need to be made to avoid repeated calculations; if the time segments are independent estimation results based on different time periods or under different conditions, weighted average and other methods can be used to comprehensively obtain a more accurate prediction value. The specific selection is based on actual needs and is not limited in this application.
[0193] Step S430 achieves accurate prediction of the traffic flow maintenance time of the target road section by integrating multiple data sources and advanced machine learning technology. This step not only takes into account the physical characteristics of the road itself and the impact of historical traffic data, but also introduces the concepts of candidate approximation algorithms and reasoning confidence sequences to flexibly respond to complex traffic dynamics. Through this process, a relatively reliable and realistic traffic flow maintenance time prediction value can be obtained, providing strong data support for road traffic management based on digital twins.
[0194] As an implementation manner, the above method provided in the embodiment of the present application also includes a debugging process of the first inference network, specifically including:
[0195] Step S11: obtaining a third traffic flow mean statistical sequence and a third maintenance rate statistical sequence of the first training example road section in the third monitoring cycle, and obtaining a fourth traffic flow mean statistical sequence of the second training example road section in the fourth monitoring cycle, wherein the second training example road section and the first training example road section are sections of the same road, the third monitoring cycle is different from the fourth monitoring cycle, the recording time length of the third traffic flow mean statistical sequence is equal to the time difference between the target monitoring time and the starting monitoring time of the first monitoring cycle, and the recording time length of the third maintenance rate statistical sequence and the recording time length of the fourth traffic flow mean statistical sequence are both equal to the recording time length of the first traffic flow mean statistical sequence;
[0196] Step S12: debugging the first inference network according to the third vehicle flow mean statistical sequence, the third maintenance rate statistical sequence and the fourth vehicle flow mean statistical sequence.
[0197] In step S11, the computer system obtains sample data for training the first inference network from a traffic management database or a real-time data acquisition system. These data include a third traffic flow mean statistical sequence and a third maintenance rate statistical sequence of the first training sample road section in a third monitoring period, and a fourth traffic flow mean statistical sequence of the second training sample road section in a fourth monitoring period. These training sample road sections should be located on the same road, but have different monitoring periods to ensure that the training data is diverse and representative.
[0198] For example, suppose the first training example road segment is a section of a main road A in a city, and the second training example road segment is a section of an adjacent road B on main road A. The third traffic flow mean statistical sequence of section A of main road in the third monitoring period (such as the past week) is recorded as T A3 , the third maintenance rate statistical series is recorded as R A3 At the same time, the fourth traffic flow mean statistical sequence of section B in the fourth monitoring period (such as the same time period in the past two weeks) is recorded as T B4 .
[0199] The third traffic flow mean statistical series (T A3 ): This is a one-dimensional array that records the average traffic volume per hour in Section A of the main road during the third monitoring period. For example, if the third monitoring period is one week, the length of the array is 168 (7 days * 24 hours).
[0200] The third maintenance rate statistical series (R A3 ): This is also a one-dimensional array, recording the traffic flow maintenance rate of the main road section A every hour during the third monitoring period. The calculation of the maintenance rate may be based on the traffic flow change rate at adjacent time points. For example, if the traffic flow in the current hour does not change by more than a certain threshold (such as 5%) compared with the previous hour, the maintenance rate is considered to be high.
[0201] The fourth traffic flow mean statistical series (T B4 ): Although it comes from a different road section (Section B) and monitoring period (the fourth monitoring period), its recording time length should be the same as T A3 , so that it can be matched with T during training. A3 and R A3 Here, it is assumed that although the fourth monitoring period spans two weeks, only the data corresponding to the time period of the third monitoring period is selected as T B4 .
[0202] In addition, according to the problem description, T A3The recording time length of should be equal to the time difference between the target monitoring time and the start monitoring time of the first monitoring cycle, which helps to ensure the consistency of the training data and the prediction target. A3 and T B4 The length of the recording time is related to T A3 The same is used to keep the data dimensions consistent during feature extraction and model training.
[0203] After obtaining enough training data, the computer system needs to use the data to debug the first inference network. The debugging process includes multiple links such as data preprocessing, feature extraction, model training, performance evaluation, and adjustment of model parameters. The following is a detailed explanation of these links.
[0204] Before the data is input into the first inference network, a series of preprocessing operations are required to ensure the cleanliness, consistency and standardization of the data, which may include missing value processing, outlier detection and correction, data standardization or normalization, etc.
[0205] Missing value processing: For missing traffic flow or maintenance rate data, interpolation methods (such as linear interpolation, polynomial interpolation) can be used to fill in the missing data, or they can be estimated based on contextual information (such as historical data, adjacent road section data).
[0206] Outlier detection and correction: Detect outliers through statistical analysis or machine learning algorithms and correct or remove them based on actual conditions. Outliers may be caused by equipment failure, data recording errors, or extreme weather conditions.
[0207] Data standardization / normalization: In order to eliminate the influence of different dimensions on data analysis, the data needs to be converted to the same scale. For example, the minimum-maximum normalization method can be used to scale the traffic flow data to the interval [0, 1].
[0208] Before the preprocessed data is input into the inference network, feature extraction is required to generate feature vectors useful for prediction tasks. This step may involve a variety of techniques such as time series analysis, filtering operations, and feature encoding.
[0209] Time series analysis: Use time series analysis techniques (such as autocorrelation function ACF, partial autocorrelation function PACF) to identify patterns such as periodicity, trend, and seasonality in the data. These patterns can be used as input features for subsequent inference networks.
[0210] Feature encoding: For categorical features (such as road type, intersection control method, etc.), encoding conversion (such as one-hot encoding, label encoding) is required to facilitate model processing.
[0211] After preparing the training data and feature vectors, the first inference network is trained. The training process includes multiple steps such as forward propagation, loss calculation, back propagation, and parameter update.
[0212] Forward propagation: The training data is input into the inference network, and forward calculations are performed through each layer of the network (such as convolutional layer, pooling layer, fully connected layer, etc.) to obtain the output prediction value.
[0213] Loss calculation: Calculate the loss value (such as mean square error (MSE), mean absolute error (MAE), etc.) based on the output prediction value and the true label to evaluate the prediction performance of the model.
[0214] Back propagation: Use the chain rule to calculate the gradient of the loss function with respect to the network parameters, and back propagate the gradient to each layer of the network for subsequent parameter updates.
[0215] Parameter update: Update network parameters (such as weights and biases) based on the gradient values obtained by backpropagation to minimize the loss function value. This process is achieved, for example, through optimization algorithms (such as stochastic gradient descent SGD, Adam, etc.).
[0216] During and after training, the performance of the model needs to be evaluated, and the model parameters or structure need to be adjusted based on the evaluation results to optimize the model performance.
[0217] Performance evaluation: Use the validation set or test set to evaluate the performance of the trained model and calculate indicators such as accuracy, recall, and F1 score to measure the predictive performance of the model.
[0218] Parameter adjustment: Adjust the model’s hyperparameters (such as learning rate, batch size, number of iterations, etc.) or network structure (such as the number of layers, number of neurons, etc.) based on the performance evaluation results to improve the model’s prediction accuracy and generalization ability.
[0219] Overfitting processing: During the training process, pay attention to monitoring the overfitting phenomenon (such as the training error continues to decrease while the validation error begins to increase), and take corresponding measures (such as adding regularization terms, using Dropout layers, stopping training early, etc.) to prevent overfitting.
[0220] Assume that the first inference network is a recurrent neural network model based on LSTM (Long Short-Term Memory Network). LSTM network is particularly suitable for processing time series data because it can capture long-term dependencies in sequence data.
[0221] During the training process, the computer system first performs preprocessing and feature extraction operations on the training data according to the above steps. Then, the processed data is input into the LSTM network for training.
[0222] Input layer: The input layer receives feature vectors as input, which may include the third traffic flow mean statistical sequence T A3 , the third maintenance rate statistical sequence R A3 And from the fourth traffic flow mean statistical sequence T B4 The relevant features extracted from the data (such as traffic volume differences and trend changes in adjacent road sections) are analyzed.
[0223] Hidden layer: The hidden layer of the LSTM network contains multiple LSTM units, each of which is able to capture long-term dependencies in the input sequence. During training, these units update their internal states (such as the weights of the forget gate, input gate, and output gate) and cell states based on the input data and the gradient of the loss function.
[0224] Output layer: The output layer outputs the prediction result, which is the predicted value of the mean traffic flow of the target road section at the target monitoring time. This prediction value is calculated based on the input features and the hidden layer output.
[0225] During the training process, the computer system uses some form of loss function (such as mean square error MSE) to evaluate the difference between the predicted value and the true value, and optimizes the network parameters through the back propagation algorithm and gradient descent method to minimize the loss value. As the training progresses, the prediction performance of the model will gradually improve and stabilize.
[0226] Finally, after the training is completed, the computer system will use the validation set or test set to evaluate the performance of the trained model and adjust the model parameters or structure based on the evaluation results to further optimize the model performance. These adjustments may include changing the number of LSTM layers, adjusting the learning rate, adding a Dropout layer to reduce overfitting, etc.
[0227] Through repeated iteration and optimization of the above steps, the computer system can train a first inference network model with high precision and strong generalization ability, providing reliable prediction support for the road traffic management system based on digital twins.
[0228] As an implementation manner, in step S11, obtaining a third vehicle flow mean statistical sequence and a third maintenance rate statistical sequence of the first training example road section in a third monitoring period may specifically include:
[0229] Step S111: obtaining a candidate vehicle flow mean statistical sequence and a candidate maintenance rate statistical sequence for the first training example road section in a candidate monitoring period, wherein the recording time length of the candidate vehicle flow mean statistical sequence is greater than the time difference between the target monitoring time and the start monitoring time, and the recording time length of the candidate maintenance rate statistical sequence is greater than the recording time length of the first vehicle flow mean statistical sequence;
[0230] Step S112: performing movement extraction in the candidate vehicle flow mean statistical sequence according to the first movement detection frame to obtain a third vehicle flow mean statistical sequence, wherein the data coverage of the first movement detection frame is smaller than the number of data items of the candidate vehicle flow mean statistical sequence;
[0231] Step S113: extract motion in the candidate maintenance rate statistical sequence according to the second motion detection frame to obtain a third maintenance rate statistical sequence, wherein the data coverage of the second motion detection frame is smaller than the number of data items in the candidate maintenance rate statistical sequence.
[0232] In step S111, the computer system accesses the traffic management database or the real-time data acquisition system to obtain the candidate traffic flow mean statistical sequence and the candidate maintenance rate statistical sequence of the first training example section within a longer candidate monitoring period. The recording time length of these candidate data should be much longer than the time difference between the target monitoring time and the starting monitoring time, as well as the recording time length of the first traffic flow mean statistical sequence. The purpose of this is to provide sufficient data redundancy so that a data set suitable for model training can be obtained by mobile extraction in subsequent steps. For example, assuming that the first training example section is section A of the main road in a certain city, training data needs to be prepared for it to train the first inference network. First, the computer system obtains the traffic flow and maintenance rate statistics of section A of the main road in the past period of time (such as the past year) from the database. These data are divided into multiple candidate monitoring periods, and the length of each period may be different, but for example, they are all much longer than the time range required for the target training task.
[0233] Candidate traffic flow mean statistical sequence: For each candidate monitoring period, the system will record the traffic flow mean every hour or every few minutes in the period, forming a longer candidate traffic flow mean statistical sequence. For example, a candidate monitoring period may contain the traffic flow mean data for 24 hours every day in the past year, forming a long sequence containing thousands of data points.
[0234] Candidate maintenance rate statistical sequence: Similarly, the system records the traffic flow maintenance rate (i.e., the proportion of traffic flow that remains stable during this time period) every hour or every few minutes in each candidate monitoring period to form a candidate maintenance rate statistical sequence. Since the calculation of the maintenance rate may be based on the rate of change of traffic flow at adjacent time points, its recording time length is, for example, the same as or slightly shorter than the candidate traffic flow mean statistical sequence.
[0235] In step S112, after obtaining the candidate traffic flow mean statistical sequence, the computer system defines a first moving detection frame (or sliding window) and performs a moving extraction operation on the candidate sequence. The data coverage of this detection frame is smaller than the number of data items in the candidate sequence, and its moving step size can be set as needed. By continuously moving the detection frame and extracting data points in the frame as training samples, the system can generate a series of third traffic flow mean statistical sequences that match the target monitoring time range. For example, assuming that the target monitoring task needs to predict the average traffic flow for each day in the next week, the time difference between the target monitoring time and the starting monitoring time is one week (i.e. 168 hours, if the traffic flow is recorded by the hour). In order to prepare the training data, the computer system defines a first moving detection frame with a length of 168 hours and performs a sliding operation on the candidate traffic flow mean statistical sequence.
[0236] The starting position of the detection box can start from any point in the candidate sequence (but in order to make full use of the data, for example, it starts sliding from the starting point of the sequence). Each time it slides, the detection box covers 168 consecutive data points in the sequence (corresponding to the average traffic flow data for one week), and then the system extracts these data points as a third traffic flow average statistical sequence for a training sample. The moving step size can be set according to the size requirements of the training set. For example, if you want to generate more training samples to increase the generalization ability of the model, you can set a smaller moving step size (such as 1 hour or several hours), so that the detection box will only skip a small number of data points each time it slides. On the contrary, if there are enough training samples or computing resources are limited, you can set a larger moving step size to reduce training time. As the detection box continues to slide on the candidate sequence, the system will generate a series of third traffic flow average statistical sequences with a length of 168 hours as part of the training data. These sequences cover different time periods within the candidate monitoring period, which helps the model learn the periodic changes in traffic flow and the characteristics of different time points.
[0237] Step S113 is similar to step S112, where the computer system defines a second moving detection frame to extract the third maintenance rate statistical sequence from the candidate maintenance rate statistical sequence. The data coverage of this detection frame is also smaller than the number of data items in the candidate sequence, and its length should match the third vehicle flow mean statistical sequence (i.e., the same as the target monitoring time range). By moving the detection frame and extracting the data points in the frame as the maintenance rate feature values of the training samples, the system can generate a series of third maintenance rate statistical sequences related to the target monitoring task.
[0238] For example, in step S112, a series of third traffic flow mean statistical sequences have been generated through the first moving detection frame as the traffic flow feature part of the training data. Now, it is necessary to add corresponding maintenance rate features to these traffic flow features to form a complete training sample set.
[0239] Similar to the first moving detection frame, the length of the second moving detection frame should also be set to the same as the target monitoring time range (such as 168 hours). This ensures that the mean traffic flow and maintenance rate data in each training sample are aligned in time. As the second moving detection frame slides on the candidate maintenance rate statistical sequence (the sliding step size can be the same or different from the first moving detection frame), the system extracts a series of third maintenance rate statistical sequences with a length of 168 hours. These sequences correspond one-to-one with the third traffic flow mean statistical sequence in time, and together constitute a complete feature set of the training sample. In order to ensure the consistency and comparability of the traffic flow mean and maintenance rate data in the training samples, the system needs to match them in chronological order when extracting data. That is, each data point in each third traffic flow mean statistical sequence should have a corresponding data point in the third maintenance rate statistical sequence to represent the traffic flow maintenance rate at that time point.
[0240] Through the implementation of the above steps S111, S112 and S113, the computer system can efficiently prepare a training data set suitable for training the first inference network. These data sets not only contain rich vehicle flow mean information to reflect the actual changes in road traffic flow; they also contain corresponding maintenance rate information to capture the stability and change trend of vehicle flow over time. Through reasonable sliding window settings and data extraction strategies, the system can generate a large and diverse set of training samples, providing a solid foundation for subsequent model training. In practical applications, these training data will help the first inference network learn the inherent laws and dynamic characteristics of road traffic flow, thereby improving the prediction accuracy and robustness of future vehicle flow mean and its maintenance time.
[0241] As an implementation manner, the above method provided in the embodiment of the present application also includes a debugging process of the second inference network, specifically including:
[0242] Step S22: obtaining a third maintenance rate statistical sequence and a fifth vehicle flow mean statistical sequence for the first training example road section in a third monitoring cycle, and obtaining a fourth maintenance rate statistical sequence for the second training example road section in a fourth monitoring cycle, wherein the second training example road section and the first training example road section are sections of the same road, the third monitoring cycle is different from the fourth monitoring cycle, the recording time length of the third maintenance rate statistical sequence is equal to the time difference between the target monitoring time and the start monitoring time of the first monitoring cycle, and the recording time length of the fifth vehicle flow mean statistical sequence and the recording time length of the fourth maintenance rate statistical sequence are both equal to the recording time length of the first vehicle flow mean statistical sequence;
[0243] Step S23: training a second inference network according to the third maintenance rate statistical sequence, the fifth vehicle flow mean statistical sequence and the fourth maintenance rate statistical sequence.
[0244] Different from the first inference network, the second inference network focuses on predicting the maintenance time of the traffic flow on the target road section, which requires it to extract comprehensive features related to time series analysis, road parameters and current traffic flow status from different data sources.
[0245] In step S22, the computer system obtains sample data for training the second reasoning network from the traffic management database or the real-time data acquisition system. These data include the third maintenance rate statistical sequence and the fifth vehicle flow mean statistical sequence of the first training sample road section in the third monitoring period, and the fourth maintenance rate statistical sequence of the second training sample road section in the fourth monitoring period. These training sample road sections should be located on the same road, but with different monitoring periods to ensure that the training data is diverse and representative.
[0246] For example, suppose the first training example road segment is a section of a main road A in a city, and the second training example road segment is a section of an adjacent road B on main road A. In order to train the second inference network to predict the traffic flow duration of section A of the main road at a certain time in the future, the computer system needs to obtain the following data:
[0247] The third maintenance rate statistical series (R A3 ): This is the maintenance rate statistical sequence of the main road section A in the third monitoring cycle (such as the time period corresponding to the first monitoring cycle in the past week), which records the traffic flow maintenance rate every hour or every few minutes. The calculation of the maintenance rate may be based on the traffic flow change rate at adjacent time points. If the traffic flow at the current time point does not change by more than a certain threshold (such as 5%) compared with the previous time point, the maintenance rate is considered to be high. The recording time length of this sequence should be equal to the time difference between the target monitoring time and the starting monitoring time of the first monitoring cycle to ensure consistency with the time range of the target prediction task.
[0248] The fifth traffic flow mean statistical series (T A5 ): Although it is named "fifth", the number of this sequence does not actually indicate its specific position in the data acquisition order, but is used to distinguish it from the first traffic flow mean statistical sequence (T A1 ). Here, T A5 Indicates that the main road section A is in another monitoring period (which can be any time period overlapping or not overlapping with the third monitoring period, but its recording time length should be the same as T A1 This sequence provides the second inference network with information about the traffic flow level, which helps the model understand the impact of the current traffic flow status on the maintenance time.
[0249] The fourth maintenance rate statistical series (R B4 ): This is the maintenance rate statistical series of section B in the fourth monitoring cycle (which is different from the third monitoring cycle but may contain data of similar time periods). Since section B and section A are on the same road and have similar geographical locations, R B4 It can provide additional information about the traffic flow maintenance rate of adjacent road segments, which helps the second inference network capture the spatial correlation in the road network.
[0250] In step S23, after obtaining sufficient training data, the computer system will use the data to train the second inference network. The training process includes, for example, data preprocessing, feature extraction, model construction, model training, performance evaluation, and adjustment of model parameters.
[0251] Similar to the training process of the first inference network, the training data of the second inference network also needs to be preprocessed to ensure the cleanliness, consistency and standardization of the data. This includes steps such as missing value processing, outlier detection and correction, and data standardization or normalization.
[0252] Before the preprocessed data is input into the inference network, feature extraction is required to generate feature vectors useful for the prediction task. For the second inference network, feature extraction may involve multiple aspects such as time series analysis, statistical feature calculation, and road parameter fusion. Although the maintenance rate statistical series itself is already a time series data, further analysis may be required to extract features such as trends and periodicity. For example, methods such as difference and moving average can be used to smooth the data or remove seasonal effects. Statistics such as the mean, variance, skewness, and kurtosis of the maintenance rate statistical series are calculated and input into the model as additional features. These statistics reflect the overall distribution characteristics and change trends of the maintenance rate data. In addition, road parameters (such as the number of lanes, design speed, road type, etc.) can also be input into the model as features. These parameters can be converted into numerical features through encoding, embedding, etc. and input into the network together with the time series features.
[0253] When building the second inference network, it is necessary to select a suitable network architecture and parameter configuration to meet the needs of the prediction task. For time series prediction problems, recurrent neural networks (RNNs) and their variants (such as LSTM and GRU) are commonly used model types because they can capture long-term dependencies in sequence data.
[0254] Choose a suitable network architecture based on the complexity of the task and the amount of data. For example, you can choose a single-layer LSTM network as a starting point and then gradually increase the number of layers and neurons as needed to improve model performance. Then set the network's initial learning rate, optimizer type (such as Adam, SGD), loss function (such as mean square error MSE, mean absolute error MAE), batch size, number of iterations and other parameters. The choice of these parameters will directly affect the training speed and final performance of the model.
[0255] After preparing the training data and model architecture, you can start training the second inference network. The training process includes multiple steps such as forward propagation, loss calculation, backpropagation, and parameter update, which are repeated until the stopping condition is met (such as reaching the maximum number of iterations, the verification error no longer decreases, etc.).
[0256] Forward propagation: Input the training data into the network for forward calculation to obtain the prediction result (i.e. the predicted value of the traffic flow maintenance time of the target road section at a certain time in the future). Calculate the loss value based on the prediction result and the true label to evaluate the model performance. Commonly used loss functions for regression problems include mean square error (MSE) and mean absolute error (MAE). Use the chain rule to calculate the gradient of the loss function with respect to the network parameters and back-propagate the gradient to each layer of the network for subsequent parameter updates. Update the network parameters (such as weights and biases) based on the gradient values obtained by back-propagation to minimize the loss function value. This is achieved, for example, through optimization algorithms (such as Adam, SGD).
[0257] During and after the training, the performance of the model needs to be evaluated and the model parameters or structure needs to be adjusted based on the evaluation results to optimize the model performance. Use the validation set or test set to evaluate the performance of the trained model and calculate the accuracy, recall (for classification problems), root mean square error (RMSE for regression problems) and other indicators to measure the prediction performance of the model. For the second inference network, since it is a regression model, the main focus is on RMSE or other regression indicators. According to the performance evaluation results, adjust the model's hyperparameters (such as learning rate, batch size, number of iterations, etc.) or network structure (such as number of layers, number of neurons, etc.) to improve the model's prediction accuracy and generalization ability. For example, if the validation error starts to rise during the training process, the learning rate can be reduced or the early stopping method can be used to prevent overfitting. During the training process, pay attention to monitoring the overfitting phenomenon and take corresponding measures to prevent overfitting. This includes adding regularization terms (such as L1 regularization, L2 regularization), using the Dropout layer to randomly discard the output of a part of the neurons, increasing the amount of training data, or using data augmentation techniques to generate more diverse training samples.
[0258] For example, suppose that the training data has been prepared according to the above steps and the second inference network has been preliminarily constructed and configured. Now input this data into the network and start the training process. A3 ), the fifth traffic flow mean statistical series (T A5 ) and the fourth maintenance rate statistical series (R B4 ) are input as features into the second inference network. Here, these sequences can be converted into a format suitable for network input (such as by time window sliding, feature encoding, etc.). During the training process, the network will continuously learn how to extract useful information from the input features and predict the traffic flow maintenance time of the target road section. As the training progresses, the network parameters will be gradually adjusted to minimize the loss function value and improve the prediction accuracy. During the training process, the computer system will regularly evaluate the performance of the model on the validation set to monitor its generalization ability. If it is found that the validation error begins to rise, the learning rate can be adjusted, the regularization term can be increased, or other measures can be taken to prevent overfitting. When the model achieves satisfactory performance on the validation set (that is, the validation error no longer decreases significantly), the computer system will save the current model parameters for subsequent use or further tuning.
[0259] The trained second inference network will be deployed in the actual traffic management system to predict the traffic flow duration of the target road section in real time. This will help the traffic management department to formulate traffic diversion plans in a timely manner, optimize the timing of signal lights, etc. to alleviate traffic congestion and improve road traffic efficiency. Through the detailed implementation and continuous optimization of the above steps, the second inference network can gradually improve its prediction accuracy and generalization ability, thereby providing more accurate and reliable prediction support for the system.
[0260] The present application embodiment provides a computer system, such as Figure 2 As shown, the computer system 100 includes: a processor 101 and a memory 103. The processor 101 and the memory 103 are connected, such as through a bus 102. Optionally, the computer system 100 may also include a transceiver 104. It should be noted that in actual applications, the transceiver 104 is not limited to one, and the structure of the computer system 100 does not constitute a limitation on the embodiments of the present application.
[0261] An embodiment of the present application provides a computer system. The computer system in the embodiment of the present application includes: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, and when the one or more programs are executed by the processor, the above method is implemented.
Claims
1. A road traffic management method based on digital twins, characterized in that: include: Obtain a first traffic flow mean statistical sequence and a first maintenance rate statistical sequence of a target section in a first monitoring cycle, and obtain a second traffic flow mean statistical sequence and a second maintenance rate statistical sequence of a control section in a second monitoring cycle, wherein the control section and the target section are sections of the same road, and the first monitoring cycle is different from the second monitoring cycle; wherein the maintenance rate refers to the proportion of traffic flow that remains relatively stable within a certain time period, and a method for calculating the maintenance rate includes: for each time interval, calculating the difference between the actual traffic flow and the traffic flow in the previous time interval, if the difference is within a preset threshold range, it is considered that the traffic flow remains stable within the time interval, the maintenance rate is increased by 1, and the total number of maintenance times is divided by the total number of time intervals to obtain the maintenance rate of the time interval; The first vehicle flow mean statistical sequence and the second vehicle flow mean statistical sequence are combined to extract characterization information to obtain a first characterization vector, and the first maintenance rate statistical sequence and the second maintenance rate statistical sequence are combined to extract characterization information to obtain a second characterization vector; Combining the first characterization vector and the first maintenance rate statistical sequence and loading them into a first inference network for inference to obtain a target traffic flow mean value of the target road section at a target monitoring time; The second characterization vector and the first traffic flow mean statistical sequence are combined and loaded into a second inference network for inference, and the traffic flow maintenance time of the target road section at the target monitoring time is determined according to the inference result of the second inference network; Determine the target traffic state of the target road section at the target monitoring time according to the target traffic flow mean and the traffic flow maintenance time; Based on the target traffic status at the target monitoring moment, the display information of the target road section is updated in the preset digital twin model.
2. The road traffic management method based on digital twin according to claim 1 is characterized in that: The step of merging the first vehicle flow mean statistical sequence and the second vehicle flow mean statistical sequence and extracting representation information to obtain a first representation vector includes: Merging the first vehicle flow mean statistical sequence and the second vehicle flow mean statistical sequence to obtain a first vehicle flow information array; Performing filtering operations on the first vehicle flow information array respectively through different filter matrices to obtain a plurality of first filter arrays with the same number of channels; Array units of the same sequence in each of the first filter arrays are respectively combined to obtain a plurality of first sequence arrays, and characterization information is extracted from the plurality of first sequence arrays to obtain a first characterization vector.
3. The road traffic management method based on digital twin according to claim 2 is characterized in that: The extracting characterization information from the plurality of first sequential arrays to obtain a first characterization vector includes: Loading the plurality of first sequential arrays one by one into a first time series analysis network for linear transformation, and obtaining first intermediate representation arrays corresponding to the first sequential arrays; Weights are assigned to each of the first intermediate representation arrays to obtain focusing coefficients corresponding to each of the first intermediate representation arrays, and each of the first intermediate representation arrays is fused according to the focusing coefficients to obtain a first representation vector.
4. The road traffic management method based on digital twin according to claim 2 is characterized in that: The number of the control sections is multiple, and the second monitoring periods corresponding to the respective control sections are different. The first vehicle flow mean statistical sequence and the second vehicle flow mean statistical sequence are merged to obtain a first vehicle flow information array, including: Merging the second vehicle flow mean statistical sequences corresponding to each of the reference road sections according to the time sequence of each of the second monitoring cycles to obtain an initial vehicle flow information array; Determine, according to the first monitoring period and the timing of each of the second monitoring periods, the position at which the first vehicle flow mean statistical sequence is added to the initial vehicle flow information array; According to the adding position, the first vehicle flow mean statistical sequence is added to the initial vehicle flow information array to obtain a first vehicle flow information array.
5. The road traffic management method based on digital twin according to claim 1 is characterized in that: The combining of the first characterization vector and the first maintenance rate statistical sequence and loading them into a first inference network for inference to obtain a target vehicle flow mean value of the target road section at a target monitoring time includes: Acquire first road parameter data corresponding to the target road section; Extracting characterization information from the first road parameter data to obtain a third characterization vector; Combining the third characterization vector, the first characterization vector, and the first maintenance rate statistical sequence, and loading them into a first inference network for inference, to obtain a target traffic flow mean value of the target road section at a target monitoring time; The combining of the second characterization vector and the first traffic flow mean statistical sequence and loading them into a second inference network for inference, and determining the traffic flow maintenance time of the target road section at the target monitoring time according to the inference result of the second inference network, comprises: Acquire second road parameter data corresponding to the target road section; Extracting characterization information from the second road parameter data to obtain a fourth characterization vector; The fourth characterization vector, the second characterization vector and the first traffic flow mean statistical sequence are combined and loaded into a second inference network for inference, and the traffic flow maintenance time of the target road section at the target monitoring time is determined according to the inference result of the second inference network.
6. The road traffic management method based on digital twin according to claim 5 is characterized in that: The combining of the fourth characterization vector, the second characterization vector, and the first traffic flow mean statistical sequence into a second inference network for inference, and determining the traffic flow maintenance time of the target road section at the target monitoring time according to the inference result of the second inference network, comprises: Combining the fourth characterization vector, the second characterization vector, and the first traffic flow mean statistical sequence to obtain a joint feature; Loading the joint features into a second inference network, classifying the joint features according to a fully connected mapping component of the second inference network, and obtaining an inference confidence sequence, wherein the inference confidence sequence represents confidence values of multiple candidate approximation algorithms; Determine a target approximation algorithm from the plurality of candidate approximation algorithms according to the inference confidence sequence, and load the start monitoring time of the first monitoring cycle, the target monitoring time, and each monitoring time between the start monitoring time and the target monitoring time into the target approximation algorithm to obtain a plurality of target maintenance times; The traffic flow maintenance time of the target road section at the target monitoring time is obtained according to the sum of the multiple target maintenance times.
7. The road traffic management method based on digital twin according to claim 1 is characterized in that: The method also includes a debugging process of the first inference network, including: Obtain a third vehicle flow mean statistical sequence and a third maintenance rate statistical sequence for the first training example road section in a third monitoring cycle, and obtain a fourth vehicle flow mean statistical sequence for the second training example road section in a fourth monitoring cycle, wherein the second training example road section and the first training example road section are sections of the same road, the third monitoring cycle is different from the fourth monitoring cycle, the recording time length of the third vehicle flow mean statistical sequence is equal to the time difference between the target monitoring time and the start monitoring time of the first monitoring cycle, and the recording time length of the third maintenance rate statistical sequence and the recording time length of the fourth vehicle flow mean statistical sequence are both equal to the recording time length of the first vehicle flow mean statistical sequence; The first inference network is debugged according to the third vehicle flow mean statistical sequence, the third maintenance rate statistical sequence and the fourth vehicle flow mean statistical sequence.
8. The road traffic management method based on digital twin according to claim 7 is characterized in that: The step of obtaining a third vehicle flow mean statistical sequence and a third maintenance rate statistical sequence of the first training example road section in a third monitoring period includes: Obtaining a candidate vehicle flow mean statistical sequence and a candidate maintenance rate statistical sequence for the first training example road section in a candidate monitoring period, wherein the recording time length of the candidate vehicle flow mean statistical sequence is greater than the time difference between the target monitoring time and the start monitoring time, and the recording time length of the candidate maintenance rate statistical sequence is greater than the recording time length of the first vehicle flow mean statistical sequence; Performing movement extraction in the candidate vehicle flow mean statistical sequence according to the first movement detection frame to obtain the third vehicle flow mean statistical sequence, wherein the data coverage range of the first movement detection frame is smaller than the number of data items in the candidate vehicle flow mean statistical sequence; The third maintenance rate statistical sequence is obtained by performing motion extraction in the candidate maintenance rate statistical sequence according to the second motion detection frame, wherein the data coverage range of the second motion detection frame is smaller than the number of data items in the candidate maintenance rate statistical sequence.
9. The road traffic management method based on digital twin according to claim 1 is characterized in that: Also included is a debugging process of the second inference network, including: Obtain a third maintenance rate statistical sequence and a fifth vehicle flow mean statistical sequence for the first training example road section in a third monitoring cycle, and obtain a fourth maintenance rate statistical sequence for the second training example road section in a fourth monitoring cycle, wherein the second training example road section and the first training example road section are sections of the same road, the third monitoring cycle is different from the fourth monitoring cycle, the recording time length of the third maintenance rate statistical sequence is equal to the time difference between the target monitoring time and the starting monitoring time of the first monitoring cycle, and the recording time length of the fifth vehicle flow mean statistical sequence and the recording time length of the fourth maintenance rate statistical sequence are both equal to the recording time length of the first vehicle flow mean statistical sequence; The second inference network is trained according to the third maintenance rate statistical sequence, the fifth vehicle flow mean statistical sequence, and the fourth maintenance rate statistical sequence.
10. A computer system, characterized in that: include: one or more processors; Memory; one or more computer programs; The one or more computer programs are stored in the memory and configured to be executed by the one or more processors, and when the one or more computer programs are executed by the processors, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Traffic flow prediction method based on bidirectionally nested LSTM neural network
CN110070713A
Traffic flow prediction method and device based on space-time attention network, and readable medium
CN117079452A