Urban road network traffic speed prediction method and related equipment

By adopting the STGAT-LSTM combination model in the traffic speed prediction of urban road networks and combining multi-source data and graph attention mechanisms, the problem of the neglected road network feature differences and insufficient utilization of multi-source data in the existing methods is solved, and higher traffic speed prediction accuracy and model applicability are achieved.

CN119626003APending Publication Date: 2025-03-14XI'AN UNIVERSITY OF ARCHITECTURE AND TECHNOLOGY
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411771813.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

The existing urban road network traffic speed prediction methods have problems such as the differences in road network characteristics being ignored, insufficient utilization of multi-source data, and room for improvement of model accuracy.

Method used

The urban road network traffic speed prediction method based on the STGAT-LSTM deep learning combination model is adopted. By collecting and preprocessing multi-source data, such as taxi GPS data, POI data, weather data and road attribute data, dynamic and static information matrix is ​​constructed, and a multi-graph fusion model is established for prediction, combined with the graph attention mechanism and long-term memory network, a multi-graph fusion model is established for prediction.

Benefits of technology

This method can not only effectively capture the spatial correlation and temporal correlation between road network nodes, but also improve the accuracy and practicality of traffic speed prediction, solving the shortcomings of existing methods in model applicability and accuracy improvement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119626003A_ABST
    Figure CN119626003A_ABST
Patent Text Reader

Abstract

The invention discloses an urban road network traffic speed prediction method and related equipment, and belongs to the technical field of urban road network traffic speed prediction.An urban road network traffic speed prediction model is established based on an STGAT-LSTM deep learning combination model, spatial correlation of static factors can be extracted based on a graph attention network, and the prediction accuracy of the urban road network traffic speed is improved. And the time correlation of dynamic factors is captured by using a long-short-term memory network, so that accurate prediction of the traffic speed of the urban road network is realized. The urban road network traffic speed prediction method provided by the invention enriches a road network traffic speed prediction method system, and effectively solves the problems that the existing research does not comprehensively consider influence factors in urban road network traffic speed prediction and the model is not widely applicable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of urban road network traffic speed prediction, and specifically relates to an urban road network traffic speed prediction method and related equipment. Background Art

[0002] As traffic problems caused by the growth of car ownership become increasingly serious, intelligent transportation systems (ITS) are developing rapidly based on big data and deep learning technologies. Traffic speed prediction, as one of its core research directions, improves prediction accuracy by mining the spatiotemporal characteristics of multi-source data, providing important support for traffic management and route optimization.

[0003] The existing technology has the following problems: The traditional urban road network traffic speed prediction has the following problems:

[0004] (1) Ignoring differences in road network characteristics and research limitations: Previous studies usually treat traffic speed prediction for different types of road networks (such as highways and urban roads) as the same task, ignoring the significant differences in their spatiotemporal characteristics. This approach may lead to significant differences in the results when the same prediction model is applied to different road networks. In addition, existing research on urban road network traffic speed prediction is mainly focused on megacities, with less attention and research on speed prediction for small and medium-sized urban road networks, leaving a research gap.

[0005] (2) Insufficient use of multi-source data: In traditional urban road network traffic speed prediction research, the influencing factors are not fully considered, and multi-source data such as urban POI information, weather conditions, and road static information are not fully utilized. With the advent of the big data era, it has become more convenient and real-time to obtain these diverse data, providing new opportunities for traffic speed prediction. Therefore, it is necessary to comprehensively utilize multi-source data such as urban POI data, weather information, and road attributes to improve the accuracy and practicality of the traffic speed prediction model.

[0006] (3) Model accuracy and room for improvement: Despite the continuous development of deep learning technology and data acquisition capabilities, the accuracy of existing traffic speed prediction models still has a lot of room for improvement. The academic community needs to use advanced deep learning models to continuously improve the accuracy of traffic speed prediction, thereby promoting the development of related theoretical research and improving the application effect of prediction models. Summary of the invention

[0007] The present invention provides a method for predicting the traffic speed of an urban road network and related equipment, which solves the problem that the influencing factors of the prediction of the traffic speed of an urban road network are not fully considered and the model is not widely applicable.

[0008] To achieve the above object, the present invention provides the following technical solutions:

[0009] A method for predicting urban road network traffic speed, comprising:

[0010] Collect multi-source data of urban road network and perform pre-processing;

[0011] Input the pre-processed urban road network multi-source data into the established urban road network traffic speed prediction model, and the urban road network traffic speed prediction model outputs the prediction result;

[0012] Among them, the urban road network traffic speed prediction model is established based on the STGAT-LSTM deep learning combination model.

[0013] Preferably, the steps of establishing the urban road network traffic speed prediction model are specifically as follows:

[0014] Collect multi-source data of urban road network and perform pre-processing;

[0015] The input features of the preprocessed urban road network multi-source data were screened to determine the number and dimensions of the input features required to establish the model. The screened features were then constructed into dynamic and static information matrices, which were then combined and fused into multiple graphs as input variables.

[0016] Based on the number and dimension of input features and input variables, the STGAT-LSTM deep learning combination model is constructed by combining the ATGAT and LSTM models.

[0017] Use dynamic and static information matrices to train the model and determine the optimal model function and parameters;

[0018] The trained model is applied to the traffic speed prediction of urban road networks, and the mean absolute error and root mean square error are used as evaluation indicators to evaluate the prediction accuracy. If the prediction accuracy is insufficient, the data set is retrained. If the prediction accuracy meets the requirements, the model is established.

[0019] Preferably, the multi-source data includes: taxi GPS data, POI data, weather data and road attribute data.

[0020] Preferably, the dynamic and static information matrix includes:

[0021] The distance matrix is ​​calculated by measuring the correlation of adjacent nodes:

[0022]

[0023] Where: d j is the distance between network nodes i and j; ε, σ 2 is a hyperparameter that controls the threshold of matrix distribution and sparsity; a j is the similarity weight between node i and node j;

[0024] Functional similarity matrix,The calculation formula of the functional similarity matrix is:

[0025]

[0026] Among them: A s(,j) is the element in the i-th row and j-th column of the functional similarity matrix, which represents the functional similarity between nodes, and its value range is A s (i, j)∈[0,1]; P v ,P vj is the static factor vector of the road network node i and node j, that is, the i-th and j-th rows of the static factor matrix S;

[0027] The connectivity matrix, measured by node connectivity, is calculated as:

[0028] A C (i,j)=maxx(0,conn(v i , v j ) K -A i,j )∈{0,1}

[0029] A c (,j) represents the connectivity matrix A c The element in the i-th row and j-th column in the conn(v,v) is 1, which means the two nodes are connected, and 0, which means they are not connected. j ) K is the connectivity function. If there is a path between node i and node j within K nodes, the value is 1, otherwise it is 0. j is the original adjacency matrix of the road network. If node i and node are adjacent nodes, it is 1, otherwise it is 0; max() represents the maximum value.

[0030] Preferably, the structure of each storage unit of the LSTM model is as follows: LSTM uses an input gate and a forget gate to control the access and forgetting of information, and after obtaining the forget gate output, the forget gate output is brought into the long short-term memory unit.

[0031] Preferably, the step of screening the input features of the pre-processed urban road network multi-source data is specifically as follows:

[0032] The Pearson correlation coefficient method is used to calculate the correlation between the static and dynamic factors of the urban road network, and the characteristics with the highest correlation with the road speed are selected;

[0033] Among them, the Pearson correlation coefficient method formula is:

[0034]

[0035] Where: X, Y are input variables, n is the sample size, μ x and μ y are the means of the two variables respectively;

[0036] The symbol E(.) represents the mathematical expectation, σ X and σ Y It represents the standard deviation of variables X and Y;

[0037] According to the correlation analysis results of different feature values ​​on road speed, the required features are screened out;

[0038] The model input features are constructed by constructing an adjacency matrix for feature combination. From the three perspectives of proximity, functional similarity and connectivity, a variety of adjacency matrices are constructed to characterize the spatial correlation of the road network.

[0039] Preferably, the STGAT model dynamically assigns different weights to nodes in the graph to better adapt to the dynamic changes of the weights of the road network nodes. The establishment of the STGAT model based on the attention mechanism includes the following steps:

[0040] First, the input layer inputs X h , X d and X w The output after the long short-term memory network is X h ′、X d ′ and X w ′, introduce a shared, learnable linear transformation, the role of this transformation is to map the input traffic speed feature sequence to a higher dimensional space, process the three inputs, and obtain the node traffic speed after dimension conversion. The sequence feature is;

[0041] Where: X h (Historical Features):

[0042] Represents the historical traffic speed data of a certain road section, which is time series data;

[0043] For example: traffic speed per minute over the past hour;

[0044] It is mainly used to capture temporal continuity, such as the change of traffic speed over time on a certain road section;

[0045] X d (Dynamic features):

[0046] Data that represents real-time dynamic changes of the day, such as current weather conditions, real-time traffic flow, etc.

[0047] Dynamic characteristics reflect short-term fluctuations, such as sudden changes in weather and fluctuations in traffic flow caused by traffic accidents;

[0048] X w (Periodic characteristics):

[0049] Data representing periodic patterns in traffic speed; for example, average traffic speed during a specific time period on a particular day of the week;

[0050] The attention scores, attention weights and node traffic speed features of the three input node traffic speed sequence features are calculated in turn;

[0051] A multi-head attention mechanism is added to the STGAT model to fuse the prediction results of the three inputs in the input layer to obtain the final prediction result.

[0052] A system for predicting traffic speed of an urban road network, comprising:

[0053] Data processing module: used to collect multi-source data of urban road network and perform pre-processing;

[0054] Prediction module: used to input the pre-processed urban road network multi-source data into the established urban road network traffic speed prediction model, and the urban road network traffic speed prediction model outputs the prediction result;

[0055] Among them, the urban road network traffic speed prediction model is established based on the STGAT-LSTM deep learning combination model.

[0056] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of a method for predicting traffic speed of an urban road network are implemented.

[0057] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a method for predicting traffic speed in an urban road network.

[0058] Compared with the prior art, the present invention has the following beneficial effects: the present invention provides a method for predicting the traffic speed of an urban road network. The urban road network traffic speed prediction model is established based on the STGAT-LSTM deep learning combination model. It can not only extract the spatial correlation of static factors based on the graph attention network, but also use the long short-term memory network to capture the temporal correlation of dynamic factors, thereby achieving accurate prediction of the traffic speed of the urban road network. The urban road network traffic speed prediction method proposed by the present invention enriches the road network traffic speed prediction method system and effectively solves the problem that the existing research on the prediction of urban road network traffic speed does not comprehensively consider the influencing factors and the model is not widely applicable. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1This is a flow chart of a method for predicting urban road network traffic speed according to the present invention;

[0060] Figure 2 This is a schematic diagram of the STGAT-LSTM combined model framework of the present invention;

[0061] Figure 3 Establish a flow chart for the STGAT-LSTM model of the present invention;

[0062] Figure 4 The present invention is a block diagram of a system for predicting urban road network traffic speed. DETAILED DESCRIPTION

[0063] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0064] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0065] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0066] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings.

[0067] like Figure 1 As shown, the present invention provides a method for predicting urban road network traffic speed, comprising:

[0068] S101 collects multi-source data of urban road networks and performs pre-processing;

[0069] S102 inputs the pre-processed urban road network multi-source data into the established urban road network traffic speed prediction model, and the urban road network traffic speed prediction model outputs the prediction result;

[0070] Among them, the urban road network traffic speed prediction model is established based on the STGAT-LSTM deep learning combination model.

[0071] Taxi GPS data, POI data, weather data, and road attribute data are collected and integrated to form a multi-source data set. The traffic speed of the urban road network is studied in depth, and the influence of spatiotemporal factors and weather factors are comprehensively considered to establish a multivariate feature data set. On this basis, the combined model of STGAT and LSTM deep learning (STGAT-LSTM) is used to predict the traffic speed of the urban road network.

[0072] like Figure 3 As shown, an embodiment of the present invention provides a process for establishing a STGAT-LSTM combination model, which includes:

[0073] Step 1. Data collection and preprocessing: Collect multi-source data of urban road networks, and use the pandas module to clean, convert and merge data;

[0074] Step 2. Feature construction: Construct a feature data set for prediction. First, calculate the correlation between the static and dynamic factors of the urban road network using the Pearson correlation coefficient method. Then, select the required features based on the correlation analysis results of different eigenvalues ​​on the road speed. Then, construct an adjacency matrix to combine the features and construct the model input features. ;

[0075] Step 3. Model construction: First, standardize the data, and then combine the advantages of GAT and LSTM to build the STGAT-LSTM deep learning combination model;

[0076] Step 4. Model training: Use the processed data set to train the model and determine the optimal network structure and parameters; the history sequence length is selected as 12; the number of hidden layer neurons is 64; the number of multi-head attention is selected as 4; Adam is used as the optimizer of the model, and the Smooth-L1 loss function is used as the loss function.

[0077] Step 5. Prediction and evaluation: The trained model is applied to the urban road network traffic speed prediction, and MAE and RMSE are used as evaluation indicators to evaluate the prediction accuracy.

[0078] Multi-source data collection:

[0079] The collected multi-source data include: taxi GPS data, POI data, weather data, and road attribute data.

[0080] Pearson correlation coefficient:

[0081]

[0082] Where: X, Y are input variables, n is the sample size, μ x and μ y are the means of the two variables.

[0083] Distance Matrix:

[0084]

[0085] Where: d j is the distance between network nodes i and j; ε, σ 2 is a hyperparameter that controls the threshold of matrix distribution and sparsity; a j is the similarity weight between node i and node j.

[0086] Functional similarity matrix:

[0087]

[0088] Among them: A s(,j) is the element in the i-th row and j-th column of the functional similarity matrix, which represents the functional similarity between nodes, and its value range is A s (i, j)∈[0,1]; P v , P vj is the static factor vector of road network node i and node j, that is, the i-th and j-th rows of the static factor matrix S.

[0089] Connectivity Matrix:

[0090] A C (i, j) = max(0, conn(v i , v j ) K -A i,j )∈{0,1}

[0091] A c (, j) represents the connectivity matrix A c The element in the i-th row and j-th column in the conn(v, v) is 1, which means the two nodes are connected, and 0, which means they are not connected. j ) K is the connectivity function. If there is a path between node i and node j within K nodes, the value is 1, otherwise it is 0. j is the original adjacency matrix of the road network. If node i and node are adjacent nodes, it is 1, otherwise it is 0; max() represents the maximum value. Here, the first-order connections are removed and only the first-order and above connections are retained.

[0092] STGAT model:

[0093] Dimension conversion. First, the input layer input X h , X d and X w The output after the long short-term memory network is X h ′、X d ′ and Xw ′. In order to further improve the level of features, a shared, learnable linear transformation is introduced. The role of this transformation is to map the input traffic speed feature sequence to a higher dimensional space. Since the three inputs are processed in the same way, only the recent input X is used here. h Taking node i as an example, the traffic speed sequence feature of node i after dimension conversion is h i , and its calculation formula is as follows:

[0094]

[0095] Where: Wh∈R q×T h represents a learnable weight matrix, and q>T h , that is, the converted dimension is larger than the original dimension; T h Represents the length of the sequence; is the historical traffic speed sequence of node j in the recent input.

[0096] Attention score calculation. Given that the correlation between road network nodes has the characteristics of dynamic changes, the traditional adjacency matrix composed of 0 and 1 cannot accurately reflect the correlation of road network traffic. Therefore, the model in this paper uses the attention mechanism to reconstruct the weights between adjacent nodes. The calculation formula is as follows:

[0097]

[0098] Where: j∈N means node j is a first-order neighbor node of node i; represents the concatenation operation of the matrix, and the concatenated [h i ||h j ]∈R 2q , is a learnable weight matrix that performs a linear transformation on the concatenated vector; LeakyReLu is the activation function; e ij R∈ is the attention score between node i and node j.

[0099] Attention weight calculation. In order to make the weights between adjacent nodes easy to compare, the Softmax function is used for j∈N i The node correlation weights are normalized, and the calculation formula is as follows:

[0100]

[0101] Among them, α ij ∈R represents the attention weight between node i and node j; LeakyReLu is the activation function; exp(·) represents the exponential function operation.

[0102] Node traffic speed feature update. This step involves integrating node features with information about adjacent nodes, followed by feature updates. The updated node features incorporate rich graph structure information. It is worth noting that different types of graph neural networks differ in node feature updates and aggregation methods. Specifically, after obtaining the weight between node i and the first-order neighbor node, the node traffic speed feature is updated through a feedforward neural network, and the calculation formula is as follows:

[0103]

[0104] Where: h i ′ is the updated traffic speed feature of node i; σ is the nonlinear activation function, and this paper uses the ReLu activation function; W is the weight matrix.

[0105] Multi-head attention mechanism. In order to further optimize the results, this paper uses a multi-head attention mechanism to accurately calculate the weight values ​​between adjacent nodes in the road network. The calculation formula is as follows:

[0106]

[0107] Where: K is the number of attention mechanisms used; W k is the weight matrix for the Kth attention mechanism operation.

[0108] The results of the three different inputs are combined to obtain the final prediction result. The above steps only obtain the prediction sequence of node i in the recent input. The above operations are performed on all nodes to obtain the recent input X h The prediction result Y h .

[0109] Repeat the above steps to obtain the prediction results of three different inputs, and finally fuse them through a fully connected layer to obtain the final result:

[0110]

[0111] Where: Y h , Y d , Y w They are the intermediate outputs corresponding to the three inputs; W1, W2, W3 are weight parameter matrices; The final prediction result.

[0112] LSTM Model:

[0113] LSTM uses input gate Z t and forget gate f t To control the access and forgetting of information, after getting the forget gate output f tAfter that, it is brought into the long short-term memory unit. Here, only the distance adjacency matrix single channel is used for explanation, which is expressed as follows: The forget gate is responsible for retaining how much input information from the previous moment to the input information unit state at the current moment, that is, deciding what information to discard from the unit state. Its calculation formula is as follows:

[0114] i t =σ(W xr ·[h t-1 , X t ]+b r )

[0115]

[0116] f t =σ(W xz ·[h t-1 , X t ]+b h )

[0117] O t =σ(W o [h t-1 , x t ]+b o )

[0118]

[0119] σ is the sigmoid function process; X t is the traffic speed characteristics of all nodes in the road network at time t; f t is the forget gate calculation process; O t Update the structure for the unit; W xr , W hr , W xz , W o are weight parameters; b r , b c , b h , b o All are bias terms; Represents the prediction result after the distance matrix is ​​input into the model;

[0120] After obtaining the outputs of the three channels, the results are fused to obtain the results based on static factors, which are expressed as follows:

[0121]

[0122] in: They represent the prediction results after the distance matrix, spatial similarity matrix, connectivity matrix and static information matrix are input into the model respectively.

[0123] The construction process of the STGAT-LSTM combination model:

[0124] Step 1: First, determine the input feature dimensions that affect passenger flow changes, such as taxi GPS data, POI data, weather data, road attribute data, etc. First, filter the input features of the data, and then construct the adjacency matrix of the filtered features. Finally, divide the processed multi-source data into training sets and test sets for model use.

[0125] Step 2: First, the multi-graph construction part driven by multi-source data is responsible for integrating and converting data in different forms into graph structures;

[0126] Step 3: Standardize the data. The calculation formula is as follows:

[0127]

[0128] Where: x mean is the data mean; x std is the standard deviation of the data; x′ is the standardized data, with a mean of 0 and a standard deviation of 1.

[0129] Step 4: Time correlation modeling based on long short-term memory network (LSTM) is responsible for analyzing the dynamic characteristics of traffic speed, weather and other data over time;

[0130] Step 5: The spatial correlation modeling based on graph attention (STGAT) focuses on capturing the spatial interactions and dependencies between nodes;

[0131] Step 6: During the model training process, each round of forward propagation will obtain the difference between the predicted value and the true value. Backward propagation updates the parameters of each round of the model by reverse derivation until the loss result meets the requirements and the number of iterations reaches the set maximum number of requirements. Otherwise, the model adjusts the network layer weight parameters through the Adam optimizer, resets the parameters and continues to iterate. After the model loss function result meets the requirements and the number of iterations reaches the set maximum number of requirements, the model training is successful. The trained model is used to predict the traffic speed of the urban road network in the test set, and the prediction results are evaluated by the constructed evaluation indicators.

[0132] Step 7: Output the predicted traffic speed data through the fully connected layer.

[0133] Model training:

[0134] Use the processed data set to train the model and determine the optimal network structure and parameters; select the history sequence length as 12; the number of hidden layer neurons as 64; the number of multi-head attention as 4; Adam as the optimizer of the model, and the Smooth-L1 loss function as the loss function. The Smooth-L1 calculation formula is as follows:

[0135]

[0136] Where: x is the difference between the predicted value and the true value.

[0137] Evaluation indicators:

[0138] (1) Mean Absolute Error (MAE): It is a basic indicator for evaluating regression models and can intuitively measure the deviation between the model's predicted value and the true value. The smaller the MAE value, the better the performance of the model and the more accurately it can reflect the true situation of the data. The calculation formula is as follows:

[0139]

[0140] In the formula, y t is the actual observed value of the traffic speed in the urban road network, is the predicted value of urban road network traffic speed, and n is the predicted sample.

[0141] (2) Root Mean Square Error (RMSE): The square root of the mean square error is taken to measure the deviation between the predicted value and the true value. Since RMSE has an amplifying effect on large errors in the model prediction results, the smaller the RMSE value, the better the model performance is. It also indicates that the maximum error in the model is relatively small. The calculation formula is as follows:

[0142]

[0143] In the formula, y t is the actual observed value of the traffic speed in the urban road network, is the predicted value of urban road network traffic speed, and n is the predicted sample.

[0144] In view of the problem that the existing research on urban road network traffic speed prediction does not fully consider the influencing factors and the model is not widely applicable, this paper uses taxi GPS data, POI data, weather data, and road attribute data to propose a method for predicting urban road network traffic speed based on the STGAT and LSTM combination algorithm. During the model training process, the historical sequence length is selected as 12; the number of hidden layer neurons is 64; the number of multi-head attention is selected as 4; Adam is used as the optimizer of the model, and the Smooth-L1 loss function is used as the loss function.

[0145] A specific application example of the present invention is given below, including:

[0146] Data collection

[0147] The data used in the present invention comes from the actual operation of XX City in December 2018. The data collected taxi GPS data, POI data, weather data, and road attribute data, and the data was processed by the pandas module. The processed data are shown in Tables 1 to 4 below.

[0148] The present invention collects the GPS record data of all taxis in XX city from December 1 to December 31, 2018, which includes data such as vehicle ID number, vehicle latitude and longitude information, and GPS data generation time.

[0149] Table 1 Part of the taxi GPS data field table

[0150]

[0151] The POI data of XX city is obtained through the interface provided by the network API. Finally, 13 POI and other category variables of the required road section are obtained.

[0152] Table 2 Network map crawling POI field table

[0153] id name type address province City district Longitude and Latitude 8897775 Bank of China (Sichuan Road Branch) Financial and Insurance Services; Banking; Bank of China Next to Jiefang Road Middle School Shaanxi Province Weinan City Linwei District 109.495734.50145 8897776 China Mobile (Business Hall) Life service; Telecommunications business hall; China Mobile business hall Intersection of Jiefang Road and Shengli Street, Jiefang Street Shaanxi Province Weinan City Linwei District 109.498134.50722 8897777 Weinan Kangrui Stomatological Hospital Medical care services; specialist hospitals; dental hospitals No. 77 Dongfeng Street Shaanxi Province Weinan City Linwei District 109.504734.5017 8897778 Weinan Watch Shop Shopping services; specialty stores; watch shops 150 meters west of the intersection of Dongfeng Avenue (East Section) and Beitang Road Shaanxi Province Weinan City Linwei District 109.505134.50167 8897779 Oriental Watch Co. Shopping services; specialty stores; watch shops One Road Shaanxi Province Weinan City Linwei District 109.50534.50168 8897780 Ma Hui Zhai (Dongfeng Road Store) Catering services; Chinese restaurants; Halal restaurants No. 92, East Section of Dongfeng Street Shaanxi Province Weinan City Linwei District 109.505334.50165 8897781 Dongfeng Street Police Station (East Section of Dongfeng Street) Government agencies and social groups; public security, procuratorial and judicial agencies; public security police 150 meters west of the intersection of Dongfeng Avenue (East Section) and Beitang Road Shaanxi Province Weinan City Linwei District 109.505434.50164 8897782 Collection of famous cigarettes and liquors Shopping services; specialty stores; tobacco and alcohol specialty stores 100 meters west of the intersection of Dongfeng Avenue (East Section) and Beitang Road Shaanxi Province Weinan City Linwei District 109.505734.50162 8897783 Bank of China (Weinan Dongfeng Street Branch) Financial and Insurance Services; Banking; Bank of China 50 meters north of the intersection of Dongfeng Avenue (East Section) and Beitang Road Shaanxi Province Weinan City Linwei District 109.506534.50155 8897784 Everlasting Wedding Photography (Weinan Flagship Store) Life services; photography and printing shops; photography and printing Dongfeng Street (East Section) near 58 Shaanxi Province Weinan City Linwei District 109.506934.50151 8897785 People's Street People's Congress Liaison Office Government agencies and social groups; government agencies; township governments and public institutions 50 meters northwest of the intersection of Dongfeng Avenue (East Section) and Nantang Road Shaanxi Province Weinan City Linwei District 109.507234.50148 8897786 Benyuan Shoes Shopping services; clothing, shoes, hats and leather goods stores; clothing, shoes, hats and leather goods stores Near 52, Dongfeng Street (East Section) Shaanxi Province Weinan City Linwei District 109.5074134.50148 8897787 Women's boutique Shopping services; shopping-related places; shopping-related places 85 meters east of the intersection of Beitang Road and Dongfeng Street Shaanxi Province Weinan City Linwei District 109.507534.50145 8897788 Hu's BBQ Spicy Chicken Catering services; Chinese restaurants: specialty / local restaurants Dongfeng Street (Eastern Section) Shaanxi Province Weinan City Linwei District 109.508134.50138 8897789 Liuzhi Police Station Government agencies and social groups; public security, procuratorial and judicial agencies; public security police 50 meters south of Beichi Road, Huazhou District Shaanxi Province Weinan City Huazhou District 109.852134.53789 8897790 Huazhou District Administration for Industry and Commerce Liuzhi Industrial and Commercial Office Government agencies and social groups; industrial and commercial taxation agencies; industrial and commercial departments 200 meters west of the intersection of Beichi Road and Mengliu Road, Huazhou District Shaanxi Province Weinan City Huazhou District 109.854634.53842 8897791 Kailai Pharmaceutical (Liuzhi Pharmacy) Health care services; medicine and health care stores; pharmacies 50 meters east of the intersection of Beichi Road and Mengliu Road Shaanxi Province Weinan City Huazhou District 109.856734.53884 8897792 Willow Branch Post Office Life service; post office; post office Opposite to the government of Liuzhi Town, Huazhou District Shaanxi Province Weinan City Huazhou District 109.856934.53896 8897793 Liuzhi Rural Credit Union Financial and insurance services; Banks; Rural commercial banks 100 meters east of the intersection of Beichi Road and Mengliu Road Shaanxi Province Weinan City Huazhou District 109.857134.53891 8897794 Yuying Primary School Science, education and cultural services; school; primary school Huazhou Town Shaanxi Province Weinan City Huazhou District 109.754134.50933 8897795 Yahe Tea House Catering services; Tea house: Tea house Near Qinhua Road Shaanxi Province Weinan City Huazhou District 109.757734.51175 8897796 Edxin Catering services; bakery; bakery 50 meters southwest of the intersection of Xinhua Street and Xinhua Street Lane 1 Shaanxi Province Weinan City Huazhou District 109.758234.51185 8897797 Hualin Dumpling Restaurant Catering services; Chinese restaurants; Chinese restaurants No. 72, Xinqin South Road, Xinhua Street, Huazhou District Shaanxi Province Weinan City Huazhou District 109.759434.51213

[0154] The present invention obtains the historical weather data of XX City from December 1 to December 30, 2018 through the website of the China Meteorological Administration.

[0155] Table 3 Weather data field table

[0156]

[0157] Obtain the road network attribute data of XX City through the website, including network topology, road section length, and latitude and longitude of each road section topology interval point information; determine the data of different roads based on the "XX City Master Plan" and the data obtained from actual surveys, including road name, road length, road grade, road width, number of lanes, lane width, design speed, and traffic capacity.

[0158] Table 4 Road attribute data field table

[0159] Section number Road length Road Class Road form road name Number of road lanes Lane Width Design speed Intersection influence coefficient One-way traffic capacity Two-way traffic capacity 1 383.4 Branch Road Single lane road Jiefang South Road 2 3.5 20 0.614213249 593 1187 2 399.84 Branch Road Single lane road Weilan Road 2 3.5 20 0.624894708 604 1207 3 416.53 Branch Road Single lane road Community Road 1 5 20 0.635745154 774 1548 4 404.13 Main Road Single lane road North Station Street 4 3.5 40 0.627685793 1347 2695 5 158.82 Branch Road Single lane road Hanma Street 2 3.5 20 0.5 483 966 6 316.59 Branch Road Single lane road Community Road 1 5 20 0.570783498 695 1389 7 216.28 Secondary trunk road Single lane road Yuhong Street 4 3.5 30 0.505584598 1026 2052 8 382.4 Secondary trunk road Single lane road Yuhong Street 4 3.5 30 0.61356196 1245 2490 9 332.56 Branch Road Single lane road Weilan Road 2 3.5 20 0.581164653 561 1123 10 403.16 Branch Road Single lane road Hanma Street 2 3.5 20 0.627055946 606 1211

[0160] Data processing

[0161] The method for calculating the average speed of a road section adopted by the present invention is to divide the GPS data with speed field values ​​into unit time periods for screening, and calculate the average value of the speed field in the screened GPS data as the average speed of the road section within the unit time. The formula for the speed of a single taxi GPS data within a unit time period is as follows:

[0162]

[0163] Where: v i is the speed of the i-th vehicle on the road section; s is the distance between the GPS track points at time t1 and time t2. i Substituting the following formula into the road section can obtain the average driving speed per unit time.

[0164]

[0165] Where: v i represents the speed of a single taxi GPS data in a unit time period; n is the number of vehicles passing through the road section in a unit time; v t The calculation result of the average speed of the road section within a unit time is the historical speed data every 15 minutes, 30 minutes, and 60 minutes in the subsequent input variables.

[0166] Feature Construction

[0167] First, the Pearson correlation coefficient method is used to calculate the correlation between the static factor and dynamic factor data. The input features are screened out, and the input feature fields are shown in Table 5.

[0168] Table 5 Selected feature field names and descriptions

[0169]

[0170] According to the correlation analysis results of different characteristic values ​​on road speed, the required characteristics are screened out.

[0171] The model input features are constructed by constructing an adjacency matrix for feature combination. From the three perspectives of proximity, functional similarity and connectivity, a variety of adjacency matrices are constructed to characterize the spatial correlation of the road network, including:

[0172] The distance matrix is ​​measured by the correlation between adjacent nodes. Its calculation formula is as follows:

[0173]

[0174] Where: d j is the distance between network nodes i and j; ε, σ 2 is a hyperparameter that controls the threshold of matrix distribution and sparsity; a jis the similarity weight between node i and node j.

[0175] Functional similarity matrix, Functional similarity matrix A s ∈R n×n It can be measured by the similarity of the POI distribution vectors around the node, and the calculation formula is as follows:

[0176]

[0177] Among them: A s(,j) is the element in the i-th row and j-th column of the functional similarity matrix, which represents the functional similarity between nodes, and its value range is A s (i, j)∈[0,1]; P v , P vj is the static factor vector of road network node i and node j, that is, the i-th and j-th rows of the static factor matrix S.

[0178] The connectivity matrix is ​​measured by node connectivity. Its calculation formula is as follows:

[0179] A C (i, j) = max(0, conn(v i , v j ) K -A i,j )∈{0,1}

[0180] A c (i, j) represents the connectivity matrix A c The element in the i-th row and j-th column in the conn(v, v) is 1, which means the two nodes are connected, and 0, which means they are not connected. j ) K is the connectivity function. If there is a path between node i and node j within K nodes, the value is 1, otherwise it is 0. j is the original adjacency matrix of the road network. If node i and node are adjacent nodes, it is 1, otherwise it is 0; max() represents the maximum value. Here, the first-order connections are removed and only the first-order and above connections are retained.

[0181] Model Building

[0182] like Figure 2 As shown, the embodiment of the present invention provides a framework of the STGAT-LSTM combination model.

[0183] The STGAT-LSTM combined model of the present invention is mainly composed of four parts: first, the multi-graph construction part driven by multi-source data is responsible for integrating and transforming data of different forms into graph structures; second, the time correlation modeling based on the long short-term memory network (LSTM) is responsible for analyzing the dynamic characteristics of data such as traffic speed and weather changing over time; then the spatial correlation modeling part based on the graph attention (GAT) focuses on capturing the spatial interactions and dependencies between nodes; finally, the predicted traffic speed data is output through the fully connected layer.

[0184] Model training and tuning

[0185] The present invention is carried out in the JupyterNotebook development environment in the Windows 10 operating system, with Python version 3.9.7; the experimental equipment CPU uses AMD Ryzen 55600X6-Core Processor, GPU uses NVIDIA 3060Ti graphics card, video memory is 8GB, and host running memory is 16GB. This experiment uses the Pytorch deep learning framework to build the STGAT-LSTM model, and also uses the data processing embedding packages Pandas and Numpy.

[0186] Use the processed data set to train the model and determine the optimal network structure and parameters; select the history sequence length as 12; the number of hidden layer neurons as 64; the number of multi-head attention as 4; Adam as the optimizer of the model, and the Smooth-L1 loss function as the loss function. The Smooth-L1 calculation formula is as follows:

[0187]

[0188] Where: x is the difference between the predicted value and the true value.

[0189] Prediction and evaluation

[0190] The present invention uses the XX city taxi GPS data set and selects the urban road network of Weinan City, which includes 117 sections including expressways, main roads, secondary roads and branches, for model experiments. The data information of some selected sections is shown in Table 6.

[0191] Table 6 Data information table of some selected road sections

[0192]

[0193] Prediction results

[0194] In order to objectively evaluate whether the prediction accuracy of the urban road network traffic speed prediction model based on STGAT-LSTM has been improved, several commonly used and seven baseline models (HA, ARIMA, SVR, LSTM, GRU, T-GCN and DCRNN) were selected. By applying the above algorithm model to the XX urban road network data, the obtained urban road network traffic speed results were compared and analyzed with the model of the present invention. The experimental results of urban road network traffic speed prediction of each model are shown in Table 7.

[0195] Table 7 Comparison of prediction performance of STGAT-LSTM model and other benchmark models

[0196]

[0197] It can be seen from Table 7 that under the same feature input, the combined prediction model adopted by the present invention has the highest accuracy. Compared with traditional machine learning and the neural network currently used, the combined model can be used to model actual problems, combining the advantages of each model in dealing with problems, thereby improving the accuracy of urban road network traffic speed prediction.

[0198] like Figure 4 As shown, an embodiment of the present invention provides a system for predicting urban road network traffic speed, comprising:

[0199] Data processing module: used to collect multi-source data of urban road network and perform pre-processing;

[0200] Prediction module: used to input the pre-processed urban road network multi-source data into the established urban road network traffic speed prediction model, and the urban road network traffic speed prediction model outputs the prediction result;

[0201] Among them, the urban road network traffic speed prediction model is established based on the STGAT-LSTM deep learning combination model.

[0202] A terminal device is provided in one embodiment of the present invention. The terminal device of this embodiment includes: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor executes the computer program, the functions of the modules / units in the above-mentioned device embodiments are implemented.

[0203] The computer program may be divided into one or more modules / units, and the one or more modules / units are stored in the memory and executed by the processor to accomplish the present invention.

[0204] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.

[0205] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0206] The memory may be used to store the computer programs and / or modules, and the processor implements various functions of the terminal device by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory.

[0207] If the module / unit integrated in the terminal device 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 present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0208] Although the embodiments of the present invention are described above in conjunction with the accompanying drawings, the present invention is not limited to the above-mentioned specific embodiments and application fields, and the above-mentioned specific embodiments are only illustrative and instructive, rather than restrictive. Under the guidance of the specification, a person skilled in the art can also make many forms without departing from the scope of protection of the claims of the present invention, all of which belong to the scope of protection of the present invention.

Claims

1. A method for predicting traffic speed in an urban road network, characterized in that: include: Collect multi-source data of urban road network and perform pre-processing; Input the pre-processed urban road network multi-source data into the established urban road network traffic speed prediction model, and the urban road network traffic speed prediction model outputs the prediction result; Among them, the urban road network traffic speed prediction model is established based on the STGAT-LSTM deep learning combination model.

2. A method for predicting urban road network traffic speed according to claim 1, characterized in that: The specific steps for establishing the urban road network traffic speed prediction model are as follows: Collect multi-source data of urban road network and perform pre-processing; The input features of the preprocessed urban road network multi-source data were screened to determine the number and dimensions of the input features required to establish the model. The screened features were then constructed into dynamic and static information matrices, which were then combined and fused into multiple graphs as input variables. Based on the number and dimension of input features and input variables, the STGAT-LSTM deep learning combination model is constructed by combining the ATGAT and LSTM models. Use dynamic and static information matrices to train the model and determine the optimal model function and parameters; The trained model is applied to the traffic speed prediction of urban road networks, and the mean absolute error and root mean square error are used as evaluation indicators to evaluate the prediction accuracy. If the prediction accuracy is insufficient, the data set is retrained. If the prediction accuracy meets the requirements, the model is established.

3. A method for predicting urban road network traffic speed according to claim 2, characterized in that: The multi-source data includes: taxi GPS data, POI data, weather data and road attribute data.

4. A method for predicting urban road network traffic speed according to claim 2, characterized in that: The dynamic and static information matrix includes: The distance matrix is ​​calculated by measuring the correlation of adjacent nodes: Where: d j is the distance between network nodes i and j; ε, σ 2 is a hyperparameter that controls the threshold of matrix distribution and sparsity; a j is the similarity weight between node i and node j; Functional similarity matrix,The calculation formula of the functional similarity matrix is: Among them: A s(,j) is the element in the i-th row and j-th column of the functional similarity matrix, which represents the functional similarity between nodes, and its value range is A s (i, j)∈[0,1]; P v ,P vj is the static factor vector of the road network node i and node j, that is, the i-th and j-th rows of the static factor matrix S; The connectivity matrix, measured by node connectivity, is calculated as: A C (i,j)=max(0,conn(v i ,v j ) K -A i,j )∈{0,1}1} A c (,j) represents the connectivity matrix A c The element in the i-th row and j-th column in the conn(v,v) is 1, which means the two nodes are connected, and 0, which means they are not connected. j ) K is the connectivity function. If there is a path between node i and node j within K nodes, the value is 1, otherwise it is 0. j is the original adjacency matrix of the road network. If node i and node are adjacent nodes, it is 1, otherwise it is 0; max() represents the maximum value.

5. The method for predicting urban road network traffic speed according to claim 2, characterized in that: The structure of each storage unit of the LSTM model is as follows: LSTM uses the input gate and forget gate to control the access and forgetting of information. After obtaining the forget gate output, the forget gate output is brought into the long short-term memory unit.

6. A method for predicting urban road network traffic speed according to claim 2, characterized in that: The specific steps of screening the input features of the preprocessed urban road network multi-source data are as follows: The Pearson correlation coefficient method is used to calculate the correlation between the static and dynamic factors of the urban road network, and the characteristics with the highest correlation with the road speed are selected; Among them, the Pearson correlation coefficient method formula is: Where: X, Y are input variables, n is the sample size, μ x and μ y are the means of the two variables respectively; The symbol E(.) represents the mathematical expectation, σ X and σ Y It represents the standard deviation of variables X and Y; According to the correlation analysis results of different feature values ​​on road speed, the required features are screened out; The model input features are constructed by constructing an adjacency matrix for feature combination. From the three perspectives of proximity, functional similarity and connectivity, a variety of adjacency matrices are constructed to characterize the spatial correlation of the road network.

7. The method for predicting urban road network traffic speed according to claim 1, characterized in that: The STGAT model dynamically assigns different weights to nodes in the graph to better adapt to the dynamic changes of node weights in the road network. The establishment of the STGAT model based on the attention mechanism includes the following steps: First, the input layer inputs X h , X d and X w The output after the long short-term memory network is X h ′、X d ′ and X w ′, introduce a shared, learnable linear transformation, the role of this transformation is to map the input traffic speed feature sequence to a higher dimensional space, process the three inputs, and obtain the node traffic speed after dimension conversion. The sequence feature is; Where: X h (Historical Features): Represents the historical traffic speed data of a certain road section, which is time series data; For example: traffic speed per minute over the past hour; It is mainly used to capture temporal continuity, such as the change of traffic speed over time on a certain road section; X d (Dynamic features): Represents data that changes dynamically in real time on the day, such as current weather conditions, real-time traffic flow, etc. Dynamic characteristics reflect short-term fluctuations, such as sudden changes in weather and fluctuations in traffic flow caused by traffic accidents; X w (Periodic characteristics): Data representing periodic patterns in traffic speed; for example, average traffic speed during a specific time period on a particular day of the week; The attention scores, attention weights and node traffic speed features of the three input node traffic speed sequence features are calculated in turn; A multi-head attention mechanism is added to the STGAT model to fuse the prediction results of the three inputs in the input layer to obtain the final prediction result.

8. A system for predicting traffic speed in an urban road network, characterized in that: include: Data processing module: used to collect multi-source data of urban road network and perform pre-processing; Prediction module: used to input the pre-processed urban road network multi-source data into the established urban road network traffic speed prediction model, and the urban road network traffic speed prediction model outputs the prediction result; Among them, the urban road network traffic speed prediction model is established based on the STGAT-LSTM deep learning combination model.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the urban road network traffic speed prediction method as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of a method for predicting urban road network traffic speed are implemented as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Traffic prediction method based on graph attention neural network and space-time big data

    CN114973678A

  • Attribute-enhanced perceptual sequence diagram convolutional network traffic speed prediction method

    CN117217381A

  • Traffic flow prediction system based on deep learning and dynamic network analysis and application method thereof

    CN118675324A

  • Method for manufacturing multipurpose yeast

    KR1020220006840A