Trajectory completion method and device, computer device, storage medium and program product

By using H3 indexing and a pre-trained trajectory completion model, the problem of rule-based methods struggling to capture subtle changes in trajectory is solved, achieving efficient and accurate trajectory completion, applicable to fields such as traffic management, urban planning, and logistics distribution.

CN119226277BActive Publication Date: 2026-03-24BEIJING INST OF TECH XINYUAN INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-14
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Rule-based trajectory completion methods struggle to accurately capture subtle changes and dynamic characteristics of trajectory data when dealing with complex and ever-changing trajectory data.

Method used

Using H3 index and a pre-trained trajectory completion model, the missing trajectory points are predicted and completed by acquiring the trajectory to be completed and historical trajectory information, constructing an inverted index and candidate trajectory set using H3 index, and combining machine learning algorithms such as LSTM and GRU.

Benefits of technology

It improves the accuracy and reliability of trajectory completion, especially significantly improving query and matching efficiency in large-scale trajectory data processing. It can comprehensively consider multiple factors such as time, speed, and direction, enhancing the model's generalization ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119226277B_ABST
    Figure CN119226277B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of trajectory processing, and discloses a trajectory completion method and device, computer equipment, a storage medium and a program product. The method comprises: obtaining to-be-completed trajectory and historical trajectory information; wherein the to-be-completed trajectory at least comprises three H3 indexes corresponding to three trajectory points; determining an H3 index set based on the historical trajectory information; determining a candidate trajectory set comprising three H3 indexes from the H3 index set; processing based on the candidate trajectory set using a pre-trained trajectory completion model to obtain a target trajectory; extracting missing trajectory point information from the target trajectory, and completing the to-be-completed trajectory based on the missing trajectory point information. The present application uses a pre-trained trajectory completion model, can predict missing trajectory point information in the to-be-completed trajectory based on information in the candidate trajectory set, and can comprehensively consider various factors, thereby improving the accuracy and reliability of the completed trajectory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of trajectory processing technology, specifically to trajectory completion methods, apparatus, computer equipment, storage media, and program products. Background Technology

[0002] With the rapid development of positioning technology and the widespread adoption of smart devices, trajectory data has become a crucial resource in many fields, such as traffic management, urban planning, logistics distribution, and user behavior analysis. Trajectory data not only records the location information of moving objects but also implicitly contains rich spatiotemporal characteristics and behavioral patterns. However, in practical applications, due to various factors (such as equipment malfunction, signal obstruction, and user privacy settings), trajectory data is often incomplete or missing, which seriously affects the analytical value and practical application effectiveness. Therefore, trajectory completion technology, as a key technology for solving this problem, has received widespread attention and research in recent years.

[0003] Currently, rule-based methods typically rely on pre-defined rules or assumptions to infer missing trajectory points. For example, the location of missing points can be estimated using interpolation algorithms (such as linear interpolation, polynomial interpolation, etc.); or the possible movement path can be inferred based on the moving object's speed, direction, and other characteristics, combined with map information.

[0004] However, rule-based methods often struggle to accurately capture subtle changes and dynamic characteristics of trajectories when dealing with complex and ever-changing trajectory data. Summary of the Invention

[0005] In view of this, the present invention provides a trajectory completion method, apparatus, computer device, storage medium and program product to solve the problem that rule-based methods often have difficulty accurately capturing subtle changes and dynamic characteristics of trajectories when processing complex and ever-changing trajectory data.

[0006] In a first aspect, the present invention provides a trajectory completion method, the method comprising: acquiring a trajectory to be completed and historical trajectory information; wherein the trajectory to be completed includes at least: H3 indices corresponding to three trajectory points respectively; determining an H3 index set based on the historical trajectory information; determining a candidate trajectory set including the three H3 indices from the H3 index set; processing the candidate trajectory set using a pre-trained trajectory completion model to obtain a target trajectory; extracting missing trajectory point information from the target trajectory, and completing the trajectory to be completed based on the missing trajectory point information.

[0007] The trajectory completion method provided in this embodiment, by using the H3 index, can efficiently organize and retrieve geospatial data, especially when processing large-scale trajectory data, significantly improving query and matching efficiency. Utilizing a pre-trained trajectory completion model, it can predict missing trajectory point information in the trajectory to be completed based on information in the candidate trajectory set, comprehensively considering multiple factors (such as time, speed, and direction), thereby improving the accuracy and reliability of the completed trajectory.

[0008] In one optional implementation, determining an H3 index set based on historical trajectory information includes: transforming the historical trajectory information to determine a first H3 index corresponding to each trajectory point in the historical trajectory and data information for each trajectory point; wherein the data information includes at least: trajectory ID, identification code, time, longitude, latitude, speed, and mileage, and the first H3 index corresponds to multiple trajectory points; constructing an inverted index with the first H3 index as the primary key; determining a second H3 index adjacent to the first H3 index based on the inverted index, and constructing an H3 index set based on the first H3 index and the second H3 index.

[0009] The trajectory completion method provided in this embodiment achieves the structuring and standardization of geospatial data by converting each trajectory point in the historical trajectory into a corresponding H3 index. As a multi-level hexagonal grid system, the H3 index can efficiently represent and store geospatial information. During the conversion process, in addition to obtaining the H3 index of the trajectory point, other important data information of the trajectory point is also retained, such as trajectory ID, identification code, time, longitude, latitude, speed, and distance. This information provides a rich data foundation for subsequent trajectory analysis and processing. Furthermore, by finding H3 indices adjacent to the H3 index in the trajectory to be completed, a candidate trajectory set can be quickly constructed. These candidate trajectories are likely to contain missing information in the trajectory to be completed, providing a possibility for subsequent trajectory completion.

[0010] In one optional implementation, the historical trajectory information is transformed to determine the first H3 index corresponding to each trajectory point in the historical trajectory and the data information of each trajectory point, including: converting the historical trajectory information into the WGS84 coordinate system according to the coordinate system in the static historical trajectory through a coordinate system transformation function; using the API provided by the H3 library to convert the latitude and longitude of each trajectory point into the first H3 index, and determining the data information of each trajectory point.

[0011] The trajectory completion method provided in this embodiment uses the API provided by the H3 library to convert the latitude and longitude of each trajectory point into an H3 index. This enables rapid indexing and structuring of geospatial data, facilitating subsequent querying and analysis. Furthermore, the H3 index allows for quick location of all trajectory points within a specific area without traversing the entire dataset. This efficient indexing mechanism significantly improves data processing and query efficiency while reducing computational costs.

[0012] In one optional implementation, the process of constructing a pre-trained trajectory completion model includes: acquiring a sample of the journey to be completed; wherein the sample of the journey to be completed includes multiple journeys, each journey including at least three trajectory points and H3 indices corresponding to the trajectory points; determining a target journey from a historical trajectory database based on the H3 indices corresponding to the trajectory points, to form a set of candidate trajectories; determining feature data based on each journey in the sample of the journey to be completed and the target journey in the set of candidate trajectories, to determine the target journey sample corresponding to the feature data; and training a first model using the target journey sample to obtain a pre-trained trajectory completion model.

[0013] The trajectory completion method provided in this embodiment, based on H3 index matching of target trips, can extract rich feature data, such as trajectory length, speed changes, and stop point distribution. This feature data comprehensively reflects users' travel habits and behavioral patterns, providing strong support for model training. Furthermore, when training the model using target trip samples, the model's parameters and structure can be adjusted according to actual needs to achieve the best completion effect. In addition, different algorithms and frameworks can be used to train the model to meet different application scenarios and requirements.

[0014] In an optional implementation, each trip includes three trajectory points: a start trajectory point, an intermediate trajectory point, and an end trajectory point. Based on each trip in the sample of trips to be supplemented and the target trip in the candidate trajectory set, feature data is determined, including: determining a first target mileage difference between a first difference and a second difference; wherein the first difference refers to the mileage difference between the intermediate point and the start point in the sample of trips to be supplemented, and the second difference refers to the mileage difference between the intermediate point and the start point in the target trip in the candidate trajectory set; determining a second target mileage difference between a third difference and a fourth difference; wherein the third difference refers to the mileage difference between the intermediate point and the end point in the sample of trips to be supplemented, and the second difference refers to the mileage difference between the intermediate point and the end point in the target trip in the candidate trajectory set; and determining a first target duration difference between a fifth difference and a sixth difference; wherein the fifth difference refers to the duration difference between the intermediate point and the start point in the sample of trips to be supplemented, and the sixth difference refers to the duration difference between the intermediate point and the start point in the target trip in the candidate trajectory set. The time difference between points; determining the second target time difference between the seventh and eighth differences; wherein the seventh difference refers to the time difference between the intermediate point and the end point within the sample of the complete journey to be completed, and the eighth difference refers to the time difference between the intermediate point and the end point within the target journey in the candidate trajectory set; determining the first target energy consumption difference between the ninth and tenth differences; wherein the ninth difference refers to the energy consumption difference between the intermediate point and the start point within the sample of the complete journey to be completed, and the tenth difference refers to the energy consumption difference between the intermediate point and the start point within the target journey in the candidate trajectory set; determining the second target energy consumption difference between the eleventh and twelfth differences; wherein the eleventh difference refers to the energy consumption difference between the intermediate point and the end point within the sample of the complete journey to be completed, and the twelfth difference refers to the energy consumption difference between the intermediate point and the end point within the target journey in the candidate trajectory set; based on the first target mileage difference, the second target mileage difference, the first target time difference, the second target time difference, the first target energy consumption difference, and the second target energy consumption difference, determining feature data.

[0015] The trajectory completion method provided in this embodiment can more accurately capture the similarities and differences between the sample of the journey to be completed and the target journey in the candidate trajectory set at multiple key points (midpoint, start point, end point) by comparing the differences in mileage, duration, and energy consumption between them. This fine-grained comparison helps to select the candidate trajectory that best matches the journey to be completed, thereby improving the accuracy of data completion.

[0016] Furthermore, considering the diversity of different trips in terms of mileage, duration, and energy consumption, calculating multiple differences and using them as feature data allows the model to learn more information about trip characteristics. This enables the model to make more reasonable predictions and inferences based on this feature data when faced with new, unseen trip data, thereby enhancing the model's generalization ability.

[0017] In an optional implementation, the method further includes: obtaining a test dataset; inputting the test dataset into a pre-trained trajectory completion model to obtain test results; detecting whether the test results meet preset conditions; if the test results meet the preset conditions, determining that the pre-trained trajectory completion model is qualified; if the test results do not meet the preset conditions, determining that the pre-trained trajectory completion model is unqualified.

[0018] The trajectory completion method provided in this embodiment evaluates model performance in an objective and repeatable manner by using a test dataset. The test dataset typically contains samples not used for model training, thus more realistically reflecting the model's performance on unknown data. This evaluation method is more accurate than subjective judgment or testing that relies on only a small number of samples.

[0019] Secondly, the present invention provides a trajectory completion device, comprising: a first acquisition module for acquiring a trajectory to be completed and historical trajectory information; wherein the trajectory to be completed includes at least three H3 indices corresponding to the trajectory points respectively; a first determination module for determining an H3 index set based on the historical trajectory information; a second determination module for determining a candidate trajectory set including the three H3 indices from the H3 index set; a processing module for processing the candidate trajectory set using a pre-trained trajectory completion model to obtain a target trajectory; and a completion module for extracting missing trajectory point information from the target trajectory and completing the trajectory to be completed based on the missing trajectory point information.

[0020] Thirdly, the present invention provides a computer device, including: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the trajectory completion method of the first aspect or any corresponding embodiment described above.

[0021] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the trajectory completion method of the first aspect or any corresponding embodiment thereof.

[0022] Fifthly, the present invention provides a computer program product, including computer instructions for causing a computer to execute the trajectory completion method of the first aspect or any corresponding embodiment thereof. Attached Figure Description

[0023] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0024] Figure 1 This is a schematic flowchart of the trajectory completion method according to an embodiment of the present invention;

[0025] Figure 2 This is a flowchart illustrating another trajectory completion method according to an embodiment of the present invention;

[0026] Figure 3 This is a structural block diagram of a trajectory completion device according to an embodiment of the present invention;

[0027] Figure 4 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0029] Based on relevant technologies, with the rapid development of positioning technology and the widespread adoption of smart devices, trajectory data has become an important resource in many fields, such as traffic management, urban planning, logistics distribution, and user behavior analysis. Trajectory data not only records the location information of moving objects but also implies rich spatiotemporal characteristics and behavioral patterns. However, in practical applications, due to various factors (such as equipment failure, signal obstruction, and user privacy settings), trajectory data is often incomplete or missing, which seriously affects the analytical value and practical application effectiveness. Therefore, trajectory completion technology, as a key technology for solving this problem, has received widespread attention and research in recent years.

[0030] Currently, rule-based methods typically rely on pre-defined rules or assumptions to infer missing trajectory points. For example, the location of missing points can be estimated using interpolation algorithms (such as linear interpolation, polynomial interpolation, etc.); or the possible movement path can be inferred based on the moving object's speed, direction, and other characteristics, combined with map information.

[0031] However, rule-based methods often struggle to accurately capture subtle changes and dynamic characteristics of trajectories when dealing with complex and ever-changing trajectory data.

[0032] Based on this, the present invention provides a trajectory completion method that, by using H3 indexing, can efficiently organize and retrieve geospatial data, especially when processing large-scale trajectory data, significantly improving query and matching efficiency. Utilizing a pre-trained trajectory completion model, it can predict missing trajectory point information in the trajectory to be completed based on information in the candidate trajectory set, comprehensively considering multiple factors (such as time, speed, and direction), thereby improving the accuracy and reliability of the completed trajectory.

[0033] According to an embodiment of the present invention, a trajectory completion method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0034] This embodiment provides a trajectory completion method that can be used in computer devices, such as computers and servers. Figure 1 This is a flowchart illustrating the trajectory completion method according to an embodiment of the present invention, as shown below. Figure 1 As shown, the process includes the following steps:

[0035] Step S101: Obtain the trajectory to be completed and historical trajectory information; wherein, the trajectory to be completed includes at least: the H3 index corresponding to the three trajectory points respectively.

[0036] The trajectory to be completed can be an incomplete trajectory, possibly due to equipment failure, signal loss, or other reasons resulting in missing trajectory points. The trajectory to be completed must contain at least three trajectory points, each corresponding to an H3 index. Historical trajectory information can be a dataset containing a large number of complete trajectories, which can be the past movement trajectories of vehicles. The trajectory to be completed can come from a real-time positioning system (such as GPS), while the historical trajectory information can be retrieved from a database that stores long-term accumulated trajectory data. Both the trajectory to be completed and the historical trajectory information can be stored in file format (such as CSV or JSON) or retrieved in real-time via an API interface.

[0037] H3 Index: H3 is a geospatial indexing system that divides the Earth's surface into a regular hexagonal grid. Each hexagon has a unique H3 index, which makes geographic location-based queries and indexing efficient.

[0038] For example, historical trajectory information contains 1 million trajectories, each containing multiple H3 indexes. By traversing or querying the database, a collection containing hundreds of thousands of unique H3 indexes can be obtained.

[0039] Step S102: Determine the H3 index set based on historical trajectory information.

[0040] Determining the H3 index set based on historical trajectory information is a process of converting geospatial trajectories into an H3 geospatial index system. Specifically, the H3 index set can be determined using direct point sampling or gridded sampling, etc. No specific limitations are specified here, and the appropriate method can be implemented by those skilled in the art.

[0041] More specifically, the sampling method involves iterating through every point in the historical trajectory (usually expressed in latitude and longitude) and converting each point into an H3 index. This can be achieved using the `geoToH3` function from the H3 library (or an implementation in another appropriate language). The gridded sampling method involves selecting the required H3 resolution (e.g., a resolution of 8 represents a hexagon approximately 3.8 km wide). The bounding box of the entire trajectory (defined by the northernmost, southernmost, easternmost, and westernmost points of the trajectory) is divided into multiple H3 grids. For each grid, it is determined whether the trajectory intersects with it. If it intersects, the H3 index of that grid is added to the set.

[0042] Step S103: Determine a set of candidate trajectories including three H3 indices from the H3 index set.

[0043] Candidate trajectories are selected from the H3 index set that contain all three H3 indices of the trajectory to be completed. These candidate trajectories may contain parts or all of the path similar to the trajectory to be completed. Specifically, for each trajectory in the H3 index set, it is checked whether it contains all three H3 indices of the trajectory to be completed. For example, if 1000 trajectories contain the starting H3 index of the trajectory to be completed, 500 contain the intermediate H3 index, and 200 contain the destination H3 index, then through intersection operations, it is possible to find 5 trajectories that simultaneously contain all three H3 indices, which can be selected as candidate trajectories.

[0044] Step S104: Based on the candidate trajectory set, the target trajectory is obtained by processing it using a pre-trained trajectory completion model.

[0045] Specifically, a pre-trained trajectory completion model is used to process the candidate trajectory set to predict the most likely complete trajectory (i.e., the target trajectory). This typically involves machine learning or deep learning algorithms. Sequence models, such as recurrent neural networks like LSTM and GRU, can be used, suitable for processing time series data. Graph neural networks can be used if the trajectory data can be represented as a graph structure. Ensemble methods combine the predictions of multiple models, obtaining the final prediction through voting or averaging, etc. No specific limitations are imposed here; implementation by those skilled in the art is permitted.

[0046] Step S105: Extract missing trajectory point information from the target trajectory, and complete the trajectory to be completed based on the missing trajectory point information.

[0047] After obtaining the target trajectory, the missing trajectory point information (such as location and time) is extracted from it. This information is then added to the trajectory to be completed. Specifically, if the trajectory points in the target trajectory are dense enough, interpolation can be performed directly at the missing locations. Alternatively, path smoothing algorithms (such as Bézier curves) can be used to connect known and predicted points to generate a smooth completed trajectory. No specific limitations are imposed here; implementation by those skilled in the art is permitted.

[0048] This embodiment provides a trajectory completion method that, by using H3 indexing, can efficiently organize and retrieve geospatial data, especially when processing large-scale trajectory data, significantly improving query and matching efficiency. Utilizing a pre-trained trajectory completion model, it can predict missing trajectory point information in the trajectory to be completed based on information in the candidate trajectory set, comprehensively considering multiple factors (such as time, speed, and direction), thereby improving the accuracy and reliability of the completed trajectory.

[0049] In an optional implementation, step S102 above, which determines the H3 index set based on historical trajectory information, includes:

[0050] Step a1: Transform the historical trajectory information to determine the first H3 index corresponding to each trajectory point in the historical trajectory and the data information of each trajectory point; wherein, the data information includes at least: trajectory ID, identification code, time, longitude, latitude, speed and mileage, and the first H3 index corresponds to multiple trajectory points.

[0051] A trajectory point can be a specific location on a trajectory, containing information such as latitude and longitude. A trajectory ID can be a unique identifier for a trajectory. An identification code can be a unique identifier for an entity (such as a vehicle or person). The time can be a timestamp used to record the trajectory point. Longitude and latitude can be the longitude and latitude values ​​representing the geographical location. Speed ​​can be the speed of movement at the trajectory point. Mileage can be the cumulative distance from the trajectory's starting point to the current point.

[0052] Specifically, each point in the historical trajectory (typically including geographical location information such as longitude and latitude) is processed. First, the latitude and longitude of each trajectory point are converted into a corresponding H3 index using an H3 library (or other libraries that support H3 indexing). Simultaneously, other data information for each trajectory point is extracted and recorded, such as the trajectory ID (used to identify different trajectories), identification code (possibly a unique identifier for a vehicle, person, or other entity), time (a timestamp recording the trajectory point), longitude, latitude (although already used to generate the H3 index, it is usually also retained as raw data), speed (representing the speed of movement at that trajectory point), and distance (the cumulative distance from the trajectory's starting point to the current point). Specifically, all trajectory points can be loaded into memory at once, and then the H3 library can be called in batches for conversion. Alternatively, a streaming processing approach can be used, i.e., converting data while reading it, reducing memory usage, etc. No specific limitations are made here; implementation by those skilled in the art is permitted.

[0053] For example, consider a vehicle's historical trajectory. One trajectory point has the following data: Trajectory ID = "001", Identifier = "Vehicle123", Time = "2023-04-01T12:00:00Z", Longitude = "121.473701", Latitude = "31.230416", Speed ​​= "60km / h", Mileage = "10km". After conversion, the H3 index corresponding to this trajectory point might be "8928308280fffff".

[0054] Specifically, step a1 above includes:

[0055] Step a11: Based on the coordinate system in the static historical trajectory, the historical trajectory information is converted into the WGS84 coordinate system using a coordinate system transformation function.

[0056] Historical trajectory static data can be historical trajectory data stored in a database or file system, which may be stored in different coordinate system formats. The WGS84 coordinate system is the standard coordinate system used by the Global Positioning System (GPS), with the Earth's center of mass as the origin and latitude and longitude as coordinate values, and is widely used for global positioning and navigation. Specifically, coordinate system transformation can be performed using geospatial data processing libraries such as proj4 (the pyproj library in Python) and GDAL. Alternatively, coordinate system transformation APIs provided by cloud service providers (such as Google Maps API, Baidu Maps API, etc.) can be used, and transformations can be completed by calling these interfaces via HTTP requests. No specific limitations are made here; implementation by those skilled in the art is permitted.

[0057] Step a12: Using the API provided by the H3 library, convert the latitude and longitude of each trajectory point into the first H3 index and determine the data information of each trajectory point.

[0058] The H3 library (an open-source library for geospatial indexing) is used to convert the latitude and longitude of each trajectory point into an H3 index. The H3 index is a geospatial indexing system that divides the Earth's surface into a hexagonal grid, with each grid having a unique identifier (i.e., an H3 index). Additionally, other data information for each trajectory point needs to be determined, such as timestamps and velocity. Specifically, in languages ​​like Python and JavaScript, functions or methods provided by the H3 library can be directly called to convert latitude and longitude to an H3 index. If H3 provides a command-line tool, latitude and longitude can be converted to an H3 index through the command-line interface. The H3 library can be integrated into larger applications or systems to automatically perform latitude and longitude to H3 index conversions in data processing pipelines; however, specific limitations are not specified here, and implementation by those skilled in the art is permitted.

[0059] Step a2: Construct an inverted index using the first H3 index as the primary key.

[0060] Using each H3 index obtained in step a1 as the primary key, and the data information (track ID, identification code, time, longitude, latitude, speed, and mileage) of all trajectory points with the same H3 index as values, an inverted index is constructed. In this way, for any H3 index, all trajectory points falling within that index range and their data can be quickly found. More specifically, the information dimension of H3 is calculated by sorting all trajectory points in ascending order by time, and then taking the information dimension of the median trajectory point as the information dimension corresponding to that H3, such as mileage or speed.

[0061] Step a3: Based on the inverted index, determine the second H3 index adjacent to the first H3 index, and construct an H3 index set based on the first H3 index and the second H3 index.

[0062] Using the adjacent index query functions provided by the H3 library (such as h3GetPentagonIndexes, h3KRing, etc.), the adjacent indices (second H3 indices) of each first H3 index are found. Then, based on these adjacent indices and the original first H3 indices, a complete set of H3 indices is constructed. This set covers all areas that the trajectory may pass through and can be used for subsequent spatial queries and analysis. Specifically, for each first H3 index, the relevant functions of the H3 library can be directly called to obtain its adjacent indices. If there are many first H3 indices, batch processing can be considered to reduce the number of function calls and improve efficiency. For frequently queried adjacent indices, caching can be used to store the results to reduce redundant calculations, etc., without specific limitations here, which can be implemented by those skilled in the art.

[0063] The trajectory completion method provided in this embodiment achieves the structuring and standardization of geospatial data by converting each trajectory point in the historical trajectory into a corresponding H3 index. As a multi-level hexagonal grid system, the H3 index can efficiently represent and store geospatial information. During the conversion process, in addition to obtaining the H3 index of the trajectory point, other important data information of the trajectory point is also retained, such as trajectory ID, identification code, time, longitude, latitude, speed, and distance. This information provides a rich data foundation for subsequent trajectory analysis and processing. Furthermore, by finding H3 indices adjacent to the H3 index in the trajectory to be completed, a candidate trajectory set can be quickly constructed. These candidate trajectories are likely to contain missing information in the trajectory to be completed, providing a possibility for subsequent trajectory completion.

[0064] Furthermore, by using the API provided by the H3 library to convert the latitude and longitude of each trajectory point into an H3 index, geospatial data can be quickly indexed and structured, facilitating subsequent querying and analysis. Moreover, the H3 index allows for rapid location of all trajectory points within a specific area without traversing the entire dataset. This efficient indexing mechanism significantly improves data processing and query efficiency while reducing computational costs.

[0065] In an optional implementation, to construct a pre-trained trajectory completion model, the above method further includes:

[0066] Step b1: Obtain the complete route sample to be completed; wherein, the complete route sample to be completed includes multiple routes, and each route includes at least three trajectory points and the H3 index corresponding to the trajectory points.

[0067] The incomplete travel sample to be supplemented can be travel data containing incomplete trajectory information. Each travel segment must contain at least three trajectory points and their corresponding H3 indices. The H3 index is a geospatial indexing system used to divide the Earth's surface into a series of hexagonal grids, each grid having a unique identifier (i.e., the H3 index), thus facilitating the storage, retrieval, and analysis of geographic data. Specifically, incomplete trajectory data can be acquired in real-time through a real-time monitoring system. Incomplete trajectory samples can also be filtered from stored historical data. Users can also be allowed to report incomplete trajectory data from their travel segments, etc. These are not specifically limited here and can be implemented by those skilled in the art.

[0068] Step b2: Based on the H3 index corresponding to the trajectory point, determine the target route from the historical trajectory database to form a set of candidate trajectories for the route.

[0069] Historical trajectory databases can store large amounts of complete trajectory data, which, after processing, includes trajectory points and their corresponding H3 indices. The target journey can be a complete journey found in the historical trajectory database that is similar to or matches the H3 index of the trajectory points in the sample to be completed. The candidate trajectory set can be a collection of the found target journeys as candidates for subsequent completion operations. Index matching: Similar trajectories in the historical trajectory database are quickly retrieved using the H3 index. Specifically, the similarity between the sample to be completed and historical trajectories can be calculated, and trajectories with high similarity can be selected as candidates. Alternatively, clustering algorithms can be used to group historical trajectory data, and then candidate trajectories can be selected from clusters similar to the route to be completed, etc. No specific limitations are imposed here; implementation by those skilled in the art is permitted.

[0070] For example, the trajectory point H3 index in the sample to be completed is 8928308280fffff. By matching the index, multiple complete trajectories containing this index or similar indices were found in the historical trajectory database. These trajectories were added to the candidate trajectory set.

[0071] Step b3: Based on each journey in the complete journey sample to be completed and the target journey in the journey candidate trajectory set, determine the feature data to determine the target journey sample corresponding to the feature data.

[0072] Feature data can be data extracted from the complete journey sample to be supplemented and the candidate trajectory set to describe trajectory characteristics, such as distances between trajectory points, speeds, and changes in direction. The target journey sample can be the complete journey selected from the candidate trajectory set that best matches the features of the complete journey sample to be supplemented, based on the degree of matching of the feature data. Specifically, feature extraction algorithms can be used to extract useful features from the trajectory data. Alternatively, the feature similarity between the complete journey sample to be supplemented and each trajectory in the candidate trajectory set can be calculated, and the trajectory with the highest similarity can be selected as the target journey sample.

[0073] Step b4: Train the first model using the target travel samples to obtain a pre-trained trajectory completion model.

[0074] The first model can be a machine learning model for trajectory completion, such as a neural network or support vector machine. Training refers to using target travel samples as training data to train the model so that it can learn the rules of trajectory completion. The pre-trained trajectory completion model can be the model obtained after training, which can be used to complete the trajectory of new travel samples to be completed. For example, a neural network model can be trained using target travel samples containing complete trajectories. During training, the model continuously adjusts its parameters to minimize the error between the predicted trajectory and the actual trajectory. After training, this model is used as a pre-trained trajectory completion model to complete the trajectory of new travel samples to be completed.

[0075] The trajectory completion method provided in this embodiment, based on H3 index matching of target trips, can extract rich feature data, such as trajectory length, speed changes, and stop point distribution. This feature data comprehensively reflects users' travel habits and behavioral patterns, providing strong support for model training. Furthermore, when training the model using target trip samples, the model's parameters and structure can be adjusted according to actual needs to achieve the best completion effect. In addition, different algorithms and frameworks can be used to train the model to meet different application scenarios and requirements.

[0076] In an optional implementation, each journey includes three trajectory points: a start trajectory point, an intermediate trajectory point, and an end trajectory point. In step b3 above, feature data is determined based on each journey in the sample of journeys to be completed and the target journey in the candidate trajectory set, including:

[0077] Step b31: Determine the first target mileage difference between the first difference and the second difference; wherein, the first difference refers to the mileage difference between the intermediate point and the starting point within the sample of the journey to be completed, and the second difference refers to the mileage difference between the intermediate point and the starting point within the target journey in the candidate trajectory set.

[0078] The mileage difference can be the difference in the actual distance traveled between two points. The midpoint can be a reference point selected from the sample of the complete trip to be completed and the target trip, and is usually used for comparison and calculation.

[0079] Specifically, the first target mileage difference can be determined using the following formula:

[0080] diff_middle_start mileage =abs((h3_middle_p mileage -h3_start_pmileage )-

[0081] (h3_middle_q mileage -h3_start_q mileage )); where, diff_middle_start mileage h3_middle_p represents the first target mileage difference. mileage -h3_start_p mileage h3_middle_q represents the mileage difference between the midpoint and the starting point within the complete travel sample to be supplemented. mileage -h3_start_q mileage This is the mileage difference between the midpoint and the starting point within the target journey in the candidate trajectory set.

[0082] Step b32: Determine the second target mileage difference between the third difference and the fourth difference; wherein, the third difference refers to the mileage difference between the intermediate point and the end point within the sample of the journey to be completed, and the second difference refers to the mileage difference between the intermediate point and the end point within the target journey in the candidate trajectory set.

[0083] Specifically, the second target mileage difference can be determined using the following formula:

[0084] diff_end_middle mileage =abs((h3_end_p mileage -h3_middle_p mileage )-

[0085] (h3_end_q mileage -h3_middle_q mileage )); where, diff_end_middle mileage h3_end_p represents the second target mileage difference. mileage -h3_middle_p mileage h3_end_q represents the mileage difference between the end point and the intermediate point within the complete trip sample to be supplemented. mileage -h3_middle_q mileage This represents the mileage difference between the end point and the intermediate point within the target journey in the candidate trajectory set.

[0086] Step b33: Determine the first target duration difference between the fifth difference and the sixth difference; wherein, the fifth difference refers to the duration difference between the intermediate point and the starting point within the sample of the complete journey to be completed, and the sixth difference refers to the duration difference between the intermediate point and the starting point within the target journey in the candidate trajectory set.

[0087] Specifically, the time difference of the first target can be determined using the following formula:

[0088] diff_middle_start duration =abs((h3_middle_p time -h3_start_p time )-

[0089] (h3_middle_q time -h3_start_q time )); where, diff_middle_start duration The first target duration difference, h3_middle_p time -h3_start_p time h3_middle_q represents the time difference between the midpoint and the start point within the complete travel sample to be filled. time -h3_start_q time This is the time difference between the midpoint and the starting point within the target travel distance in the candidate trajectory set.

[0090] Step b34: Determine the second target duration difference between the seventh difference and the eighth difference; wherein, the seventh difference refers to the duration difference between the intermediate point and the end point within the sample of the journey to be completed, and the eighth difference refers to the duration difference between the intermediate point and the end point within the target journey in the candidate trajectory set.

[0091] Specifically, the second target duration difference can be determined using the following formula:

[0092] diff_end_middle duration =abs((h3_end_p time -h3_middle_p time )-

[0093] (h3_nd_q time -h3_middle_q time )); where, diff_end_middle duration The second target duration difference, h3_end_p time -h3_middle_p time h3_nd_q is the time difference between the midpoint and end point within the complete journey sample to be supplemented. time -h3_middle_q time It represents the time difference between the midpoint and end point within the target journey in the candidate trajectory set.

[0094] Step b35: Determine the first target energy consumption difference between the ninth difference and the tenth difference; wherein, the ninth difference refers to the energy consumption difference between the intermediate point and the starting point within the sample of the route to be completed, and the tenth difference refers to the energy consumption difference between the intermediate point and the starting point within the target route in the candidate trajectory set.

[0095] Specifically, the first target energy consumption difference can be determined using the following formula:

[0096] diff_middle_start electricity =

[0097] abs((h3_middle_p electricity -h3_start_p electricity )-(h3_middle_q electricity -h3_start_q electricity )); where, diff_middle_start electricity The first target energy consumption difference, h3_middle_p electricity -h3_start_p electricity h3_middle_q represents the energy consumption difference between the midpoint and the starting point within the complete travel sample to be filled. electricity -h3_start_q electricity This represents the energy consumption difference between the midpoint and the starting point within the target travel distance in the candidate trajectory set.

[0098] Step b36: Determine the second target energy consumption difference between the eleventh difference and the twelfth difference; wherein, the eleventh difference refers to the energy consumption difference between the intermediate point and the end point in the sample of the complete journey to be completed, and the twelfth difference refers to the energy consumption difference between the intermediate point and the end point in the target journey in the candidate trajectory set.

[0099] Specifically, the energy consumption difference for the second target can be determined using the following formula:

[0100] diff_end_middle electricity =

[0101] abs((h3_end_p electricity -h3_middle_p electricity )-(h3_end_q electricity -h3_middle_q electricity )); where, diff_end_middle electricity The energy consumption difference for the second objective, h3_end_p electricity -h3_middle_p electricityh3_end_q is the energy consumption difference between the midpoint and end point within the entire journey sample to be filled. electricity -h3_middle_q electricity This represents the energy consumption difference between the midpoint and end point within the target travel distance in the candidate trajectory set.

[0102] Step b37: Determine feature data based on the first target mileage difference, the second target mileage difference, the first target duration difference, the second target duration difference, the first target energy consumption difference, and the second target energy consumption difference.

[0103] The feature data is obtained by integrating the first target mileage difference, the second target mileage difference, the first target duration difference, the second target duration difference, the first target energy consumption difference, and the second target energy consumption difference.

[0104] The trajectory completion method provided in this embodiment can more accurately capture the similarities and differences between the sample of the journey to be completed and the target journey in the candidate trajectory set at multiple key points (midpoint, start point, end point) by comparing the differences in mileage, duration, and energy consumption between them. This fine-grained comparison helps to select the candidate trajectory that best matches the journey to be completed, thereby improving the accuracy of data completion.

[0105] Furthermore, considering the diversity of different trips in terms of mileage, duration, and energy consumption, calculating multiple differences and using them as feature data allows the model to learn more information about trip characteristics. This enables the model to make more reasonable predictions and inferences based on this feature data when faced with new, unseen trip data, thereby enhancing the model's generalization ability.

[0106] In an optional implementation, the method further includes:

[0107] Step c1: Obtain the test dataset.

[0108] Step c2: Input the test dataset into the pre-trained trajectory completion model to obtain the test results.

[0109] Step c3: Check whether the test results meet the preset conditions; if the test results meet the preset conditions, the pre-trained trajectory completion model is deemed qualified; if the test results do not meet the preset conditions, the pre-trained trajectory completion model is deemed unqualified.

[0110] The samples corresponding to the calculated data features are sampled according to a positive-to-negative sample ratio (e.g., 1:10). Then, the training dataset and the test dataset are split according to a certain ratio (e.g., 7:3). The test dataset is input into the pre-trained trajectory completion model to obtain the test results. If the test results meet the preset conditions, the pre-trained trajectory completion model is deemed qualified; if the test results do not meet the preset conditions, the pre-trained trajectory completion model is deemed unqualified.

[0111] The trajectory completion method provided in this embodiment evaluates model performance in an objective and repeatable manner by using a test dataset. The test dataset typically contains samples not used for model training, thus more realistically reflecting the model's performance on unknown data. This evaluation method is more accurate than subjective judgment or testing that relies on only a small number of samples.

[0112] In one optional implementation, combined with Figure 2 As shown, this embodiment provides a trajectory completion method, which includes:

[0113] 1. Preprocessing of trajectory data: Convert all vehicle trajectories to WGS84: Based on the coordinate system in the static model, and according to the coordinate system transformation function, convert all vehicle trajectory data to the WGS84 coordinate system.

[0114] 2. Convert latitude and longitude to H3 index: Use the API provided by H3 to convert the latitude and longitude points in the vehicle trajectory into H3 index.

[0115] 3. Build an inverted index based on H3: Use H3 as the primary key, and the other data content is the set of all trajectory points corresponding to this H3. The data information of the trajectory points includes the following: <trajectory id, vin, time, longitude, latitude, speed, mileage>. One H3 corresponds to multiple trajectory points, and each trajectory point has a corresponding speed or mileage. The information dimension of this H3 is calculated by sorting all trajectory points in ascending order by time, and then taking the information dimension of the median trajectory point as the information dimension corresponding to this H3, such as mileage, speed, etc.

[0116] 4. H3 Nearest Neighbor Mining: Using the API provided by H3, find the nearest neighbor set of each H3 point and add it to the H3 index set.

[0117] 5. Recall: Treat the H3(ph1, ph2, ph3) corresponding to the existing trajectory points in the trajectory to be completed (tr) as Query.

[0118] 6. Query: The set of all historical trajectories containing the query is regarded as the candidate set rs. Each trajectory in rs contains three H3 index points corresponding to the query. Each H3 index point contains information such as mileage and speed.

[0119] 7. Ranking: Calculate the similarity score between the Query and each trajectory trip in the candidate set rs based on the ranking model rank(Query, trip). The trajectory points corresponding to the trajectory with the highest similarity, top_tr, can be completed into the candidate tr. The ranking model rank(Query, trip) is the pre-trained trajectory completion model mentioned above.

[0120] More specifically, the construction process of the ranking model rank(Query,trip) is as follows:

[0121] Complete Trip Samples: Randomly select some (e.g., 1000) trips from a certain region (e.g., Beijing) on ​​a certain day, and randomly select three trajectory points at the start, middle, and end of the trip: h3_start, h3_middle, and h3_end. Record the vehicle chassis number (vin) and trip start time (start_time) of the trip to form the samples data set.

[0122] Trajectory Recall: For each trip p in samples, extract the corresponding three H3 indices h3_start, h3_middle, and h3_end. Recall all trips in the historical trajectory that pass through these three H3 index points to form the sample_recall dataset. If all h3 values ​​of p and a trip q in its recalled sample_recall are the same, the sample is marked as 1; otherwise, it is marked as 0.

[0123] For any two trips p and q, calculate the following data characteristics: mileage difference (between midpoint and start point), mileage difference (between end point and midpoint), time difference (between midpoint and start point), time difference (between end point and midpoint), energy consumption difference (between midpoint and start point), and energy consumption difference (between end point and midpoint).

[0124] After calculating the features, the sample data is sampled according to the ratio of positive to negative samples (e.g., 1:10). Then, the training set and the test set are split according to a certain ratio (e.g., 7:3). The LightGBM model is trained on the training set to obtain the rank(Query,trip) ranking model. Then, the rank(Query,trip) model is tested on the test set to verify the model effect.

[0125] Precision and recall are used to validate the model's performance, and the calculation formulas are as follows:

[0126] Where Precision is the accuracy, Recall is the recall, S is the test sample set, s is one of the trajectory instances, R(s) is the H3 set of trajectory s completed by the algorithm, and P(s) is the true H3 set of trajectory s.

[0127] This embodiment also provides a trajectory completion device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0128] This embodiment provides a trajectory completion device, such as... Figure 3 As shown, it includes:

[0129] The first acquisition module 301 is used to acquire the trajectory to be completed and historical trajectory information; wherein, the trajectory to be completed includes at least: H3 indices corresponding to three trajectory points respectively; the first determination module 302 is used to determine the H3 index set based on the historical trajectory information; the second determination module 303 is used to determine the candidate trajectory set including the three H3 indices from the H3 index set; the processing module 304 is used to process the candidate trajectory set using a pre-trained trajectory completion model to obtain the target trajectory; the completion module 305 is used to extract the missing trajectory point information from the target trajectory and complete the trajectory to be completed based on the missing trajectory point information.

[0130] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.

[0131] In this embodiment, the trajectory completion device is presented in the form of a functional unit. Here, a functional unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0132] This invention also provides a computer device having the above-described features. Figure 3 The trajectory completion device shown.

[0133] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 4As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 4 Take a processor 10 as an example.

[0134] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.

[0135] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.

[0136] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0137] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.

[0138] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.

[0139] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.

[0140] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0141] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A trajectory completion method, characterized in that, The method includes: Obtain the trajectory to be completed and historical trajectory information; the trajectory to be completed shall include at least the H3 indexes corresponding to the three trajectory points respectively; Based on the historical trajectory information, determine the H3 index set; From the H3 index set, determine a candidate trajectory set including the H3 indices corresponding to the three trajectory points in the trajectory to be completed; Based on the candidate trajectory set, the target trajectory is obtained by processing it using a pre-trained trajectory completion model. Extract missing trajectory point information from the target trajectory, and complete the trajectory to be completed based on the missing trajectory point information; The process of building a pre-trained trajectory completion model includes: Obtain the complete travel sample to be supplemented; the complete travel sample to be supplemented includes multiple travels, and each travel includes at least three trajectory points and the H3 index corresponding to the trajectory points; Based on the H3 index corresponding to the trajectory point, the target route is determined from the historical trajectory database, and the found target routes are collected to form a set of candidate trajectories. Based on the target journey in each journey in the full journey sample to be supplemented and the journey candidate trajectory set, feature data is determined to determine the target journey sample corresponding to the feature data; The first model is trained using the target travel samples to obtain a pre-trained trajectory completion model; Each journey includes three trajectory points: a start trajectory point, an intermediate trajectory point, and an end trajectory point. The feature data determined based on each journey in the sample of journeys to be completed and the target journey in the set of candidate trajectories includes: Determine the first target mileage difference between the first difference and the second difference; wherein, the first difference refers to the mileage difference between the intermediate trajectory point and the starting trajectory point within the sample of the complete journey to be completed, and the second difference refers to the mileage difference between the intermediate trajectory point and the starting trajectory point within the target journey in the candidate trajectory set; Determine the second target mileage difference between the third difference and the fourth difference; where the third difference refers to the mileage difference between the intermediate trajectory point and the end trajectory point within the sample of the complete journey to be completed, and the second difference refers to the mileage difference between the intermediate trajectory point and the end trajectory point within the target journey in the candidate trajectory set; Determine the first target duration difference between the fifth and sixth differences; where the fifth difference refers to the duration difference between the intermediate trajectory point and the starting trajectory point within the sample of the complete journey to be completed, and the sixth difference refers to the duration difference between the intermediate trajectory point and the starting trajectory point within the target journey in the candidate trajectory set; Determine the second target duration difference between the seventh and eighth differences; where the seventh difference refers to the duration difference between the intermediate trajectory point and the end trajectory point within the sample of the complete journey to be completed, and the eighth difference refers to the duration difference between the intermediate trajectory point and the end trajectory point within the target journey in the candidate trajectory set; Determine the first target energy consumption difference between the ninth difference and the tenth difference; where the ninth difference refers to the energy consumption difference between the intermediate trajectory point and the starting trajectory point within the sample of the complete journey to be completed, and the tenth difference refers to the energy consumption difference between the intermediate trajectory point and the starting trajectory point within the target journey in the candidate trajectory set; Determine the second target energy consumption difference between the eleventh difference and the twelfth difference; where the eleventh difference refers to the energy consumption difference between the intermediate trajectory point and the end trajectory point in the sample of the complete journey to be completed, and the twelfth difference refers to the energy consumption difference between the intermediate trajectory point and the end trajectory point in the target journey in the candidate trajectory set; Based on the first target mileage difference, the second target mileage difference, the first target duration difference, the second target duration difference, the first target energy consumption difference, and the second target energy consumption difference, feature data is determined.

2. The trajectory completion method according to claim 1, characterized in that, Based on the historical trajectory information, the H3 index set is determined, including: The historical trajectory information is transformed to determine the first H3 index corresponding to each trajectory point in the historical trajectory and the data information of each trajectory point; wherein, the data information includes at least: trajectory ID, vehicle identification number (VIN), time, longitude, latitude, speed and mileage, and the first H3 index corresponds to multiple trajectory points; the mileage is the cumulative distance from the trajectory starting point to the current trajectory point; Construct an inverted index using the first H3 index as the primary key; Based on the inverted index, the second H3 index adjacent to the first H3 index is determined, and an H3 index set is constructed based on the first H3 index and the second H3 index.

3. The trajectory completion method according to claim 2, characterized in that, The historical trajectory information is transformed to determine the first H3 index corresponding to each trajectory point in the historical trajectory and the data information of each trajectory point, including: Based on the coordinate system in the static historical trajectory, the historical trajectory information is converted into the WGS84 coordinate system through a coordinate system transformation function; the static historical trajectory refers to historical trajectory data stored in a database or file system, and the historical trajectory data is stored in different coordinate system formats. Using the API provided by the H3 library, the latitude and longitude of each trajectory point are converted into the first H3 index, and the data information of each trajectory point is determined.

4. The trajectory completion method according to claim 1, characterized in that, The method further includes: Obtain the test dataset; The test dataset is input into the pre-trained trajectory completion model to obtain the test results; Check whether the test results meet the preset conditions; If the test results meet the preset conditions, the pre-trained trajectory completion model is deemed qualified. If the test results do not meet the preset conditions, the pre-trained trajectory completion model is deemed unqualified.

5. An apparatus for implementing the trajectory completion method as described in claim 1, characterized in that, The device includes: The first acquisition module is used to acquire the trajectory to be completed and historical trajectory information; wherein, the trajectory to be completed includes at least: the H3 indexes corresponding to the three trajectory points respectively; The first determining module is used to determine the H3 index set based on the historical trajectory information; The second determining module is used to determine a set of candidate trajectories from the H3 index set, including the H3 indices corresponding to the three trajectory points in the trajectory to be completed. The processing module is used to process the candidate trajectory set using a pre-trained trajectory completion model to obtain the target trajectory. The completion module is used to extract missing trajectory point information from the target trajectory and complete the trajectory to be completed based on the missing trajectory point information.

6. A computer device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the trajectory completion method according to any one of claims 1 to 4 by executing the computer instructions.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the trajectory completion method according to any one of claims 1 to 4.

8. A computer program product, characterized in that, Includes computer instructions for causing a computer to perform the trajectory completion method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Moving track prediction method and device, computer equipment and storage medium

    CN116980830A

  • Movement track prediction method and system, storage medium and electronic equipment

    CN117726042A