Unknown trajectory travel time estimation method based on region division

By employing a region-based approach and a PyTorch deep learning model, the problem of travel time estimation under unknown trajectory conditions is solved, achieving high-precision and robust travel time prediction applicable to complex urban traffic environments.

CN121353025APending Publication Date: 2026-01-16OCEAN UNIV OF CHINA
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202511923202.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-19
Publication Date
2026-01-16

AI Technical Summary

Technical Problem

Existing technologies rely on complete trajectory data for travel time estimation under unknown trajectory conditions, but they lack sufficient utilization of regional traffic features, have unreasonable path generation, and limited time modeling, resulting in insufficient prediction accuracy and robustness.

Method used

We employ a region-based approach, acquiring open-source taxi data, performing topology construction and feature selection encoding, and building an unknown trajectory travel time estimation model based on PyTorch deep learning. This model includes regional road segment representation pre-training, cross-regional recursive path generation, and multi-representation fusion, outputting travel time estimation results.

Benefits of technology

It reduces reliance on complete trajectory data, improves the accuracy and robustness of travel time estimation under conditions of missing trajectory data, reduces mean absolute error, and is suitable for complex urban traffic environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121353025A_ABST
    Figure CN121353025A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of time estimation, in particular to an unknown track travel time estimation method based on region division. The method comprises the steps of performing data preprocessing on an obtained data set based on topology construction; performing feature selection and feature coding on the preprocessed data; constructing an unknown track travel time estimation model based on PyTorch deep learning, wherein the unknown track travel time estimation model comprises regional road segment characterization pre-training, cross-regional recursive path generation, regional feature coding and multi-characterization fusion and time estimation; and outputting a travel time estimation result. The problem that the model cannot be used when the trajectory is missing or difficult to obtain is solved, and the application range and the data utilization efficiency of the method are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of time estimation, and in particular to an unknown trajectory travel time estimation method based on regional division. BACKGROUND

[0002] With the acceleration of urbanization, travel time estimation (TTE) has become one of the core problems of intelligent transportation systems (ITS). Accurate travel time prediction not only affects the efficiency of traffic resource allocation, but also relates to the experience and travel decision of travelers. However, the existing related technologies still have the following shortcomings in practical application: (1) Dependence on complete trajectory data. Most current methods are based on complete GPS trajectory modeling, such as deep learning models and graph neural network models. Such methods require a large amount of high-precision trajectory data as a supervisory signal, while in reality, due to privacy protection and data collection costs, public taxi, online car or shared bicycle data often only contains start and end point information, lacking complete intermediate trajectory. Therefore, when trajectory data is unavailable or missing, the prediction accuracy of existing methods is significantly reduced, and the applicability is limited.

[0003] (2) Insufficient modeling of spatial heterogeneity. Existing methods usually treat the entire urban road network as a homogeneous space, or use simple grid division for regional modeling. However, different regions (such as business districts, school districts, residential areas) have significantly different traffic patterns, and simple division often leads to ambiguous regional semantics or artificial cutting of continuous road segments, making it difficult to accurately capture cross-regional traffic characteristics and affecting travel time estimation.

[0004] (3) Lack of rationality in path generation. In the case of unknown trajectories, traditional methods often use shortest path or fastest path algorithms (such as Dijkstra, A*) to generate candidate paths. Although such methods have high computational efficiency, they do not fully consider the diversity of real driving behavior and the dynamics of traffic flow, which can lead to a large deviation between the generated path and the actual driving path, affecting the reliability of time estimation.

[0005] (4) Limited use of time characteristics. Some methods consider the departure time factor, but often only use a single time granularity for modeling, failing to capture the dynamic change rules of traffic at multiple time scales. This can lead to poor prediction performance during peak hours or special periods (such as school drop-off periods).

[0006] In summary, the existing travel time estimation techniques have the problems of strong data dependence, insufficient utilization of regional characteristics, unreasonable path generation, and limited time modeling. These defects make it difficult for existing methods to ensure the accuracy and robustness of the prediction in scenarios with missing trajectories or complex regional traffic patterns. SUMMARY

[0007] In order to solve the problems of relying on complete trajectory data, insufficient utilization of regional traffic characteristics, unreasonable path generation, and limited time modeling in the prior art, the present application provides an unknown trajectory travel time estimation method based on regional division. The travel time of travel data with only start and end point information is accurately predicted.

[0008] In the first aspect, the present application provides an unknown trajectory travel time estimation method based on regional division, which adopts the following technical solution: An unknown trajectory travel time estimation method based on regional division, comprising: obtaining an open source taxi road travel data set; performing data preprocessing on the obtained data set based on topology construction; performing feature selection and feature encoding on the preprocessed data; constructing an unknown trajectory travel time estimation model based on PyTorch deep learning, which includes regional road segment representation pre-training, cross-regional recursive path generation, regional feature encoding, and multi-representation fusion and time estimation; outputting travel time estimation results.

[0009] In the second aspect, an unknown trajectory travel time estimation system based on regional division is provided, comprising: a data acquisition module configured to obtain an open source taxi road travel data set; a preprocessing module configured to perform data preprocessing on the obtained data set based on topology construction; an encoding module configured to perform feature selection and feature encoding on the preprocessed data; a prediction module configured to construct an unknown trajectory travel time estimation model based on PyTorch deep learning, which includes regional road segment representation pre-training, cross-regional recursive path generation, regional feature encoding, and multi-representation fusion and time estimation; an output module configured to output travel time estimation results.

[0010] In the third aspect, the present application provides a computer readable storage medium, which stores a plurality of instructions, the instructions being adapted to be loaded and executed by a processor of a terminal device to implement the unknown trajectory travel time estimation method based on regional division.

[0011] In a fourth aspect, the present application provides a terminal device, comprising a processor and a computer readable storage medium, the processor is used to implement instructions; the computer readable storage medium is used to store a plurality of instructions, the instructions are suitable for being loaded by the processor and performing the unknown trajectory travel time estimation method based on region division.

[0012] In summary, the present application has the following beneficial technical effects: (1) Reduce the dependence on complete trajectory data: traditional methods generally rely on complete travel trajectories as input, while the present application can achieve travel time estimation using only departure point, destination and departure time information, overcoming the problem that the model cannot be used when the trajectory is missing or difficult to obtain, and improving the applicability and data utilization efficiency of the method.

[0013] (2) Improve the utilization efficiency of regional traffic characteristics: by dividing the urban road network into regions and introducing multi-time slice combination to construct regional traffic flow tensor, the present application can better depict the traffic differences and dynamics between different regions. Experimental results show that compared with methods that do not use regional modeling, the average absolute error (MAE) of the present application on the Manhattan and Porto data sets is reduced by about 21-27 percentage points.

[0014] (3) Improve prediction accuracy and robustness: the present application introduces regional recursive path generation and multi-representation fusion mechanism, so that the model can capture road segment level features, regional level features and time period features at the same time. The results show that the prediction error of the present application is significantly reduced in long-distance travel scenarios, showing better generalization ability and robustness, and is suitable for application in complex urban traffic environments. BRIEF DESCRIPTION OF DRAWINGS

[0015] Figure 1 is a schematic diagram of an unknown trajectory travel time estimation method based on region division of embodiment 1 of the present application; Figure 2 is a model architecture schematic diagram of embodiment 1 of the present application; Figure 3 is a regional representation pre-training effect diagram of embodiment 1 of the present application; Figure 4 is a regional representation visualization diagram of embodiment 1 of the present application. DETAILED DESCRIPTION

[0016] The present application will be further described in detail below in conjunction with the accompanying drawings.

[0017] Embodiment 1 Reference Figure 1This embodiment presents a method for estimating travel time for unknown trajectories based on regional division. This method, based on urban road networks and regional division, achieves high-precision estimation of travel time given only the origin, destination, and departure time. The specific invention process is as follows: Figure 1 As shown. Its technical solution includes the following steps: S1 Data Acquisition and Definition S1.1 Data Source The basic data used in the implementation of this invention includes: (1) Taxi travel data: The open-source Manhattan Taxi Dataset and Porto Taxi Dataset were selected. As shown in Table 1, a portion of the Manhattan Taxi Dataset is used as an example. Each data point includes information such as departure point, destination, departure time, and actual travel time. Table 1. Sample Taxi Dataset Vehicle identification Departure time Arrival time Origin longitude Origin latitude Destination longitude Destination latitude Travel time ID 28745 3 / 14 17:24 3 / 14 17:32 -73.98 40.76 -73.96 40.77 455s ID 28456 6 / 12 0:43 6 / 12 0:54 -73.98 40.74 -73.99 40.73 663s ID 28656 1 / 19 11:35 1 / 19 12:10 -73.99 40.76 -74.00 40.71 2124s ID 28432 2 / 19 9:52 2 / 19 10:11 -73.96 40.76 -73.98 40.76 1114s ID 28113 5 / 15 11:16 5 / 15 11:34 -73.99 40.75 -73.96 40.77 1128s (2) Urban road network data: including attribute information such as road ID, number of lanes, speed limit, road length, traffic flow, and intersection topology.

[0018] S1.2 Symbol Explanation For ease of description, the symbols used in this invention are explained as follows: (1) In the taxi trip dataset, the labels include trip identifier (TRID), trip origin latitude (ORIGIN_LAT), trip origin longitude (ORIGIN_LON), trip destination latitude (DESTINATION_LAT), trip destination longitude (DESTINATION_LON), trip departure time (DEPARTURE_TIME), trip arrival time (DROPOFF_TIME), and trip duration (TRAVEL_TIME). (2) Define the urban road network graph G=(E,V), where vertex V represents an intersection and edge E represents a directed road segment; (3) In the preprocessing stage, the road network is divided into several regions, and the i-th region is denoted as . The region where the starting point is located is denoted as The area where the destination is located is denoted as ; (4) Define a multi-time slot set to generate the initial feature tensor of the region.

[0019] S2 data preprocessing S2.1 topology construction and noise processing We divide the road networks of Manhattan and Porto into regions using OpenStreetMap, where Manhattan is divided into 35 sub-regions: , and Porto is divided into 8 sub-regions: , each road segment is uniquely assigned to a region except for the boundary segments: .

[0020] where, denotes the Manhattan road network region, denotes the third Manhattan road network sub-region; denotes the Porto road network region, denotes the third Porto road network sub-region; denotes the first road segment in the Manhattan / Porto road network.

[0021] The criteria for region division comprehensively consider administrative and social functions. On this basis, we project the division results into a region directed graph: → and further clean the data, including removing ambiguous boundary road segments, duplicate road segments, and filtering out abnormal records in the taxi dataset.

[0022] S2.2 origin-destination mapping and region feature tensor construction We design a trajectory latitude and longitude to road segment matching algorithm to map the origin and destination coordinates of a trip to the nearest road segment in the road network: , where, denotes the origin / destination mapping to road segment i, denotes the latitude and longitude of the origin / destination.

[0023] Then, we divide the time axis into multiple time slices according to different granularities Δ = {5, 10, 20, 30, 60}: where .

[0024] For each region, we calculate the traffic flow features according to the time slices to generate the region traffic flow matrix, and further combine to obtain the region traffic flow tensor , which is used for subsequent modeling and estimation. Specifically: Given the time slice set Δ = {5, 10, 20, 30, 60}, randomly select three granularities of time slices ( )​ Δ , , , in, Δ, This represents the traffic flow matrix corresponding to a time slice granularity of region z, g. Let z represent the traffic flow tensor of region z.

[0025] S3 Feature Selection and Feature Encoding S3.1 Feature Selection In this invention, the features used are mainly divided into two categories: (1) Trip data features: derived from the trip dataset, specifically including trip identifier (TRID), origin road segment (Origin Road Segment), destination road segment (Destination Road Segment), and trip departure time (DEPARTURE_TIME). (2) Road network characteristics: These are derived from the parsing and processing of OpenStreetMap data. The folium function is used to extract and transform road segment information, resulting in attributes such as Road ID, Lanes, Speed ​​Limit, Road Length, Traffic Flow, and Intersection topology. , in, It is a comprehensive representation of the characteristics of the aforementioned road sections.

[0026] S3.2 Feature Encoding After completing feature selection, this invention encodes the road network features, travel data features, and departure time features respectively, as follows: (1) Road network feature encoding: Discrete numerical features such as road ID, number of lanes, speed limit, road length, and traffic flow are converted into continuous values ​​and input into the embedding layer, mapped to a fixed-length binary vector representation. Specifically: , (2) Trip Data Feature Encoding: Trip identifiers (TRIDs) are encoded in binary format. The representation of a road segment is formed by fusing encoded features such as road ID, number of lanes, speed limit, road length, and traffic flow, thereby generating a unified road segment representation vector. Specifically, it can be expressed as: , Based on this, the starting point segment and the ending point segment of the journey are further represented.

[0027] (3) Departure time feature encoding: Departure time is first decomposed into month ,day ,hour ,point and weekdays / non-working days Elements such as time, minutes, weekdays, and non-working days are then analyzed using sine and cosine calculations to reflect the periodicity of time. Specifically: , , , in, , , All are time representations after sine and cosine encoding.

[0028] Finally, the above results are concatenated and input into the encoding layer to generate a departure time vector representation. The details are as follows: , , in, The fusion feature representing departure time Used to indicate whether the departure time is a weekday. =1 indicates a working day, otherwise it is a non-working day. and Each represents a learnable parameter matrix. Indicates deviation.

[0029] Through the above steps, different types of features are uniformly transformed into vectorized representations, providing a standardized input basis for path generation and region representation.

[0030] S4 Dataset Label Generation and Model Input S4.1 Dataset Label Generation In the taxi trip time estimation problem, each trip data point includes the actual travel time (TRAVEL_TIME), which serves as the label in supervised learning. The predicted trip time output by the model is compared with the label value, and the model's performance and accuracy are measured through error calculation. The details are as follows: , in, This represents the estimated value of the model. Represents the actual value.

[0031] S4.2 Model Input The main inputs to the model of this invention include: the origin road segment, the destination road segment, the regional traffic flow tensor, the feature vector after feature selection and encoding, and the actual travel time (a supervision signal used during model training). These inputs collectively serve as the basis for model training and inference, thereby enabling the estimation of travel time under unknown trajectory conditions.

[0032] S5 Model Building This invention implements model construction based on the PyTorch deep learning framework. Figure 2 This is a diagram of the overall model framework. The model structure mainly includes the following modules: S5.1 Area Road Segment Representation Pre-training Module This module includes a graph reconstruction structure, a node relation encoding structure (R-GCN), and a multi-sampling cross-sample learning structure. Its function is to enhance structural information by reconstructing the regional network graph, encode the global relationships of each node in the new graph using a relational graph convolutional network, and construct anchor point samples, positive samples, and negative sample sets based on this. For example... Figure 3 As shown, the module uses a custom contrastive loss function for reverse updating and optimization, thereby obtaining a more accurate and robust representation of road segment nodes. Specifically: Two road segment similarity rules are set for graph reconstruction: , in, Indicates road segment i, This indicates the number of lanes in road segment i. This represents the difference in directional angle between road segment i and road segment j. This indicates the angle parameter being set. This represents the difference in traffic flow between road segment i and road segment j. This indicates the set traffic threshold.

[0033] For the reconstructed graph, generate a new adjacency matrix. , Road segment representation learning: , in, This represents the type value of road segment i in region z. and These represent the length and width of road segment i in region z, respectively. This represents the normalized traffic flow value for road segment i in region z. This represents the inherent ID of road segment i in region z. This represents the road segment representation after merging. This represents the learnable parameter matrix.

[0034] ③ Reconstructing the spatiotemporal representation fusion of graph nodes: , , in, This represents the characterization of road segment i in region z after MLP processing. Indicates the process The representation of road segment i after sub-spatiotemporal graph convolution. Indicates the first Layer convolution operation.

[0035] ④ Positive and negative sample sampling: Positive samples , negative samples , ⑤ Set the contrast loss function: For region z, the set of anchor points is The loss function is as follows: , in, Represents the set of positive samples. Represents the set of negative samples. Indicates the anchor point. This indicates the similarity between the anchor point and the positive sample node. This indicates the similarity between the anchor point and the negative sample.

[0036] S5.2 Cross-regional recursive path generation module This module assigns corresponding weight coefficients to each feature based on its importance, and performs weighted fusion on features such as Road ID, Lanes, Speed ​​Limit, Road Length, and Traffic Flow to obtain a new "weighted length." Based on this, the module pre-generates candidate paths between boundary points of each region. Then, starting from the starting region, it gradually expands to adjacent regions; upon entering a new region, it selects a suitable connection point from the boundary nodes of that region, concatenating the previous path with the optimal sub-path of that region. This process continues recursively until the destination region is reached, at which point the path between the destination and the last boundary node is completed, thus generating multiple candidate paths from the starting point to the destination. Each candidate path is recursively concatenated from several regional sub-paths. Specifically: ①Pre-generate candidate paths between boundary points of each region: , , in This represents the probability value of the i-th candidate path from the starting point O to the ending point D. Indicates the weighting coefficient. Represents the candidate path set, Indicates inclusion A set of candidate paths, This indicates the set path probability threshold. =3.

[0037] ② Multipath generation: First, determine the connecting nodes between regions. The specific algorithm is as follows: , Next, the region expansion generates a path from the starting point to the ending point: , in, This represents the path from the starting point to the current node. This represents the k candidate paths from the starting point to the ending point.

[0038] S5.3 Region Feature Coding Module This module includes a grid-location encoding structure, a high-dimensional spatial mapping structure, fully connected layers, and a Transformer structure based on a mask-based visual mechanism. Its function is to map the regional traffic flow tensor to a high-dimensional feature space and further model the spatiotemporal dependencies of the region, thereby generating a high-dimensional regional representation that reflects the dynamic characteristics of the region. Figure 4As shown, taking the Manhattan Chinatown area as an example, this invention visualizes the similarity of road segment representations obtained from pre-training. The higher the similarity between two road segment representations, the darker their visualization color.

[0039] The specific functional steps of this module are as follows: ① Construction of multi-granularity spatiotemporal tensors: Given a set of time slices Δ={5,10,20,30,60}, this module randomly selects three granularity time slices ( ) Δ is used to construct the traffic flow tensor for each sub-region. : , , , in, This represents the traffic flow matrix corresponding to a time slice granularity of region z, g. Let z represent the traffic flow tensor of region z.

[0040] ② Path region representation learning: For candidate paths Each section Each has a corresponding area The corresponding traffic flow tensor is This module first flattens the traffic flow tensor to obtain a flattened matrix (which is no longer a tensor after flattening). Next, this module will perform feature transformation and fusion, as detailed below: , , in, This represents the region matrix after MLP processing. Represents the weight parameters. Indicates position code, This represents the region where location information is fused.

[0041] ③ Fine-grained timing coding: This module uses a multi-layer mask Transformer for processing. Obtain the final path region representation The details are as follows: , , , in, Indicates the area The weight, It is a learnable parameter. This represents the final learned path region representation.

[0042] S5.4 Multi-representation fusion and time estimation module S5.4.1 Trajectory Spatial Relationship Encoding Module The cross-regional recursive path generation module generates candidate paths from the start point to the end point. The regional road segment representation pre-training module obtains road segment node representations. In the trajectory spatial relationship encoding module, the road segment node representations are sequentially concatenated according to their order in the candidate paths. A gated recurrent unit is then used to obtain the corresponding path representation, thus fully reflecting the spatial continuity and local dependencies within the path. Specifically: For candidate paths Each section Each has a corresponding pre-trained representation. First, an adaptive representation transformation is performed: , in, Represents the adaptive parameter matrix. This represents the adaptive parameter bias value. This represents the adaptive representation of road segment i after transformation. Indicates dimension.

[0043] For path Overall spatiotemporal dependency modeling: , , , in This indicates the weight of each road segment. This represents the road segment characterization after two layers of GRU processing. Indicates the filling of the mask matrix, when This indicates that the current road segment i is a real road segment; otherwise, it is a filled road segment.

[0044] Next, the various road segments are concatenated to generate the overall representation of path P. : , S5.4.2 Multi-characteristic fusion module This module jointly models path representation, region representation, and departure time vector representation (generated through a multi-period time attribute encoding module). Specifically, it employs a multi-head attention mechanism based on residual gating to interactively fuse features from different sources. The fused result serves as the final trajectory representation, comprehensively reflecting path structure, regional dynamics, and temporal periodicity. Details are as follows: ① Multi-representation fusion: This module first uses a multi-head attention mechanism to represent the overall path P. Path region representation Departure time represents To merge: , , , in, Let H represent the output representation of the m-th attention head, and let H represent the representation after multi-head fusion. This represents the learnable parameter matrix.

[0045] ② Gating Mechanism Optimization Features: This module uses a residual gating structure to further process the fused representation H, improving the representation effect: , , in, G represents the gating unit, and G represents the representation after processing by the gating structure. This represents the final trajectory representation after residual structure processing. This indicates the characterization of the splicing operation. This represents element-wise multiplication.

[0046] S5.4.3 Time Estimation Module This module takes trajectory representation as input, processes it through multiple fully connected layers, and outputs the predicted overall travel time. This predicted time is then compared with the true label to estimate travel time under unknown trajectory conditions, as shown below: , , in, For the first Layer activation function.

[0047] S5.5 Model Training and Optimization S5.5.1 Dataset Partitioning This invention uses the Manhattan dataset and the Porto dataset as the basic data sources for training and validation. The specific details are as follows: (1) Manhattan dataset: The time range is from January 2016 to June 2016. After preprocessing, a total of 1,129,942 valid travel data were obtained. The corresponding urban road network contains 13,214 road segments, and the average travel time is 760.80 seconds; (2) Porto dataset: The time range is from June 2013 to June 2014. After preprocessing, a total of 1,451,748 valid trip data were obtained. The corresponding urban road network contains 8,106 road segments, and the average trip time is 696.13 seconds.

[0048] Both datasets were divided into training, validation, and test sets in an 8:1:1 ratio. The performance metrics for the models included: Mean Absolute Error (MAE), Mean Absolute Percentage Error (MAPE), and Root Mean Squared Error (RMSE).

[0049] S5.5.2 Loss Function In this invention, two types of loss functions are used during model training. The first type is a loss function used in the pre-training stage: in the regional road segment representation pre-training module, a custom contrastive loss function is used to optimize the representation difference between anchor point samples and positive and negative samples, thereby improving the discriminativeness and stability of road segment representation. The second type is a travel time optimization loss function: in the overall model training stage, the mean squared error (MSE) loss function is used as a supervision signal to measure the deviation between the predicted travel time and the actual travel time, and the model parameters are continuously optimized through backpropagation. The specific definitions are as follows: (1) Contrastive Loss: , in, Let z represent the set of nodes in the z-th region. Represents the set of positive samples. Represents the set of negative samples. Indicates the anchor point. This indicates the similarity between the anchor point and the positive sample node. This indicates the similarity between the anchor point and the negative sample.

[0050] (2) Mean Squared Error (MSE) loss function , in, This represents the estimated value of the model. Represents the actual value.

[0051] S5.5.3 Model Training In this invention, the model is trained using the PyTorch deep learning framework. During training, the Adam optimizer is used for parameter updates, with a learning rate of 0.0005, a batch size of 8, and 50 epochs. The training steps are as follows: Step 1: Model Initialization: The initial road segment representations generated during the pre-training phase will be saved to a file after the first training iteration and will not be updated during subsequent training. During the overall model training, the parameters of all modules except the pre-training module are initialized randomly.

[0052] Step 2: Data Loading: Import the trip dataset through the data loading module and divide it into training, validation, and test sets according to a pre-set ratio to ensure the objectivity of model evaluation.

[0053] Step 3: Forward Propagation Training: Data is input into the model according to the set batch size. The road segment representations saved in the pre-training stage are loaded to participate in the forward propagation, generating the predicted time for each trip data point. Subsequently, the mean squared error loss function (MSE) is used to calculate the error between the predicted value and the actual trip time.

[0054] Step 4: Backpropagation and Optimization: Backpropagation is performed based on the error results. The Adam optimizer is used to update the model parameters and related representations, thereby minimizing the loss function. During this process, the pre-trained road segment representations remain unchanged and do not participate in parameter updates.

[0055] Step 5: Validation Set Performance Evaluation: As shown in Table 2, after each training epoch, the model performance is evaluated using the validation set to monitor model convergence and prevent overfitting.

[0056] Table 2 Training Results Epoch Cumulative loss value MAE MAPE RMSE PCC Training time Epoch 1 13100.75 178.28 25.42% 211.95 0.6820 1:24:14 Epoch 2 11121.43 154.13 20.65% 183.48 0.7868 1:23:27 Epoch 3 10536.57 146.57 19.14% 174.59 0.8144 1:24:30 Epoch 4 10203.67 142.06 18.31% 169.43 0.8297 1:23:39 Epoch 5 9675.01 134.94 16.96% 161.06 0.8533 1:24:11 Epoch 6 9467.84 132.15 16.49% 157.70 0.8625 1:25:18

[0057] Example 2 This embodiment provides a travel time estimation system for unknown trajectories based on region partitioning, including: The data acquisition module is configured to acquire an open-source taxi road trip dataset; The preprocessing module is configured to preprocess the acquired dataset based on topology construction. The encoding module is configured to perform feature selection and feature encoding on the preprocessed data; The prediction module is configured to build an unknown trajectory travel time estimation model based on PyTorch deep learning, including regional road segment representation pre-training, cross-regional recursive path generation, regional feature encoding, and multi-representation fusion and time estimation. The output module is configured to output the travel time estimation results.

[0058] A computer-readable storage medium storing a plurality of instructions adapted for loading and execution by a processor of a terminal device of the method for estimating the travel time of an unknown trajectory based on region partitioning.

[0059] A terminal device includes a processor and a computer-readable storage medium, the processor being configured to implement various instructions; the computer-readable storage medium being configured to store multiple instructions adapted for loading and execution by the processor of the aforementioned method for estimating the travel time of an unknown trajectory based on region partitioning.

[0060] The above are all preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Therefore, all equivalent changes made in accordance with the structure, shape and principle of the present invention should be covered within the scope of protection of the present invention.

Claims

1. A method for estimating travel time of unknown trajectories based on region division, characterized in that, The method comprises the following steps: obtaining an open-source taxi road trip dataset; performing data preprocessing on the obtained dataset based on topology construction; performing feature selection and feature encoding on the preprocessed data; constructing an unknown trajectory travel time estimation model based on PyTorch deep learning, which includes regional road segment representation pre-training, cross-regional recursive path generation, regional feature encoding, and multi-feature fusion and time estimation; outputting the travel time estimation result.

2. The method of claim 1, wherein, The data preprocessing of the obtained data set based on topology construction includes regional division of road networks of Manhattan and Porto cities by using OpenStreetMap, wherein Manhattan is divided into 35 sub-regions and Porto is divided into 8 sub-regions: Each road segment is uniquely attributed to one region except for the boundary road segments: Wherein, represents the Manhattan road network region, represents the third Manhattan road network sub-region; represents the Porto road network region, represents the third Porto road network sub-region; represents the first road segment in the city road network; represents the second road segment in the city road network; The division result is projected into a regional directed graph , and data cleaning is performed, including removing ambiguous boundary road segments, duplicate road segments, and filtering out abnormal records in the taxi data set; and finally, a matching algorithm of track latitude and longitude to road segments is constructed to map the starting point and end point coordinates of the trip to the road segments closest in distance in the road network: , where, denotes the start / end point maps to road segment i, denotes the latitude / longitude of the start / end point; then the time axis is divided into multiple time slices with different granularity Δ = {5, 10, 20, 30, 60}: where, , Δ, for each region, the traffic flow characteristics are counted according to the time slice, the traffic flow matrix of the region is generated, and the regional traffic flow tensor is obtained by combination .

3. The method of claim 2, wherein, The feature selection and feature encoding on the preprocessed data comprises selecting trip data features and road network features based on the preprocessed data set, and after completing the feature selection, encoding processing is performed on the road network features, trip data features and departure time features respectively, wherein the road network feature encoding comprises converting the discrete numerical features of road identifiers Road ID, lane number Lanes, speed limit Velocity, road length Road Length and traffic flow Traffic Flow into continuous value input to the embedding layer, and mapping them into fixed-length binary vector representation. The journey data feature coding includes coding the journey identifier TRID in a binary manner to generate a unified road segment representation vector , denoted as: , and further obtaining the start point road segment representation and the end point road segment representation of the journey; the departure time feature coding includes decomposing the departure time into month , day , hour , minute , and weekday / non-weekday , and then performing sine and cosine operations on the hour, minute, weekday and non-weekday features to reflect the periodicity of time, denoted as: , , , wherein, , , are all time representations after sine-cosine encoding; finally, the operation results are spliced and input into the encoding layer to generate the departure time vector representation , which is represented as: , , where, fusion features indicating a departure time, for marking whether the departure time is a weekday, and both represent a learnable parameter matrix, represents a bias.

4. The method of claim 3, wherein, The regional road segment representation pre-training comprises enhancing the structural information by reconstructing the regional network graph, encoding the global relationship of each node in the new graph using a relational graph convolution network, and constructing anchor sample, positive sample and negative sample sets, wherein a self-defined contrastive loss function Contrastive Loss is used for backward update and optimization to obtain road segment node representation. First, set the graph reconstruction rule, which is represented as , wherein, denotes a road segment i, denotes the number of lanes of road segment i, denotes the difference in direction angle between road segment i and road segment j, denotes a set angle parameter, denotes the difference in traffic flow between road segment i and road segment j, denotes a set traffic threshold, for the new graph after reconstruction, a new adjacency matrix is generated: and then road segment representation learning is performed, denoted as: , wherein, denotes the type value of the road segment i in the region z, and denotes the length and width of the road segment i in the region z, respectively, denotes the normalized traffic flow value of the road segment i in the region z, denotes the intrinsic id of the road segment i in the region z, denotes the fused road segment representation, denotes the learnable parameter matrix, and performs the fusion of the reconstructed graph node spatiotemporal representation: , wherein, denotes the representation of the road segment i in the region z after MLP processing, denotes the representation of the road segment i after times of spatiotemporal graph convolution, denotes the layer convolution operation, and finally the positive and negative sample sampling is performed: wherein the positive sample , the negative sample , and the contrast loss function is set: for the region z, the anchor point set is , and the loss function is: , wherein, represents a positive sample set, represents a negative sample set, represents an anchor point, represents a similarity between an anchor point and a positive sample node, represents a similarity between an anchor point and a negative sample.

5. The method of claim 4, wherein, The cross-regional recursive path generation comprises assigning each feature a corresponding weight coefficient according to the importance of different road segment features, and weighting and fusing the features of the road segment to obtain a new weighted length. The candidate paths between the boundary points of each region are generated in advance, and the expansion starts from the starting region to the adjacent region. When entering a new region, a connection point is selected from the boundary nodes of the new region, and the previous path is spliced with the optimal sub-path of the new region until the end region is reached. The path between the end point and the last boundary node is then filled to generate multiple candidate paths from the starting point to the end point. Each candidate path is recursively spliced by several regional sub-paths, wherein the candidate paths between the boundary points of each region are represented as , , wherein represents the probability value of the i-th candidate path from the start point O to the end point D, represents a weight coefficient, represents a candidate path set, represents a path set containing a candidate path, represents a set path probability threshold, and the multi-path generation includes first determining the connecting nodes between the regions, represented as: and then generating a path from the start point to the end point based on the region expansion, denoted as: wherein, denotes a path from the start point to the current node, denotes k candidate paths from the start point to the end point.

6. The method of claim 5, wherein, The regional feature encoding includes visualizing the similarity of road segment representations obtained from pre-training. First, a multi-granularity spatiotemporal tensor is constructed. For a given time slice set Δ={5,10,20,30,60}, three granularity time slices are randomly selected. ) Δ is used to construct the traffic flow tensor for each sub-region. : , , ,in, This represents the traffic flow matrix corresponding to a time slice granularity of region z, g. Let z be the traffic flow tensor of region z; then, path region representation learning is performed based on the constructed traffic flow tensor for candidate paths. Each section Each has a corresponding area The corresponding traffic flow tensor is The flattened matrix is ​​obtained by flattening the traffic flow tensor. Then, feature transformation and fusion will be performed, represented as: , , wherein, denotes the region matrix after MLP processing, denotes the weight parameter, denotes the position encoding, denotes the region representation fused with position information; finally, fine-grained temporal encoding is performed, and a multi-layer mask Transformer is used for processing to obtain the final path region representation denoted as: , , , wherein, representing regions of the weight, is a learnable parameter, represents the final learned path region representation.

7. The method of claim 6, wherein, The multi-representation fusion includes, for a candidate path Each road segment Has a corresponding pre-trained representation First, adaptive representation conversion is performed: , wherein, denotes an adaptive parameter matrix, denotes an adaptive parameter bias value, denotes a transformed adaptive representation for link i, denotes a dimension; then for a path spatiotemporal dependency modeling is performed on the whole: , , , wherein represents the weight of each road segment, represents the road segment representation after two-layer GRU processing, represents the padding mask matrix, when represents the current road segment i is a real road segment, otherwise it is a padding road segment, and then splicing each road segment to generate the overall representation of the path P : .

8. The method of claim 7, wherein, The multi-feature fusion includes joint modeling of path features, region features and departure time vector features, using a multi-head attention mechanism based on a residual gating structure to interact and fuse features from different sources, and the fused result is used as the final trajectory feature. , path region features , departure time features are fused, , , , wherein, represents the output representation of the m-th attention head, H represents the fused representation after multi-head fusion, represents a learnable parameter matrix, and then the features are optimized by using a gating mechanism, and the fused representation H is further processed by using a residual gating structure, represented as: , , wherein, denotes a gating unit, G denotes a representation processed by a gating structure, denotes a final trajectory representation processed by a residual structure, denotes a representation concatenation operation, denotes an element-wise multiplication operation.

9. The method of claim 8, wherein, The time estimation includes taking trajectory characteristics as input, processing through multiple layers of fully connected layers, outputting predicted overall travel time, and comparing with real labels to realize travel time estimation under unknown trajectory conditions, represented as: .

10. The method of claim 9, wherein, The time estimation further comprises constructing a pre-training stage loss function and a trip time optimization loss function respectively, wherein the pre-training stage loss function uses a contrastive loss function Contrastive Loss to optimize the representation difference between the anchor sample and the positive and negative samples, thereby improving the discriminability and stability of the road segment representation, which is represented as , wherein, denotes a set of nodes of the z-th region, denotes a set of positive samples, denotes a set of negative samples, denotes an anchor point, denotes a similarity between an anchor point and a positive sample node, denotes a similarity between an anchor point and a negative sample; the travel time optimization loss function adopts a mean square error loss function MSE as a supervision signal, which is used to measure the deviation between the predicted travel time and the actual travel time, and continuously optimizes the model parameters through back propagation, and is represented as , wherein, represents an estimated value of the model, represents a true value.

Citation Information

Patent Citations

  • Video-based intersection area traffic parameter statistical method

    CN113538902A

  • Travel time estimation method of dual graph convolutional network based on intersection joint modeling

    CN116246457A

  • Different-source city taxi track generation method and system based on time-space door mechanism migration

    CN118569075A

  • Cross-scale self-supervised spatio-temporal trajectory basic model training method

    CN121051506A

  • Time dependent path planning method based on discrete space-time network

    CN121148176A