A method and system for predicting traffic flow at a highway toll station

Through the application of multi-source heterogeneous traffic data acquisition and deep learning models, the problems of data source singularity and external factors are ignored in highway toll station traffic prediction, achieving higher prediction accuracy and external environment sensitivity.

CN119625994BActive Publication Date: 2025-05-09TE WEI LE XING (GUANG ZHOU) JI SHU YOU XIAN GONG SI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510162427.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-14
Publication Date
2025-05-09
Estimated Expiration
2045-02-14

AI Technical Summary

Technical Problem

The prior art has problems such as data source singularity and external factors being ignored in the traffic forecast of highway toll stations, resulting in insufficient prediction accuracy and generalization capabilities.

Method used

Using multi-source heterogeneous traffic data acquisition and preprocessing technology, comprehensive feature vectors are generated and STGATwE model is constructed to perform traffic prediction through feature extraction, feature fusion and deep learning model training.

Benefits of technology

Through the application of multi-source data fusion and deep learning models, the accuracy and reliability of traffic prediction are improved, and the model's sensitivity to changes in the external environment and its ability to deal with emergencies is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119625994B_ABST
    Figure CN119625994B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for predicting traffic flow at a highway toll station, which relates to the field of intelligent traffic management and big data analysis. The method and system include collecting multi-source heterogeneous traffic data and preprocessing it, extracting features from the preprocessed multi-source heterogeneous traffic data, mapping the extracted features to a common feature space, fusing features, generating a comprehensive feature vector, obtaining a traffic network diagram based on the comprehensive feature vector, building an STGATwE model according to the traffic network diagram, training the STGATwE model using the comprehensive feature vector, adjusting STGATwE model parameters, generating a trained STGATwE model, inputting the multi-source heterogeneous traffic data collected in real time into the trained STGATwE model, and obtaining traffic flow prediction results. By collecting multi-source heterogeneous traffic data and introducing external influencing factor mapping functions, the data dimension is enriched and the sensitivity to external factors is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent traffic management and big data analysis, and in particular to a method and system for predicting traffic flow at a highway toll station. Background Art

[0002] In recent years, with the rapid development of intelligent transportation and the popularization of Internet of Things technology, highway toll station traffic forecasting, as one of the key links of intelligent transportation management, has received extensive attention. Traditionally, traffic flow forecasting mainly relies on time series analysis methods of historical data, such as autoregressive moving average model, exponential smoothing, etc.

[0003] However, the existing technologies still have some shortcomings. On the one hand, most of the existing technologies focus on the integration of a single data source or a few types of data, and lack effective solutions for how to efficiently integrate diverse information from different data sources. On the other hand, traditional prediction models often ignore the impact of external factors on traffic flow, such as weather conditions, which limits the generalization ability of the model and the prediction accuracy. Summary of the invention

[0004] In view of the above existing problems, the present invention is proposed.

[0005] Therefore, the present invention provides a method for predicting traffic flow at a highway toll station to solve the problems of single data source and neglect of external factors.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0007] In a first aspect, the present invention provides a method for predicting traffic flow at a highway toll station, comprising:

[0008] Collect multi-source heterogeneous traffic data from cameras, radars, GPS and historical records, and perform pre-processing operations such as denoising, format conversion, time alignment and standardization;

[0009] Through feature extraction, effective features related to traffic flow prediction are extracted from preprocessed multi-source heterogeneous traffic data, including features of traffic density, queue length, average vehicle speed, and length of vehicle travel path;

[0010] The extracted features are mapped to a common feature space, and feature fusion is performed through standardization, dimensionality reduction, covariance analysis, and UMAP algorithm mapping to generate a comprehensive feature vector that can comprehensively reflect the traffic conditions;

[0011] According to the actual highway network structure, an initial traffic network graph is constructed. The node attributes and edge weights of the initial traffic network graph are defined based on the comprehensive feature vector to generate a traffic network graph. Based on the traffic network graph, a STGATwE model including a graph attention layer and a spatiotemporal convolution layer is designed.

[0012] The STGATwE model is trained using the comprehensive feature vector. The training steps are back propagation and forward propagation. The model parameters are adjusted by combining the loss function optimization technology. After multiple rounds of iterative training, the trained STGATwE model is obtained.

[0013] The multi-source heterogeneous traffic data collected in real time is input into the trained STGATwE model to obtain the traffic prediction results.

[0014] As a preferred solution of the method for predicting traffic flow at a highway toll station of the present invention, the multi-source heterogeneous traffic data collected from cameras, radars, GPS and historical records, and pre-processed by denoising, format conversion, time alignment and standardization, specifically includes the following steps:

[0015] Use high-definition cameras to collect video image data at toll gates;

[0016] Use Doppler radar to collect lane radar detection data;

[0017] Use RSU to receive and collect GPS data from OBU;

[0018] Use license plate recognition cameras to collect license plate recognition data;

[0019] Use local storage to collect historical traffic data;

[0020] The collected multi-source heterogeneous traffic data is preprocessed by denoising, format conversion and time alignment to obtain the preprocessed multi-source heterogeneous traffic data.

[0021] As a preferred solution of the method for predicting traffic flow at a highway toll station of the present invention, the pre-processed multi-source heterogeneous traffic data is subjected to feature extraction to extract effective features related to traffic flow prediction, including features of traffic density, queue length, average vehicle speed, and length of vehicle travel path, which specifically includes the following steps:

[0022] The convolutional neural network is used to extract the features of traffic density and queue length from the pre-processed toll gate video image data.

[0023] The pre-processed lane radar detection data is used to extract the frequency domain features of the average speed and minimum distance of the vehicle using Fourier transform;

[0024] For the pre-processed vehicle GPS data, GIS tools are used to extract the characteristics of the length and direction change rate of the vehicle's driving path;

[0025] For the pre-processed license plate recognition data, use OCR technology to extract the license plate number features;

[0026] For the preprocessed historical traffic data, the regression integral moving average model is used to extract the periodicity and trend characteristics.

[0027] As a preferred solution of the method for predicting traffic flow at a highway toll station of the present invention, the extracted features are mapped to a common feature space, and feature fusion is performed by standardization, dimensionality reduction, covariance analysis and UMAP algorithm mapping to generate a comprehensive feature vector that can comprehensively reflect the traffic conditions, which specifically includes the following steps:

[0028] Standardize the extracted features;

[0029] After standardization, PCA technology is applied to project high-dimensional features into feature space;

[0030] Combine the features that have been standardized and processed by PCA technology to generate a covariance matrix, and identify key eigenvectors based on the covariance matrix;

[0031] Use the key eigenvectors to construct a low-dimensional feature matrix, and use the UMAP algorithm to map the low-dimensional feature matrix to a common feature space;

[0032] The low-dimensional feature matrices mapped to the common feature space are fused, different weights are assigned to the features in each low-dimensional feature matrix, and all features are fused according to their respective weights to obtain a comprehensive feature vector, which is expressed as:

[0033] ;

[0034] in represents the comprehensive feature vector, represents the mixing ratio, Indicates the number of feature types, represents the index of the feature, Indicates The weight of the class feature, Indicates The low-dimensional representation of class features in a common feature space, Represents the covariance matrix Middle Line The elements of the column, represents a small constant to prevent the denominator from being zero, represents the function after feature enhancement, represents the feature enhancement strength parameter, Represents the external influencing factor mapping function value.

[0035] As a preferred solution of the highway toll station traffic prediction method of the present invention, the initial traffic network diagram is constructed according to the actual highway network structure, the node attributes and edge weights of the initial traffic network diagram are defined based on the comprehensive feature vector, the traffic network diagram is generated, and based on the traffic network diagram, the STGATwE model including the graph attention layer and the spatiotemporal convolution layer is designed, which specifically includes the following steps:

[0036] Based on the actual topological structure of the highway and the location of toll stations, an initial traffic network diagram is established, where each toll station is represented as a node and the connections between road sections are represented as edges;

[0037] Initialize the properties of the nodes in the traffic network graph according to the characteristics of traffic density, average vehicle speed and path length in the comprehensive vector characteristics;

[0038] According to the speed and driving path features in the comprehensive vector features, the weight of each edge of the initial traffic network graph is defined to generate a traffic network graph;

[0039] Based on the traffic network graph, the STGATwE model is constructed in a deep learning framework using graph attention mechanism and spatiotemporal convolution technology.

[0040] As a preferred solution of the method for predicting traffic flow at a highway toll station of the present invention, the STGATWE model is trained using a comprehensive feature vector, the training steps are back propagation and forward propagation, and the model parameters are adjusted in combination with the loss function optimization technology, and the trained STGATWE model is obtained after multiple rounds of iterative training, which specifically includes the following steps:

[0041] The comprehensive feature vector is input into the STGATwE model and the forward propagation and back-propagation steps are performed for training;

[0042] When the STGATwE model is trained, a loss function is used to measure the difference between the traffic prediction value of the STGATwE model and the known traffic measurement value in the historical data. The loss of each comprehensive feature vector sample is calculated by the mean square error, and the losses of all comprehensive feature vector samples are averaged to obtain the loss value.

[0043] After obtaining the loss value, the Adam optimizer is used to adjust the model parameters. By calculating the gradient of the loss function relative to the model parameters, the model is subjected to gradient descent using the adaptive learning rate adjustment method. In each iteration, the Adam optimizer first calculates the loss gradient under the current parameter settings, and then adjusts the learning step size of each parameter according to the unique adaptive learning rate mechanism of the Adam algorithm, and performs parameter updates to adjust the model parameters.

[0044] The STGATwE model with adjusted parameters is subjected to regularization technology to prevent overfitting. A penalty term proportional to the weight size is added to the loss function to limit the complexity of the model parameters, simplify the model structure, reduce the parameters, and generate an optimized and trained STGATwE model after multiple rounds of iterative training.

[0045] As a preferred solution of the method for predicting traffic flow at a highway toll station of the present invention, the method of inputting the multi-source heterogeneous traffic data collected in real time into the trained STGATwE model to obtain the traffic flow prediction result specifically includes the following steps:

[0046] Collect the latest multi-source heterogeneous traffic data, input the trained STGATwE model, and predict the traffic flow at highway toll stations. The expression is:

[0047] ;

[0048] in ;

[0049] in, represents the traffic volume at the highway toll station, represents the trained STGATwE model, Indicates the number of feature types, An index representing the type of feature. represents the spatiotemporal dynamic weight, Indicates the extracted feature vectors, represents the eigenvalue after feature enhancement, represents the feature enhancement strength parameter, represents the mixing ratio, Represents the mapping function value of external influencing factors, represents a set of different scale levels and their corresponding weights, Represents the total number of different scale levels, each Indicates a specific scale level, is the weight of this scale level.

[0050] In a second aspect, the present invention provides a highway toll station flow prediction system, including a preprocessing module, a feature extraction module, a fusion module, a model building module, a model training module, and a flow prediction module;

[0051] The preprocessing module is used to collect multi-source heterogeneous traffic data from cameras, radars, GPS and historical records, and perform preprocessing operations such as denoising, format conversion, time alignment and standardization;

[0052] The feature extraction module is used to extract effective features related to traffic flow prediction from the pre-processed multi-source heterogeneous traffic data, including features of traffic density, queue length, average vehicle speed, and length of vehicle travel path;

[0053] The fusion module is used to map the extracted features into a common feature space, perform feature fusion through standardization, dimension reduction, covariance analysis and UMAP algorithm mapping, and generate a comprehensive feature vector that can comprehensively reflect the traffic conditions;

[0054] The model building module is used to build an initial traffic network graph according to the actual highway network structure, define the node attributes and edge weights of the initial traffic network graph based on the comprehensive feature vector, generate the traffic network graph, and design the STGATwE model including the graph attention layer and the spatiotemporal convolution layer based on the traffic network graph;

[0055] The model training module is used to train the STGATwE model using the comprehensive feature vector. The training steps are back propagation and forward propagation. The model parameters are adjusted in combination with the loss function optimization technology. After multiple rounds of iterative training, the trained STGATwE model is obtained.

[0056] The traffic prediction module is used to input the multi-source heterogeneous traffic data collected in real time into the trained STGATwE model to obtain the traffic prediction results.

[0057] In a third aspect, the present invention provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program is executed by the processor, any step of the highway toll station traffic prediction method as described in the first aspect of the present invention is implemented.

[0058] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of a method for predicting traffic flow at a highway toll station as described in the first aspect of the present invention.

[0059] The beneficial effects of the present invention are as follows: by collecting and integrating various types of traffic information such as high-definition camera videos, Doppler radar detection, GPS signals received by RSU, license plate recognition camera images, and historical traffic data stored locally, a more comprehensive and accurate data set is constructed for subsequent analysis. This method greatly enriches the data dimensions that can be used for prediction, and helps to improve the accuracy and reliability of predictions. An external influencing factor mapping function is introduced and considered in the feature enhancement process. Specifically, by quantifying the factors and integrating them into the final comprehensive feature vector, not only the sensitivity of the model to changes in the external environment is enhanced, but also its ability to respond to emergencies is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0061] Figure 1 This is a flow chart of the highway toll station traffic prediction method in Example 1.

[0062] Figure 2 Schematic diagram of the highway toll station traffic prediction system in Example 1. DETAILED DESCRIPTION

[0063] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.

[0064] Example 1

[0065] Reference Figure 1 and Figure 2 , which is the first embodiment of the present invention, and provides a method for predicting traffic flow at a highway toll station, comprising the following steps:

[0066] S1. Collect multi-source heterogeneous traffic data from cameras, radars, GPS and historical records, and perform pre-processing operations such as denoising, format conversion, time alignment and standardization.

[0067] The specific steps include:

[0068] In order to fully capture the traffic dynamics in the toll station area, multi-source heterogeneous data is collected, including: toll gate video image data, lane radar detection data, GPS data, license plate recognition data, and historical traffic data;

[0069] High-definition cameras are used to collect video image data at toll gates. These cameras not only have high-resolution imaging capabilities, but also can transmit continuous video streams in real time to facilitate subsequent accurate analysis of visual features such as traffic density and queue length;

[0070] Use Doppler radar detection equipment to collect lane radar detection data. Install Doppler radar on each lane to monitor the speed and spacing of vehicles. This radar can provide high-frequency and high-precision speed measurement results and can effectively distinguish different vehicles on adjacent lanes, thus providing reliable data support for the calculation of parameters such as speed distribution and minimum distance;

[0071] The roadside unit (RSU) using the Internet of Vehicles technology is used to receive and collect GPS data sent by the on-board unit (OBU). The RSU establishes a connection with the moving vehicle through a wireless communication protocol to obtain its geographic location information and other attributes. This process not only increases the diversity of data sources, but also provides the possibility of understanding the specific driving path of the vehicle and its changes.

[0072] Use license plate recognition cameras to collect license plate number data of every vehicle passing through the toll booth. Using advanced optical character recognition (OCR) technology, the license plate information can be quickly and accurately read and converted into a structured data format for further processing and correlation analysis.

[0073] Use the data warehouse of local storage to collect historical traffic data, which is irreplaceable for identifying periodic patterns, trends and abnormal events;

[0074] After completing the collection of multi-source heterogeneous traffic data, pre-processing operations are performed;

[0075] For video image data, advanced image processing algorithms are used for pre-processing to remove noise interference and enhance image quality;

[0076] For radar detection data, filter technology is applied to smooth signal fluctuations and improve data stability;

[0077] For license plate recognition data, deep learning-driven image enhancement and character recognition algorithm preprocessing is used to improve the accuracy and robustness of OCR reading;

[0078] For GPS data, we use advanced geographic information GIS algorithms for pre-processing, coordinate correction and trajectory optimization to ensure high accuracy and continuity of location information;

[0079] For historical traffic data, a method combining time series analysis and data cleaning is used for preprocessing to improve the consistency and integrity of the data;

[0080] During the preprocessing process, all multi-source heterogeneous traffic data are converted into a unified standard format and a common time reference point is found so that each record can be accurately mapped to a specific timestamp for time alignment. The entire preprocessing stage aims to eliminate redundancy and inconsistency in the data, create conditions for the next step, feature extraction, and ensure the quality and reliability of the input data.

[0081] S2. Through feature extraction, effective features related to traffic flow prediction are extracted from the preprocessed multi-source heterogeneous traffic data, including features of traffic density, queue length, average vehicle speed, and length of vehicle travel path.

[0082] The specific steps include:

[0083] For the pre-processed toll gate video image data, a convolutional neural network is used to extract visual features such as traffic density and queue length. Each frame of the image is traversed through a sliding window mechanism to identify and locate the vehicle position, calculate the number of vehicles per unit area to evaluate the traffic density, extract traffic density features, and use a bounding box detection algorithm to determine the queue vehicle sequence on each lane. The distance from the end of the queue to the toll booth is measured to quantify the queue length and extract the features of the queue length.

[0084] For the lane radar detection data after preprocessing, the Fourier transform technology is applied to extract the frequency domain characteristics of the average speed and minimum distance of the vehicle. The speed signal in the form of a time series is converted into a frequency spectrum, and the dominant frequency components are identified. These frequencies reflect the distribution of the average speed of the vehicle, and the average speed characteristics of the vehicle are extracted. By analyzing the change rate of the spacing between adjacent vehicles, the peak position corresponding to the minimum distance is found in the frequency domain, the shortest safe following distance is obtained, and the frequency domain characteristics of the minimum distance are extracted;

[0085] For the pre-processed vehicle GPS data, the spatial features such as the length and direction change rate of the vehicle's driving path are extracted with the help of geographic information GIS tools. The actual driving trajectory of the vehicle is reconstructed according to the longitude and latitude coordinates, the total mileage of the entire journey is calculated, and the length feature of the vehicle's driving path is extracted. The direction change rate is obtained by taking the derivative of the azimuth difference between the two points where the vehicle turns, and the characteristics of the direction change rate are extracted;

[0086] For the pre-processed license plate recognition data, continue to use OCR optical character recognition technology to deeply extract the license plate number features, perform secondary enhancement processing on the original image, including denoising and edge sharpening to improve character clarity, use the deep learning model to re-analyze the license plate image, especially to remedy the blurry and partially blocked situations, and extract the license plate number features by comparing with the standard template in the existing database;

[0087] For the preprocessed historical traffic data, the regression integral moving average model is used to extract the periodic and trend characteristics. The three components of long-term trend, seasonal fluctuation and random error are separated based on the time series decomposition technology, so as to construct the regression integral moving average model respectively. For the trend item, the linear regression equation is constructed to fit the overall trend of change over time. For the periodic item, the Fourier series expansion method is used to capture the recurring patterns. Finally, the local mean is calculated through the sliding window mechanism, the short-term fluctuations are smoothed, and the periodic and trend characteristics are extracted.

[0088] S3. Map the extracted features into a common feature space, perform feature fusion through standardization, dimensionality reduction, covariance analysis and UMAP algorithm mapping, and generate a comprehensive feature vector that can comprehensively reflect the traffic conditions.

[0089] The specific steps include:

[0090] Different types of multi-source heterogeneous traffic data come from a wide range of sources, with different numerical ranges and dimensions. In order to eliminate the impact of such differences, all extracted features are standardized. Specifically, the Z-score standardization method is used to convert each feature value into a standard normal distribution with a mean of 0 and a standard deviation of 1, ensuring the comparability of data from different sensors and data sources and reducing the errors that may be caused by differences in numerical ranges. Through standardization, all features can be compared on the same scale, thereby improving the accuracy of subsequent analysis;

[0091] After completing the standardization process, the next key step is to apply the principal component analysis (PCA) technique to reduce the feature dimension. Considering that there may be a lot of redundant information in the collected raw data, the unnecessary complexity can be removed by dimensionality reduction while retaining the main direction of change.

[0092] The standardized and PCA processed features are combined to generate a covariance matrix, and the eigenvalues ​​and corresponding eigenvectors of the covariance matrix are obtained. The eigenvectors corresponding to the first few largest eigenvalues ​​are selected as principal components to construct an initial low-dimensional feature matrix. This step effectively projects the high-dimensional features into a lower-dimensional space while retaining most of the original information, which not only simplifies the data structure but also enhances computational efficiency and explanatory power.

[0093] After generating the initial low-dimensional feature matrix, the key eigenvectors are identified. Through in-depth analysis of the initial low-dimensional feature matrix, the eigenvectors that can represent the main variation direction of the data are found. At the same time, the covariance matrix is ​​feature decomposed to find the key eigenvectors. These key eigenvectors are not only the main driving factors of data changes, but also can assist in analyzing the internal connections between features, further compressing the feature space without losing important information, and ensuring the quality and accuracy of feature mapping in subsequent steps;

[0094] Using the identified key feature vectors, a low-dimensional feature matrix is ​​constructed and mapped into a common feature space by using the UMAP algorithm;

[0095] By configuring the UMAP algorithm parameters and selecting the appropriate number of neighbors and target dimension, the appropriate separation between the data points of the low-dimensional feature matrix is ​​ensured, and a neighbor graph is constructed to capture local similarities. At the same time, the UMAP algorithm minimizes the difference in local probability distribution between high-dimensional and low-dimensional spaces by optimizing the embedding space, and adjusts the data point positions of the low-dimensional feature matrix until they are optimal. Finally, after the low-dimensional feature matrix is ​​mapped to the common feature space, each point in the matrix obtains a new coordinate representation. These coordinates are not only close to the actual physical meaning, but can also be effectively compared and combined in the common feature space, laying a solid foundation for feature fusion.

[0096] In order to fully consider the importance of different features, the low-dimensional feature matrices mapped to the common feature space are fused, and different weights are assigned to each feature. All features are fused according to their respective weights to obtain a comprehensive vector.

[0097] The process of obtaining the comprehensive vector is not just a simple weighted average, but a fine adjustment based on the importance and relevance of the features, including giving higher weights to the features that are crucial in traffic flow prediction, such as traffic density and vehicle speed, and appropriately reducing the weights of minor features. This not only improves the representativeness of the comprehensive feature vector, but also better captures the dynamic changes of traffic flow. Its mathematical expression is:

[0098] ;

[0099] in represents the comprehensive feature vector, represents the mixing ratio, Indicates the number of feature types, represents the index of the feature, Indicates The weight of the class feature, Indicates The low-dimensional representation of class features in a common feature space, Represents the covariance matrix Middle Line The elements of the column, represents a small constant to prevent the denominator from being zero, represents the function after feature enhancement, represents the feature enhancement strength parameter, Represents the mapping function value of external influencing factors;

[0100] above The expression of the feature enhancement function is:

[0101] ;

[0102] in Represents the comprehensive value of multiple features after weighted summation and standardization. represents the feature enhancement strength parameter, Indicates the mapping function value of the influencing factors;

[0103] The final generated comprehensive feature vector not only enhances the consistency and compatibility of feature representation, but also provides high-quality data support for subsequent traffic prediction tasks.

[0104] S4. Construct an initial traffic network graph based on the actual highway network structure, define the node attributes and edge weights of the initial traffic network graph based on the comprehensive feature vector, generate a traffic network graph, and design a STGATwE model based on the traffic network graph that includes a graph attention layer and a spatiotemporal convolutional layer.

[0105] The specific steps include:

[0106] An initial traffic network diagram is established based on the actual topological structure of the highway and the location of toll stations. Each toll station is represented as a node, and the connection between road sections is represented as an edge. In order to ensure that the network diagram can truly reflect the actual situation of the road network, the location of all toll stations is accurately marked using geographic information GIS tools, and the road section connection is drawn according to the official highway map. A detailed initial traffic network diagram is constructed, which not only covers the main highway trunk lines, but also includes the various toll stations and the connection relationship between them.

[0107] According to the characteristics of traffic density, average vehicle speed and path length in the comprehensive feature vector, the attributes of the nodes in the traffic network graph are initialized. Specifically, for each toll station node, the traffic density value in different time periods is assigned to reflect the busyness of the node at a specific time point. At the same time, the average vehicle speed attribute is set to measure the speed of vehicles passing through the node. In addition, the path length feature is also taken into consideration to reflect the distance from one node to another. The initialization of these attributes enables each node to carry rich dynamic information, which enhances the ability of the initialized traffic network graph to express the actual traffic conditions.

[0108] The weight of each edge of the initial traffic network diagram is defined according to the speed and driving path characteristics in the comprehensive feature vector. The weight of the edge directly reflects the traffic mobility and accessibility between road sections. By combining the average vehicle speed and driving path characteristics, the traffic efficiency of each road section is obtained. For example, when the average vehicle speed of a certain road section is high and the path is short, the corresponding edge weight will be larger, indicating that this road section is easier to pass. On the contrary, if there is congestion or the path is long, the edge weight will be reduced accordingly. By using the comprehensive vector to generate a weighted traffic network diagram, the weight of each edge not only reflects the physical distance, but also includes the impact of real-time traffic status;

[0109] Based on the constructed traffic network graph, the STGATwE model is constructed in the deep learning framework using the graph attention mechanism and spatiotemporal convolution technology. The construction steps are as follows:

[0110] The overall architecture of the initial model is defined in the deep learning framework TensorFlow. This architecture integrates graph convolution layers, graph attention layers, and spatiotemporal convolution layers to ensure that the spatial and temporal characteristics of the traffic network can be fully captured. Each module is responsible for processing different types of feature information, providing a solid foundation for subsequent traffic prediction.

[0111] A graph attention mechanism is introduced into the initial model to capture the interactive relationship between nodes in the traffic network graph. Through the graph attention layer, the model can adaptively assign different weights to the connections between nodes and focus on those parts that are important for traffic prediction. Specifically, for each pair of connected nodes, the attention coefficient between the nodes is obtained to reflect the importance between the nodes. The attention coefficients are then normalized to ensure that the sum of all attention coefficients is 1, and the output of each node is the weighted average of the features of its neighboring nodes. Finally, the feature representation of each node is updated by weighted summation, so that the initial model can better understand the relationship between each node and its surrounding environment.

[0112] The spatiotemporal convolution technology was added to the initial model. The spatiotemporal convolution layer combines graph convolution in the spatial dimension and time series convolution in the time dimension. It can process spatial and temporal information at the same layer. The interaction information between nodes is extracted through multiple layers of graph convolution layers, and then time series convolution is applied to process time series data. For example, causal convolution is used to ensure that the initial model only depends on data from the past and current moments to avoid future information leakage. In addition, in order to better integrate spatiotemporal information, residual connections are added to the output of each layer, so that the initial model can learn long-term dependencies more stably. A gating mechanism, including GRU and LSTM units, is introduced to control the information flow and enhance the memory capacity of the initial model.

[0113] By stacking multiple layers of graph attention layers and spatiotemporal convolutional layers, the initial model is generated into a deep STGATwE model. Each layer gradually enhances the model's ability to understand complex traffic networks, making the final output more accurate.

[0114] S5. The STGATwE model is trained using the comprehensive feature vector. The training steps are back propagation and forward propagation. The model parameters are adjusted in combination with the loss function optimization technology. After multiple rounds of iterative training, the trained STGATwE model is obtained.

[0115] The specific steps include:

[0116] The comprehensive feature vector is input into the pre-built STGATwE model, and the model training process is started. The two key steps of forward propagation and back propagation are performed. Forward propagation means that the comprehensive feature vector passes through each layer of the model in sequence and outputs the prediction result, while back propagation is to calculate the loss value based on the difference between the prediction result and the actual label, and adjust the model parameters accordingly. Through training, the STGATwE model can gradually improve its accuracy of traffic prediction in each iteration;

[0117] During the training of the STGATwE model, the loss function is used to calculate the loss value and quantify the difference between the predicted value and the true value. The specific steps are as follows:

[0118] During training, the comprehensive feature vector is input into the STGATwE model, and forward propagation is performed to obtain the predicted value. For each comprehensive feature vector sample, its true flow value is recorded, and then the mean square error formula is used to calculate the loss of the comprehensive feature vector sample, which is:

[0119] ;

[0120] in Indicates The loss value of the comprehensive feature vector sample, Indicates the STGATwE model for the The predicted flow value of the comprehensive feature vector samples, Indicates The real flow measurement value of the comprehensive feature vector samples, that is, the known historical flow data;

[0121] The loss value of each comprehensive feature vector sample is calculated through the formula, and then the average loss value of all comprehensive feature vector samples is obtained, which provides a basis for subsequent parameter adjustment;

[0122] After completing a round of forward propagation and calculating the loss value, the Adam optimizer is used to adjust the model parameters. The Adam optimizer combines the advantages of momentum gradient descent and adaptive learning rate. In each round of iteration, the performance of the current model is first evaluated by calculating the gradient of the loss function relative to the current model parameters to help understand the impact of each parameter on the final loss value. Then, based on this gradient information, the Adam optimizer uses an adaptive learning rate method to assign a dynamically adjusted learning step to each parameter. This method takes into account historical gradient information, so that the learning rate can be automatically adjusted according to different parameters to obtain the optimal solution. Specifically, the Adam optimizer will The first-order moment estimate of each parameter, i.e., the mean of the gradient, and the second-order moment estimate, i.e., the mean of the square of the gradient, are calculated, and the accuracy of the early iterations is ensured by bias correction. Then, using these estimates, the Adam optimizer determines the specific update step size of each parameter, thereby achieving effective adjustment of the parameters. Finally, the parameter update operation is performed according to the calculated update step size, and the model parameters are gradually optimized. This series of steps is repeated in each iteration until the preset stop condition is met, such as reaching the maximum number of iterations or the change in the loss value is less than the set threshold. In this way, the Adam optimizer can effectively find the optimal parameter configuration during the training process and improve the prediction performance of the model.

[0123] After adjusting the parameters, in order to prevent the STGATwE model from overfitting during the training process, regularization technology is applied. By introducing additional constraints, including adding a penalty term proportional to the weight size to the loss function, the model complexity is limited, and the parameters are reduced so that the model focuses more on the basic patterns of the data rather than noise. Specifically, an L2 regularization term is added to the loss function to penalize larger parameter values, prompting the model to adopt a simpler solution. In addition, the early stopping method is used, that is, the training is terminated in advance when the performance on the validation set no longer improves, avoiding overfitting of the training data, ensuring that the model has good generalization ability and can perform stably on unseen data;

[0124] The STGATwE model has undergone multiple rounds of iterations through continuous training. Each round includes all the above steps: inputting a comprehensive feature vector, performing forward propagation and back propagation, calculating loss values, adjusting model parameters, and applying regularization techniques. As the number of iterations increases, the model gradually learns to extract useful information from the comprehensive feature vector and accurately predict the traffic conditions at highway toll stations. Finally, after sufficient training and parameter adjustment, an optimized and trained STGATwE model is obtained, which enhances the ability to understand complex traffic conditions and lays a solid foundation for subsequent real-time traffic prediction tasks.

[0125] S6. Input the multi-source heterogeneous traffic data collected in real time into the trained STGATwE model to obtain the traffic prediction results.

[0126] The specific steps include:

[0127] The multi-source heterogeneous traffic data collected in real time are input into the trained STGATwE model to predict the traffic flow at highway toll stations. In order to more accurately capture the changes in traffic conditions, a comprehensive expression is introduced to calculate the final traffic flow prediction value. The construction of this expression involves the following key operations;

[0128] According to different time and space conditions, different weights are assigned to various features of multi-source heterogeneous traffic data collected in real time. By considering different time periods of the day, including peak hours and off-peak hours, and geographical locations, including urban central areas and suburbs, the importance of features can be flexibly adjusted. For example, during peak hours, traffic density and average speed are more important, while during off-peak hours, weather conditions or events are more decisive.

[0129] Extract feature vectors from multi-source heterogeneous data collected in real time. Each feature vector carries a specific type of traffic information, such as traffic density and average vehicle speed. These feature vectors are direct inputs after preprocessing and reflect the real-time status of the traffic network.

[0130] The feature enhancement technology is used to further optimize the original feature vector to improve its representation ability. The feature enhancement strength parameter controls the degree of enhancement, so that the model can adjust the importance of the feature according to the actual situation. For example, for those features that are very important in specific situations, including local congestion caused by emergencies, the role can be emphasized by increasing the strength parameter.

[0131] Taking into account the impact of external factors including weather and special events on traffic flow, the concepts of mixed ratio and external influencing factor mapping are introduced to quantify the role of these factors. This step enhances the adaptability of the model to changes in the external environment. For example, if heavy rain is forecast, it may reflect the impact of rainfall on road capacity, while the mixed ratio and external influencing factor mapping concepts determine the proportion of this impact in the overall prediction;

[0132] Different weights are set for features at different scale levels to reflect their relative importance in the overall prediction. This multi-scale analysis method enables the model to fully consider local and global traffic characteristics. For example, local traffic conditions in a short period of time, including congestion in front of a toll station, and regional traffic patterns over a long period of time, including the traffic flow distribution of the entire city, can all receive appropriate attention.

[0133] Putting all the relevant information together, we can generate the expression:

[0134] ;

[0135] in ;

[0136] in, represents the traffic volume at the highway toll station, represents the STGATwE model, Indicates the number of feature types, An index representing the type of feature. represents the spatiotemporal dynamic weight, Indicates the extracted feature vectors, represents the eigenvalue after feature enhancement, represents the feature enhancement strength parameter, represents the mixing ratio, Represents the mapping function value of external influencing factors, represents a set of different scale levels and their corresponding weights, Represents the total number of different scale levels, each Indicates a specific scale level, is the weight of the scale level;

[0137] Specifically The value of the spatiotemporal dynamic weight is 0.9. The value of the feature enhancement strength parameter is 0.5, The value of the mixing ratio is 0.3. For features at different scale levels, the weight of local features is 0.7, the weight of regional features is 0.8, the weight of the global feature is 0.5;

[0138] The final output is the predicted highway toll station traffic, which represents the quantitative value of the number of vehicles and traffic volume passing through the toll station in a specific time period, and also includes the prediction results of traffic trend, peak hour prediction and potential congestion warning information;

[0139] This prediction result is not only based on multi-source heterogeneous traffic data collected in real time, but also combines multiple factors such as spatiotemporal dynamic weights, feature enhancement, and external influencing factors to provide a comprehensive assessment of the current traffic conditions. In addition, the model's predictive ability is also reflected in its ability to predict traffic changes in the future, thereby providing strong support for the management and scheduling of highway toll stations.

[0140] This embodiment also provides a highway toll station flow prediction system, including: a preprocessing module, a feature extraction module, a fusion module, a model building module, a model training module, and a flow prediction module;

[0141] Preprocessing module, feature extraction module, fusion module, model building module, model training module, traffic prediction module;

[0142] The preprocessing module is used to collect multi-source heterogeneous traffic data from cameras, radars, GPS and historical records, and perform preprocessing operations such as denoising, format conversion, time alignment and standardization;

[0143] The feature extraction module is used to extract effective features related to traffic flow prediction from the pre-processed multi-source heterogeneous traffic data, including features of traffic density, queue length, average vehicle speed, and length of vehicle travel path;

[0144] The fusion module is used to map the extracted features into a common feature space, perform feature fusion through standardization, dimensionality reduction, covariance analysis and UMAP algorithm mapping, and generate a comprehensive feature vector that can comprehensively reflect the traffic conditions;

[0145] The model building module is used to build an initial traffic network graph according to the actual highway network structure, define the node attributes and edge weights of the initial traffic network graph based on the comprehensive feature vector, generate the traffic network graph, and design the STGATwE model including the graph attention layer and the spatiotemporal convolution layer based on the traffic network graph;

[0146] The model training module is used to train the STGATwE model using the comprehensive feature vector. The training steps are back propagation and forward propagation. The model parameters are adjusted in combination with the loss function optimization technology. After multiple rounds of iterative training, the trained STGATwE model is obtained.

[0147] The traffic prediction module is used to input the multi-source heterogeneous traffic data collected in real time into the trained STGATwE model to obtain the traffic prediction results.

[0148] This embodiment also provides a computer device, which is applicable to the method for predicting traffic flow at highway toll stations, and includes: a memory and a processor; the memory is used to store computer executable instructions, and the processor is used to execute computer executable instructions to implement the method for predicting traffic flow at highway toll stations as proposed in the above embodiment.

[0149] The computer device may be a terminal, and the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.

[0150] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the method for predicting the traffic flow at a highway toll station as proposed in the above embodiment is implemented; the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, referred to as EPROM), programmable read-only memory (Programmable Red-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0151] In summary, the present invention constructs a more comprehensive and accurate data set for subsequent analysis by collecting and integrating various types of traffic information such as high-definition camera videos, Doppler radar detection, GPS signals received by RSU, license plate recognition camera images, and historical traffic data stored locally. This method greatly enriches the data dimensions that can be used for prediction, and helps to improve the accuracy and reliability of predictions. The external influencing factor mapping function is introduced and considered in the feature enhancement process. Specifically, the external factors are quantified and integrated into the final comprehensive feature vector, which not only enhances the model's sensitivity to changes in the external environment, but also improves its ability to respond to emergencies.

Claims

1. A method for predicting traffic flow at a highway toll station, characterized in that: include: Collect multi-source heterogeneous traffic data from cameras, radars, GPS and historical records, and perform pre-processing operations such as denoising, format conversion, time alignment and standardization; The pre-processed multi-source heterogeneous traffic data is extracted through feature extraction to extract effective features related to traffic flow prediction, including traffic density, queue length, average vehicle speed and vehicle travel path length; The extracted features are mapped to a common feature space, and feature fusion is performed through standardization, dimensionality reduction, covariance analysis and UMAP algorithm mapping to generate a comprehensive feature vector that can comprehensively reflect the traffic conditions; the following steps include: standardizing the extracted features; after standardization, applying PCA technology to project high-dimensional features into the feature space; combining the features processed by standardization and PCA technology to generate a covariance matrix, and identifying key feature vectors based on the covariance matrix; using the key feature vectors to construct a low-dimensional feature matrix, and mapping the low-dimensional feature matrix to a common feature space through the UMAP algorithm; fusing the low-dimensional feature matrix mapped to the common feature space, assigning different weights to the features in each low-dimensional feature matrix, and fusing all features according to their respective weights to obtain a comprehensive feature vector, which is expressed as follows: ; in represents the comprehensive feature vector, Indicates the mixing ratio when features are fused. Indicates the number of feature types, represents the index of the feature, Indicates The weight of the class feature, Indicates The low-dimensional representation of class features in a common feature space, Represents the covariance matrix Middle Line The elements of the column, represents a small constant to prevent the denominator from being zero, represents the function after feature enhancement, represents the feature enhancement strength parameter, Represents the mapping function value of external influencing factors; The expression of the feature enhancement function is: ; in Represents the comprehensive value of multiple features after weighted summation and standardization; According to the actual highway network structure, an initial traffic network graph is constructed. The node attributes and edge weights of the initial traffic network graph are defined based on the comprehensive feature vector to generate a traffic network graph. Based on the traffic network graph, a STGATwE model including a graph attention layer and a spatiotemporal convolution layer is designed. The STGATwE model is trained using the comprehensive feature vector. The training steps are back propagation and forward propagation. The model parameters are adjusted by combining the loss function optimization technology. After multiple rounds of iterative training, the trained STGATwE model is obtained. The multi-source heterogeneous traffic data collected in real time is input into the trained STGATwE model to obtain the traffic prediction results.

2. The method for predicting traffic flow at a highway toll station as claimed in claim 1, characterized in that: The multi-source heterogeneous traffic data from cameras, radars, GPS and historical records are collected, and pre-processed by denoising, format conversion, time alignment and standardization. The specific steps are as follows: Use high-definition cameras to collect video image data at toll gates; Use Doppler radar to collect lane radar detection data; Use RSU to receive and collect GPS data from OBU; Use license plate recognition cameras to collect license plate recognition data; Use local storage to collect historical traffic data; The collected multi-source heterogeneous traffic data is preprocessed by denoising, format conversion and time alignment to obtain the preprocessed multi-source heterogeneous traffic data.

3. The method for predicting traffic flow at a highway toll station as claimed in claim 2, characterized in that: The pre-processed multi-source heterogeneous traffic data is extracted through feature extraction to extract effective features related to traffic flow prediction, including features of traffic density, queue length, average vehicle speed and length of vehicle travel path. The specific steps are as follows: The convolutional neural network is used to extract the features of traffic density and queue length from the preprocessed toll gate video image data. The pre-processed lane radar detection data is used to extract the frequency domain features of the vehicle average speed and minimum distance using Fourier transform; For the pre-processed vehicle GPS data, GIS tools are used to extract the characteristics of the length and direction change rate of the vehicle's driving path; For the pre-processed license plate recognition data, use OCR technology to extract the license plate number features; For the preprocessed historical traffic data, the regression integral moving average model is used to extract the periodicity and trend characteristics.

4. The method for predicting traffic flow at a highway toll station as claimed in claim 1, characterized in that: The initial traffic network graph is constructed according to the actual highway network structure, the node attributes and edge weights of the initial traffic network graph are defined based on the comprehensive feature vector, the traffic network graph is generated, and the STGATwE model including the graph attention layer and the spatiotemporal convolution layer is designed based on the traffic network graph. The specific steps are as follows: Based on the actual topological structure of the highway and the location of toll stations, an initial traffic network diagram is established, where each toll station is represented as a node and the connections between road sections are represented as edges; Initialize the attributes of the nodes in the traffic network graph according to the characteristics of traffic density, average vehicle speed and path length in the comprehensive feature vector; According to the speed and driving path characteristics in the comprehensive feature vector, the weight of each edge of the initial traffic network diagram is defined to generate the traffic network diagram; Based on the traffic network graph, the STGATwE model is constructed in a deep learning framework using graph attention mechanism and spatiotemporal convolution technology.

5. The method for predicting traffic flow at a highway toll station as claimed in claim 4, characterized in that: The STGATwE model is trained using a comprehensive feature vector. The training steps are back propagation and forward propagation. The model parameters are adjusted in combination with the loss function optimization technology. After multiple rounds of iterative training, the trained STGATwE model is obtained. The specific steps are as follows: The comprehensive feature vector is input into the STGATwE model and the forward propagation and back-propagation steps are performed for training; When the STGATwE model is trained, a loss function is used to measure the difference between the traffic prediction value of the STGATwE model and the known traffic measurement value in the historical data. The loss of each comprehensive feature vector sample is calculated by the mean square error, and the losses of all comprehensive feature vector samples are averaged to obtain the loss value. After obtaining the loss value, the Adam optimizer is used to adjust the model parameters. By calculating the gradient of the loss function relative to the model parameters, the model is subjected to gradient descent using the adaptive learning rate adjustment method. In each iteration, the Adam optimizer first calculates the loss gradient under the current parameter settings, and then adjusts the learning step size of each parameter according to the unique adaptive learning rate mechanism of the Adam algorithm, and performs parameter updates to adjust the model parameters. The STGATwE model with adjusted parameters is subjected to regularization technology to prevent overfitting. A penalty term proportional to the weight size is added to the loss function to limit the complexity of the model parameters, simplify the model structure, reduce the parameters, and generate an optimized and trained STGATwE model after multiple rounds of iterative training.

6. The method for predicting traffic flow at a highway toll station as claimed in claim 5, characterized in that: The multi-source heterogeneous traffic data collected in real time is input into the trained STGATwE model to obtain the traffic prediction results. The specific steps are as follows: Collect the latest multi-source heterogeneous traffic data, input the trained STGATwE model, and predict the traffic flow at highway toll stations. The expression is: ; in ; in, represents the traffic volume at the highway toll station, represents the STGATwE model, Indicates the number of feature types, An index representing the type of feature. represents the spatiotemporal dynamic weight, Indicates the extracted feature vectors, represents the eigenvalue after feature enhancement, represents the feature enhancement strength parameter, It represents the mixing ratio when the eigenvalue after feature enhancement is combined with the external influencing factors. Represents the mapping function value of external influencing factors, represents a set of different scale levels and their corresponding weights, Represents the total number of different scale levels, each Indicates a scale level, is the weight of this scale level.

7. A highway toll station flow prediction system, based on the highway toll station flow prediction method according to any one of claims 1 to 6, characterized in that: Including preprocessing module, feature extraction module, fusion module, model building module, model training module, traffic prediction module, The preprocessing module is used to collect multi-source heterogeneous traffic data from cameras, radars, GPS and historical records, and perform preprocessing operations such as denoising, format conversion, time alignment and standardization; The feature extraction module is used to extract effective features related to traffic flow prediction from the pre-processed multi-source heterogeneous traffic data, including features of traffic density, queue length, average vehicle speed and length of vehicle travel path; The fusion module is used to map the extracted features into a common feature space, perform feature fusion through standardization, dimensionality reduction, covariance analysis and UMAP algorithm mapping, and generate a comprehensive feature vector that can comprehensively reflect the traffic conditions; The model building module is used to build an initial traffic network graph according to the actual highway network structure, define the node attributes and edge weights of the initial traffic network graph based on the comprehensive feature vector, generate the traffic network graph, and design the STGATwE model including the graph attention layer and the spatiotemporal convolution layer based on the traffic network graph; The model training module is used to train the STGATwE model using the comprehensive feature vector. The training steps are back propagation and forward propagation. The model parameters are adjusted in combination with the loss function optimization technology. After multiple rounds of iterative training, the trained STGATwE model is obtained. The traffic prediction module is used to input the multi-source heterogeneous traffic data collected in real time into the trained STGATwE model to obtain the traffic prediction results.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the highway toll station traffic prediction method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the highway toll station flow prediction method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Traffic prediction method and system based on elastic learning framework

    CN112216101A

  • Expressway toll station flow prediction method and system

    CN117809456A