Travel link extraction-oriented vehicle travel time prediction method
By using the Northern Goshawk optimization algorithm and Attention-ConvLSTM model in vehicle travel time prediction, combined with the traffic theme link extraction and attention mechanism, the problems of vehicle travel time prediction accuracy and calculation time in the existing technology are solved, and the more High prediction accuracy and stability provide effective support for the traffic management system.
Patent Information
- Application Number
- CN202410289145.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-14
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-03-14
AI Technical Summary
The existing vehicle travel time prediction methods still have room for improvement in calculation time and prediction accuracy, especially the tree integration algorithm is difficult to meet the practical application needs in terms of speed and accuracy.
The Attention-ConvLSTM model based on the Northern Goshawk optimization algorithm is adopted, combined with the traffic theme link extraction and attention mechanism, and is used to predict the itinerary time of the vehicle travel link. This model improves prediction performance by extracting traffic theme links and optimizing parameters using the Northern Goshawk optimization algorithm, and captures traffic conditions at different time scales through attention mechanisms.
It significantly improves the prediction accuracy of the vehicle travel link travel time, shortens the calculation time, and improves the average absolute percentage error and R2 indicator by 30.9% and 28.4%, and the prediction accuracy reaches more than 90%, providing higher accuracy and stability. Provides a useful reference for the traffic management system.
Smart Images

Figure CN119204277A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of vehicle travel time prediction, and in particular to a vehicle travel time prediction method oriented to travel link extraction. Background Art
[0002] With the rapid development of my country's comprehensive national strength and national economy, the living consumption level and ability of residents are constantly improving, and the number of cars is also increasing sharply. As an important part of the intelligent transportation system, the prediction of vehicle travel link travel time is of great significance for alleviating traffic congestion, improving road utilization and optimizing urban traffic planning. In recent years, a large number of studies have been devoted to exploring more accurate and efficient methods for predicting vehicle travel link travel time, in order to provide strong support for real traffic problems. Existing travel time prediction research methods mainly include parameterized models and machine learning models.
[0003] In recent years, many scholars have used different methods to prove the applicability and prediction accuracy of various models in travel time prediction. At present, the vehicle travel time prediction model adopts machine learning methods, mainly neural networks, Kalman filters, K-nearest neighbors, etc. Among them, the inherited algorithm models mainly include random forests, gradient boosting regression trees, gradient boosting decision trees, etc. The tree integration algorithm has the advantages of fast speed, high prediction accuracy, and low data quality requirements compared to traditional machine learning. However, the calculation time of these methods can still be improved, and the accuracy of predicting travel time can still be further improved. Summary of the invention
[0004] The present invention provides a vehicle travel time prediction method for travel link extraction, which can overcome certain defects of the prior art.
[0005] A vehicle travel time prediction method for travel link extraction according to the present invention comprises the following steps:
[0006] Step S1, obtaining the trajectory data of the taxi vehicle, and then extracting the traffic theme links and their classification based on similarity;
[0007] Step S2: adopting the Attention-ConvLSTM vehicle travel link travel time prediction model based on the Northern Goshawk optimization algorithm;
[0008] Step S3: extract the results of the traffic theme link and obtain the travel time of the predicted vehicle travel link.
[0009] Preferably, the taxi trajectory (Traj) data of step S1 is data recording the location information of the taxi within a certain period of time, and includes the unloaded trajectory points and the loaded trajectory points of the taxi;
[0010] There are several trajectories in the taxi trajectory dataset, namely
[0011] Traj={Traj1,Traj2,K,Traj n} (1)
[0012] (1) Where Traj i represents the i-th trajectory.
[0013] A trajectory Traj consists of multiple trajectory points, x1, x2, ..., x n , composed of, where a trajectory point x i It is the location data points collected by the GPS device during the taxi's driving process. These data points include vehicle identification (id), longitude (lng), latitude (lat), time (time), passenger status (flag), etc., expressed as: i =(id i , lng i ,lat i , time i , flag i ).
[0014] According to the driving trajectory of the taxi and the passenger status of the taxi, the pick-up and drop-off points of the taxi are judged and extracted, and the link information between the pick-up and drop-off points is extracted. It is necessary to construct the driving trajectory of the taxi based on the timestamp and location information in the GPS data, and extract the links between each track point. The specific steps are as follows:
[0015] When the taxi's passenger-carrying status flag changes from 0 to 1, it means that the taxi will start to pick up passengers, and this information will be used as the taxi's pick-up point.
[0016] When the taxi's passenger-carrying status flag changes from 1 to 0, it means that the taxi has finished carrying passengers, and this information is used as the taxi's drop-off point.
[0017] According to the preprocessed GPS data, the spatial relationship between the sampling points is analyzed using formula (2) to estimate the position of the unknown point Yu, thereby constructing the taxi's driving trajectory Traj.
[0018] Extract the links between adjacent trajectory points on the driving trajectory Traj, set a time threshold t, and if the time interval between two trajectory points is less than the threshold t, it is considered that there is a link between the two trajectory points. The algorithm flow chart is as follows Figure 1 shown.
[0019]
[0020] Where Y uis the value of the unknown point, Y i is the value of the known point, X i is the weight of the known point, r i is the distance between the known point and the unknown point.
[0021] Preferably, the method for extracting traffic theme links based on similarity in step S1 includes:
[0022] Trajectory similarity is an indicator used to measure the similarity between two trajectories. Based on the similarity, an optimal trajectory is found between the starting and ending points as the traffic theme link. The taxi chooses to travel along the traffic theme link, which can enable the taxi to reach the destination as quickly as possible.
[0023] First, the input trajectory coordinates are preprocessed, the S longitude and latitude coordinates are converted to the tangent plane coordinates (x, y, z), and then the tangent plane coordinates (x, y, z) are converted to the coordinate data (X, Y, Z) in the Cartesian coordinate system, the longitude is converted to radians and divided by the radius of the earth to obtain a value less than 1 in radians, and the latitude is directly converted to radians;
[0024] Next, calculate the longitude and latitude distance between each point on the two trajectories. For points i and j on each trajectory, the Euclidean distance formula can be used, that is,
[0025]
[0026] In the formula, x i and i is the Cartesian coordinate of point i, x j and j are the Cartesian coordinates of point j;
[0027] Then calculate the contribution of each point to the entire trajectory, calculate the similarity between the two trajectories based on the contribution, take the weighted average of these distances, and then calculate the similarity between the two trajectories.
[0028] Finally, the similarity between the two trajectories is output. The closer the similarity is to 1, the more similar the two trajectories are. Trajectories with close similarity are regarded as one trajectory. Traverse all links, count the number of times each travel link is walked between the boarding and alighting points, and extract the travel links with a travel number greater than the threshold;
[0029] The formula for calculating the contribution of a trajectory point to the entire trajectory is:
[0030]
[0031] The formula for calculating the similarity between two trajectories is:
[0032]
[0033] Where n is the number of points on the trajectory, and d(i, j) is the distance between trajectory points i and j;
[0034] First, determine the partition of OD points, extract the OD points with high travel demand, extract the paths between OD partitions according to the similarity of trajectories, and extract the traffic theme links with the most trips between each pair of OD partitions;
[0035] Step1: Calculate the distances from O and D points to the center points of each cluster respectively, and match the numbers s_number and e_number of the cluster centers closest to O and D points to confirm the partition of OD points.
[0036] Step2: Group according to s_number and e_number of OD points, count the number count of OD point partitions, select the OD partitions with count greater than 200, and count that there are hang rows in the partition.
[0037] Step3: Extract all OD travel links in each partition, and create tabular data guiji_ODzhuti for storing the theme links of all partitions.
[0038] Step3.1: Let h = 0. When h < hang, take the value of the first column in the h-th partition as a, and the value of the second column as b, make s_number = a and e_number = b in the OD partition, extract the boarding time stime, alighting time etime and license plate ID of each OD point in this partition, and count that there are hang_fenqu rows in this partition.
[0039] Step3.2: Loop through each row i of this partition, make open_time equal to the stime of the i-th row, make close_time equal to the etime of the i-th row, and C equal to the license plate ID of the i-th row. Create a list list, convert the trajectory data of the pick-up and drop-off points into an array, traverse and loop through each trajectory data item, take out the license plate number sh in the array, if C = sh, add item to list, and convert list into tabular data.
[0040] Step3.3: Extract the data in the partition whose trajectory data time is greater than open_time and less than close_time, add each trajectory data in the partition to guiji_fenqu, initially i = 0, and create a list Slist for counting the number of trips of the current path.
[0041] Step4: In the OD trajectories of the current partition, calculate the similarity between every two trajectories, and consider the trajectories with close similarity as one trajectory.
[0042] Step 4.1: Repeat steps 3.2-3.3, take out the trajectory data guiji_od1 of the i-th OD point, make r=i+1, count the number of times of the current route s=1, when r is less than hang_fenqu, repeat steps 3.2-3.3, take out the trajectory data guiji_od2 of the r-th OD point.
[0043] Step 4.2: Find each longitude and latitude (X j ,Y j )The latitude and longitude point closest to the latitude and longitude in guiji_od1 (X i ,X i ), the distance between the two coordinate points is calculated as dist according to the distance formula (3), and the sum of squares of each distance dist is calculated according to the formula (2), and then the square root is taken to obtain sqrt. If sqrt is less than the threshold, s=s+1.
[0044] Step 4.3: r = r + 1, repeat steps 4.1-4.2, and calculate the similarity between the i-th OD trajectory data and the r-th OD trajectory data. When r is greater than hang_fenqu, this loop ends and the value of s is added to Slist.
[0045] Step 5: i=i+1, repeat step 4 until i is greater than hang_fenqu, the loop ends.
[0046] Step 6: Extract the OD path with the most travel demand in the current OD partition, list the largest values in the list Slist, and store them in the list res, and create the table data guiji_ODzhuti1 that stores the current partition topic link.
[0047] Step 6.1: Take out the value b in res one by one, take out the value of stime in row b in the partition data, which is Otime, the value of etime in row b is Ctime, and the license plate ID in row b is C. Create a list blist so that the license plate number in the trajectory data is equal to C, and the trajectory data with time between Otime and Ctime is guiji0.
[0048] Step 6.2: Let a=b+1, repeat step 6.1, and get the trajectory data of the ath OD point guiji1. Take the square root of the sum of the longitude and latitude points of guiji0 and guiji1 and get sqrt. If sqrt is less than the threshold, add guiji0 and guiji1 to the table data guiji_ODzhuti1.
[0049] Step 6.3: a=a+1, loop step 6.2 until a is greater than hang_fenqu, the loop ends. Add the current partition's topic link track guiji_ODzhuti1 to guiji_Odzhuti.
[0050] Step 7: Extract the traffic theme link for the next partition, so that h=h+1, and repeat steps 3.1-6.3 until h is greater than hang.
[0051] Preferably, the travel link classification based on the travel purpose in step S1 is classified as follows:
[0052] The purpose of travel link classification is to classify links according to different attribute characteristics or uses, and to distinguish travel links by the attribute characteristics or uses of their categories.
[0053] The present invention classifies the transportation links according to the points of interest and POI types of the boarding and alighting points.
[0054] First, we extract the pick-up and drop-off points from the taxi GPS data and cluster the pick-up and drop-off points to get the passenger hotspots.
[0055] Next, crawl the POI data with a fixed radius around the passenger hotspot as the center, select the POI type with the largest proportion as the type of passenger hotspot, and use the passenger hotspot area as the starting and ending point of the travel link.
[0056] The starting and ending points are divided into four types: residential, office, life service and school.
[0057] From the actual travel situation of travelers, we can know that the number of passengers is the largest during the morning and evening peak hours, because people have a greater travel demand for work and school during the morning peak hours, while the evening peak hours are the time when people have a higher travel demand for getting off work, shopping, etc.
[0058] Therefore, travel links are divided into links from residence to company, residence to school, residence to life services, from school to company, school to life services, and round-trip links according to the attribute characteristics of the starting and ending points.
[0059] Preferably, the model in step S2 includes:
[0060] The input layer is responsible for converting the received raw sequence data into a form readable by the model;
[0061] Convolutional layer, used to extract local features from input data. A convolutional layer can contain multiple convolution kernels, each of which corresponds to a different feature.
[0062] LSTM layer, which has multiple LSTM units. Each LSTM unit consists of an input gate, a forget gate, and an output gate to capture long-term dependencies in the input data.
[0063] The Northern Goshawk optimization algorithm is used to optimize the parameters of the ConvLSTM layer to improve the prediction performance of the model;
[0064] The Attention mechanism is used to weight information at different time steps to help the model focus on more important information when making predictions, thereby improving the accuracy of predictions.
[0065] The fully connected layer is used to fully connect the output of Attention-ConvLSTM to obtain the final prediction result;
[0066] The output layer is used to transform the prediction results of the fully connected layer into a numerical value in the time series data.
[0067] Preferably, the northern goshawk optimization algorithm is mainly divided into two stages: a global search stage and a local search stage;
[0068] Global search phase: In this phase, the northern goshawk is used to randomly select a prey in the search space and then quickly attack it;
[0069] This process can be described by a mathematical model, such as equation (6) for position update and equation (7) for velocity update, where the prey represents the objective function in the optimization problem and the northern goshawk needs to find a solution that minimizes the objective function in the search space.
[0070] x t+1 =x t -a*(bx t ) (6)
[0071] v t+1 =v t -c*(wv t ) (7)
[0072] Where a and c are acceleration coefficients, b is the prey position, w is the goshawk position, xt is the current goshawk position, and vt is the current goshawk speed.
[0073] 1) Local search phase: After successfully attacking the prey, the northern goshawk will enter the local search phase. This phase can be seen as the process of the northern goshawk tracking and approaching the prey when the prey's location is known. In this process, the northern goshawk will constantly update its search strategy in order to better approach the prey. Using the simulated annealing method, a temperature parameter T can be set. In each iteration, the goshawk will decide whether to accept the new position based on the Metropolis criterion. The formula can be described as:
[0074]
[0075]
[0076] Where n is the number of samples in the validation set, y _i is the actual travel time, y _pred_i is the travel time predicted by the model, MSE is the mean square error between the predicted travel time and the true value of the Attention-ConvLSTM model, x new and x old are the new and old positions and T is the temperature.
[0077] Update solution: After completing the local search, the northern goshawk will update its solution. This process involves attacking and chasing the prey, and adjusting the search strategy according to the prey's movement trajectory. Through this process, the northern goshawk can find a better solution in the search space.
[0078] Repeat the above process: The northern goshawk will continue to repeat the process of global search, local search and solution update until it finds the optimal solution that meets the conditions.
[0079] As a preferred method, the convolutional long short-term memory network (ConvLSTM) is a deep learning model that combines the convolutional neural network (CNN) and the long short-term memory network (LSTM) for processing time series data. The traditional LSTM does not have a convolutional layer, but the convolutional layer is added to the ConvLSTM, which can effectively extract the spatial features in the input data and has strong capabilities in processing time series data and spatial data. LSTM can only process sequences of fixed length, while the convolution layer in ConvLSTM can process sequence data of variable length. The structure diagram of the convolutional layer and LSTM layer is shown in the figure. Figure 3 As shown, the formula is:
[0080] i t =σ(W xi *h t-1 +b i ) (10)
[0081] f t =σ(W fh*h t-1 +b f ) (11)
[0082] o t =σ(W ho *h t +b o ) (12)
[0083] h t =σ(W ch *x t +b c ) (13)
[0084] Where: it is the output of the input gate, ft is the output of the forget gate, ot is the output of the output gate, ht is the output of the convolutional layer, Wxi, Wfh, Who, Wch are the weight matrices of the input gate, forget gate, output gate, and convolutional layer respectively, ht is the hidden state at the current moment, ht-1 is the hidden state at the previous moment, bi, bf, bo, bc are the bias vectors of the input gate, forget gate, output gate, and convolutional layer respectively, σ is the sigmoid activation function, and * is the convolution operation.
[0085] As a preferred method, the attention mechanism is a strategy widely used in deep learning models to dynamically adjust the information weights of different positions when processing input sequences. The core idea of the attention mechanism is to give the model the ability to automatically learn and pay attention to the importance of different positions in the input sequence, so as to better capture the key information related to the task. Its structure is as follows: Figure 4 shown.
[0086] First, a convolutional neural network (CNN) is used to extract features from travel links to obtain convolutional features. Then, the convolutional features are input into a long short-term memory network (LSTM) for time series analysis. An attention mechanism is introduced into the ConvLSTM model so that the model focuses on the features of the input data that are useful for prediction and weights different spatial locations and feature channels.
[0087] In the attention mechanism, the output sequence of each ConvLSTM [h t-s+1 , ..., h t-1 ,h t ] is used as the input sequence of the Attention mechanism, and an attention weight [α t-s+1 , ..., α t-1 , α t ] Finally, these weights are multiplied by the corresponding input values, and the products are summed to obtain a vector [H t-s+1 , ..., H t-1, H t ], formulas as (14)-(16).
[0088] In this process, the model can automatically learn to ignore unimportant or redundant information based on the attention weight, thereby improving the performance and efficiency of the model. Combining the ConvLSTM's Attention mechanism to predict the travel time of travel links can effectively capture local information and useful features in the prediction task, and weight the information at different time steps, thereby improving the accuracy and reliability of the prediction.
[0089] c t =W s *tanh(W xa *X t +W ha *h t +b a ) (14)
[0090]
[0091]
[0092] Where: W is the convolution kernel weight, X is the input feature, h is the input sequence of ConvLSTM, b a is the bias term, c t To calculate the median value of the attention coefficient for each feature region, α t is the attention weight, and H is the output sequence of the weighted sum.
[0093] The present invention also provides a vehicle travel time prediction device for travel link extraction, comprising a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of the method described are implemented.
[0094] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed, the steps of the method described are implemented.
[0095] Beneficial effects:
[0096] Traditional vehicle travel time prediction methods often have high errors and are difficult to meet the needs of practical applications. Using Chengdu taxi GPS data and crawled POI data, the type of the pick-up and drop-off area of the travel link is determined according to the type of POI, and the traffic theme links with a large number of trips are extracted according to the similarity. Aiming at the problem of link travel time prediction, a vehicle travel link travel time prediction method based on NGO-Attention-ConvLSTM is proposed. The attention mechanism is used to capture the traffic conditions at different time scales; then, the convolutional long short-term memory network is used to extract features of the traffic state and model the spatiotemporal relationship; in order to improve the generalization ability of the model, the northern goshawk optimization algorithm is introduced to optimize the parameters of the model. The research results show that: the extraction of traffic theme links based on the similarity algorithm is more advantageous than the traditional algorithm. Its calculation time is 86.345s, which is about 190s and 345s less than other algorithms respectively; compared with the LSTM model, the proposed method predicts the travel time of the travel link with an accuracy of mean absolute percentage error and R 2 The indicators have been improved by 30.9% and 28.4% respectively, and the prediction accuracy can reach more than 90%. It has higher accuracy and stability in the task of predicting the travel time of vehicle travel links, providing a useful reference for the actual traffic management system and helping to further improve traffic operation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0097] Figure 1 is a flow chart of the travel link extraction algorithm in the present invention;
[0098] Figure 2 It is the overall structure diagram of the NGO-Attention-ConvLSTM prediction model in the present invention;
[0099] Figure 3 It is a structural diagram of the ConvLSTM model in the present invention;
[0100] Figure 4 It is a structural diagram of the attention mechanism in the present invention;
[0101] Figure 5 is a travel link between ODs and the extracted traffic theme link graph in the experimental verification step of Example 1;
[0102] Figure 6 is a traffic theme link classification diagram of different travel demands in the experimental verification step of Example 1;
[0103] Figure 7 is the convergence curve of the NGO-Attention-ConvLSTM model in the experimental verification step of Example 1;
[0104] Figure 8is a histogram of attention coefficients at different time steps in the experimental verification step of Example 1;
[0105] Fig. 9 is a comparison chart of the travel link travel time prediction results in the experimental verification step of Example 1;
[0106] Fig.10 This is a picture of the test set accuracy comparison table in the experimental verification step in Example 1; DETAILED DESCRIPTION
[0107] Example 1
[0108] This embodiment provides a vehicle travel time prediction method for travel link extraction; the vehicle trajectory selected in this method is a taxi trajectory; trajectory data:
[0109] Taxi trajectory data is the data that records the location information of taxis in a certain period of time. It includes the unloaded and loaded trajectory points of taxis. There are several trajectories in the taxi trajectory dataset, namely
[0110] Traj={Traj1,Traj2,K,Traj n} (1)
[0111] Where Traj i represents the i-th trajectory.
[0112] A trajectory Traj consists of multiple trajectory points (x1, x2, ..., x n ), where a trajectory point x i It is the location data points collected by the GPS device during the taxi's driving process. These data points include vehicle identification (id), longitude (lng), latitude (lat), time (time), passenger status (flag), etc., expressed as: i =(id i , lng i ,lat i , time i , flag i ).
[0113] According to the driving trajectory of the taxi and the passenger status of the taxi, the pick-up and drop-off points of the taxi are judged and extracted, and the link information between the pick-up and drop-off points is extracted. It is necessary to construct the driving trajectory of the taxi based on the timestamp and location information in the GPS data, and extract the links between each track point. The specific steps are as follows:
[0114] 1) When the taxi's passenger-carrying status flag changes from 0 to 1, it means that the taxi will start to pick up passengers, and this information will be used as the taxi's pick-up point.
[0115] 2) When the taxi's passenger-carrying status flag changes from 1 to 0, it means that the taxi has finished carrying passengers, and this information is used as the taxi's drop-off point.
[0116] 3) Based on the preprocessed GPS data, the spatial relationship between the sampling points is analyzed using formula (2) to estimate the position of the unknown point Yu, thereby constructing the taxi's driving trajectory Traj.
[0117] 4) Extract the links between adjacent trajectory points on the driving trajectory Traj, set a time threshold t, and if the time interval between two trajectory points is less than the threshold t, it is considered that there is a link between the two trajectory points. The algorithm flow chart is as follows Figure 1 shown.
[0118]
[0119] Where Y u is the value of the unknown point, Y i is the value of the known point, X i is the weight of the known point, r i is the distance between the known point and the unknown point.
[0120] Extract traffic theme links and their classification:
[0121] The specific process of travel link classification based on travel purpose is as follows:
[0122] The purpose of travel link classification is to classify links according to different attribute characteristics or uses, and to distinguish travel links by their attribute characteristics or uses. In this embodiment, the transportation travel links are classified according to the point of interest (POI) type of the boarding and alighting point.
[0123] First, the pick-up and drop-off points are extracted from the taxi GPS data, and the pick-up and drop-off points are clustered to obtain passenger hotspots. Then, the POI data with a fixed radius with the passenger hotspot as the center is crawled, and the POI type with a large proportion is selected as the type of passenger hotspot. The passenger hotspot area is used as the starting and ending point of the travel link, and the starting and ending points are divided into four types: residential, office, life service, and school.
[0124] It can be seen from the actual travel situation of travelers that the number of passengers is the largest during peak hours in the morning and evening, because people have a greater demand for travel to work and school during the morning peak hour, while people have a higher demand for travel after get off work and shopping during the evening peak hour. Therefore, the travel links are divided into links from residence to company, residence to school, residence to life services, from school to company, school to life services, and round-trip links according to the attribute characteristics of the starting and ending points.
[0125] The specific process of extracting traffic theme links is as follows:
[0126] Trajectory similarity is an indicator used to measure the similarity between two trajectories. Based on the similarity, an optimal trajectory is found between the starting and ending points as the traffic theme link. The taxi chooses to travel along the traffic theme link, which can enable the taxi to reach the destination as quickly as possible.
[0127] First, preprocess the input trajectory coordinates, convert the longitude and latitude coordinates S to the tangent plane coordinates (x, y, z), and then convert the tangent plane coordinates (x, y, z) to the coordinate data (X, Y, Z) in the Cartesian coordinate system. Convert the longitude to radians and divide it by the radius of the earth to get a value less than 1 in radians, and convert the latitude directly to radians. Next, calculate the longitude and latitude distance between each point on the two trajectories. For each point i and j on the trajectory, the Euclidean distance formula can be used, that is,
[0128]
[0129] In the formula, x i and i is the Cartesian coordinate of point i, x j and j are the Cartesian coordinates of point j.
[0130] Then calculate the contribution of each point to the entire trajectory, calculate the similarity between the two trajectories based on the contribution, weight these distances and average them, and then calculate the similarity between the two trajectories. Finally, output the similarity between the two trajectories. The closer the similarity is to 1, the more similar the two trajectories are. Trajectories with close similarity are regarded as one trajectory. Traverse all links, count the number of times each travel link is walked between the boarding and alighting points, and extract the travel links with a travel number greater than the threshold.
[0131] The formula for calculating the contribution of a trajectory point to the entire trajectory is:
[0132]
[0133] The formula for calculating the similarity between two trajectories is:
[0134]
[0135] Where n is the number of points on the trajectory, and d(i, j) is the distance between trajectory points i and j.
[0136] First, determine the partitions of the OD points, extract the OD points with more travel demand, extract the paths between the OD partitions according to the similarity of the trajectories, and extract the traffic theme links with the most travel between each OD partition.
[0137] The specific steps are as follows:
[0138] Step 1: Calculate the distances from points O and D to the center points of each cluster respectively, and match the cluster center point numbers s_number and e_number that are closest to points O and D to confirm the partition of OD points.
[0139] Step 2: Group according to s_number and e_number of OD points, count the number of partitions count of the OD point partition, select the OD partitions where the number of partitions count is greater than 200, and count that there are hang rows in the partition.
[0140] Step 3: Extract all OD travel links in each partition and create tabular data guiji_ODzhuti for storing the topic links of all partitions.
[0141] Step 3.1: h = 0. When h < hang, take the value of the first column in the h-th partition as a, and the value of the second column as b. Set s_number in the OD partition to a and e_number to b. Extract the boarding time stime, alighting time etime, and license plate ID of each OD point in this partition, and count that there are hang_fenqu rows in this partition.
[0142] Step 3.2: Loop through each row i of this partition. Set open_time equal to the stime of the i-th row, set close_time equal to the etime of the i-th row, and C equal to the license plate ID of the i-th row. Create a list list, convert the trajectory data of the pick-up and drop-off points into an array, traverse each trajectory data item in the loop, take out the license plate number sh in the array. If C = sh, add item to list and convert list into tabular data.
[0143] Step 3.3: Extract the data in the partition where the time of the trajectory data is greater than open_time and less than close_time, add each trajectory data in the partition to guiji_fenqu. Initially, i = 0, and create a list Slist for counting the number of trips on the current path.
[0144] Step 4: Calculate the similarity between every two trajectories in the OD trajectories of the current partition, and consider the trajectories with close similarity as one trajectory.
[0145] Step 4.1: Repeat steps 3.2 - 3.3. Take out the trajectory data guiji_od1 of the i-th OD point, set r = i + 1, count the number of times s = 1 for the current route. When r is less than hang_fenqu, repeat steps 3.2 - 3.3 and take out the trajectory data guiji_od2 of the r-th OD point.
[0146] Step 4.2: Find each longitude and latitude (X j ,Y j )The latitude and longitude point closest to the latitude and longitude in guiji_od1 (X i ,X i ), the distance between the two coordinate points is calculated as dist according to the distance formula (3), and the sum of squares of each distance dist is calculated according to the formula (2), and then the square root is taken to obtain sqrt. If sqrt is less than the threshold, s=s+1.
[0147] Step 4.3: r = r + 1, repeat steps 4.1-4.2, and calculate the similarity between the i-th OD trajectory data and the r-th OD trajectory data. When r is greater than hang_fenqu, this loop ends and the value of s is added to Slist.
[0148] Step 5: i=i+1, repeat step 4 until i is greater than hang_fenqu, the loop ends.
[0149] Step 6: Extract the OD path with the most travel demand in the current OD partition, list the largest values in the list Slist, and store them in the list res, and create the table data guiji_ODzhuti1 that stores the current partition topic link.
[0150] Step 6.1: Take out the value b in res one by one, take out the value of stime in row b in the partition data, which is Otime, the value of etime in row b is Ctime, and the license plate ID in row b is C. Create a list blist so that the license plate number in the trajectory data is equal to C, and the trajectory data with time between Otime and Ctime is guiji0.
[0151] Step 6.2: Let a=b+1, repeat step 6.1, and get the trajectory data of the ath OD point guiji1. Take the square root of the sum of the longitude and latitude points of guiji0 and guiji1 and get sqrt. If sqrt is less than the threshold, add guiji0 and guiji1 to the table data guiji_ODzhuti1.
[0152] Step 6.3: a=a+1, loop step 6.2 until a is greater than hang_fenqu, the loop ends. Add the current partition's topic link track guiji_ODzhuti1 to guiji_Odzhuti.
[0153] Step 7: Extract the traffic theme link for the next partition, so that h=h+1, and repeat steps 3.1-6.3 until h is greater than hang.
[0154] Furthermore, the travel link travel time prediction process based on NGO-Attention-ConvLSTM is as follows:
[0155] Travel time series have the characteristics of complexity, volatility and nonlinearity. Using only a single model to predict the travel time of a travel link will affect the accuracy of the prediction results. Considering that NGO has strong global and local search capabilities, the Attention mechanism can automatically learn the characteristics of input data and perform corresponding weight allocation, and ConvLSTM can effectively capture spatial and temporal dependencies. This embodiment uses the NGO-Attention-ConvLSTM combined model to predict the travel time of a travel link, which can more accurately predict the travel time of a travel link and provide users with more effective travel suggestions.
[0156] The overall structure diagram of the NGO-Attention-ConvLSTM prediction model proposed in this embodiment is shown in the attached figure of the specification Figure 2 shown.
[0157] The input layer of the vehicle travel link travel time prediction model based on NGO-Attention-ConvLSTM is the characteristic index of factors affecting the travel time of urban taxis; the output layer is the predicted travel time of taxis. Figure 2 As can be seen, the model consists of 7 parts: the input layer is responsible for converting the received raw sequence data into a form readable by the model;
[0158] The convolution layer is used to extract local features in the input data. The convolution layer can contain multiple convolution kernels, each of which corresponds to a different feature. The LSTM layer has multiple LSTM units, each of which consists of an input gate, a forget gate, and an output gate to capture long-term dependencies in the input data.
[0159] NGO is used to optimize the parameters of the ConvLSTM layer to improve the prediction performance of the model;
[0160] The Attention mechanism weights the information of different time steps to help the model focus on more important information when predicting and improve the accuracy of the prediction. The fully connected layer fully connects the output of the Attention-ConvLSTM to obtain the final prediction result. The output layer converts the prediction result of the fully connected layer into a certain value in the time series data.
[0161] The Northern Goshawk optimization algorithm is specifically recorded as follows:
[0162] Northern Goshawk Optimization (NGO) is an optimization algorithm that simulates the hunting behavior of northern goshawks in nature. It was proposed by Mohammad Dehghani et al. in 2022. The basic idea of the algorithm is to imitate the behavior of goshawks in the hunting process, including prey identification and attack, pursuit, and prey escape and re-chase. The main purpose of the algorithm is to find the optimal solution in the search space to solve the optimization problem. It is mainly divided into two stages: global search stage and local search stage.
[0163] 2) Global search phase: In this phase, the northern goshawk will randomly select a prey in the search space and then quickly attack it. This process can be described by a mathematical model, such as equation (6) for position update and equation (7) for speed update, where the prey represents the objective function in the optimization problem, and the northern goshawk needs to find a solution that minimizes the objective function in the search space.
[0164] x t+1 =x t -a*(bx t ) (6)
[0165] v t+1 =v t -c*(wv t ) (7)
[0166] Where a and c are acceleration coefficients, b is the prey position, w is the goshawk position, xt is the current goshawk position, and vt is the current goshawk speed.
[0167] 3) Local search phase: After successfully attacking the prey, the northern goshawk will enter the local search phase. This phase can be seen as the process of the northern goshawk tracking and approaching the prey when the prey's location is known.
[0168] 4) In this process, the northern goshawk will constantly update its search strategy to better approach its prey. Using the simulated annealing method, a temperature parameter T can be set. In each iteration, the goshawk will decide whether to accept the new position based on the Metropolis criterion. The formula can be described as:
[0169]
[0170]
[0171] Where n is the number of samples in the validation set, y _i is the actual travel time, y _pred_iis the travel time predicted by the model, MSE is the mean square error between the predicted travel time and the true value of the Attention-ConvLSTM model, x new and x old are the new and old positions and T is the temperature.
[0172] 5) Update solution: After completing the local search, the northern goshawk will update its solution. This process involves attacking and chasing the prey, and adjusting the search strategy according to the prey's movement trajectory. Through this process, the northern goshawk can find a better solution in the search space.
[0173] 6) Repeat the above process: The northern goshawk will continue to repeat the process of global search, local search and solution update until it finds the optimal solution that meets the conditions.
[0174] This embodiment also combines the convolutional long short-term memory network model. Specifically, the convolutional long short-term memory network (ConvLSTM) is a deep learning model that combines the convolutional neural network (CNN) and the long short-term memory network (LSTM) for processing time series data. The traditional LSTM does not have a convolutional layer. The convolutional layer is added to the ConvLSTM, which can effectively extract the spatial features in the input data and has strong capabilities in processing time series data and spatial data. LSTM can only process sequences of fixed length, while the convolution layer in ConvLSTM can process sequence data of variable length. Its structure diagram is shown in the figure. Figure 3 As shown, the formula is:
[0175] i t =σ(W xi *h t-1 +b i ) (10)
[0176] f t =σ(W fh *h t-1 +b f ) (11)
[0177] o t =σ(W ho *h t +b o ) (12)
[0178] h t =σ(W ch *x t +b c ) (13)
[0179] Where: i t is the output of the input gate, f t is the output of the forget gate, o tis the output of the output gate, h t is the output of the convolutional layer, W xi , W fh , W ho , W ch They are the input gate, forget gate, output gate, and weight matrix of the convolutional layer, h t is the hidden state at the current moment, h t-1 is the hidden state at the previous moment, b i 、b f 、b o 、b c They are the input gate, forget gate, output gate, and bias vector of the convolution layer. σ is the sigmoid activation function, and * is the convolution operation.
[0180] Furthermore, this embodiment combines the attention mechanism of convolutional long short-term memory;
[0181] Specifically, the attention mechanism is a strategy widely used in deep learning models to dynamically adjust the weight of information at different positions when processing input sequences. The core idea of the attention mechanism is to give the model the ability to automatically learn and focus on the importance of different positions in the input sequence, so as to better capture key information related to the task. Its structure is as follows: Figure 4 shown.
[0182] First, a convolutional neural network (CNN) is used to extract features from travel links to obtain convolutional features. Then, the convolutional features are input into a long short-term memory network (LSTM) for time series analysis. An attention mechanism is introduced into the ConvLSTM model to make the model focus on the features of the input data that are useful for prediction and to weight different spatial positions and feature channels.
[0183] In the attention mechanism, the output sequence of each ConvLSTM [h t-s+1 , ..., h t-1 ,h t ] is used as the input sequence of the Attention mechanism, and an attention weight [α t-s+1 , ..., α t-1 , α t ] Finally, these weights are multiplied by the corresponding input values, and the products are summed to obtain a vector [H t-s+1 , ..., H t-1 , H t], as shown in formulas (13)-(15). In this process, the model can automatically learn to ignore unimportant or redundant information based on the attention weight, thereby improving the performance and efficiency of the model. Combining the ConvLSTM's Attention mechanism to predict the travel time of travel links can effectively capture local information and useful features in the prediction task, and weight the information at different time steps, thereby improving the accuracy and reliability of the prediction.
[0184] c t =W s *tanh(W xa *X t +W ha *h t +b a ) (14)
[0185]
[0186]
[0187] Where: W is the convolution kernel weight, X is the input feature, h is the input sequence of ConvLSTM, b a is the bias term, c t To calculate the median value of the attention coefficient for each feature region, α t is the attention weight, and H is the output sequence of the weighted sum.
[0188] Based on the foregoing, the example verification process in this embodiment is as follows:
[0189] Analysis of the results of extracting traffic theme links:
[0190] First, the traffic theme link is extracted. The data selected in this embodiment is the GPS trajectory data generated by more than 14,000 taxis in Chengdu from August 3 to August 30, 2014. The trajectory data is stored in CSV format and contains information such as vehicle ID, longitude, latitude, passenger status and time. The passenger pick-up and drop-off point data are clustered to obtain passenger hotspot areas, and Chengdu is divided into 41 areas. The types of the 41 areas are determined to be one of the four types of residential, office, life service and school by the type of POI.
[0191] A total of about 89,700 vehicle trajectory data and about 7.742 million trajectory points were selected on Monday, August 4. Travel links with a start and end point partition in passenger hotspots with more than 500 points were selected, and the longitude and latitude data were converted into Euclidean distance. In order to determine the appropriate similarity threshold, two trajectories with the same start and end points and the same taxi travel links were selected. The similarity thresholds were set to 0.5, 0.6, and 0.7 respectively. The test showed that the similarities of the two line trajectories were 0.82, 0.73, and 0.65. By comparing the similarity results under different similarity thresholds, it was found that when the similarity threshold was 0.5, the similarity of the two line trajectories was 0.82, which was higher than the similarity under the other two thresholds.
[0192] Therefore, the similarity threshold is set to 0.5 as the basis for judging whether two trajectories are similar. Taking the case of a maximum of one OD pair in the travel demand on Monday, there are multiple paths from the starting point to the destination. The one with the most taxi passes is selected as the traffic theme link, such as Figure 5 As shown in Figure (a), the travel links of all taxis between the OD pairs in each path, and in Figure (b), the maximum number of travel links of taxis in the OD pair in one path is 17, and this path serves as the traffic theme link between the starting and ending points.
[0193] According to the above method, 808 traffic theme links were extracted, among which, Figure 6 As shown, red represents 103 transportation theme links with residential areas and companies as the starting and ending points, green represents 262 transportation theme links with residential areas and schools as the starting and ending points, blue represents 99 transportation theme links with residential areas and life service areas as the starting and ending points, purple represents 133 transportation theme links with residential areas and residential areas as the starting and ending points, black represents 92 transportation theme links with schools and companies as the starting and ending points, and brown represents 119 transportation theme links with schools and life as the starting and ending points.
[0194] Then, the traffic theme links are extracted and the efficiency of calculation is analyzed;
[0195] This embodiment compares the computational efficiency of the similarity algorithm with Zhou Yang's graph density peak clustering algorithm and Wang Shaofan's method of distinguishing travel endpoints from stop points and inferring travel links using mobile phone GPS data. The results are shown in Table 1. The similarity algorithm proposed in this embodiment can effectively reduce the computational complexity when processing high-dimensional data and large-scale data sets. The similarity algorithm shows higher computational efficiency and has an advantage in the computational efficiency of extracting traffic theme links. This is because the similarity algorithm can find the correlation between data points faster when processing complex data, and compared with other algorithms, the similarity algorithm is more controllable in computational complexity.
[0196] Table 1 Comparison of computational efficiency between similarity algorithm and traditional algorithm
[0197] Algorithm Name Calculation time / s Graph Density Peak Clustering Algorithm 376.1532 Inferring travel links by distinguishing travel endpoints based on stop points 431.2317 Similarity Algorithm 86.345
[0198] Analysis of travel time prediction results
[0199] Experimental data and parameter settings
[0200] The peak hours in the morning, afternoon and evening are the periods when urban residents have a high demand for travel. The travel purposes and routes of travelers are relatively fixed. Taxi GPS data during peak hours are more representative than data at other times. Therefore, only taxi trajectory data during the morning peak hours of 7:00-9:00, the afternoon peak hours of 12:00-14:00, and the evening peak hours of 19:00-21:00 in Chengdu are selected. The time interval is selected as 15 minutes, that is, the data set includes 24 time intervals every day. The average travel time of the first 15 minutes, 30 minutes, 40 minutes and 60 minutes of each road section is calculated for the current time. The types of destinations are residential, office, life service and school. 70% of the data in the data set are selected for training the model, and 30% of the data are used for testing.
[0201] The input features are converted into numerical data and normalized; convolutional neural network is used to extract features, and the convolution kernel size is set to 3*3, the number of output channels is 16; the pooling kernel size is 2*2; the hidden layer dimension of LSTM is 64, and the number of iterations is 50; the attention weight dimension is 64, and the number of neurons in the attention layer is 16; the number of output nodes of the fully connected layer is 1, and the Sigmoid activation function is used.
[0202] The learning factor of the northern goshawk is set to 0.7, the inertia weight value is 0.9, the speed range is between 0.01 and 0.1, the population size is 40, the maximum number of iterations is 50, and the batch size, number of iterations, filter size, and number of convolution kernels in the Attention-ConvLSTM model after NGO algorithm optimization are 64, 50, 3*3, and 32, respectively. The mean squared error (MSE) is selected as the optimization objective function of NGO for Attention-ConvLSTM. MSE reflects the average square difference between the model travel time prediction result and the actual value. The convergence curve of the model is shown in Figure 2. Figure 7 As shown, when the number of iterations reaches 17, the MSE approaches 3.28%.
[0203] In order to enable the model to better capture information related to the prediction target, the attention mechanism is introduced, which can adjust the weights of the features accordingly, which helps to further optimize and adjust the model, thereby improving the real-time and accuracy of the travel time prediction of the travel link. The attention mechanism can automatically learn the correlation between different time steps in the input sequence and assign higher weights to important time steps, such as Figure 8 As shown, the attention coefficients of the 3rd, 5th, 14th, and 15th time steps are relatively large, the model pays more attention to them, and the attention to the 7th and 9th time steps is relatively low.
[0204] 3.2.2 Result analysis
[0205] In order to verify the accuracy of the NGO-Attention-ConvLSTM model in predicting the travel time of vehicle travel links, the Attention-ConvLSTM prediction model without optimization, the ConvLSTM model without attention mechanism and the commonly used LSTM model were selected for comparison. The model was used to randomly select 70 paths from the test set data to predict the travel time of vehicle travel links in the next 15 minutes. The comparison results between the actual values and predicted values of various models are shown in Figure 1. Fig. 9 As shown by Fig. 9 (a) It can be seen that the horizontal axis is each path, the vertical axis is the travel time, the red dotted line is the actual value of the path travel time, and the blue dotted line is the predicted value of the path travel time. It can be clearly shown that the model used in this embodiment can predict the path travel time with an accuracy of more than 90%. Fig. 9 (b) It can be seen that the LSTM model performs poorly in predicting the travel time of vehicle travel links. The travel time prediction values of the Attention-ConvLSTM and ConvLSTM models are somewhat different from the true values. The travel time prediction results of the NGO-Attention-ConvLSTM model are closest to the true values and have the best prediction effect. This model has high value in practical applications.
[0206] In order to quantify the prediction ability of each model for the travel time of the travel link and determine the effect of the model in practical application, the mean absolute error (MAE), mean relative error (MRE), mean absolute percentage error (MAPE), root mean squared error (RMSE), coefficient of determination (R 2 ), where MAE and MAPE focus on absolute errors, while MRE and RMSE focus on relative errors, both of which are used to measure the difference between the predicted value and the actual value. 2 It is used to evaluate the closeness between the predicted data and the real data. The five evaluation indicators can be expressed as:
[0207]
[0208]
[0209]
[0210]
[0211]
[0212] Where Y i represents the true value, represents the predicted value, represents the mean value, and n represents the number of samples.
[0213] Combination Fig.10 The table shows the average accuracy of 5 experiments of each model. The NGO-Attention-ConvLSTM model has the highest prediction accuracy. In terms of RMSE, the model reduces 187.346s, 127.238s, and 109.201s respectively. 2 The determination coefficient of this model is closest to 1, which is 28.4%, 19.9%, and 7.2% higher than other models respectively. The unoptimized Attention-ConvLSTM prediction model has certain advantages in various indicators compared with the ConvLSTM model without the attention mechanism and the commonly used LSTM model, indicating that the attention mechanism helps to improve the prediction accuracy. It can be seen that the model of this embodiment can be used as a preferred model in practical applications.
[0214] Therefore, in order to predict the travel time of vehicle travel links, we analyze traffic data and extract traffic theme links based on similarity to provide strong support for subsequent travel time prediction. We use the Attention-ConvLSTM vehicle travel link travel time prediction model based on the Northern Goshawk optimization algorithm. The convolutional long short-term memory network helps to extract the spatiotemporal characteristics of the link and enhance the model's expressiveness. The introduction of the attention mechanism enables the model to better focus on the key information related to the predicted target link. The Northern Goshawk optimization algorithm has good global search capabilities. By optimizing the model, it can find the optimal weight of the model faster, improve the convergence speed and prediction performance of the model, and thus improve the prediction accuracy. By comparing the error between the prediction results and the actual values, it is found that the evaluation indicators of the model are better than other methods, and the travel time of vehicle travel links can be accurately predicted.
[0215] It is easy to understand that those skilled in the art can combine, split, reorganize, etc. the embodiments of the present application to obtain other embodiments based on one or several embodiments provided in the present application, and these embodiments do not exceed the protection scope of the present application.
[0216] The present invention and its implementation methods are described schematically above, and the description is not restrictive. The embodiments shown in the embodiments are only part of the implementation methods of the present invention, and the actual structure is not limited thereto. Therefore, if a person skilled in the art is inspired by the embodiments and designs a structure and an implementation method similar to the technical solution without creativity without departing from the purpose of the invention, they should all fall within the protection scope of the present invention.
Claims
1. A vehicle travel time prediction method for travel link extraction, characterized in that: The following steps are involved: Step S1, obtaining the vehicle trajectory data of the taxi, and then extracting the traffic theme links and their classification; Step S2: constructing a vehicle travel link travel time prediction model based on NGO-Attention-ConvLSTM; Step S3: extract the results of the traffic theme link and obtain the predicted travel time of the vehicle travel link.
2. The vehicle travel time prediction method for travel link extraction according to claim 1 is characterized in that: The vehicle trajectory of the taxi in step S1, Traj data, is data recording the location information of the taxi in a certain period of time, which includes the unloaded trajectory points and the loaded trajectory points of the taxi; There are several trajectories in the taxi trajectory dataset, namely Path={Path1,Path2,K,Path n }(1) (1) Where Traj i represents the i-th trajectory; A trajectory Traj consists of multiple trajectory points, x1, x2, ..., x n , composed of, where a trajectory point x i It is the location data points collected by the GPS device during the taxi's driving process. These data points include vehicle identification ID, longitude lng, latitude lat, time time, and passenger status flag, expressed as: x i =(id i , lng i ,lat i , time i , flag i ); According to the driving trajectory of the taxi and the passenger status of the taxi, the pick-up and drop-off points of the taxi are judged and extracted, and the link information between the pick-up and drop-off points is extracted; First, based on the timestamp and location information in the GPS data, the taxi's driving trajectory is constructed, and the links between the various trajectory points are extracted from it. The specific steps are as follows: When the taxi's passenger-carrying status flag changes from 0 to 1, it means that the taxi will start to pick up passengers, and this information will be used as the taxi's pick-up point; When the taxi's passenger-carrying status flag changes from 1 to 0, it means the taxi has finished carrying passengers, and this information is used as the taxi's drop-off point; According to the preprocessed GPS data, the spatial relationship between the sampling points is analyzed using formula (2) to estimate the position of the unknown point Yu and construct the taxi's driving trajectory Traj; Extract the links between adjacent trajectory points on the driving trajectory Traj, set a time threshold t, and if the time interval between two trajectory points is less than the threshold t, it is considered that there is a link between the two trajectory points; Where Y u is the value of the unknown point, Y i is the value of the known point, X i is the weight of the known point, r i is the distance between the known point and the unknown point.
3. The vehicle travel time prediction method for travel link extraction according to claim 2 is characterized in that: The method for extracting traffic theme links in step S1 is based on similarity, and specifically includes: First, the input trajectory coordinates are preprocessed, the S longitude and latitude coordinates are converted to the tangent plane coordinates (x, y, z), and then the tangent plane coordinates (x, y, z) are converted to the coordinate data (X, Y, Z) in the Cartesian coordinate system, the longitude is converted to radians and divided by the radius of the earth to obtain a value less than 1 in radians, and the latitude is directly converted to radians; Next, calculate the longitude and latitude distance between each point on the two trajectories. For each point i and j on each trajectory, use the Euclidean distance formula, that is, In the formula, x i and i is the Cartesian coordinate of point i, x j and j are the Cartesian coordinates of point j; Then calculate the contribution of each point to the entire trajectory, calculate the similarity between the two trajectories based on the contribution, take the weighted average of these distances, and then calculate the similarity between the two trajectories. Finally, the similarity between the two trajectories is output, all links are traversed, the number of times each travel link is walked between the boarding and alighting points is counted, and the travel links with a travel number greater than the threshold are extracted; The formula for calculating the contribution of a trajectory point to the entire trajectory is: The formula for calculating the similarity between two trajectories is: Where n is the number of points on the trajectory, d(i, j) is the distance between trajectory points i and j; First, determine the partitions of the OD points, extract the OD points with more travel demand, extract the paths between the OD partitions according to the similarity of the trajectories, and extract the traffic theme links with the most travel between each OD partition.
4. The vehicle travel time prediction method for travel link extraction according to claim 3 is characterized in that: The classification method of the traffic theme link in step S1 is performed based on the travel purpose, and the classification method is as follows: First, we extract the pick-up and drop-off points from the taxi GPS data and cluster the pick-up and drop-off points to get the passenger hotspots. Next, crawl the POI data with a fixed radius around the passenger hotspot as the center, select the POI type with the largest proportion as the type of passenger hotspot, and use the passenger hotspot area as the starting and ending point of the travel link. The types of starting and ending points are divided into four types: residential, office, life service and school; Travel links are divided into links from residence to company, residence to school, residence to life services, from school to company, school to life services, and round-trip links according to the attribute characteristics of the starting and ending points.
5. The vehicle travel time prediction method for travel link extraction according to claim 1, characterized in that: The model in step S2 includes: The input layer is used to convert the received raw sequence data into a form readable by the model; Convolutional layer, used to extract local features from input data. A convolutional layer can contain multiple convolution kernels, each of which corresponds to a different feature. LSTM layer, which has multiple LSTM units. Each LSTM unit consists of an input gate, a forget gate, and an output gate to capture long-term dependencies in the input data. Northern Goshawk optimization algorithm, used to optimize the parameters of the ConvLSTM layer; Attention mechanism, which is used to weight information at different time steps to help the model focus on more important information when making predictions; The fully connected layer is used to fully connect the output of Attention-ConvLSTM to obtain the final prediction result; The output layer is used to transform the prediction results of the fully connected layer into a numerical value in the time series data.
6. The vehicle travel time prediction method for travel link extraction according to claim 5 is characterized in that: The northern goshawk optimization algorithm is mainly divided into two stages: global search stage and local search stage; Global search phase: In this phase, the northern goshawk is used to randomly select a prey in the search space and then quickly attack it; This process is described by a mathematical model, such as equation (6) for position update and equation (7) for velocity update, where the prey represents the objective function in the optimization problem, and the northern goshawk needs to find a solution that minimizes the objective function in the search space; x t+1 =x t -a*(b-x t )(6) v t+1 =v t -c*(w-v t )(7) Where a and c are acceleration coefficients, b is the position of the prey, w is the position of the goshawk, and x is t is the current position of the goshawk, v t is the current speed of the goshawk; Local search phase: After successfully attacking the prey, the northern goshawk will enter the local search phase. Using the simulated annealing method, a temperature parameter T is set. In each iteration, the goshawk will decide whether to accept the new position according to the Metropolis criterion. The formula can be described as: In the formula, n is the number of samples in the validation set, y _i is the actual travel time, y _pred_i is the travel time predicted by the model, MSE is the mean square error between the predicted travel time and the true value of the Attention-ConvLSTM model, x new and x old are the new and old positions and T is the temperature.
7. The vehicle travel time prediction method for travel link extraction according to claim 6 is characterized in that: The formulas for the convolutional layer and LSTM layer are: I t =σ(W xi *h t-1 +b i ) (10) f t =σ(W fh *h t-1 +b f ) (11) the t =σ(W ho *h t +b o ) (12) h t =σ(W ch *x t +b c ) (13) Where: i t is the output of the input gate, f t is the output of the forget gate, o t is the output of the output gate, h t is the output of the convolutional layer, W xi , W fh , W ho , W ch They are the input gate, forget gate, output gate, and weight matrix of the convolutional layer, h t is the hidden state at the current moment, h t-1 is the hidden state at the previous moment, b i 、b f 、b o 、b c They are the input gate, forget gate, output gate, and bias vector of the convolution layer. σ is the sigmoid activation function, and * is the convolution operation.
8. The vehicle travel time prediction method for travel link extraction according to claim 7, characterized in that: Introducing the attention mechanism into the ConvLSTM model so that the model focuses on the features of the input data that are useful for prediction and weights different spatial positions and feature channels; In the attention mechanism, the output sequence [h t-s+1 , ..., h t-1 ,h t ] as the input sequence of the Attention mechanism, For each position in the input sequence, an attention weight [α t-s+1 , ..., α t-1 , α t ], Finally, these weights are multiplied by the corresponding input values, and the products are summed to obtain a vector [H t-s+1 , ..., H t-1 , H t ], formulas as (14)-(16); c t =W s *tanh(W xa *X t +W ha *h t +b a ) (14) Where: W is the convolution kernel weight, X is the input feature, h is the input sequence of ConvLSTM, b a is the bias term, c t To calculate the median value of the attention coefficient for each feature region, α t is the attention weight, and H is the output sequence of the weighted sum.
9. A vehicle travel time prediction device for travel link extraction, comprising a memory and a processor, wherein a computer program is stored in the memory, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Predictive parsing method for track of vehicle
CN104318327A
Method and device for predicting driving time of vehicle
CN107331149A
Cargo transportation route planning method and system based on history data and server
CN107346478A
Travel time prediction method and system based on multi-dimensional trajectory, and electronic device
CN109376906A
A travel time prediction method based on multi-modal data fusion and multi-model integration
CN109670277A
