Traffic volume prediction method based on multi-layer complex network and multi-head self-attention mechanism
Through multi-layer complex networks and multi-head self-attention mechanisms, the problem of lack of traffic flow detection equipment on highway sections is solved, traffic volume prediction with spatio-temporal correlation is achieved, and prediction accuracy and computing efficiency are improved.
Patent Information
- Application Number
- CN202411116648.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-08-15
AI Technical Summary
Existing traffic volume prediction methods are difficult to achieve accurate short-term traffic volume prediction on road sections lacking traffic flow detection equipment, and traditional methods lack consideration of spatiotemporal correlation and have high computational complexity.
A traffic volume prediction method based on multi-layer complex networks and multi-head self-attention mechanisms is adopted. By constructing a structure network, a weight network, a starting point-destination network and a transit time network, combined with historical data, the self-attention mechanism is used for model training and prediction. Fully consider the spatial and temporal correlation of traffic.
It improves the accuracy of traffic volume prediction and can achieve accurate prediction with a small amount of data. It combines traffic theoretical knowledge and machine learning to enhance prediction capabilities.
Smart Images

Figure CN118629218B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of traffic volume prediction, and specifically relates to a traffic volume prediction method based on a multi-layer complex network and a multi-head self-attention mechanism. Background Art
[0002] In transportation infrastructure, highways, as key traffic channels, carry a large amount of traffic flow. Accurate traffic volume forecasting is a necessary condition for effectively managing and optimizing traffic flow. However, the lack of traffic flow detection equipment on certain sections of roads is a huge obstacle to accurately predicting short-term traffic volume.
[0003] Methods for short-term traffic volume prediction can generally be divided into two categories: model-driven and data-driven.
[0004] Model-driven methods include time series models and filter models, time series models such as ARIMA and its variants, filter models such as Kalman filter, particle filter, etc., and hybrid models that combine time series and filter methods. In general, parameter models have the following shortcomings: first, they have strong conditional assumptions and require real-time statistics of road traffic observations; second, they make separate predictions for each observation location and lack spatial correlation considerations.
[0005] Data-driven methods can be divided into traditional machine learning methods and deep learning methods. Traditional machine learning methods such as classification regression tree, K nearest neighbor and SVM are applied to road traffic prediction. In addition, some studies also use Bayesian methods, KNN, RNN, LSTM, etc. Deep learning methods such as CNN and Transformer, etc. Under normal circumstances, data-driven models need to be based on traffic big data. The data lacks spatial correlation considerations, requires a large amount of data to extract its features, and has high computational complexity. Summary of the invention
[0006] The main purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art, and to provide a traffic volume prediction method based on a multi-layer complex network and a multi-head self-attention mechanism, which combines domain knowledge with machine learning technology, uses complex network theory to capture and analyze the spatiotemporal correlation in traffic data, and uses a self-attention mechanism for model training and prediction, thereby improving the level of accurate prediction of road section traffic volume.
[0007] In order to achieve the above object, the present invention adopts the following technical solutions:
[0008] One aspect of the present invention provides a traffic volume prediction method based on a multi-layer complex network and a multi-head self-attention mechanism, comprising the following steps:
[0009] Get node traffic volume;
[0010] Constructing a multi-layer complex network, selecting the predicted section and the parallel section of the predicted section as the reference section, and calculating the characteristic value sequence of the node according to the path selection attribute and the time attribute of reaching the reference section for the start-end traffic volume between the nodes; the multi-layer complex network includes a structure network, a weight network, a start-end network and a travel time network;
[0011] Taking the network location of the predicted road section as the center, the surrounding nodes are clustered by weighted Kmeans according to the characteristic value sequence of the nodes to divide the traffic zones; the node traffic volume is converted into the zone traffic volume through the traffic zones;
[0012] The self-attention mechanism prediction network is trained by combining the traffic volume of the community with the historical road section data;
[0013] The node traffic volume to be predicted is converted through traffic cells and input into the trained self-attention mechanism prediction network to predict the traffic volume of the road section.
[0014] As a preferred technical solution, the structural network is represented as: G =( V , E ),in, G Represents the structural network; entrances, exits and interchanges are nodes. V ={ v 1, v 2,…, v n} indicates that the network n A collection of nodes; v i To Node v j Directed segments e ij For the edge, E express m Directed segment e ij =( v i , v j )'s collection.
[0015] As a preferred technical solution, the weight network uses a generalized cost function to characterize the travel cost of a road section, specifically:
[0016] ;
[0017] In the formula, Directed road segment e ij The weight of K ηijFor car models or On a directed path e ij of highway tolls; d η Is the model or The unit distance operating cost includes fuel consumption, tire wear and vehicle repair costs; L ij It is a directed path e ij Mileage; is the traveler’s time value; T ij The vehicle is on a directed road segment e ij Travel time in free flow conditions; v ij is the traffic volume of the road section, C ij is the road section capacity; α , β A parameter representing the expected travel time.
[0018] As a preferred technical solution, the origin-destination network is used to characterize the travel information of the vehicle in the road network, including the license plate number, vehicle model, starting point, destination, departure time and arrival time.
[0019] As a preferred technical solution, the travel time network is used to characterize the average travel time of vehicles on a road section, specifically:
[0020] ;
[0021] In the formula, is the travel time of the road section; T ij The vehicle is on a directed road segment e ij Travel time in free flow conditions; v ij is the traffic volume of the road section, C ij is the road section capacity; α , β A parameter representing the expected travel time.
[0022] As a preferred technical solution, the characteristic value sequence of the node is calculated based on the path selection attribute and the time attribute of reaching the reference section, specifically:
[0023] ;
[0024] ;
[0025] ;
[0026] in, d ( i ) is a node i The travel time to the predicted road section and parallel road sections; p ( i ) is a node i The probability of selecting the predicted road section and the parallel road section in the travel route selection, express p ( i ) meets the constraint that the probability sum is 1, where st Indicates constraints; m is the number of center points of parallel sections including the predicted section, c is the number of parallel segments including the predicted segment.
[0027] As a preferred technical solution, the division of traffic zones is specifically as follows:
[0028] According to the node i The travel time to the predicted road section and parallel road sections d ( i ) and nodes i The probability of selecting the predicted road segment and the parallel road segment in the travel route selection p ( i ) These two feature value sequences are used to divide traffic zones using the weighted Kmeans clustering method, as shown in the following formula:
[0029] ;
[0030] ;
[0031] in, goal Used to identify the optimization objective function, argmin It is used to describe the value of the independent variable required when the minimum value of a function needs to be found. d ( X i ,V k ) is a node i With cluster k Euclidean distance to the centroid, X i and V k The nodes are i With cluster k The sequence of eigenvalues of the centroid, where X i include d ( i )and p ( i ),x is the node eigenvalue, v is the eigenvalue of the cluster centroid, x ij and v kj The nodes are i With cluster k The first j eigenvalues, C k It is a cluster k The set of internal nodes, N is the number of elements in the collection, K is the number of clusters, d 1 and d 2 represent the arrival time and the Euclidean distance of the path selection, respectively. l is the clustering attribute coefficient, m is the number of center points of parallel sections including the predicted section, c is the number of parallel segments including the predicted segment.
[0032] As a preferred technical solution, the self-attention mechanism prediction network includes an encoder for implementing the input sequence x =( x 1, ..., x n ) to the output sequence z =( z 1, ..., z n ), including input linear layer, self-attention mechanism, and output linear layer;
[0033] The self-attention mechanism includes a 2-layer self-attention network, each layer includes two sub-layers in turn, the first sub-layer includes multi-head attention and sum-normalization, the second sub-layer includes a feedforward network and sum-normalization, and each sub-layer has a residual connection.
[0034] As a preferred technical solution, the number of multi-head attention in the sub-layer of the self-attention mechanism is 2, that is, h =2, connected together by vector concatenation, the expression is as follows:
[0035] ;
[0036] ;
[0037] ;
[0038] Among them, Attention represents the self-attention function, Q is the query vector, K andV are the key vector and value vector of the dictionary data structure, respectively. K T express K The transpose of softmax represents the normalized exponential function; MultiHead represents the multi-head self-attention function, Concat is the vector concatenation function, head a Representative a The output of the head self-attention function, a ∈[1,…, h ]; , and Respectively represent a head Q , K , V The weight parameter matrix, Represents the weight parameter matrix of multi-head self-attention output, is the set of real numbers, d model The number of input features for multi-head attention, d q , d k , d v They are Q , K , V The vector dimension of h The number of longs for long attention.
[0039] Another aspect of the present invention further provides a traffic volume prediction system based on a multi-layer complex network and a multi-head self-attention mechanism, with node traffic volume as input and section predicted traffic volume as output, and applies the above-mentioned traffic volume prediction method based on a multi-layer complex network and a multi-head self-attention mechanism, including a multi-layer complex network, a traffic cell division module and a self-attention mechanism prediction network;
[0040] The multi-layer complex network includes a structure network, a weight network, a start-end network and a travel time network, which is used to select the predicted section and the parallel section of the predicted section as the reference section, and calculate the characteristic value sequence of the node according to the path selection attribute and the time attribute of reaching the reference section for the start-end traffic volume between the nodes;
[0041] The traffic cell division module is used to perform weighted Kmeans clustering on the surrounding nodes according to the characteristic value sequence calculated by the path selection attribute and the arrival time attribute of the benchmark section, and divide the traffic cells; the traffic cells are used to convert the node traffic volume into the cell traffic volume;
[0042] The self-attention mechanism prediction network takes the traffic volume of the traffic area obtained by traffic area conversion as input and the predicted road section traffic volume as output, including an input linear layer, a self-attention mechanism and an output linear layer; the self-attention mechanism includes two layers of self-attention networks, each layer includes two sublayers in turn, the first sublayer includes multi-head attention and sum-normalization, the second sublayer includes a feedforward network and sum-normalization, and each sublayer has a residual connection.
[0043] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0044] (1) This paper proposes a traffic volume prediction method based on basic complex networks and self-attention mechanism, taking the entrance node traffic volume as the model input and the predicted traffic volume of the road section as the model output, and realizes the dynamic traffic volume prediction of the highway section without the vehicle flow detection equipment installed. The model extracts the characteristic value sequence of the node based on the multi-layer complex network and forms the traffic zone through weight clustering, and uses the self-attention mechanism to predict the traffic volume. The advantage of the model is that it fully considers the spatiotemporal correlation of traffic and ensures the homogeneity of the traffic zone, thereby improving the accuracy of the model prediction; the model only needs a small amount of data training to achieve the prediction accuracy, and it also shows that the method of combining traffic theory knowledge with machine learning can effectively improve the fusion prediction ability.
[0045] (2) The present invention establishes a four-layer complex network for the highway network, including a road network, a weight network, an OD network, and a travel time network, thereby realizing a dynamic and vehicle-type-based characterization of the complex traffic network and reflecting the dynamic characteristics of actual traffic.
[0046] (3) The present invention considers the diversion effect of parallel sections for traffic volume prediction, takes the diversion characteristics as node attributes, and uses the distribution ratio as the characteristic value; at the same time, the time of impact of node traffic volume on the section is considered, and the time of arrival at the predicted section and the parallel section is taken as the node attribute, and the arrival time is taken as the characteristic value; the above two parts of the characteristic values are vectorized to form the node characteristic value. Its characteristic value is both a representation of the timeliness of traffic volume impact and a representation of traffic volume distribution.
[0047] (4) Traffic zone division method of the present invention. According to the node characteristic values, weighted Kmeans clustering is performed. The weight represents the influence of different node characteristic values on the classification. The larger the weight, the greater the influence on the clustering, and vice versa. Through weight optimization and adjustment, the homogeneity of nodes in the traffic zone is maximized, laying a foundation for accurately predicting the traffic volume of the road section.
[0048] (5) The present invention adopts a self-attention mechanism prediction network to predict the traffic volume of a road section. The input linear layer and the output sub-linear layer respectively realize the matching of the input and output data dimensions. The self-attention layer has two layers, and the number of heads of the multi-head scaling dot product attention is 2, so as to realize the accurate prediction of the traffic volume. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 It is a flow chart of a traffic volume prediction method based on a multi-layer complex network and a multi-head self-attention mechanism according to an embodiment of the present invention;
[0050] Figure 2 It is a schematic diagram of the structure of the self-attention mechanism prediction network of an embodiment of the present invention. DETAILED DESCRIPTION
[0051] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.
[0052] Example
[0053] like Figure 1 As shown, this embodiment provides a traffic volume prediction method based on a multi-layer complex network and a multi-head self-attention mechanism, with node traffic volume as input and section predicted traffic volume as output, including the following steps:
[0054] S1. Obtain node traffic volume.
[0055] S2. Construct a multi-layer complex network, select the predicted section and its parallel sections as the benchmark sections, and calculate the eigenvalue sequence of the nodes for the origin-destination (OD, Origin-Destination, which represents the starting and ending points of a trip in traffic engineering, and corresponds to the vehicles entering and leaving the highway network respectively) traffic volume between the nodes based on the path selection attributes and the time attribute of arriving at the benchmark section.
[0056] Furthermore, in this embodiment, a multi-layer complex network is a network composed of multiple single-layer complex networks, so that there are multiple attribute connection relationships between the elements. The multi-layer complex network can reflect the multi-attribute characteristics of the road network and make up for the one-sidedness of the single-layer network. According to the road structure, travel cost, traffic travel and travel time attributes, the corresponding structure network, weight network, origin-destination network (hereinafter referred to as OD network, Origin-Destination), and travel time network are formed. Four layers of complex networks provide multiple characteristics of the road network. The weight network, OD network and travel time network are affected by traffic demand and traffic status, thus showing dynamic change characteristics.
[0057] (1) Structural network. A highway consists of entrances and exits, interchanges, and road sections, which are abstracted into elements such as nodes and edges to form a structural network. Specifically, the structural network G =( V , E ) is composed of nodes and edges; entrances, exits, and interchanges are nodes. V ={ v 1, v 2,…, v n} is the network n A collection of nodes; v i To Node v j Directed segments e ij For the edge, E express m Directed segment e ij =( v i , v j )'s collection.
[0058] (2) The weight network uses a generalized cost function to characterize the travel cost of a road section. For expressways, it is composed of tolls, vehicle operating costs, and time value costs. The mathematical expression formula is as follows:
[0059] ;
[0060] In the formula, Directed road segment e ij The weight of K ηij For car models or On a directed path e ij of highway tolls; d η Is the model or The unit distance operating cost includes fuel consumption, tire wear and vehicle repair costs; L ij It is a directed path e ij Mileage; is the traveler’s time value; T ij The vehicle is on a directed road segment e ij Travel time in free flow conditions; v ij is the traffic volume of the road section, C ij is the road section capacity; α , β A parameter representing the expected travel time.
[0061] (3) The OD network is an expression of the vehicle’s origin, destination, departure time, and arrival time in the road network. The travel information of all vehicles constitutes the OD network. The vehicle’s trip information includes the license plate number, vehicle model, origin, destination, departure time, and arrival time.
[0062] (4) The travel time network is the average travel time of vehicles on the road section, and its value is determined by the design grade of the road and the traffic service level. Its mathematical expression formula is as follows:
[0063] ;
[0064] In the formula, is the travel time of the road section; T ij The vehicle is on a directed road segment e ij Travel time in free flow conditions; v ij is the traffic volume of the road section, C ij is the road section capacity; α , β A parameter representing the expected travel time.
[0065] S3. Taking the network position of the predicted road section as the center, weighted Kmeans clustering is performed on the surrounding nodes according to the characteristic value sequence of the nodes to divide the traffic cells; the node traffic volume is converted into the cell traffic volume through the traffic cells; wherein, a traffic cell consists of multiple nodes.
[0066] Furthermore, since the observed traffic volume data formed by the entry node has a sparse characteristic within the statistical period, in order to effectively process the data and reduce the difficulty of data processing, the observed traffic volume data is merged based on the traffic cell as a unit. The division of traffic cells follows the following principles: with the predicted section as the center, the closer the traffic cell is to the section, the smaller the node scale, and vice versa; considering the diversion effect of parallel sections, the diversion characteristics of parallel sections are used as node attributes (path selection attributes); considering the timeliness of analyzing the impact of the entry node traffic volume on the section, the time to reach the predicted section and the parallel section is used as the node attribute (time attribute to reach the benchmark section). The characteristic value sequence of the node is as follows:
[0067] ;
[0068] ;
[0069] ;
[0070] in, d ( i ) is a node i The travel time to the predicted road section and parallel road sections; p ( i ) is a node i The probability of selecting the predicted road section and the parallel road section in the travel route selection, express p ( i ) meets the constraint that the probability sum is 1, where st It is the abbreviation of subject to, which means constraint condition; m is the number of center points of parallel sections including the predicted section, c is the number of parallel segments including the predicted segment.
[0071] Furthermore, the division of traffic zones is specifically as follows:
[0072] According to the node d ( i )and p ( i ) two eigenvalues, the weighted Kmeans clustering method is used to divide the traffic zone. The weight represents the influence of different node eigenvalues on the classification. The larger the weight, the greater the influence on the clustering, and vice versa. Through weight optimization and adjustment, the homogeneity of nodes in the traffic zone is maximized, and the nodes in the traffic zone are similar in path selection and arrival time. Its mathematical expression is as follows.
[0073] ;
[0074] ;
[0075] Among them, goal is used to identify the optimization objective function. argmin It is used to describe the value of the independent variable required when the minimum value of a function needs to be found. d ( X i ,V k ) is a node i With cluster k Euclidean distance to the centroid, X i and V k The nodes are i With cluster k The sequence of eigenvalues of the centroid, where X i include d ( i )and p ( i ), x is the node eigenvalue, v is the eigenvalue of the cluster centroid, x ij and v kj The nodes are i With cluster k The eigenvalue sequence of the centroid j eigenvalues, C k It is a cluster k The set of internal nodes, N is the number of elements in the collection, K is the number of clusters, d 1 and d 2 represent the arrival time and the Euclidean distance of the path selection, respectively. l is the clustering attribute coefficient.
[0076] S4. The self-attention mechanism prediction network is trained by combining the community traffic volume with the historical road section data; the node traffic volume to be predicted is converted through the traffic community and input into the trained self-attention mechanism prediction network to predict the road section traffic volume.
[0077] Furthermore, the existing sequence neural network conversion model has a conventional encoder-decoder structure, such as Transformer, Seq2Seq, etc. After analysis, it is believed that the conventional structure is used for tasks such as translation, and the input and output of the model are in parallel. The traffic prediction problem solved by the present invention is to predict the actual traffic volume based on the traffic generation volume. The two are causally related. Therefore, the self-attention mechanism prediction network proposed in the present invention only retains the encoding structure and makes adaptive improvements, as shown in the following example. Figure 2 As shown, the encoder structure implements the input sequence ( x 1, ..., x n ) to the output sequence z = ( z 1,..., z n ), including input linear layer, self-attention mechanism and output linear layer. The self-attention mechanism consists of 2 layers, that is, Nx=2, each layer contains two sublayers in turn, the first sublayer consists of multi-head attention, sum-normalization, and the second sublayer consists of feedforward network, sum-normalization, and each sublayer has residual connection.
[0078] In the above self-attention mechanism prediction network, multi-head attention is an important module, and the number of multi-heads is 2, that is, h =2, connected together by vector splicing, the mathematical expression is as follows:
[0079] ;
[0080] ;
[0081] ;
[0082] Among them, Attention represents the self-attention function, Q is the query vector, K and V are the key vector and value vector of the dictionary data structure, respectively. K T express K The transpose of softmax represents the normalized exponential function; MultiHead represents the multi-head self-attention function, Concat is the vector concatenation function, head a Representative a The output of the head self-attention function, a ∈[1,…, h ]; , and Respectively represent a head Q , K , V The weight parameter matrix, Represents the weight parameter matrix of multi-head self-attention output, is the set of real numbers, d model The number of input features for multi-head attention, d q ,d k , d v They are Q , K , V The vector dimension of h The number of longs for long attention.
[0083] In another embodiment of the present application, a traffic volume prediction system based on a multi-layer complex network and a multi-head self-attention mechanism is provided, the system comprising a multi-layer complex network, a traffic cell division module, and a self-attention mechanism prediction network;
[0084] The multi-layer complex network is established for traffic network attributes such as road structure, travel cost, traffic travel and travel time, including structure network, weight network, OD network and travel time network, which is used to select the predicted section and its parallel section as the reference section, and calculate the characteristic value sequence of the node according to the path selection attribute and the time attribute of reaching the reference section for the OD traffic volume between the nodes;
[0085] The traffic cell division module is used to perform weighted Kmeans clustering on the surrounding nodes based on the characteristic value sequence calculated by the path selection attribute and the time attribute of reaching the benchmark road section with the location of the road section as the center, and divide the traffic cells, so that the probability of the node traffic volume in the same traffic cell entering the road network and the arrival time of the road section have similar characteristics; the traffic cell is used to convert the node traffic volume into the cell traffic volume, and a traffic cell includes multiple nodes;
[0086] The self-attention mechanism prediction network takes the traffic volume of the traffic area obtained by traffic area conversion as input and the predicted road section traffic volume as output, including an input linear layer, a self-attention mechanism, and an output linear layer; the self-attention mechanism includes 2 layers of self-attention networks, each layer includes two sublayers in turn, the first sublayer includes multi-head attention and summation-normalization, the second sublayer includes a feedforward network and summation-normalization, and each sublayer has a residual connection.
[0087] It should be noted here that the system provided in the above embodiment is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure is divided into different functional modules to complete all or part of the functions described above. The system is a traffic volume prediction method based on a multi-layer complex network and a multi-head self-attention mechanism applied to the above embodiment.
[0088] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0089] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.
Claims
1. A traffic volume prediction method based on a multi-layer complex network and a multi-head self-attention mechanism, characterized in that: The steps include: Get node traffic volume; Constructing a multi-layer complex network, selecting the predicted section and the parallel section of the predicted section as the reference section, and calculating the characteristic value sequence of the node according to the path selection attribute and the time attribute of reaching the reference section for the start-end traffic volume between the nodes; the multi-layer complex network includes a structure network, a weight network, a start-end network and a travel time network; Taking the network location of the predicted road section as the center, the surrounding nodes are clustered by weighted Kmeans according to the characteristic value sequence of the nodes to divide the traffic zones; the node traffic volume is converted into the zone traffic volume through the traffic zones; The self-attention mechanism prediction network is trained by combining the traffic volume of the community with the historical road section data; The node traffic volume to be predicted is converted through traffic cells and input into the trained self-attention mechanism prediction network to predict the traffic volume of the road section.
2. The traffic volume prediction method based on multi-layer complex network and multi-head self-attention mechanism according to claim 1 is characterized in that: The structural network is represented as: G =( V , E ),in, G Represents the structural network; entrances, exits and interchanges are nodes. V ={ v 1, v 2,…, v n } indicates that the network n A collection of nodes; v i To Node v j Directed segments e ij For the edge, E express m Directed segments e ij =( v i , v j )'s collection.
3. The traffic volume prediction method based on multi-layer complex network and multi-head self-attention mechanism according to claim 1 is characterized in that: The weight network uses a generalized cost function to characterize the travel cost of a road section, specifically: ; In the formula, For directed segments e ij The weight of K ηij For car models η On a directed path e ij of highway tolls; δ η Is the model η The unit distance operating cost includes fuel consumption, tire wear and vehicle repair costs; L ij It is a directed path e ij Mileage; is the traveler’s time value; T ij The vehicle is on a directed road segment e ij Travel time in free flow conditions; v ij is the traffic volume of the road section, C ij is the road section capacity; α , β A parameter representing the expected travel time.
4. The traffic volume prediction method based on multi-layer complex network and multi-head self-attention mechanism according to claim 1 is characterized in that: The origin-destination network is used to characterize the travel information of the vehicle in the road network, including the license plate number, vehicle type, starting point, destination, departure time and arrival time.
5. The traffic volume prediction method based on multi-layer complex network and multi-head self-attention mechanism according to claim 1 is characterized in that: The travel time network is used to characterize the average travel time of vehicles on a road section, specifically: ; In the formula, is the travel time of the road section; T ij The vehicle is on a directed road segment e ij Travel time in free flow conditions; v ij is the traffic volume of the road section, C ij is the road section capacity; α , β A parameter representing the expected travel time.
6. The traffic volume prediction method based on multi-layer complex network and multi-head self-attention mechanism according to claim 1 is characterized in that: The characteristic value sequence of the node is calculated based on the path selection attribute and the time attribute of reaching the reference section, specifically: ; ; ; in, d ( i ) is a node i The travel time to the predicted road section and parallel road sections; p ( i ) is a node i The probability of selecting the predicted road section and the parallel road section in the travel route selection, express p ( i ) meets the constraint that the probability sum is 1, where st Indicates constraints; μ is the number of center points of parallel sections including the predicted section, γ is the number of parallel segments including the predicted segment.
7. The traffic volume prediction method based on multi-layer complex network and multi-head self-attention mechanism according to claim 1 is characterized in that: The division of traffic zones is specifically as follows: According to the node i The travel time to the predicted road section and parallel road sections d ( i ) and nodes i The probability of selecting the predicted road segment and the parallel road segment in the travel route selection p ( i ) These two feature value sequences are used to divide traffic zones using the weighted Kmeans clustering method, as shown in the following formula: ; ; in, goal Used to identify the optimization objective function, argmin It is used to describe the value of the independent variable required when the minimum value of a function needs to be found. d ( X i ,V k ) is a node i With cluster k Euclidean distance to the centroid, X i and V k The nodes are i With cluster k The sequence of eigenvalues of the centroid, where X i include d ( i )and p ( i ), x ij and v kj The nodes are i With cluster k The first j eigenvalues, C k It is a cluster k The set of internal nodes, N is the number of elements in the collection, K is the number of clusters, d 1( X i ,V k )and d 2( X i ,V k ) represent the arrival time and the Euclidean distance of the path selection, respectively. λ is the clustering attribute coefficient, μ is the number of center points of parallel sections including the predicted section, γ is the number of parallel segments including the predicted segment.
8. The traffic volume prediction method based on multi-layer complex network and multi-head self-attention mechanism according to claim 1 is characterized in that: The self-attention mechanism prediction network includes an encoder for implementing the input sequence x =( x 1, ..., x n ) to the output sequence z = ( z 1, ..., z n ), including input linear layer, self-attention mechanism and output linear layer; The self-attention mechanism includes two layers of self-attention networks, each layer includes two sub-layers in turn, the first sub-layer includes multi-head attention and sum-normalization, the second sub-layer includes a feedforward network and sum-normalization, and each sub-layer has a residual connection.
9. The traffic volume prediction method based on multi-layer complex network and multi-head self-attention mechanism according to claim 8 is characterized in that: The number of multi-head attention in the sub-layer of the self-attention mechanism is 2, that is, h =2, connected together by vector concatenation, the expression is as follows: ; ; ; Among them, Attention represents the self-attention function, Q is the query vector, K and V are the key vector and value vector of the dictionary data structure, respectively. K T express K The transpose of softmax represents the normalized exponential function; MultiHead represents the multi-head self-attention function, Concat is the vector concatenation function, head a Representative a The output of the head self-attention function, a ∈[1,…, h ]; , and Respectively represent a head Q , K , V The weight parameter matrix, Represents the weight parameter matrix of multi-head self-attention output, is the set of real numbers, d model The number of input features for multi-head attention, d q , d k , d v They are Q , K , V The vector dimension of h The number of longs for long attention.
10. A traffic volume prediction system based on a multi-layer complex network and a multi-head self-attention mechanism, with node traffic volume as input and section predicted traffic volume as output, is characterized by: A traffic volume prediction method based on a multi-layer complex network and a multi-head self-attention mechanism as described in any one of claims 1 to 9, comprising a multi-layer complex network, a traffic zone division module, and a self-attention mechanism prediction network; The multi-layer complex network includes a structure network, a weight network, a start-end network and a travel time network, which is used to select the predicted section and the parallel section of the predicted section as the reference section, and calculate the characteristic value sequence of the node according to the path selection attribute and the time attribute of reaching the reference section for the start-end traffic volume between the nodes; The traffic cell division module is used to perform weighted Kmeans clustering on the surrounding nodes according to the characteristic value sequence calculated by the path selection attribute and the arrival time attribute of the benchmark section, and divide the traffic cells; the traffic cells are used to convert the node traffic volume into the cell traffic volume; The self-attention mechanism prediction network takes the traffic volume of the traffic area obtained by traffic area conversion as input and the predicted road section traffic volume as output, including an input linear layer, a self-attention mechanism and an output linear layer; the self-attention mechanism includes two layers of self-attention networks, each layer includes two sublayers in turn, the first sublayer includes multi-head attention and sum-normalization, the second sublayer includes a feedforward network and sum-normalization, and each sublayer has a residual connection.
Citation Information
Patent Citations
Time-space traffic flow prediction method based on hidden time-space feature mining
CN117496715A
Prediction device, prediction method, computer program product, and vehicle control system
US20210383213A1
