Arrival Time Prediction Method, Device, Electronic Device, and Storage Medium
By generating a section network and processing the section data in combination with clustering and feature extraction models, the problems of low prediction accuracy and large calculation amount in the prior art are solved, and high-precision and efficient arrival time prediction are achieved.
Patent Information
- Application Number
- CN202111383461.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-22
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2041-11-22
AI Technical Summary
In the prior art, the method for predicting the arrival time has low prediction accuracy and large calculation amount, making it difficult to effectively improve the estimation performance and time efficiency of the arrival time prediction model.
The road segment network is generated by obtaining the target road segment data. After embedding processing, the road segment feature vector is processed using the clustering algorithm and the spatiotemporal feature extraction model, and combined with the auxiliary feature extraction model, travel time prediction and approximate estimation are performed.
It improves the prediction accuracy of arrival time, and effectively reduces the calculation amount and improves time efficiency.
Smart Images

Figure CN114154693B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of transportation, and in particular, to a method, apparatus, electronic device, and storage medium for predicting arrival time. Background Art
[0002] Predicting the Estimated Time of Arrival (ETA) is an important part of intelligent transportation systems. Currently, there are mainly two methods for predicting the arrival time. One is the method for predicting the arrival time based on GPS trajectories. This method regards the predicted arrival time (ETA) as a regression problem and takes into account that GPS trajectories contain rich time and space information. By using the powerful representation ability of deep neural networks (DNN) to capture the high-dimensional features of GPS trajectories for arrival time prediction. However, the difficulty of this method is that the spatial correlation of GPS is diverse and complex, making it a challenge to explicitly extract the features of each trajectory, and it is unrealistic to predict the future GPS trajectories of a trip. The other is the method for predicting the arrival time based on road segments. This method divides a trip into a series of individual road segments and considers their interactions. However, the method for predicting the arrival time based on road segments requires the use of complex neural networks for feature extraction for each road segment, which requires a large amount of computing resources and is very inefficient in terms of time. Therefore, how to provide a method for predicting the arrival time, improving the estimation performance of the arrival time prediction model, and effectively reducing the amount of calculation has become an urgent problem to be solved. Summary of the Invention
[0003] The present invention aims to at least solve one of the technical problems existing in the prior art. For this purpose, the present invention provides a method for predicting the arrival time, which can improve the prediction accuracy of the arrival time, effectively reduce the amount of calculation, and improve the time efficiency.
[0004] The present invention also provides an arrival time prediction apparatus having the above-mentioned arrival time prediction method.
[0005] The present invention also provides an electronic device having the above-mentioned arrival time prediction method.
[0006] The present invention also provides a computer-readable storage medium.
[0007] According to an embodiment of the first aspect of the present invention, the method for predicting the arrival time includes:
[0008] Obtain target road segment data;
[0009] Generate a road segment network according to the target road segment data;
[0010] Perform embedding processing on the road segment network to obtain a road segment feature vector;
[0011] Perform clustering on the road segment feature vectors through a preset clustering algorithm to obtain a target road segment sequence;
[0012] Extract features from the target road segment sequence through a preset spatio-temporal feature extraction model to obtain spatio-temporal feature vectors;
[0013] Extract features from the target road segment sequence through a preset auxiliary feature extraction model to obtain auxiliary feature vectors;
[0014] Predict the travel time based on the spatio-temporal feature vectors and the auxiliary feature vectors to obtain a target trip classification value;
[0015] Perform approximate estimation based on the target trip classification value to obtain target travel time data.
[0016] According to the arrival time prediction method of the embodiments of the present invention, it has at least the following beneficial effects: This arrival time prediction method obtains target road segment data; generates a road segment network according to the target road segment data; performs embedding processing on the road segment network to obtain road segment feature vectors; performs clustering on the road segment feature vectors through a preset clustering algorithm to obtain a target road segment sequence; extracts features from the target road segment sequence through a preset spatio-temporal feature extraction model to obtain spatio-temporal feature vectors; extracts features from the target road segment sequence through a preset auxiliary feature extraction model to obtain auxiliary feature vectors; predicts the travel time based on the spatio-temporal feature vectors and the auxiliary feature vectors to obtain a target trip classification value; performs approximate estimation based on the target trip classification value to obtain target travel time data; in this way, the prediction accuracy of the arrival time can be improved, while effectively reducing the calculation amount and improving the time efficiency.
[0017] According to some embodiments of the present invention, the performing embedding processing on the road segment network to obtain road segment feature vectors includes:
[0018] Perform graph embedding processing on the road segment network to obtain a road segment walk sequence;
[0019] Perform node embedding processing on the road segment walk sequence to obtain the road segment feature vectors.
[0020] According to some embodiments of the present invention, the performing clustering on the road segment feature vectors through a preset clustering algorithm to obtain a target road segment sequence includes:
[0021] Perform clustering on the road segment feature vectors through the K-Means clustering algorithm to obtain a labeled road segment sequence;
[0022] Perform merging processing on the labeled road segment sequence according to a preset clustering label to obtain the target road segment sequence.
[0023] According to some embodiments of the present invention, the feature extraction of the target road segment sequence by the preset spatio-temporal feature extraction model to obtain a spatio-temporal feature vector includes:
[0024] Performing forward feature extraction on the target road segment sequence through a first recurrent neural network layer to obtain a forward hidden vector;
[0025] Performing backward feature extraction on the target road segment sequence through a second recurrent neural network layer to obtain a backward hidden vector;
[0026] Performing fusion processing on the forward hidden vector and the backward hidden vector to obtain the time feature vector.
[0027] According to some embodiments of the present invention, the feature extraction of the target road segment sequence by the preset auxiliary feature extraction model to obtain an auxiliary feature vector includes:
[0028] Classifying the target road segment sequence according to the preset travel time category label to obtain a travel time category value;
[0029] Calculating the probability of the travel time category value through a preset probability density function to obtain a classification probability value corresponding to the travel time category value;
[0030] Performing normalization processing on the obtained travel distance to obtain a normalized travel distance value;
[0031] Performing embedding processing on the obtained travel time and travel weather respectively to obtain a travel time category value and a travel weather category value;
[0032] Performing fusion processing on the normalized travel distance value, travel time category value, travel weather category value, and the classification probability value to obtain the auxiliary feature vector.
[0033] According to some embodiments of the present invention, the prediction of the travel time based on the spatio-temporal feature vector and the auxiliary feature vector to obtain a target travel classification value includes:
[0034] Performing prediction processing on the spatio-temporal feature vector to obtain a first prediction data;
[0035] Performing prediction processing on the auxiliary feature vector to obtain a second prediction data;
[0036] Performing splicing processing on the first prediction data and the second prediction data to obtain a third prediction data;
[0037] Performing prediction processing on the third prediction data to obtain a target travel classification value.
[0038] According to some embodiments of the present invention, the approximate estimation based on the target trip classification value to obtain target travel time data includes:
[0039] Obtain the classification confidence corresponding to the target trip classification value;
[0040] Approximately estimate the target trip classification value according to the classification confidence to obtain target travel time data.
[0041] According to the arrival time prediction device of the second aspect embodiment of the present invention, the arrival time prediction device includes:
[0042] An acquisition module, configured to acquire target road segment data;
[0043] A generation module, configured to generate a road segment network according to the target road segment data;
[0044] An embedding module, configured to perform embedding processing on the road segment network to obtain feature vectors of each road segment;
[0045] A clustering module, configured to perform clustering processing on the feature vectors through a preset clustering algorithm to obtain a target road segment sequence;
[0046] A first extraction module, configured to extract features from the target road segment sequence through a preset spatio-temporal feature extraction model to obtain spatio-temporal feature vectors;
[0047] A second extraction module, configured to extract features from the target road segment sequence through a preset auxiliary feature vector model to obtain auxiliary feature vectors;
[0048] A prediction module, configured to perform travel time prediction according to the spatio-temporal feature vectors and the auxiliary feature vectors to obtain a target trip classification value;
[0049] An approximate estimation module, configured to perform approximate estimation according to the target trip classification value to obtain target travel time data.
[0050] The arrival time prediction device according to an embodiment of the present invention has at least the following beneficial effects: Such an arrival time prediction device acquires target road section data through an acquisition module; a generation module generates a road section network according to the target road section data; an embedding module performs embedding processing on the road section network to obtain a road section feature vector; a clustering module performs clustering processing on the road section feature vector through a preset clustering algorithm to obtain a target road section sequence; a first extraction module extracts features from the target road section sequence through a preset spatio-temporal feature extraction model to obtain a spatio-temporal feature vector; a second extraction module extracts features from the target road section sequence through a preset auxiliary feature vector extraction model to obtain an auxiliary feature vector; performs travel time prediction according to the spatio-temporal feature vector and the auxiliary feature vector to obtain a target trip classification value; an approximation estimation module performs approximation estimation according to the target trip classification value to obtain target travel time data; in this way, the prediction accuracy of the arrival time can be improved, and at the same time, the calculation amount can be effectively reduced and the time efficiency can be improved.
[0051] An electronic device according to a third aspect embodiment of the present invention includes a memory, a processor, and a computer program that can run on the memory and on the processor. When the processor executes the program, it implements the arrival time prediction method according to the first aspect embodiment of the present invention.
[0052] The electronic device according to an embodiment of the present invention has at least the following beneficial effects: Such an electronic device adopts the above arrival time prediction method to acquire target road section data; generates a road section network according to the target road section data; performs embedding processing on the road section network to obtain a road section feature vector; performs clustering processing on the road section feature vector through a preset clustering algorithm to obtain a target road section sequence; extracts features from the target road section sequence through a preset spatio-temporal feature extraction model to obtain a spatio-temporal feature vector; extracts features from the target road section sequence through a preset auxiliary feature extraction model to obtain an auxiliary feature vector; performs travel time prediction according to the spatio-temporal feature vector and the auxiliary feature vector to obtain a target trip classification value; performs approximation estimation according to the target trip classification value to obtain target travel time data; in this way, the prediction accuracy of the arrival time can be improved, and at the same time, the calculation amount can be effectively reduced and the time efficiency can be improved.
[0053] A computer-readable storage medium according to a fourth aspect embodiment of the present invention stores computer-executable instructions, and the computer-executable instructions are used to execute the arrival time prediction method according to the first aspect embodiment.
[0054] According to the computer-readable storage medium of the embodiments of the present invention, it has at least the following beneficial effects: The computer-readable storage medium stores computer-executable instructions. The computer-executable instructions adopt the above-mentioned arrival time prediction method, including obtaining target road section data; generating a road section network according to the target road section data; performing an embedding process on the road section network to obtain a road section feature vector; performing a clustering process on the road section feature vector through a preset clustering algorithm to obtain a target road section sequence; performing feature extraction on the target road section sequence through a preset spatio-temporal feature extraction model to obtain a spatio-temporal feature vector; performing feature extraction on the target road section sequence through a preset auxiliary feature extraction model to obtain an auxiliary feature vector; predicting the travel time according to the spatio-temporal feature vector and the auxiliary feature vector to obtain a target travel classification value; performing an approximate estimation according to the target travel classification value to obtain target travel time data. In this way, the prediction accuracy of the arrival time can be improved, the calculation amount can be effectively reduced, and the time efficiency can be improved.
[0055] Additional aspects and advantages of the present invention will be given in part in the following description, become apparent in part from the following description, or be learned through the practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] The following further describes the present invention with reference to the drawings and embodiments, where:
[0057] Figure 1 is a flowchart of an arrival time prediction method according to an embodiment of the present invention;
[0058] Figure 2 is Figure 1 a flowchart of step S300 in
[0059] Figure 3 is Figure 1 a flowchart of step S400 in
[0060] Figure 4 is Figure 1 a flowchart of step S500 in
[0061] Figure 5 is Figure 1 a flowchart of step S600 in
[0062] Figure 6 is Figure 1 a flowchart of step S700 in
[0063] Figure 7 is Figure 1 a flowchart of step S800 in
[0064] Figure 8 is a structural schematic diagram of an arrival time prediction device according to another embodiment of the present invention.
[0065] Reference numerals: 910, acquisition module; 920, generation module; 930, embedding module; 940, clustering module; 950, first extraction module; 960, second extraction module; 970, prediction module; 980, approximate estimation module. Detailed implementation manners
[0066] Embodiments of the present invention will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only for explaining the present invention and should not be construed as limiting the present invention.
[0067] In the description of the present invention, it should be understood that with respect to the orientation description, such as the orientation or positional relationship indicated by up, down, front, back, left, right, etc. is based on the orientation or positional relationship shown in the accompanying drawings. It is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as limiting the present invention.
[0068] In the description of the present invention, the meaning of several is more than one, the meaning of a plurality is more than two, and understandings such as greater than, less than, exceeding, etc. do not include the present number, and understandings such as above, below, within, etc. include the present number. If there is a description of first and second, it is only for the purpose of distinguishing technical features and should not be construed as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features or implicitly indicating the sequence relationship of the indicated technical features.
[0069] In the description of the present invention, unless otherwise clearly defined, terms such as setting, installation, connection, etc. should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above terms in the present invention in combination with the specific content of the technical solution.
[0070] In the description of the present invention, the description with reference to terms such as "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples", etc. means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic descriptions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.
[0071] In a first aspect, with reference to Figure 1 , the arrival time prediction method according to the embodiment of the present invention includes:
[0072] S100. Obtain the data of the target road section;
[0073] S200. Generate a road network based on the data of the target road section;
[0074] S300. Embed the road network to obtain a road section feature vector;
[0075] S400. Cluster the road section feature vectors through a preset clustering algorithm to obtain a target road section sequence;
[0076] S500. Extract features from the target road section sequence through a preset spatio-temporal feature extraction model to obtain a spatio-temporal feature vector;
[0077] S600. Extract features from the target road section sequence through a preset auxiliary feature extraction model to obtain an auxiliary feature vector;
[0078] S700. Predict the travel time based on the spatio-temporal feature vector and the auxiliary feature vector to obtain a target travel classification value;
[0079] S800. Make an approximate estimate based on the target travel classification value to obtain target travel time data.
[0080] When predicting the arrival time, first obtain the data of the target road section. It should be noted that a road section is represented by Link, which is defined as a triple [l id ,l ratio ,l status , where l id represents the ID number of the road section; l ratio represents the coverage ratio of the road section in a trip, where l ratio ∈ (0, 1]. Except for the first and the last road sections in the trip, l ratio of the remaining road sections = 1; l status represents the road section state at the start of the trip. l status includes five types, namely 0 - unknown, 1 - unobstructed, 2 - slow, 3 - congested, and 4 - extremely congested. Generate a road network based on the data of the target road section. The basic road network is represented as a directed graph G=(V, A) of the road sections. Among them, V represents the set of nodes, that is, the set of road sections in the network, and the connectivity between road sections is represented by A. For example, A ij= 1 indicates that section j is the downstream section of section i. The section network is embedded to obtain section feature vectors; the section feature vectors are clustered through a preset clustering algorithm to obtain a target section sequence, which is a section sequence obtained by merging spatially adjacent sections. Merging spatially adjacent sections can reduce the impact of changes in the number of section sequences and also reduce the computational complexity of the spatio-temporal feature extraction model. The target section sequence is subjected to feature extraction through a preset spatio-temporal feature extraction model to obtain spatio-temporal feature vectors. For example, a BiGRU (Bidirectional Gated Recurrent Unit) neural network model is used to extract spatio-temporal features from the target section sequence, thereby further extracting high-dimensional spatio-temporal feature vectors. The target section sequence is subjected to feature extraction through a preset auxiliary feature extraction model to obtain auxiliary feature vectors. It should be noted that after extracting the spatio-temporal feature vectors from the target section sequence, other trip features are also considered, the trip time is divided into multiple categories, and external attributes such as trip distance, travel time, and travel weather are embedded, thereby improving the estimation performance of the arrival time prediction model. The travel time is predicted based on the spatio-temporal feature vectors and the auxiliary feature vectors to obtain a target trip classification value. An approximate estimation is performed based on the target trip classification value to obtain target travel time data. The spatio-temporal feature vectors and the auxiliary feature vectors are input into the prediction model, and the arrival time is estimated through weighted approximate values of various categories. This classification approximation method can reduce the error caused by the uneven distribution of trip times compared to the regression method and has less computational complexity, effectively improving the time efficiency and achieving high-precision estimation performance.
[0081] Refer to Figure 2 , in some embodiments, step S300 includes:
[0082] S310, perform graph embedding processing on the section network to obtain a section walk sequence;
[0083] S320, perform node embedding processing on the section walk sequence to obtain section feature vectors.
[0084] When predicting the arrival time, after obtaining the section network, in order to reduce the fluctuation of the number of section sequences and also reduce the computational complexity, first merge spatially adjacent sections. Specifically, during the process of merging section sequences, first perform graph embedding processing on the section network. Among them, the DeepWalk network embedding model is used for graph embedding processing. The DeepWalk network embedding model uses random walks starting from specific nodes to obtain section walk sequences, and then performs node embedding processing on the section walk sequences through the Skip-Gram embedding model to obtain section feature vectors. Among them, the embedding learning model can be represented by the following formula:
[0085]
[0086] Among them, a walk sequence is defined as \(W = \{v_1, v_2, \cdots, v\) n \}, where \(v\) represents a node in the road segment network, and \(v\) i represents a node in the walk sequence \(\{v\) i -w, \cdots, v\) i+w \}, \(w\) represents the size of the window, and \(\theta\) represents an empirical two-layer neural network.
[0087] The learning process is to maximize the probability that the adjacent nodes of \(v\) i in the walk sequence with window size \(w\). After embedding learning, nodes with common neighbors have similar embeddings. In some specific embodiments, the step size of the walk is set to 30, and the size of the window is set to 10.
[0088] Referring to Figure 3 , in some embodiments, step S400 includes:
[0089] S410, clustering the road segment feature vectors by the K-Means clustering algorithm to obtain a labeled road segment sequence;
[0090] S420, merging the labeled road segment sequence according to the preset clustering labels to obtain a target road segment sequence.
[0091] After embedding processing the road segment network, the K-Means clustering method is used to cluster the road segment feature vectors. After clustering, a labeled road segment sequence is obtained, and then the labeled road segment sequence is merged according to the preset clustering labels to obtain a target road segment sequence. The target road segment sequence is represented by \(L'=\{l'_1, l'_2, \cdots, l'\) d \}, and the original road segments in the network are \(L = \{l_1, l_2, \cdots, l\) n \}, where \(d < n\). This process can be expressed as \(\{l\) i , l\) i+1 , \cdots, l\) j \} \to l'\), and the number of merged road segments in the merged road segment sequence \(l'\) is denoted as \(|l'|\). The road segment features of the target road segment sequence are represented by the following formula:
[0092]
[0093]
[0094]
[0095] Among them, \(l'\) len represents the weight of \(l'\) in the entire road segment sequence \(L\). Since \(l\) status is represented by a category, then \(l\)status Through one-hot encoding to B 5 After that, a merged target road segment sequence L′ with a shape of R can be obtained. d×7
[0096] Refer to Figure 4 , in some embodiments, step S500 includes:
[0097] S510, performing forward feature extraction on the target road segment sequence through a first recurrent network layer to obtain a forward hidden vector;
[0098] S520, performing backward feature extraction on the target road segment sequence through a second recurrent network layer to obtain a backward hidden vector;
[0099] S530, performing fusion processing on the forward hidden vector and the backward hidden vector to obtain a temporal feature vector.
[0100] After merging adjacent road segments in space to obtain the target road segment sequence, feature extraction is performed on the target road segment sequence through a GRU neural network model. The GRU neural network model includes a reset gate and an update gate. The reset gate and the update gate are gating units used to determine whether to save or delete information in the next state. For example, given a sequence x as the input quantity, the hidden state at time stamp t can be calculated by the following formula:
[0101] r t =σ(W r ·[h t-1 ,x t ),
[0102] z t =σ(W z ·[h t-1 ,x t ),
[0103]
[0104]
[0105] Among them, r t represents the reset gate, z t represents the update gate, h t-1 represents the hidden state of the previous state, represents the current candidate state, σ represents the sigmoid activation function, and * represents the Hadamard product. By using the BiGRU model as the extraction component, two GRU layers are stacked to capture the forward hidden state and the backward hidden state of the target road segment sequence. Specifically, the target road segment sequence L′={l′1, l′2,..., l′ d Input the BiGRU model, perform forward feature extraction on the target road segment sequence through the first recurrent network layer to obtain a forward hidden vector; perform backward feature extraction on the target road segment sequence through the second recurrent network layer to obtain a backward hidden vector. The forward hidden state at time t is represented by and the backward hidden state is Fuse the forward hidden state and the backward hidden state to obtain a time feature vector In some specific embodiments, the hidden unit size of the BiGRU model is set to 256.
[0106] Referring to Figure 5 , in some embodiments, step S600 includes:
[0107] S610, classify the target road segment sequence according to the preset travel time category label to obtain a travel time category value;
[0108] S620, calculate the probability of the travel time category value through the preset probability density function to obtain the classification probability value corresponding to the travel time category value;
[0109] S630, normalize the obtained travel distance to obtain a normalized travel distance value;
[0110] S640, perform embedding processing on the obtained travel time and travel weather respectively to obtain a travel time category value and a travel weather category value;
[0111] S650, fuse the normalized travel distance value, travel time category value, travel weather category value, and classification probability value to obtain an auxiliary feature vector.
[0112] After obtaining the time feature vector of the target road segment sequence, in order to reduce the error caused by the uneven distribution of travel time, the travel time is converted into a classification value, that is, the target road segment sequence is classified according to the preset travel time category label to obtain a travel time category value, where the number of trips in each category is the same. Then, the probability of the travel time category value is calculated through the preset probability density function to obtain the classification probability value corresponding to the travel time category value. The classification probability value is calculated by the following formula:
[0113]
[0114] where C represents the number of categories of travel time, f(t) represents the probability density function of travel time in the training set, β i represents the threshold of the i-th category, and the label c i of the i-th category represents the average travel time of all trips in this category.
[0115] In addition, since some external attributes can affect the travel time, the travel distance value, the travel time category value, and the travel weather category value are also embedded to improve the estimation performance of the system. Specifically, since the travel distance, travel time, and travel weather have important impacts on the travel time, the obtained travel distance is normalized through a z-score model to obtain a normalized travel distance value, and the travel time and travel weather are respectively embedded. Specifically, the departure time is embedded into R 8 , the departure date is embedded into R 3 , and the travel weather is embedded into R 3 to obtain the travel time category value and the travel weather category value. The normalized travel distance value, the travel time category value, the travel weather category value, and the classification probability value are fused to obtain an auxiliary feature vector.
[0116] Referring to Figure 6 , in some embodiments, step S700 includes:
[0117] S710, performing prediction processing on the spatio-temporal feature vector to obtain first prediction data;
[0118] S720, performing prediction processing on the auxiliary feature vector to obtain second prediction data;
[0119] S730, performing splicing processing on the first prediction data and the second prediction data to obtain third prediction data;
[0120] S740, performing prediction processing on the third prediction data to obtain a target travel classification value.
[0121] After obtaining the spatio-temporal feature vector and the auxiliary feature vector of the target road segment sequence, a prediction model is set up to obtain the target trip classification value. Among them, the prediction model consists of three sets of consecutive fully connected layers (FCL), namely FC-link, FC-attr, and FC-out. FC-link uses the spatio-temporal feature vector as the input, while FC-attr uses the auxiliary feature vector as the input. FC-link and FC-attr have the same hidden layer and output layer sizes. In some specific embodiments, the sizes of the hidden layer and the output layer are respectively set to 1024 and 128. FC-link outputs the first prediction data, FC-attr outputs the second prediction data. The first prediction data and the second prediction data are concatenated to obtain the third prediction data, and the third prediction data is sent to FC-out. The size of the hidden layer of FC-out is set to 1024, and the size of the output layer depends on the number of classes. Except for the output layer in FC-out, the rectified linear unit (ReLU) is also applied as the activation of other layers. In the training phase, 20% of the connections between neurons in the FC layer are randomly removed to prevent overfitting. FC-out performs prediction processing on the third prediction data and outputs the result to the softmax function for processing, so as to obtain the target trip classification value. The formula of the softmax function is defined as follows:
[0122]
[0123] Among them, C represents the number of classes, and p i represents the probability that the input belongs to the i-th class. The loss function L s uses the categorical cross-entropy loss function, which is defined by the following formula:
[0124]
[0125] Among them, y i represents the label that the input belongs to the i-th class. L s can be optimized by the gradient descent algorithm.
[0126] Referring to Figure 7 , in some embodiments, step S800 includes:
[0127] S810, obtaining the classification confidence corresponding to the target trip classification value;
[0128] S820, approximately estimating the target trip classification value according to the classification confidence to obtain the target travel time data.
[0129] After obtaining the target trip classification value, obtain the classification confidence corresponding to the target trip classification value, select the category with a higher confidence, and then estimate the arrival time by the weighted average of the corresponding classification labels. If a trip has similar confidences in several categories, then the travel time of this trip will be close to the thresholds of these categories. Specifically, take the output probability of the softmax function as the confidence of the classification result, and select the class with the largest k probabilities as K. The hyperparameter k defines the degree of approximation, which represents the number of approximate categories. Thus, the target travel time data is calculated by the following formula:
[0130]
[0131] Wherein, represents the predicted target travel time data, p j represents the probability output of the softmax function, c j represents the category label, and K represents the set of categories where p j is relatively high.
[0132] In a second aspect, referring to Figure 8 , the arrival time prediction device according to the embodiment of the present invention includes:
[0133] An acquisition module 910, configured to acquire target road segment data;
[0134] A generation module 920, configured to generate a road segment network according to the target road segment data;
[0135] An embedding module 930, configured to perform embedding processing on the road segment network to obtain a road segment feature vector;
[0136] A clustering module 940, configured to perform clustering processing on the road segment feature vectors through a preset clustering algorithm to obtain a target road segment sequence;
[0137] A first extraction module 950, configured to extract features from the target road segment sequence through a preset spatio-temporal feature extraction model to obtain a spatio-temporal feature vector;
[0138] A second extraction module 960, configured to extract features from the target road segment sequence through a preset auxiliary feature extraction model to obtain an auxiliary feature vector;
[0139] A prediction module 970, configured to perform travel time prediction according to the spatio-temporal feature vector and the auxiliary feature vector to obtain a target trip classification value;
[0140] An approximate estimation module 980, configured to perform approximate estimation according to the target trip classification value to obtain target travel time data.
[0141] When predicting the arrival time, the acquisition module 910 acquires the target road segment data. Further, the generation module 920 generates a road segment network based on the target road segment data. The embedding module 930 performs an embedding process on the road segment network to obtain a road segment feature vector. The clustering module 940 performs a clustering process on the road segment feature vector through a preset clustering algorithm to obtain a target road segment sequence. Specifically, the target road segment sequence is a road segment sequence obtained by merging spatially adjacent road segments, which can reduce the influence of the change in the number of road segment sequences and also reduce the computational load of the spatio-temporal feature extraction model. The first extraction module 950 extracts features from the target road segment sequence through a preset spatio-temporal feature extraction model to obtain a spatio-temporal feature vector. The second extraction module 960 extracts features from the target road segment sequence through a preset auxiliary feature extraction model to obtain an auxiliary feature vector. The prediction module 970 predicts the travel time based on the spatio-temporal feature vector and the auxiliary feature vector to obtain a target travel classification value. The approximation estimation module 980 performs an approximation estimation based on the target travel classification value to obtain target travel time data. Compared with the regression method, this classification approximation method uses the weighted average of different categories to approximately fit the travel time, which can reduce the error caused by the uneven distribution of travel attributes, thereby improving the prediction accuracy. In this way, the prediction accuracy of the arrival time can also be improved, while effectively reducing the computational load and improving the time efficiency.
[0142] In a third aspect, an electronic device according to an embodiment of the present invention includes at least one processor and a memory communicatively connected to the at least one processor. Wherein, the memory stores instructions, and the instructions are executed by the at least one processor so that when the at least one processor executes the instructions, the arrival time prediction method according to the embodiment of the first aspect is implemented.
[0143] By adopting the above arrival time prediction method, this electronic device acquires the target road segment data; generates a road segment network based on the target road segment data; performs an embedding process on the road segment network to obtain a road segment feature vector; performs a clustering process on the road segment feature vector through a preset clustering algorithm to obtain a target road segment sequence; extracts features from the target road segment sequence through a preset spatio-temporal feature extraction model to obtain a spatio-temporal feature vector; extracts features from the target road segment sequence through a preset auxiliary feature extraction model to obtain an auxiliary feature vector; predicts the travel time based on the spatio-temporal feature vector and the auxiliary feature vector to obtain a target travel classification value; performs an approximation estimation based on the target travel classification value to obtain target travel time data. In this way, the prediction accuracy of the arrival time can be improved, while effectively reducing the computational load and improving the time efficiency.
[0144] In a fourth aspect, the present invention also proposes a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions for causing a computer to execute the arrival time prediction method according to the embodiment of the first aspect.
[0145] A computer-readable storage medium stores computer-executable instructions. The computer-executable instructions, by adopting the above arrival time prediction method, obtain target road section data; generate a road section network according to the target road section data; perform embedding processing on the road section network to obtain a road section feature vector; perform clustering processing on the road section feature vector through a preset clustering algorithm to obtain a target road section sequence; perform feature extraction on the target road section sequence through a preset spatio-temporal feature extraction model to obtain a spatio-temporal feature vector; perform feature extraction on the target road section sequence through a preset auxiliary feature extraction model to obtain an auxiliary feature vector; perform travel time prediction according to the spatio-temporal feature vector and the auxiliary feature vector to obtain a target travel classification value; perform approximate estimation according to the target travel classification value to obtain target travel time data. In this way, the prediction accuracy of the arrival time can be improved, the calculation amount can be effectively reduced, and the time efficiency can be improved.
[0146] The embodiments of the present invention have been described in detail above in conjunction with the accompanying drawings. However, the present invention is not limited to the above embodiments. Various changes can be made without departing from the spirit of the present invention within the knowledge scope of those of ordinary skill in the art. In addition, the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
Claims
1. A method for predicting arrival time, characterized in that, Including: Obtain target road segment data; Generate a road segment network according to the target road segment data; Perform embedding processing on the road segment network to obtain a road segment feature vector; Perform clustering processing on the road segment feature vector through a preset clustering algorithm to obtain a target road segment sequence; Perform forward feature extraction on the target road segment sequence through a first recurrent network layer to obtain a forward hidden vector; Perform backward feature extraction on the target road segment sequence through a second recurrent network layer to obtain a backward hidden vector; Perform fusion processing on the forward hidden vector and the backward hidden vector to obtain a spatio-temporal feature vector; Classify the target road segment sequence according to a preset travel time category label to obtain a travel time category value; Perform probability calculation on the travel time category value through a preset probability density function to obtain a classification probability value corresponding to the travel time category value; Perform normalization processing on the obtained travel distance to obtain a normalized travel distance value; Perform embedding processing on the obtained travel time and travel weather respectively to obtain a travel time category value and a travel weather category value; Perform fusion processing on the normalized travel distance value, the travel time category value, the travel weather category value, and the classification probability value to obtain an auxiliary feature vector; Perform travel time prediction according to the spatio-temporal feature vector and the auxiliary feature vector to obtain a target travel classification value; Perform approximate estimation according to the target travel classification value to obtain target travel time data.
2. The arrival time prediction method according to claim 1, wherein The performing embedding processing on the road segment network to obtain a road segment feature vector includes: Perform graph embedding processing on the road segment network to obtain a road segment walk sequence; Perform node embedding processing on the road segment walk sequence to obtain the road segment feature vector.
3. The arrival time prediction method according to claim 1, characterized in that The performing clustering processing on the road segment feature vector through a preset clustering algorithm to obtain a target road segment sequence includes: Perform clustering processing on the road segment feature vector through the K-Means clustering algorithm to obtain a labeled road segment sequence; Perform merging processing on the labeled road segment sequence according to a preset clustering label to obtain the target road segment sequence.
4. The arrival time prediction method according to claim 1, wherein The performing travel time prediction according to the spatio-temporal feature vector and the auxiliary feature vector to obtain a target travel classification value includes: Perform prediction processing on the spatio-temporal feature vector to obtain first prediction data; Perform prediction processing on the auxiliary feature vector to obtain second prediction data; Perform splicing processing on the first prediction data and the second prediction data to obtain third prediction data; Perform prediction processing on the third prediction data to obtain a target travel classification value.
5. The arrival time prediction method according to claim 1, characterized in that The performing approximate estimation according to the target travel classification value to obtain target travel time data includes: Obtain the classification confidence corresponding to the target travel classification value; Perform approximate estimation on the target travel classification value according to the classification confidence to obtain target travel time data.
6. An arrival time prediction device, characterized in that, Including: An acquisition module for obtaining target road segment data; A generation module for generating a road segment network according to the target road segment data; An embedding module for performing embedding processing on the road segment network to obtain a road segment feature vector; A clustering module, configured to cluster the road segment feature vectors through a preset clustering algorithm to obtain a target road segment sequence; A first extraction module, configured to perform forward feature extraction on the target road segment sequence through a first recurrent neural network layer to obtain a forward hidden vector; perform backward feature extraction on the target road segment sequence through a second recurrent neural network layer to obtain a backward hidden vector; and perform fusion processing on the forward hidden vector and the backward hidden vector to obtain a spatio-temporal feature vector; A second extraction module, configured to classify the target road segment sequence according to a preset travel time category label to obtain a travel time category value; calculate the probability of the travel time category value through a preset probability density function to obtain a classification probability value corresponding to the travel time category value; perform normalization processing on the obtained travel distance to obtain a normalized travel distance value; perform embedding processing on the obtained travel time and travel weather respectively to obtain a travel time category value and a travel weather category value; and perform fusion processing on the normalized travel distance value, the travel time category value, the travel weather category value, and the classification probability value to obtain an auxiliary feature vector; A prediction module, configured to predict the travel time according to the spatio-temporal feature vector and the auxiliary feature vector to obtain a target travel classification value; An approximate estimation module, configured to perform approximate estimation according to the target travel classification value to obtain target travel time data.
7. An electronic device, including a memory, a processor, and a computer program that can run on the memory and on the processor, where when the processor executes the program, the arrival time prediction method according to any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to execute the arrival time prediction method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method and system for estimating time of arrival
CN109002905A