Road trajectory generation method, device and computer equipment

By iteratively generating and sorting data on a road network map, the problems of low continuity and accuracy in traditional trajectory data generation are solved, and high-precision road trajectory generation is achieved.

CN123033356APending Publication Date: 2026-11-03BEIHANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611147697.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-30
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

Traditional trajectory data generation methods, which rely on progressive trajectory prediction based on road networks, result in discrete road segments that cannot form continuous trajectories, leading to low accuracy.

Method used

Based on the road network map, a set of road segments for new trajectory points is generated, and the target road segment information is predicted through a trajectory generation model. The process is iteratively generated until the target information overlaps, and then sorted to obtain the user's road trajectory information.

Benefits of technology

This ensures the continuity and coherence of the road trajectory, improves the generation accuracy, and avoids the actual errors that traditional methods cannot generate continuous trajectories.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123033356A_ABST
    Figure CN123033356A_ABST
Patent Text Reader

Abstract

The application relates to a road track generation method, device and computer equipment. The method comprises the following steps: acquiring starting information of a user, target information of the user and a road network map of a target area, and generating a road section set of a new track point according to the road network map based on the starting information; generating a candidate feature set of the road section set based on the road section set and the target information, and predicting target road section information of the new track point through a track generation model based on the candidate feature set; replacing the starting information with the target road section information, returning to execute the step of generating the road section set of the new track point according to the road network map based on the starting information, and when the target road section information coincides with the target information, performing sorting processing on the target road section information of each new track point generated in each iteration to obtain road track information of the user. The method can improve the generation accuracy of the road track.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of spatiotemporal trajectory data processing technology, and in particular to a method, apparatus and computer device for generating road trajectories. Background Technology

[0002] GPS trajectory data is a crucial data foundation for describing the spatiotemporal behavior of moving objects, and it has wide applications in urban traffic analysis, travel behavior research, route selection modeling, traffic condition assessment, and related prediction tasks. High-quality trajectory data can accurately reflect spatial location changes and temporal evolution patterns during movement, thus playing a vital role in traffic research and data-driven applications. With the development of urban sensing, location services, and spatiotemporal data analysis technologies, trajectory data generation and sharing have gradually become important research directions in related fields.

[0003] Traditional trajectory data generation methods typically use a road-level trajectory generation framework based on road networks, modeling trajectory generation as a sequential navigation decision-making process. This framework predicts the user's next road segment through progressive trajectory prediction, thereby generating a structurally effective road sequence. However, the data output by this method is only at the discrete road segment level and cannot form a continuous trajectory, resulting in significant actual errors and low accuracy in generating road trajectories. Summary of the Invention

[0004] Therefore, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium, and computer program product for generating road trajectories to address the aforementioned technical problems.

[0005] Firstly, this application provides a method for generating road trajectories, including:

[0006] Obtain the user's initial information, the user's target information, and the road network map of the target area, and generate a set of road segments for new trajectory points based on the initial information and the road network map;

[0007] Based on the road segment set and the target information, a candidate feature set for the road segment set is generated, and based on the candidate feature set, the target road segment information of the new trajectory point is predicted through a trajectory generation model.

[0008] Replace the starting information with the target road segment information, and return to execute the process of generating a new set of road segments for trajectory points based on the starting information and the road network map, until the target road segment information coincides with the target information. Then sort the target road segment information of each new trajectory point generated in each iteration to obtain the user's road trajectory information.

[0009] Optionally, generating a set of road segments for new trajectory points based on the initial information and according to the road network map includes:

[0010] Based on the starting information, the user's starting road segment, the user's starting point location information, and the user's starting timestamp are identified;

[0011] In the road network map, each adjacent road segment is filtered to be adjacent to the starting road segment, and based on the starting point location information and the starting timestamp, a road segment fitting strategy is used to filter each candidate adjacent road segment suitable for user passage.

[0012] In each of the candidate adjacent road segments, a new trajectory point of the user in each candidate adjacent road segment is generated, and the candidate adjacent road segments corresponding to each new trajectory point are used as a road segment set.

[0013] Optionally, generating a candidate feature set for the road segment set based on the road segment set and the target information includes:

[0014] Based on the target information, the user's target road segment is identified, and the geometric relationship information between each candidate adjacent road segment and the target road segment is identified;

[0015] For each candidate adjacent road segment, based on the geometric relationship information corresponding to the candidate adjacent road segment, road network coding processing is performed on the candidate adjacent road segment to obtain the road segment features of the candidate adjacent road segment;

[0016] The target area is divided into functional areas, and the functional area to which each candidate adjacent road segment belongs is identified;

[0017] Based on the sub-road network map of each functional area in the road network map, sub-region features corresponding to each functional area are constructed respectively, and the road segment features of each candidate adjacent road segment and the sub-region features of the functional area to which each candidate adjacent road segment belongs are used as the candidate feature set of the road segment set.

[0018] Optionally, predicting the target road segment information of the new trajectory point based on the candidate feature set and using a trajectory generation model includes:

[0019] For each candidate adjacent road segment, the road segment features of the candidate adjacent road segment and the sub-region features of the functional area to which the candidate adjacent road segment belongs are subjected to feature fusion encoding processing to obtain the feature encoding information of the candidate adjacent road segment;

[0020] Based on the new trajectory points corresponding to the candidate adjacent road segments, the location coding information corresponding to the candidate adjacent road segments is generated through a relative position coding strategy;

[0021] Based on the feature encoding information of each candidate adjacent road segment and the location encoding information of each candidate adjacent road segment, a trajectory generation model is used to predict the target road segment suitable for the user and the arrival timestamp of the target road segment.

[0022] The target road segment, the location information of the new trajectory point corresponding to the target road segment, and the arrival timestamp of the target road segment are used as the target road segment information of the new trajectory point.

[0023] Optionally, the step of predicting a target road segment suitable for the user and the arrival timestamp of the target road segment using a trajectory generation model based on the feature encoding information and location encoding information of each of the candidate adjacent road segments includes:

[0024] Based on the feature encoding information of each candidate adjacent road segment and the location encoding information of each candidate adjacent road segment, the navigator of the trajectory generation model predicts the transition probability of each candidate adjacent road segment.

[0025] Candidate adjacent road segments with the highest transition probability are selected as target road segments. Based on the feature encoding information of the target road segments and the start timestamp, the arrival timestamp of the target road segments is generated by the time prediction unit of the trajectory generation model.

[0026] Optionally, the step of sorting the target road segment information of each new trajectory point generated in each iteration to obtain the user's road trajectory information includes:

[0027] According to the time order of each arrival timestamp, the target road segments corresponding to each new trajectory point are sorted to obtain the road trajectory sequence;

[0028] The location information of the new trajectory point corresponding to each target road segment and the arrival timestamp of each target road segment are marked in the road trajectory sequence to obtain the user's road trajectory information.

[0029] Secondly, this application also provides a road trajectory generation device, comprising:

[0030] The acquisition module is used to acquire the user's starting information, the user's target information, and the road network map of the target area, and generate a set of road segments for new trajectory points based on the starting information and the road network map.

[0031] The prediction module is used to generate a candidate feature set for the road segment set based on the road segment set and the target information, and to predict the target road segment information of the new trajectory point based on the candidate feature set through a trajectory generation model.

[0032] The iteration module replaces the starting information with the target road segment information and returns to execute the generation of a new set of road segments for trajectory points based on the starting information and the road network map. This process continues until the target road segment information coincides with the target information. Then, the target road segment information of each new trajectory point generated in each iteration is sorted to obtain the user's road trajectory information.

[0033] Optionally, the acquisition module is specifically used for:

[0034] Based on the starting information, the user's starting road segment, the user's starting point location information, and the user's starting timestamp are identified;

[0035] In the road network map, each adjacent road segment is filtered to be adjacent to the starting road segment, and based on the starting point location information and the starting timestamp, a road segment fitting strategy is used to filter each candidate adjacent road segment suitable for user passage.

[0036] In each of the candidate adjacent road segments, a new trajectory point of the user in each candidate adjacent road segment is generated, and the candidate adjacent road segments corresponding to each new trajectory point are used as a road segment set.

[0037] Optionally, the prediction module is specifically used for:

[0038] Based on the target information, the user's target road segment is identified, and the geometric relationship information between each candidate adjacent road segment and the target road segment is identified;

[0039] For each candidate adjacent road segment, based on the geometric relationship information corresponding to the candidate adjacent road segment, road network coding processing is performed on the candidate adjacent road segment to obtain the road segment features of the candidate adjacent road segment;

[0040] The target area is divided into functional areas, and the functional area to which each candidate adjacent road segment belongs is identified;

[0041] Based on the sub-road network map of each functional area in the road network map, sub-region features corresponding to each functional area are constructed respectively, and the road segment features of each candidate adjacent road segment and the sub-region features of the functional area to which each candidate adjacent road segment belongs are used as the candidate feature set of the road segment set.

[0042] Optionally, the prediction module is specifically used for:

[0043] For each candidate adjacent road segment, the road segment features of the candidate adjacent road segment and the sub-region features of the functional area to which the candidate adjacent road segment belongs are subjected to feature fusion encoding processing to obtain the feature encoding information of the candidate adjacent road segment;

[0044] Based on the new trajectory points corresponding to the candidate adjacent road segments, the location coding information corresponding to the candidate adjacent road segments is generated through a relative position coding strategy;

[0045] Based on the feature encoding information of each candidate adjacent road segment and the location encoding information of each candidate adjacent road segment, a trajectory generation model is used to predict the target road segment suitable for the user and the arrival timestamp of the target road segment.

[0046] The target road segment, the location information of the new trajectory point corresponding to the target road segment, and the arrival timestamp of the target road segment are used as the target road segment information of the new trajectory point.

[0047] Optionally, the prediction module is specifically used for:

[0048] Based on the feature encoding information of each candidate adjacent road segment and the location encoding information of each candidate adjacent road segment, the navigator of the trajectory generation model predicts the transition probability of each candidate adjacent road segment.

[0049] Candidate adjacent road segments with the highest transition probability are selected as target road segments. Based on the feature encoding information of the target road segments and the start timestamp, the arrival timestamp of the target road segments is generated by the time prediction unit of the trajectory generation model.

[0050] Optionally, the iterative module is specifically used for:

[0051] According to the time order of each arrival timestamp, the target road segments corresponding to each new trajectory point are sorted to obtain the road trajectory sequence;

[0052] The location information of the new trajectory point corresponding to each target road segment and the arrival timestamp of each target road segment are marked in the road trajectory sequence to obtain the user's road trajectory information.

[0053] Thirdly, this application provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method described in any one of the first aspects.

[0054] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the steps of the method described in any one of the first aspects.

[0055] Fifthly, this application provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of the method described in any one of the first aspects.

[0056] The aforementioned road trajectory generation method, apparatus, and computer equipment acquire the user's initial information, the user's target information, and a road network map of the target area. Based on the initial information, a road segment set of new trajectory points is generated according to the road network map. Based on the road segment set and the target information, a candidate feature set of the road segment set is generated. Based on the candidate feature set, a trajectory generation model is used to predict the target road segment information of the new trajectory points. The target road segment information replaces the initial information, and the process returns to generate a road segment set of new trajectory points based on the initial information and the road network map. This continues until the target road segment information coincides with the target information. Finally, the target road segment information of each new trajectory point generated in each iteration is sorted to obtain the user's road trajectory information. This solution uses the road network map of the target area as a basis. Following the user's travel sequence, it iteratively predicts the road segment set for each new trajectory point. The terminal then sorts these road segment sets according to temporal sequence and trajectory connectivity to obtain the user's road trajectory information. This ensures the continuity and coherence of the sorted road trajectory information, avoiding the problems of traditional iterative road segment generation, such as the inability to form continuous trajectories and significant actual errors. Furthermore, the trajectory generation model in this solution first filters multiple candidate road segment phrases when generating new road segments corresponding to each new trajectory point. Then, by extracting features from each road segment, it performs further segment filtering and prediction. This ensures road coherence while effectively guaranteeing the rationality and practicality of the generated road aggregation, significantly improving the accuracy of road trajectory generation. Attached Figure Description

[0057] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0058] Figure 1 This is a flowchart illustrating a road trajectory generation method in one embodiment;

[0059] Figure 2 This is a flowchart illustrating an example of road trajectory generation in one embodiment;

[0060] Figure 3 This is a structural block diagram of a road trajectory generation device in one embodiment;

[0061] Figure 4 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0062] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0063] The road trajectory generation method provided in this application can be applied to a road trajectory generation system. This system can be applied to a terminal, which can be, but is not limited to, various personal computers, laptops, mid-range computers, etc. The terminal uses a road network map of the target area as a basis, and iteratively predicts the road segment set of each new trajectory point according to the user's travel sequence. Then, the terminal sorts the road segment sets of each new trajectory point according to temporal sequence and trajectory connectivity to obtain the user's road trajectory information. This ensures the continuity and coherence of the sorted road trajectory information, avoiding the problems of traditional iterative road segment generation, such as the inability to form continuous trajectories and large actual errors. Furthermore, the trajectory generation model involved in this solution, when generating new road segments corresponding to each new trajectory point, first filters multiple candidate road segment phrases, then extracts the features of each road segment, and then performs road segment filtering and prediction. This ensures road coherence while effectively ensuring the rationality and practicality of the generated road aggregation, effectively improving the accuracy of road trajectory generation.

[0064] In one exemplary embodiment, such as Figure 1 As shown, a road trajectory generation method is provided. Taking the application of this method to a terminal as an example, the method includes the following steps S101 to S103. Wherein:

[0065] Step S101: Obtain the user's starting information, the user's target information, and the road network map of the target area, and generate a set of road segments for new trajectory points based on the starting information and the road network map.

[0066] In this embodiment, in response to the user's information input operation, the terminal obtains the road segment where the user's starting trajectory point is located, the starting timestamp, and the relative position ratio of the starting trajectory point within that road segment, thus obtaining starting information. Then, the terminal obtains the road segment where the user's destination is located, as target information. Next, the terminal obtains a road network map of the area containing the user's starting trajectory point (i.e., the starting road segment) and the destination road segment, as the target area's road network map, where the road network map is a road distribution map of the road network structure within the target area. Then, based on the starting information and according to the road network map, the terminal generates a road segment set for new trajectory points. This road segment set includes all adjacent road segments that are adjacent to and connected to the road segment where the starting trajectory point is located, and each adjacent road segment travels in the same direction as the road segment where the starting trajectory point is located, i.e., road segments with a directed connectivity relationship to the road segment where the starting trajectory point is located. The specific generation process will be described in detail later.

[0067] Step S102: Based on the road segment set and target information, generate a candidate feature set of the road segment set, and based on the candidate feature set, predict the target road segment information of the new trajectory point through the trajectory generation model.

[0068] In this embodiment, the terminal generates a candidate feature set for the road segment set based on the road segment set and target information. Based on this candidate feature set, it then predicts the target road segment information for the new trajectory point using a trajectory generation model. The candidate feature set is a collection of road segment features from all adjacent road segments connected to and adjacent to the road segment where the starting trajectory point is located. The trajectory generation model includes a road network encoder, a trajectory encoder, a navigator, and a time prediction unit. The road network encoder generates the candidate feature set for the road segment set, while the trajectory encoder, navigator, and time prediction unit predict the target road segment information for the new trajectory point. The specific prediction process will be described in detail later.

[0069] Step S103: Replace the starting information with the target road segment information, return to execute the generation of a new trajectory point road segment set based on the starting information and the road network map, until the target road segment information coincides with the target information, sort the target road segment information of each new trajectory point generated in each iteration to obtain the user's road trajectory information.

[0070] In this embodiment, the terminal replaces the starting information with the target road segment information and returns to execute the generation of a new set of road segments for trajectory points based on the starting information and the road network map. This process continues until the target road segment information overlaps with the target information. Then, the target road segment information of each new trajectory point generated in each iteration is sorted to obtain the user's road trajectory information. During sorting, the terminal adds the target road segment information of each trajectory point to the user's trajectory information, resulting in the user's road trajectory information. Each target road segment information is represented as a triple, and the formula for calculating this triple is:

[0071]

[0072] in, This indicates the road segment to which the point belongs. This indicates the relative position and proportion of the point on that road segment. This represents the timestamp corresponding to that point.

[0073] Based on the above scheme, using the road network map of the target area as a foundation, the system iteratively predicts the road segment set of each new trajectory point of the user according to the user's travel sequence. Then, the terminal sorts the road segment set of each new trajectory point according to the temporal sequence and trajectory connection relationship to obtain the user's road trajectory information. This ensures the continuity and coherence of the sorted road trajectory information, avoiding the problems of traditional iterative road segment generation, such as the inability to form continuous trajectories and large actual errors. Moreover, the trajectory generation model involved in this scheme first filters multiple candidate road segment sentences when generating new road segments corresponding to each new trajectory point. Then, by extracting the features of each road segment, it performs road segment filtering and prediction. While ensuring road coherence, it effectively ensures the rationality and practicality of the generated road set, effectively improving the accuracy of road trajectory generation.

[0074] Optionally, based on the starting information and according to the road network map, a set of road segments for new trajectory points is generated, including: identifying the user's starting road segment, the user's starting point location information, and the user's starting timestamp based on the starting information; in the road network map, filtering each adjacent road segment adjacent to the starting road segment, and based on the starting point location information and the starting timestamp, filtering each candidate adjacent road segment suitable for the user's passage through each adjacent road segment using a road segment fitting strategy; generating new trajectory points for the user in each candidate adjacent road segment, and using the candidate adjacent road segments corresponding to each new trajectory point as a set of road segments.

[0075] In this embodiment, the terminal identifies the user's starting road segment, the user's starting point location information, and the user's starting timestamp based on the starting information. Then, in the road network map, the terminal filters each adjacent road segment adjacent to the starting road segment, and based on the starting point location information and the starting timestamp, uses a road segment fitting strategy to filter each candidate adjacent road segment suitable for the user's passage. Specifically, the road segment fitting strategy adopts a sequential autoregressive generation method, filtering road segments in the road network map that have a mailbox connectivity relationship with the starting road segment as candidate adjacent road segments.

[0076] Next, the terminal generates new trajectory points for the user in each candidate adjacent road segment, and sets the candidate adjacent road segments corresponding to each new trajectory point as a road segment set. The new trajectory points are generated as follows: for any road segment S, the terminal assumes its geometry is represented by a sequence of broken line points: Its total length is denoted as The terminal defaults to a scalar r with a value range of [0,1], representing the normalized position of the point along the arc length of the road segment. The corresponding new trajectory point is obtained through road polyline interpolation:

[0077]

[0078] Here, `Interp` represents a function that interpolates along the road polyline by arc length. Since the coordinates are determined by both road geometry and positional scale, it ensures that the generated GPS points are strictly located on the road segment, avoiding the problem of new trajectory points deviating from the road. This method yields new trajectory points in each candidate critical road segment. The location information of these new trajectory points also includes their relative positional scale information. This relative positional scale information characterizes the distance and positional relationship between the new trajectory point and the road segment, preventing the generated trajectory points from being outside the road segment, thus avoiding trajectory point deviations and abnormal positions.

[0079] Based on the above scheme, by filtering multiple adjacent road segments, the route information between each generated road segment and the starting trajectory point is ensured to be consistent. Secondly, this scheme can also generate new trajectory points for different candidate adjacent road segments, thus predicting the trajectory points of adjacent road segments and improving the accuracy of trajectory point generation.

[0080] Optionally, based on the road segment set and target information, a candidate feature set for the road segment set is generated, including: identifying the user's target road segment based on the target information, and identifying the geometric relationship information between each candidate adjacent road segment and the target road segment; for each candidate adjacent road segment, performing road network coding processing on the candidate adjacent road segment based on the geometric relationship information corresponding to the candidate adjacent road segment to obtain the road segment features of the candidate adjacent road segment; dividing the target area into functional areas and identifying the functional area to which each candidate adjacent road segment belongs; constructing the sub-region features corresponding to each functional area based on the sub-road network map of each functional area in the road network map, and using the road segment features of each candidate adjacent road segment and the sub-region features of the functional area to which each candidate adjacent road segment belongs as the candidate feature set for the road segment set.

[0081] In this embodiment, the terminal identifies the user's target road segment based on the target information, and identifies the geometric relationship information between each candidate adjacent road segment and the target road segment. This geometric relationship information is used to characterize the spatial geometric relationship between the candidate adjacent road segments and the target road segment, such as the distance, direction, and angle. For example, it includes information such as the distance difference, direction deviation, and angle difference between the candidate road segments and the target road segment.

[0082] For each candidate adjacent road segment, the terminal performs road network encoding processing on the candidate adjacent road segment based on the corresponding geometric relationship information to obtain the road segment features. Specifically, the above road network encoding processing method can be implemented through the road network encoder in the trajectory generation model constructed in this scheme. The terminal abstracts each road segment in the road network as a node, and the adjacency relationship and intersection connection relationship between road segments as edges. The terminal uses a graph attention network to aggregate the information of each node and its neighborhood to extract road connectivity, navigation directionality, local topological relationships and related semantic information, forming a road-level embedding representation (i.e., road features). In this way, the road feature technology can comprehensively characterize the role of the candidate adjacent road segment in the local structure of the entire road network.

[0083] The terminal divides the target area into functional zones and identifies the functional zone to which each candidate adjacent road segment belongs. Then, based on the sub-road network maps of each functional zone in the road network map, the terminal constructs sub-region features corresponding to each functional zone. First, the terminal uses a multi-layer graph partitioning algorithm to divide the target area's road network map into multiple functional zones. These functional zones represent areas with different road functions, such as highway areas, national highway areas, and provincial highway areas. Then, in response to the information upload operation by staff, the terminal obtains historical traffic flow data for each functional zone and performs feature matrix processing on the historical traffic flow data to obtain a regional-level adjacency relation matrix. Next, the terminal uses a graph convolutional network to extract the functional features of the different functional zones and concatenates the regional and adjacency relation matrices with the functional features of each functional zone to obtain a regional-level embedding representation (regional features). This regional-level representation helps the model understand the connections between non-adjacent but functionally related areas in the city, such as the macro-level traffic correspondence between high-activity areas and commuting destination areas.

[0084] Finally, the terminal uses the segment features of each candidate adjacent road segment and the sub-region features of the functional area to which each candidate adjacent road segment belongs as the candidate feature set of the road segment set.

[0085] Based on the above scheme, by extracting the road features and regional features of each candidate adjacent road, the resulting road segment features have both local path decision-making capabilities and global destination guidance capabilities, thereby improving the comprehensiveness of the practical feature analysis of candidate adjacent roads.

[0086] Optionally, based on the candidate feature set, a trajectory generation model is used to predict the target road segment information of the new trajectory point, including: for each candidate adjacent road segment, performing feature fusion encoding on the road segment features of the candidate adjacent road segment and the sub-region features of the functional area to which the candidate adjacent road segment belongs, to obtain the feature encoding information of the candidate adjacent road segment; based on the new trajectory point corresponding to the candidate adjacent road segment, generating the location encoding information corresponding to the candidate adjacent road segment through a relative location encoding strategy; based on the feature encoding information and location encoding information of each candidate adjacent road segment, using the trajectory generation model, predicting the target road segment suitable for the user and the arrival timestamp of the target road segment; and using the target road segment, the location information of the new trajectory point corresponding to the target road segment, and the arrival timestamp of the target road segment as the target road segment information of the new trajectory point.

[0087] In this embodiment, for each candidate adjacent road segment, the terminal performs feature fusion encoding processing on the road segment features of the candidate adjacent road segment and the sub-region features of the functional area to which the candidate adjacent road segment belongs, to obtain the feature encoding information of the candidate adjacent road segment. Specifically, this feature fusion encoding processing first performs feature fusion through a gated fusion unit to obtain a feature sequence of each candidate adjacent road segment arranged in chronological order. Then, the terminal inputs the fused feature sequence into a Transformer with a decoder-only structure for sequence modeling to obtain the feature encoding information of the candidate adjacent road segment.

[0088] Then, based on the new trajectory points corresponding to the candidate adjacent road segments, the terminal generates location coding information corresponding to the candidate adjacent road segments using a relative location coding strategy. This relative location coding strategy employs Fourier coding to encode the location information of each new trajectory point. Specifically, the terminal identifies the relative location ratio information of the starting trajectory point, the starting timestamp of the starting trajectory point, and the relative location ratio information of the new trajectory point. By using the Fourier coding strategy, the terminal obtains the location coding information corresponding to each candidate adjacent road segment, thus representing the spatial progression relationship and temporal evolution relationship from the starting road segment to each candidate adjacent road segment. Specifically, the coding process is as follows:

[0089] In order for the system to distinguish different locations within the same road segment, this technical solution will use location proportions. A trajectory encoding process is introduced. For the i-th point in the trajectory (i.e., the new trajectory point), the terminal embeds its road-level information. Combined with the positional proportions, an enhanced representation (i.e., relative positional proportion information) is formed:

[0090]

[0091] Then, this enhanced representation is shared with the region-level embedded gating fusion unit as a common input:

[0092]

[0093]

[0094] Through the above processing, the system can not only identify "which road it is currently on", but also "what position it is currently in on that road segment", thereby improving its ability to express fine-grained spatial states.

[0095] Next, based on the feature encoding information and location encoding information of each candidate adjacent road segment, the terminal uses a trajectory generation model to predict the target road segment suitable for the user and its arrival timestamp. The specific prediction process will be explained in detail later. In this step, the terminal, along with the navigator and time prediction unit of the trajectory generation model, predicts the target road segment suitable for the user's next step and its arrival timestamp. Finally, the terminal uses the target road segment, the location information of the corresponding new trajectory point, and the arrival timestamp of the target road segment as the target road segment information for the new trajectory point.

[0096] Based on the above scheme, when performing feature fusion, this scheme simultaneously encodes the relative positional relationship between the new trajectory point and the starting trajectory point, thereby not only improving the comprehensiveness of feature recognition of each road network, but also improving the accuracy of recognizing the spatial progression relationship and temporal evolution relationship of the starting road segment to each candidate adjacent road segment.

[0097] Optionally, based on the feature encoding information and location encoding information of each candidate adjacent road segment, a trajectory generation model is used to predict the target road segment suitable for the user and the arrival timestamp of the target road segment. This includes: based on the feature encoding information and location encoding information of each candidate adjacent road segment, the navigator of the trajectory generation model predicts the transition probability of each candidate adjacent road segment; selecting the candidate adjacent road segment with the highest transition probability as the target road segment; and generating the arrival timestamp of the target road segment based on the feature encoding information and the start timestamp of the target road segment through the time prediction unit of the trajectory generation model.

[0098] In this embodiment, the terminal predicts the transition probability of each candidate adjacent road segment based on the feature encoding information and location encoding information of each candidate adjacent road segment through the navigator of the trajectory generation model. Specifically, the navigator is used to predict the next state based on the current partial trajectory and the target destination information. For each reachable candidate road segment in the current trajectory state, the navigation generation module integrates the semantic representation of the current partial trajectory, the embedding representation of the region where the target destination is located, and the geometric features between the candidate road segment and the target location, and obtains the transition probability of the candidate road segment through an additive attention mechanism. In this way, the path generated by the system not only satisfies local connectivity, but also always moves towards the target direction, reflecting the destination orientation characteristics in real human travel. In the next inference process, in addition to outputting a road selection score for each candidate road segment, the terminal also uses a lightweight multilayer perceptron to predict the position ratio corresponding to the next point for each candidate road segment (i.e., the relative position ratio relationship of each new trajectory point). Its form is:

[0099]

[0100] in, The query representation is formed by combining the current trajectory context and the target embedding. Let be the transition score (i.e., transition probability) of candidate road segment c. This design makes the location proportion prediction depend on trajectory history, target intent, and local candidate transition preferences simultaneously, thereby ensuring that the generated point's location on the path is more consistent and reasonable.

[0101] Then, the terminal selects candidate adjacent road segments with the highest transition probability as target road segments. Based on the feature encoding information of the target road segments and the start timestamp, it generates the arrival timestamp of the target road segments through the time prediction unit of the trajectory generation model. Specifically, the terminal uses a multilayer perceptron to fuse the current trajectory semantics with the relevant features of the candidate road segments and outputs the next time increment. .

[0102] Based on the above scheme, the navigator constructed using this scheme filters candidate adjacent road segments with the highest transfer probability, thereby improving the accuracy of target road segment selection.

[0103] Optionally, the target road segment information of each new trajectory point generated in each iteration is sorted to obtain the user's road trajectory information, including: sorting the target road segments corresponding to each new trajectory point according to the time order of each arrival timestamp to obtain a road trajectory sequence; marking the location information of the new trajectory point corresponding to each target road segment and the arrival timestamp of each target road segment in the road trajectory sequence to obtain the user's road trajectory information.

[0104] In this embodiment, the terminal sorts the target road segments corresponding to each new trajectory point according to the time order of their arrival timestamps to obtain a road trajectory sequence. Then, the terminal marks the location information of the new trajectory point corresponding to each target road segment and the arrival timestamp of each target road segment in the road trajectory sequence to obtain the user's road trajectory information. Specifically, during the marking process, the terminal first constructs a triplet from the arrival timestamp of each new trajectory point, the relative position ratio of the new trajectory point, and the location information of the new trajectory point. Then, the terminal fills the triplet of each new trajectory point into the target road segment corresponding to each new trajectory point through trajectory interpolation to obtain the user's road trajectory information.

[0105] Based on the above scheme, after sorting the road segments, the triplet information of the trajectory points is added to form a trajectory point sequence, so that the output trajectory information of the user can have a better effect in maintaining the trajectory spatial scale and structural features.

[0106] This application also provides an example of road trajectory generation, such as Figure 2 As shown, the specific processing procedure includes the following steps:

[0107] Step S201: Obtain the user's initial information, the user's target information, and the road network map of the target area.

[0108] Step S202: Based on the starting information, identify the user's starting road segment, the user's starting point location information, and the user's starting timestamp.

[0109] Step S203: In the road network map, filter each adjacent road segment that is adjacent to the starting road segment, and based on the starting point location information and the starting timestamp, filter each candidate adjacent road segment that is suitable for the user to travel through each adjacent road segment through the road segment fitting strategy.

[0110] Step S204: In each candidate adjacent road segment, generate a new trajectory point for the user in each candidate adjacent road segment, and take the candidate adjacent road segments corresponding to each new trajectory point as a road segment set.

[0111] Step S205: Based on the target information, identify the user's target road segment and identify the geometric relationship information between each candidate adjacent road segment and the target road segment.

[0112] Step S206: For each candidate adjacent road segment, based on the geometric relationship information corresponding to the candidate adjacent road segment, perform road network coding processing on the candidate adjacent road segment to obtain the road segment features of the candidate adjacent road segment.

[0113] Step S207: Divide the target area into functional areas and identify the functional area to which each candidate adjacent road segment belongs.

[0114] Step S208: Based on the sub-road network map of each functional area in the road network map, construct the sub-region features corresponding to each functional area, and take the road segment features of each candidate adjacent road segment and the sub-region features of the functional area to which each candidate adjacent road segment belongs as the candidate feature set of the road segment set.

[0115] Step S209: For each candidate adjacent road segment, the road segment features of the candidate adjacent road segment and the sub-region features of the functional area to which the candidate adjacent road segment belongs are subjected to feature fusion encoding processing to obtain the feature encoding information of the candidate adjacent road segment.

[0116] Step S210: Based on the new trajectory points corresponding to the candidate adjacent road segments, generate the location coding information corresponding to the candidate adjacent road segments through a relative location coding strategy.

[0117] Step S211: Based on the feature encoding information and location encoding information of each candidate adjacent road segment, the navigator of the trajectory generation model predicts the transition probability of each candidate adjacent road segment.

[0118] Step S212: Select the candidate adjacent road segments corresponding to the maximum transition probability as the target road segments, and generate the arrival timestamp of the target road segments based on the feature encoding information of the target road segments and the start timestamp through the time prediction unit of the trajectory generation model.

[0119] Step S213: Use the target road segment, the location information of the new trajectory point corresponding to the target road segment, and the arrival timestamp of the target road segment as the target road segment information of the new trajectory point.

[0120] Step S214: Replace the starting information with the target road segment information, and return to execute the process of generating a new set of trajectory points based on the starting information and the road network map, until the target road segment information and the target information coincide.

[0121] Step S215: Sort the target road segments corresponding to each new trajectory point according to the time order of each arrival timestamp to obtain the road trajectory sequence.

[0122] Step S216: Mark the location information of the new trajectory point corresponding to each target road segment and the arrival timestamp of each target road segment in the road trajectory sequence to obtain the user's road trajectory information.

[0123] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0124] Based on the same inventive concept, this application also provides a road trajectory generation apparatus for implementing the road trajectory generation method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more road trajectory generation apparatus embodiments provided below can be found in the limitations of the road trajectory generation method described above, and will not be repeated here.

[0125] In one exemplary embodiment, such as Figure 3 As shown, a road trajectory generation device is provided, including: an acquisition module 310, a prediction module 320, and an iteration module 330, wherein:

[0126] The acquisition module 310 is used to acquire the user's starting information, the user's target information, and the road network map of the target area, and generate a set of road segments for new trajectory points based on the starting information and the road network map.

[0127] The prediction module 320 is used to generate a candidate feature set of the road segment set based on the road segment set and the target information, and to predict the target road segment information of the new trajectory point based on the candidate feature set through a trajectory generation model.

[0128] The iteration module 330 replaces the starting information with the target road segment information and returns to execute the generation of a new trajectory point road segment set based on the starting information and the road network map, until the target road segment information coincides with the target information. Then, the target road segment information of each new trajectory point generated in each iteration is sorted to obtain the user's road trajectory information.

[0129] Optionally, the acquisition module 310 is specifically used for:

[0130] Based on the starting information, the user's starting road segment, the user's starting point location information, and the user's starting timestamp are identified;

[0131] In the road network map, each adjacent road segment is filtered to be adjacent to the starting road segment, and based on the starting point location information and the starting timestamp, a road segment fitting strategy is used to filter each candidate adjacent road segment suitable for user passage.

[0132] In each of the candidate adjacent road segments, a new trajectory point of the user in each candidate adjacent road segment is generated, and the candidate adjacent road segments corresponding to each new trajectory point are used as a road segment set.

[0133] Optionally, the prediction module 320 is specifically used for:

[0134] Based on the target information, the user's target road segment is identified, and the geometric relationship information between each candidate adjacent road segment and the target road segment is identified;

[0135] For each candidate adjacent road segment, based on the geometric relationship information corresponding to the candidate adjacent road segment, road network coding processing is performed on the candidate adjacent road segment to obtain the road segment features of the candidate adjacent road segment;

[0136] The target area is divided into functional areas, and the functional area to which each candidate adjacent road segment belongs is identified;

[0137] Based on the sub-road network map of each functional area in the road network map, sub-region features corresponding to each functional area are constructed respectively, and the road segment features of each candidate adjacent road segment and the sub-region features of the functional area to which each candidate adjacent road segment belongs are used as the candidate feature set of the road segment set.

[0138] Optionally, the prediction module 330 is specifically used for:

[0139] For each candidate adjacent road segment, the road segment features of the candidate adjacent road segment and the sub-region features of the functional area to which the candidate adjacent road segment belongs are subjected to feature fusion encoding processing to obtain the feature encoding information of the candidate adjacent road segment;

[0140] Based on the new trajectory points corresponding to the candidate adjacent road segments, the location coding information corresponding to the candidate adjacent road segments is generated through a relative position coding strategy;

[0141] Based on the feature encoding information of each candidate adjacent road segment and the location encoding information of each candidate adjacent road segment, a trajectory generation model is used to predict the target road segment suitable for the user and the arrival timestamp of the target road segment.

[0142] The target road segment, the location information of the new trajectory point corresponding to the target road segment, and the arrival timestamp of the target road segment are used as the target road segment information of the new trajectory point.

[0143] Optionally, the prediction module 320 is specifically used for:

[0144] Based on the feature encoding information of each candidate adjacent road segment and the location encoding information of each candidate adjacent road segment, the navigator of the trajectory generation model predicts the transition probability of each candidate adjacent road segment.

[0145] Candidate adjacent road segments with the highest transition probability are selected as target road segments. Based on the feature encoding information of the target road segments and the start timestamp, the arrival timestamp of the target road segments is generated by the time prediction unit of the trajectory generation model.

[0146] Optionally, the iteration module 330 is specifically used for:

[0147] According to the time order of each arrival timestamp, the target road segments corresponding to each new trajectory point are sorted to obtain the road trajectory sequence;

[0148] The location information of the new trajectory point corresponding to each target road segment and the arrival timestamp of each target road segment are marked in the road trajectory sequence to obtain the user's road trajectory information.

[0149] Each module in the aforementioned road trajectory generation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0150] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 4As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a road trajectory generation method. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0151] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0152] In one exemplary embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of a road trajectory generation method.

[0153] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of a road trajectory generation method.

[0154] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of a road trajectory generation method.

[0155] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0156] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0157] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0158] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for generating road trajectories, characterized in that, The method includes: Obtain the user's initial information, the user's target information, and the road network map of the target area, and generate a set of road segments for new trajectory points based on the initial information and the road network map; Based on the road segment set and the target information, a candidate feature set for the road segment set is generated, and based on the candidate feature set, the target road segment information of the new trajectory point is predicted through a trajectory generation model. Replace the starting information with the target road segment information, and return to execute the process of generating a new set of road segments for trajectory points based on the starting information and the road network map, until the target road segment information coincides with the target information. Then sort the target road segment information of each new trajectory point generated in each iteration to obtain the user's road trajectory information.

2. The method according to claim 1, characterized in that, The step of generating a set of road segments for new trajectory points based on the initial information and according to the road network map includes: Based on the starting information, the user's starting road segment, the user's starting point location information, and the user's starting timestamp are identified; In the road network map, each adjacent road segment is filtered to be adjacent to the starting road segment, and based on the starting point location information and the starting timestamp, a road segment fitting strategy is used to filter each candidate adjacent road segment suitable for user passage. In each of the candidate adjacent road segments, a new trajectory point of the user in each candidate adjacent road segment is generated, and the candidate adjacent road segments corresponding to each new trajectory point are used as a road segment set.

3. The method according to claim 2, characterized in that, The step of generating a candidate feature set for the road segment set based on the road segment set and the target information includes: Based on the target information, the user's target road segment is identified, and the geometric relationship information between each candidate adjacent road segment and the target road segment is identified; For each candidate adjacent road segment, based on the geometric relationship information corresponding to the candidate adjacent road segment, road network coding processing is performed on the candidate adjacent road segment to obtain the road segment features of the candidate adjacent road segment; The target area is divided into functional areas, and the functional area to which each candidate adjacent road segment belongs is identified; Based on the sub-road network map of each functional area in the road network map, sub-region features corresponding to each functional area are constructed respectively, and the road segment features of each candidate adjacent road segment and the sub-region features of the functional area to which each candidate adjacent road segment belongs are used as the candidate feature set of the road segment set.

4. The method according to claim 3, characterized in that, The step of predicting the target road segment information of the new trajectory point based on the candidate feature set and through a trajectory generation model includes: For each candidate adjacent road segment, the road segment features of the candidate adjacent road segment and the sub-region features of the functional area to which the candidate adjacent road segment belongs are subjected to feature fusion encoding processing to obtain the feature encoding information of the candidate adjacent road segment; Based on the new trajectory points corresponding to the candidate adjacent road segments, the location coding information corresponding to the candidate adjacent road segments is generated through a relative position coding strategy; Based on the feature encoding information of each candidate adjacent road segment and the location encoding information of each candidate adjacent road segment, a trajectory generation model is used to predict the target road segment suitable for the user and the arrival timestamp of the target road segment. The target road segment, the location information of the new trajectory point corresponding to the target road segment, and the arrival timestamp of the target road segment are used as the target road segment information of the new trajectory point.

5. The method according to claim 4, characterized in that, The step of predicting a target road segment suitable for the user and the arrival timestamp of the target road segment using a trajectory generation model, based on the feature encoding information and location encoding information of each candidate adjacent road segment, includes: Based on the feature encoding information of each candidate adjacent road segment and the location encoding information of each candidate adjacent road segment, the navigator of the trajectory generation model predicts the transition probability of each candidate adjacent road segment. Candidate adjacent road segments with the highest transition probability are selected as target road segments. Based on the feature encoding information of the target road segments and the start timestamp, the arrival timestamp of the target road segments is generated by the time prediction unit of the trajectory generation model.

6. The method according to claim 4, characterized in that, The process of sorting the target road segment information of each new trajectory point generated in each iteration to obtain the user's road trajectory information includes: According to the time order of each arrival timestamp, the target road segments corresponding to each new trajectory point are sorted to obtain the road trajectory sequence; The location information of the new trajectory point corresponding to each target road segment and the arrival timestamp of each target road segment are marked in the road trajectory sequence to obtain the user's road trajectory information.

7. A road trajectory generation device, characterized in that, The device includes: The acquisition module is used to acquire the user's starting information, the user's target information, and the road network map of the target area, and generate a set of road segments for new trajectory points based on the starting information and the road network map. The prediction module is used to generate a candidate feature set for the road segment set based on the road segment set and the target information, and to predict the target road segment information of the new trajectory point based on the candidate feature set through a trajectory generation model. The iteration module replaces the starting information with the target road segment information and returns to execute the generation of a new set of road segments for trajectory points based on the starting information and the road network map. This process continues until the target road segment information coincides with the target information. Then, the target road segment information of each new trajectory point generated in each iteration is sorted to obtain the user's road trajectory information.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.