High-speed blocking point prediction method and system based on gridding Transform model
Through the high-speed bottleneck prediction method based on the grid-based Transformer model, the problem of low efficiency of high-speed bottleneck prediction in the existing technology is solved, efficient and accurate bottleneck prediction is achieved, and calculation and storage costs are reduced.
Patent Information
- Application Number
- CN202411732825.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-11
AI Technical Summary
In the prior art, when high-speed bottleneck prediction models process high-latitude traffic data, the computing resources and storage space are demanding, resulting in increased training time and cost and low prediction efficiency.
The high-speed bottleneck prediction method based on the grid Transformer model is adopted. By obtaining the gantry feedback data and operator data, the first and second eigenvectors are determined, the target eigenvector matrix is matched, and the convolutional network is used to extract features and fuse them with the grid features, the target feature parameters are generated, and the Transformer model is input to predict.
It reduces the storage space requirements of the model, simplifies the calculation process, improves the efficiency of high-speed bottleneck prediction, reduces costs, and provides accurate bottleneck prediction results.
Smart Images

Figure CN119599213A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of highway congestion prediction, and in particular to a highway congestion prediction method and system based on a gridded Transformer model. Background Art
[0002] With the increase in the number of vehicles and the continuous changes in traffic demand, highway traffic congestion has become a common phenomenon, especially during holidays, which has a huge impact on driving costs, environmental pollution, accident probability, and travel time. Therefore, using the monitoring data of various monitoring points on highways and data from many toll stations, big data algorithms can scientifically predict road congestion. Travelers can reasonably arrange their time and routes based on this, improve travel efficiency and economic benefits, and reduce potential safety accidents.
[0003] In the existing technology, some deep learning theories have been proposed for predicting highway congestion conditions, and they can predict traffic flow under different periods, weather conditions, and traffic conditions during holidays. However, this method is more dependent on objective data such as weather, which causes errors in the subsequent prediction model, resulting in the accuracy of the prediction results not meeting the current prediction accuracy requirements. In addition, spatiotemporal prediction based on traditional Transformer model technology has been proposed, in which the data is a two-dimensional data set containing time and space information. This requires a large amount of computing resources and storage space when the model processes such a high-dimensional data set, which increases training time and cost, and is prone to low efficiency in predicting highway congestion conditions. Summary of the invention
[0004] The embodiments of the present application provide a method and system for predicting highway congestion points based on a gridded Transformer model, which are used to solve the problem of low efficiency of the model in predicting highway congestion conditions.
[0005] The first aspect of the embodiment of the present application provides a method for predicting highway congestion points based on a gridded Transformer model, comprising:
[0006] Obtaining data on non-congested traffic from several gantries and data on congested traffic from traffic operators;
[0007] Determine a first feature vector based on the data of traffic being in a non-congested state fed back by the plurality of gantries and the data of traffic being in a congested state provided by the traffic operator;
[0008] Performing regional grid division based on the highway map and determining the second eigenvector;
[0009] Matching the first eigenvector and the second eigenvector to obtain a target eigenvector matrix;
[0010] Extracting features from the target feature vector matrix through a convolutional network, fusing the extracted feature vector with the second feature vector to obtain target feature parameters;
[0011] The target feature parameters are input into the Transformer model to generate highway congestion prediction results.
[0012] Furthermore, the expression of the first eigenvector is as follows:
[0013]
[0014] Where: D x,y,t is the traffic state vector of coordinate (x, y) at time t, The traffic state vector of the congestion coordinate (x, y) at time t provided by the traffic operator, is the traffic state vector of the non-congested coordinates (x, y) at time t fed back by several gantries, is the time set when the coordinate (x, y) is congested, is the time set when the coordinate (x, y) is not congested.
[0015] Furthermore, the expression of the second eigenvector is as follows:
[0016]
[0017] Where: For the kth x , k y The grid is divided into two parts, Δx is the latitude accuracy of the grid or the step length along the latitude coordinate axis, Δy is the longitude accuracy of the grid or the step length along the longitude coordinate axis, a is the starting longitude coordinate value, and c is the starting latitude coordinate value.
[0018] Furthermore, matching the first eigenvector and the second eigenvector to obtain a target eigenvector matrix includes:
[0019] Filtering the feature representations of all highway nodes in the second feature vector;
[0020] The first feature vector is matched sequentially with the feature representations of all the highway nodes.
[0021] Furthermore, the expression of the target feature vector matrix is as follows:
[0022]
[0023] Where: is the traffic feature vector matrix, N(k) is Mk The number of roads in the grid, M k Feature set representation of the N(k)th road in the grid.
[0024] Furthermore, the extracting features of the target feature vector matrix by using a convolutional network includes:
[0025] The expression of the grid structure of the convolutional network is as follows:
[0026]
[0027] X l =conv(X l―1 ,W l );
[0028]
[0029] Where: X 0 is the initial input, X l is the input of the lth layer, W l is the convolution kernel of the lth layer, is the input of the last layer, is the one-dimensional vector of the last layer, conv(X l―1 ,W l ) is the input X to the l-1th layer l―1 Use the convolution kernel W l Perform convolution operation, is the input X to the last layer l―1 Perform a flattening operation.
[0030] Furthermore, the target feature parameters are input into the Transformer model to generate highway congestion prediction results, including:
[0031] Determine the time series corresponding to the target characteristic parameters, and determine the highway congestion prediction result by predicting the time series at a certain moment.
[0032] A second aspect of the embodiment of the present application provides a high-speed congestion prediction system based on a gridded Transformer model, including:
[0033] A data acquisition unit, used for acquiring data of a non-congested traffic state fed back by several gantries and data of a congested traffic state provided by a traffic operator;
[0034] A first feature vector determination unit, configured to determine a first feature vector based on data of traffic being in a non-congested state fed back by the plurality of gantries and data of traffic being in a congested state provided by a traffic operator;
[0035] A second eigenvector determining unit, configured to perform regional grid division based on the highway map and determine a second eigenvector;
[0036] a target feature vector determination unit, configured to match the first feature vector with the second feature vector to obtain a target feature vector matrix;
[0037] A target feature parameter determination unit, configured to extract features from the target feature vector matrix through a convolutional network, and fuse the extracted feature vector with the second feature vector to obtain a target feature parameter;
[0038] The highway congestion point prediction result generating unit is used to input the target feature parameters into the Transformer model to generate the highway congestion point prediction result.
[0039] A third aspect of the embodiments of the present application provides a computer device, including:
[0040] memories, transceivers, processors, and bus systems;
[0041] Wherein, the memory is used to store programs;
[0042] The processor is used to execute the program in the memory, including executing the methods of the above aspects;
[0043] The bus system is used to connect the memory and the processor so that the memory and the processor can communicate with each other.
[0044] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on a computer, enables the computer to execute the methods provided in the above aspects.
[0045] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0046] This application first determines the first eigenvector based on the data of traffic in a non-congested state fed back by several gantries and the data of traffic in a congested state provided by traffic operators; then the regional grid is divided according to the highway map to obtain the second eigenvector, the first eigenvector and the second eigenvector are matched to obtain the target eigenvector matrix; then the target eigenvector matrix is subjected to feature extraction through a convolutional network, the extracted eigenvector is fused with the second eigenvector to obtain the target feature parameters, and finally the parameters are input into the Transformer model for prediction to obtain the final jam prediction result. This application constructs a grid model, fuses the grid model with traffic data, obtains grid-based road features, and inputs the fused feature data into the Transformer model for prediction, so that the prediction data is focused on a few grids, does not require too much storage space, reduces costs and improves prediction efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 It is a schematic diagram of an embodiment of a method for predicting highway congestion points based on a gridded Transformer model in the present invention;
[0048] Figure 2 A schematic diagram of the traffic state feature vector modeling and calculation process in the present invention;
[0049] Figure 3 It is a schematic diagram of the grid modeling calculation process in the present invention;
[0050] Figure 4 Schematic diagram of the feature vector data matching operation steps in the present invention;
[0051] Figure 5 It is a schematic diagram of the road feature data fusion operation steps in the present invention;
[0052] Figure 6 Schematic diagram of convolutional network feature extraction in the present invention;
[0053] Figure 7 Schematic diagram of convolutional grid feature fusion in the present invention;
[0054] Figure 8 This is a schematic diagram of Transformer model prediction in the present invention;
[0055] Fig. 9 It is a schematic diagram of the structure of an embodiment of a high-speed congestion prediction system based on a gridded Transformer model in the present invention;
[0056] Fig.10 The figure is a structural block diagram of a computer device in the present invention. DETAILED DESCRIPTION
[0057] In the embodiment of the present application, the highway congestion prediction method based on the gridded Transformer model is used to improve the prediction efficiency of highway congestion. In the embodiment of the present application, the implementation method can be implemented in the system, can be implemented in the server, and can also be implemented in the terminal, without specific limitation.
[0058] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "corresponding to" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0059] Embodiment 1
[0060] See also Figure 1 The present invention provides a method for predicting high-speed traffic jams based on a gridded Transformer model, and the method comprises the following steps:
[0061] S11. Obtaining data on non-congested traffic provided by several gantries and data on congested traffic provided by traffic operators;
[0062] In this embodiment, the data on traffic being in a non-congested state obtained from feedback from several gantries include the traffic data of the gantries, such as the gantry number, geographic information data, and vehicle information such as the license plate number, vehicle type, and vehicle color of the passing vehicles; the data on traffic being in a congested state provided by the traffic operator includes congestion status data, such as the congested road section, congestion time, and congested vehicle information.
[0063] Specifically, the data obtained is a data set collected in real time by the system link gantry and the traffic operator system. The quality of the data set will directly affect the effectiveness and accuracy of the prediction. In the process of collecting data on the congested and non-congested states of highways, due to interference from factors such as the environment, data transmission process, and collection equipment, the collected data sets may have problems such as missing data, data redundancy, and data anomalies. Therefore, after the data sets are collected, the data needs to be preprocessed to remove missing feature values, duplicate data, and abnormal data. Finally, the selected data is used as the data basis for subsequent predictions.
[0064] S12. Determine a first feature vector based on data from several gantry feedback indicating that the traffic is in a non-congested state and data from traffic operators indicating that the traffic is in a congested state;
[0065] In this embodiment, the first feature vector is a traffic state feature vector, which is obtained by fusing the data fed back by the gantry and the data provided by the operator. The data fusion here is multi-source heterogeneous data fusion based on different time series feature data, where multi-source heterogeneous data is data from different sources, different structures, and different time series. Therefore, the corresponding first feature vector representation is standardized time series fusion data.
[0066] For a time window T at coordinate point (x, y) x,y , the calculation process is as follows Figure 2 The specific expression is as follows:
[0067]
[0068] Where: D x,y,t is the traffic state vector of coordinate (x, y) at time t, The traffic state vector of the congestion coordinate (x, y) at time t provided by the traffic operator, is the traffic state vector of the non-congested coordinates (x, y) at time t fed back by several gantries, is the time set when the coordinate (x, y) is congested, is the time set when the coordinate (x, y) is not congested.
[0069] S13. Perform regional grid division based on the highway map and determine the second eigenvector;
[0070] In this embodiment, the second feature vector is a gridded highway feature data vector, where the highway feature data may include the number of lanes, undulating road sections, multi-curve road sections, or road feature data with frequent accidents. First, assuming that the highway map can be represented as a set of points M, then the highway map is divided into K grids, such as Figure 3 As shown in the figure, the Nanning highway map is divided into K grids, with M grids. k is the grid-based highway feature vector, and the calculation expression is as follows:
[0071]
[0072] Where: For the kth x , k yGrids are divided into grids, Δx is the latitude accuracy of the grid or the step length along the latitude coordinate axis, Δy is the longitude accuracy of the grid or the step length along the longitude coordinate axis, a is the starting longitude coordinate value, c is the starting latitude coordinate value, and the grid M k The index can be obtained by k x ,k y The product of k = k x *k y .
[0073] S14. Match the first eigenvector and the second eigenvector to obtain a target eigenvector matrix;
[0074] In this embodiment, obtaining the target feature vector matrix also includes the following steps:
[0075] 1. Filter the feature representations of all highway nodes in the second feature vector;
[0076] 2. Match the first feature vector to the feature representations of all highway nodes in sequence.
[0077] Specifically, in M k In the grid, there are N(k) roads. The feature representation of all nodes in the N(k) roads is screened, that is, the coordinate set of the i-th road is expressed as The first eigenvector (traffic state vector) D x,y,t Match the feature representations of all nodes in sequence Get the target feature vector, that is, the traffic feature vector Until all N(k) roads are matched, such as Figure 4 As shown, we get the Kth grid feature matrix at time t. Assume that for each road Has its own road feature vector Therefore, it can be combined with the traffic feature vector Splicing and fusing road feature data, such as Figure 5 As shown, the road feature vector matrix after matching and fusion is obtained, and the expression is as follows:
[0078]
[0079] Where: is the traffic feature vector matrix, N(k) is M k The number of roads in the grid, M k Feature set representation of the N(k)th road in the grid.
[0080] S15. Extract features from the target feature vector matrix through a convolutional network, and fuse the extracted feature vector with the second feature vector to obtain target feature parameters;
[0081] A convolutional network is established to extract features from the k-th grid feature matrix. Its network structure can be expressed by the following recursive formula:
[0082]
[0083] X l =conv(X l―1 ,W l )(Convolutional layer)
[0084]
[0085] Where: X 0 is the initial input, X l is the input of the lth layer, W l is the convolution kernel of the lth layer, is the input of the last layer, is the one-dimensional vector of the last layer, conv(X l―1 ,W l ) is the input X to the l-1th layer l―1 Use the convolution kernel W l Perform convolution operation, is the input X to the last layer l―1 Perform a flattening operation to turn it into a one-dimensional vector. The specific steps are as follows Figure 6 shown.
[0086] Assume that for each grid M k , has its own grid eigenvector Therefore, it can be combined with the feature vector extracted by convolution feature Splice and fuse grid feature data, such as weather data, geographic information data and other grid geographic features. The specific steps are as follows Figure 7 As shown in the figure, using the fused grid feature data as the target input parameter of the prediction model for subsequent prediction operations can improve the matching ability between data and model and the efficiency of model training.
[0087] S16. Input the target feature parameters into the Transformer model to generate highway congestion prediction results.
[0088] In this embodiment, the target feature parameters are input into the Transformer model to generate highway congestion prediction results, including:
[0089] Determine the time series corresponding to the target characteristic parameters, and determine the highway congestion prediction results by predicting the time series at a certain moment.
[0090] After determining the target parameters, the target parameters are input into the Transformer model for prediction. Specifically, for the kth sub-block, assuming that there is a time window [0, ξ―1], the data is grid-modeled, the traffic state feature vector is matched with the road feature vector to obtain the target feature vector, and the vector output after the convolutional network feature extraction is On the time window, a set of time series can be formed Then through Figure 8 The Transformer model shown predicts the time series at [ξ,T] The time series As the input of the model, it is encoded by the encoder, the time series entities and relationships are identified, and then decoded by the decoder, and finally the time series of the corresponding time is output. That is, the highway congestion status data and road data at the time [ξ, T] can be directly predicted, so as to determine the relevant information of the congestion point.
[0091] The above embodiment constructs a grid model based on the highway map, fuses the traffic status data with the road feature data to obtain the model representation, and further processes the input parameters of the model, thereby reducing the storage space of the model prediction, simplifying the calculation process of the model prediction, and effectively improving the efficiency of highway congestion prediction. In addition, based on the determination of the above time series, in addition to being able to predict traffic congestion points, other road features can also be predicted, providing an effective and accurate data basis for the traffic management department to deal with them in a targeted manner, thereby improving the efficiency of traffic operation management.
[0092] Embodiment 2
[0093] See also Fig. 9 An embodiment of a high-speed congestion prediction system based on a gridded Transformer model in the present invention includes the following steps:
[0094] A data acquisition unit 101 is used to acquire data of traffic being in a non-congested state fed back by several gantries and data of traffic being in a congested state provided by traffic operators;
[0095] A first feature vector determination unit 102, configured to determine a first feature vector based on data of traffic being in a non-congested state fed back by a plurality of gantries and data of traffic being in a congested state provided by a traffic operator;
[0096] A second feature vector determination unit 103, configured to perform regional grid division based on the highway map and determine a second feature vector;
[0097] A target feature vector determination unit 104 is used to match the first feature vector with the second feature vector to obtain a target feature vector matrix;
[0098] A target feature parameter determination unit 105 is used to extract features from a target feature vector matrix through a convolutional network, and fuse the extracted feature vector with the second feature vector to obtain a target feature parameter;
[0099] The highway congestion point prediction result generating unit 106 is used to input the target feature parameters into the Transformer model to generate a highway congestion point prediction result.
[0100] For the specific definition of the system, please refer to the definition of the method above, which will not be repeated here. Each module in the above system can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0101] Embodiment 3
[0102] See also Fig.10 The present invention provides a computer device, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor. When the processor executes the computer-readable instructions, the steps of the above method are implemented.
[0103] Those of ordinary skill in the art will appreciate that the units of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition of each example has been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0104] In the embodiments provided by the present invention, it should be understood that the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units can be combined into one unit, one unit can be split into multiple units, or some features can be ignored. In addition, each functional unit in each embodiment of the present invention can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0105] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-0nlyMemory), random access memory (RAM, RandomAccessMemory), mobile hard disk, magnetic disk or optical disk, etc., which can store program code.
[0106] It can be understood that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be included in the scope of the claims and specification of the present invention.
Claims
1. A highway congestion prediction method based on a gridded Transformer model, characterized in that: include: Obtaining data on non-congested traffic from several gantries and data on congested traffic from traffic operators; Determine a first feature vector based on the data of traffic being in a non-congested state fed back by the plurality of gantries and the data of traffic being in a congested state provided by the traffic operator; Performing regional grid division based on the highway map and determining the second eigenvector; Matching the first eigenvector and the second eigenvector to obtain a target eigenvector matrix; Extracting features from the target feature vector matrix through a convolutional network, fusing the extracted feature vector with the second feature vector to obtain target feature parameters; The target feature parameters are input into the Transformer model to generate highway congestion prediction results.
2. The method for predicting highway congestion points based on a gridded Transformer model according to claim 1, characterized in that: The expression of the first eigenvector is as follows: Where: D x,y,t is the traffic state vector of coordinate (x, y) at time t, The traffic state vector of the congestion coordinate (x, y) at time t provided by the traffic operator, is the traffic state vector of the non-congested coordinates (x, y) at time t fed back by several gantries, is the time set when the coordinate (x, y) is congested, is the time set when the coordinate (x, y) is not congested.
3. The highway congestion prediction method based on the gridded Transformer model according to claim 1 is characterized in that: The expression of the second eigenvector is as follows: Where: For the kth x , k y The grid is divided into two parts, Δx is the latitude accuracy of the grid or the step length along the latitude coordinate axis, Δy is the longitude accuracy of the grid or the step length along the longitude coordinate axis, a is the starting longitude coordinate value, and c is the starting latitude coordinate value.
4. The method for predicting highway congestion points based on a gridded Transformer model according to claim 1, characterized in that: The matching the first eigenvector and the second eigenvector to obtain a target eigenvector matrix includes: Filtering the feature representations of all highway nodes in the second feature vector; The first feature vector is matched sequentially with the feature representations of all the highway nodes.
5. The method for predicting highway congestion points based on a gridded Transformer model according to claim 4 is characterized in that: The expression of the target eigenvector matrix is as follows: Where: is the traffic feature vector matrix, N(k) is M k The number of roads in the grid, M k The feature set representation of the N(k)th road in the grid.
6. The method for predicting highway congestion points based on a gridded Transformer model according to claim 1, characterized in that: The extracting features of the target feature vector matrix by using a convolutional network includes: The expression of the grid structure of the convolutional network is as follows: X l =conv(X l―1 ,W l ); Where: X 0 is the initial input, X l is the input of the lth layer, W l is the convolution kernel of the lth layer, is the input of the last layer, is the one-dimensional vector of the last layer, conv(X l―1 ,W l ) is the input X to the l-1th layer l―1 Use the convolution kernel W l Perform convolution operation, is the input X to the last layer l―1 Perform a flattening operation.
7. The method for predicting highway congestion points based on a gridded Transformer model according to claim 6, characterized in that: The step of inputting the target feature parameters into the Transformer model to generate a highway congestion prediction result includes: Determine the time series corresponding to the target characteristic parameters, and determine the highway congestion prediction result by predicting the time series at a certain moment.
8. A high-speed congestion prediction system based on a gridded Transformer model, characterized in that: include: A data acquisition unit, used for acquiring data of a non-congested traffic state fed back by several gantries and data of a congested traffic state provided by a traffic operator; A first feature vector determination unit, configured to determine a first feature vector based on data of traffic being in a non-congested state fed back by the plurality of gantries and data of traffic being in a congested state provided by a traffic operator; A second eigenvector determining unit, configured to perform regional grid division based on the highway map and determine a second eigenvector; a target feature vector determination unit, configured to match the first feature vector with the second feature vector to obtain a target feature vector matrix; A target feature parameter determination unit, configured to extract features from the target feature vector matrix through a convolutional network, and fuse the extracted feature vector with the second feature vector to obtain a target feature parameter; The highway congestion point prediction result generating unit is used to input the target feature parameters into the Transformer model to generate the highway congestion point prediction result.
9. A computer device, characterized in that: include: memories, transceivers, processors, and bus systems; Wherein, the memory is used to store programs; The processor is used to execute the program in the memory, including executing the highway congestion prediction method based on the gridded Transformer model according to any one of claims 1 to 7; The bus system is used to connect the memory and the processor so that the memory and the processor can communicate with each other.
10. A readable storage medium, characterized in that: The method comprises instructions which, when executed on a computer, enable the computer to execute the highway congestion prediction method based on a gridded Transformer model as described in any one of claims 1 to 7.