Trajectory recovery method and device based on latent space condition constraint generation model, equipment, medium and product

By using a latent space conditional constraint-based generative model and leveraging a Transformer encoder and contrastive learning mechanism, this method addresses the problem of existing trajectory recovery methods' inability to simultaneously utilize multiple spatiotemporal information, thereby improving the accuracy of trajectory recovery results.

CN120951281BActive Publication Date: 2025-12-12NAVAL AVIATION UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511483608.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-17
Publication Date
2025-12-12
Estimated Expiration
2045-10-17

AI Technical Summary

Technical Problem

Existing trajectory recovery methods struggle to simultaneously utilize multiple additional spatiotemporal constraints to capture rich spatiotemporal dependencies, resulting in inaccurate trajectory recovery results.

Method used

A latent space-based conditional constraint generative model is adopted, which is encoded by a Transformer encoder, a graph neural network (GNN), a long short-term memory artificial neural network (LSTM), and a convolutional neural network (CNN). Combined with a contrastive learning mechanism, the trajectory latent vector and the conditional latent vector are jointly optimized in a unified latent space. The loss function is designed using dynamic time warp distance to achieve a unified representation of multiple conditional constraints.

Benefits of technology

It improves the accuracy of trajectory recovery, making the trajectory recovery results more accurately reflect the original motion of the real trajectory data. Multiple conditions can be superimposed to constrain trajectory recovery and improve accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120951281B_ABST
    Figure CN120951281B_ABST
Patent Text Reader

Abstract

The application discloses a trajectory recovery method and device based on a latent space condition constraint generation model, equipment, medium and products, relates to the trajectory data mining field, and comprises the following steps: obtaining original trajectory data and corresponding various spatio-temporal condition constraint data and preprocessing; a first network model is constructed; the trajectory sequence tensor and the constraint data after preprocessing are encoded to obtain a trajectory latent vector and a corresponding condition latent vector set; based on a contrast learning mechanism, the aligned trajectory latent vector and each condition latent vector are output; a second network model is constructed; the aligned trajectory latent vector and each condition latent vector are matched through the trained generation model to obtain a matching vector and obtain the final trajectory recovery result based on a decoder. The application can effectively fuse multi-source spatio-temporal constraint information, and significantly improve the recovery accuracy and rationality of sparse or discontinuous trajectories.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of trajectory data mining, and in particular to a trajectory recovery method, apparatus, equipment, medium and product based on a latent space condition constraint generation model. Background Technology

[0002] Trajectory recovery refers to the reconstruction of discontinuous or sparse trajectories of objects in space to obtain more continuous and accurate trajectories that smoothly and accurately reflect the object's motion. Trajectory recovery plays a crucial role in trajectory applications such as vehicle navigation, route estimation, and traffic planning. However, in reality, due to the low sampling frequency and accuracy of trajectory acquisition equipment, trajectory recovery faces the challenge of capturing spatiotemporal dependencies. Therefore, how to utilize spatiotemporal dependencies in trajectory recovery to improve its accuracy has become a current research hotspot. Based on the presence or absence of additional spatiotemporal dependencies, trajectory recovery is divided into free-space trajectory recovery and trajectory recovery utilizing additional spatiotemporal information.

[0003] Trajectory recovery in free space, without utilizing additional information annotation, treats the trajectory as a discrete sequence of trajectory points with timestamps and spatial locations. It emphasizes leveraging the original spatiotemporal attributes of the trajectory points to extract or learn the spatiotemporal sequence features of the trajectory, recovering the trajectory within a spatially unconstrained environment. This category includes early interpolation algorithms, statistical learning-based algorithms, and more recent sequence-based and graph-based deep learning methods. However, these methods are limited by their inability to effectively utilize spatiotemporal dependencies, increasing the inaccuracy of trajectory recovery results when applied to discontinuous or sparse trajectories.

[0004] Trajectory recovery using additional spatiotemporal information: By using additional spatiotemporal information, such as introducing road networks, the trajectory recovery results are converged from free space to specific road segments in the road network structure; by introducing point of interest (POI) annotations, the trajectory recovery results are given semantic information constraints; by introducing weather and traffic conditions, the trajectory recovery results are given dynamic environmental constraints.

[0005] These methods introduce additional spatiotemporal information beyond the timestamps and spatial locations of trajectory points as constraints, subjecting the trajectory recovery results to specific spatiotemporal dependencies and improving the accuracy of trajectory recovery. However, current trajectory recovery methods suffer from the difficulty of utilizing multiple additional spatiotemporal information to capture rich spatiotemporal dependencies. Since various constraints (such as road networks, points of interest, weather, traffic conditions, etc.) and the trajectory reside in different representation spaces, it is difficult to simultaneously utilize multiple additional spatiotemporal information in trajectory recovery.

[0006] Based on this, this application proposes a novel trajectory recovery method. It employs a generative model based on latent space conditional constraints, matching the encoder's output vector with the conditional embedding vector of the original trajectory, thus constraining the encoder's output vector in the latent space. Simultaneously, a constraint representation method based on contrastive learning is used to achieve a unified representation of trajectory data and various constraints. A dynamic time-warped distance loss function is used in the loss function to more accurately reflect the original motion of the real trajectory data. This method effectively implements multiple conditional constraints in trajectory recovery. Summary of the Invention

[0007] The purpose of this application is to provide a trajectory recovery method, apparatus, device, medium and product based on a latent space condition constraint generation model, which solves the problem that existing models cannot simultaneously utilize multiple additional spatiotemporal information to capture rich spatiotemporal dependencies, and enables multiple conditions to superimpose to constrain trajectory recovery to improve accuracy.

[0008] To achieve the above objectives, this application provides the following solution:

[0009] Firstly, this application provides a trajectory recovery method based on a latent space conditional constraint generation model, including:

[0010] Acquire the original trajectory data and various spatiotemporal constraint data of the original trajectory data;

[0011] The original trajectory data is preprocessed to obtain a preprocessed trajectory sequence tensor;

[0012] The original trajectory data is subjected to various spatiotemporal constraints and structured processing to construct a set of conditional features, including road network adjacency matrix and node features, Gaussian kernel density distribution features of interest points, and numerical encoding of environmental information.

[0013] Construct a first network model; the first network model includes: a trained Transformer encoder, a trained graph neural network (GNN), a trained long short-term memory artificial neural network (LSTM), and a trained convolutional neural network (CNN);

[0014] The preprocessed trajectory sequence tensor is encoded using a trained Transformer encoder to obtain the trajectory latent vector;

[0015] For each type of spatiotemporal conditional constraint data after structured processing, the trained graph neural network (GNN), the trained long short-term memory artificial neural network (LSTM), and the trained convolutional neural network (CNN) are used for independent encoding to obtain the corresponding set of conditional latent vectors.

[0016] Based on the contrastive learning mechanism, the trajectory latent vector and each conditional latent vector in the set of conditional latent vectors are jointly optimized in the unified latent space, so that the trajectory latent vector and each conditional latent vector achieve semantic alignment in the unified representation space, and the aligned trajectory latent vector and each conditional latent vector are output.

[0017] Construct a second network model; the second network model includes: the first network model and the trained generative model;

[0018] The aligned trajectory latent vectors are matched with each conditional latent vector using a trained generative model to obtain the matching vectors.

[0019] The matching vector is input into the decoder to generate a continuous spatiotemporal trajectory point sequence point by point, and the output result is mapped back to the original geographic coordinate system to obtain the final trajectory recovery result.

[0020] Optionally, the original trajectory data is preprocessed to obtain a preprocessed trajectory sequence tensor, specifically including:

[0021] Project the spatial coordinates in the original trajectory data onto a unified coordinate system: , Map the timestamps in the original trajectory data to periodic features: , ,in, and Represents the coordinates of the original trajectory data in a unified coordinate system; and Represents the spatial coordinates of the original trajectory data; This represents the mean x-coordinate of all spatial locations in the original trajectory; This represents the variance of the x-coordinates of all spatial locations in the original trajectory; This represents the mean of the y-coordinates of all spatial locations in the original trajectory; This represents the variance of the y-coordinate of all spatial locations in the original trajectory; This indicates the periodicity of the timestamps in the original trajectory; Represents a timestamp; Indicates the length of the time period; The timestamp cosine periodicity characteristic in the original trajectory is represented.

[0022] Optionally, the preprocessed trajectory sequence tensor is encoded to obtain the trajectory latent vector using the following formula:

[0023] ;

[0024] in, Represents the latent vector of the trajectory; This indicates that the Transformer encoder is used to extract the spatiotemporal features of the trajectory sequence tensor X; The vector dimension is .

[0025] Optionally, the parameters of the first network model can be optimized using a first loss function;

[0026] The expression for the first loss function is as follows:

[0027] ;

[0028] in, Denotes the first loss function. The number of condition types, This represents a temporary intermediate variable used to iterate from 1 to M. For cosine similarity, For the trajectory latent vector For each conditional implicit vector, For temperature coefficient, The number of negative samples. This is the conditional latent vector in the negative samples. The index representing the negative sample is used to iterate from 1 to the number of negative samples. , Indicates the first The index label of the conditional latent vector corresponding to each negative sample.

[0029] Optionally, the adoption rate of the second network model can be optimized using a second loss function;

[0030] The expression for the second loss function is as follows:

[0031] ;

[0032] in, This represents the second loss function. The mean square error loss for the position of trajectory points. To compare learning loss, For dynamic time-warped distance, To adjust the contrastive learning loss The weighting coefficient, For adjusting dynamic time warp distance The weighting coefficients.

[0033] Optionally, the process of matching the aligned trajectory latent vector with each conditional latent vector using a trained generative model to obtain the matching vector specifically employs the following formula:

[0034] ;

[0035] in, Represents the matching vector. Represents the fusion function. This represents the latent vector of the aligned trajectory. This represents the aligned conditional implicit vectors. The number of condition types, This represents a temporary intermediate variable used to iterate from 1 to M.

[0036] Secondly, this application provides a trajectory recovery device based on a latent space condition constraint generation model, comprising:

[0037] The data acquisition module is used to acquire the original trajectory data and various spatiotemporal constraint data of the original trajectory data;

[0038] The preprocessing module is used to preprocess the original trajectory data to obtain a preprocessed trajectory sequence tensor.

[0039] The structured processing module is used to perform structured processing on the original trajectory data under various spatiotemporal constraints, and to construct a set of conditional features including road network adjacency matrix and node features, Gaussian kernel density distribution features of interest points, and numerical encoding of environmental information.

[0040] The first network model construction module is used to construct the first network model; the first network model includes: a trained Transformer encoder, a trained graph neural network (GNN), a trained long short-term memory artificial neural network (LSTM), and a trained convolutional neural network (CNN).

[0041] The first encoding module is used to encode the preprocessed trajectory sequence tensor using a trained Transformer encoder to obtain the trajectory latent vector;

[0042] The second encoding module is used to independently encode each type of spatiotemporal conditional constraint data after structured processing using a trained graph neural network (GNN), a trained long short-term memory artificial neural network (LSTM), and a trained convolutional neural network (CNN) to obtain the corresponding set of conditional latent vectors.

[0043] The unified representation module is used to jointly optimize the trajectory latent vector and each conditional latent vector in the set of conditional latent vectors in the unified latent space based on the contrastive learning mechanism, so that the trajectory latent vector and each conditional latent vector achieve semantic alignment in the unified representation space, and output the aligned trajectory latent vector and each conditional latent vector.

[0044] The second network model construction module is used to construct the second network model; the second network model includes: the first network model and the trained generative model;

[0045] The matching module is used to match the aligned trajectory latent vector with each conditional latent vector through the trained generative model to obtain the matching vector;

[0046] The decoding module is used to input the matching vector into the decoder, generate a continuous spatiotemporal trajectory point sequence point by point, and map the output result back to the original geographic coordinate system to obtain the final trajectory recovery result.

[0047] Thirdly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the trajectory recovery method based on the latent space condition constraint generation model described in any one of the above.

[0048] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the trajectory recovery method based on the latent space condition constraint generation model described above.

[0049] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the trajectory recovery method based on the latent space condition constraint generation model described above.

[0050] According to the specific embodiments provided in this application, this application has the following technical effects:

[0051] This application provides a trajectory recovery method, apparatus, device, medium, and product based on a latent space conditional constraint generative model. It utilizes a constraint representation method based on contrastive learning to achieve a unified representation of trajectory data and constraint conditions, ensuring a constraint relationship between them. A latent space conditional constraint generative model is employed, with an encoder-decoder structure. The original trajectory's output vector in the encoder is matched with the conditional embedding vector, resulting in conditional convergence of the encoder's output vector in the latent space. The final trajectory recovery result is constrained by these conditions. A dynamic time-warped distance loss function is used to more accurately reflect the original state of the real trajectory data. In summary, this application solves the problem that existing models cannot simultaneously utilize multiple additional spatiotemporal information to capture rich spatiotemporal dependencies, enabling multiple conditions to superimpose and constrain trajectory recovery to improve accuracy. Attached Figure Description

[0052] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the 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.

[0053] Figure 1 This is a flowchart illustrating a trajectory recovery method based on a latent space condition constraint generation model in one embodiment of this application.

[0054] Figure 2 A schematic diagram of the functional modules of a trajectory recovery device based on a latent space condition constraint generation model, provided for another embodiment of this application;

[0055] Figure 3 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0056] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0057] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0058] In one exemplary embodiment, such as Figure 1 As shown, a trajectory recovery method based on a latent space condition constraint generation model is provided. This method is executed by a computer device, specifically by a terminal or server alone, or by both a terminal and a server. In this embodiment, it includes the following steps:

[0059] Step 101: Obtain the original trajectory data and various spatiotemporal constraint data of the original trajectory data.

[0060] The original trajectory data is a discrete point sequence with timestamps and spatial locations. ,in The spatial coordinates of the trajectory points. For timestamps, The number of trajectory points is the total number of discrete points with timestamps and spatial locations in the original trajectory data.

[0061] The conditional constraints of the raw trajectory data include: road network data (such as road topology and road segment attributes), point of interest data (such as POI type and location), and environmental data (such as weather and traffic conditions).

[0062] Step 102: Preprocess the original trajectory data to obtain the preprocessed trajectory sequence tensor.

[0063] The preprocessing of the raw trajectory data first involves projecting its spatial coordinates onto a unified coordinate system. , Then, the timestamps are mapped to periodic features. , ;in, and Represents the coordinates of the original trajectory data in a unified coordinate system; and Represents the spatial coordinates of the original trajectory data; This represents the mean x-coordinate of all spatial locations in the original trajectory; This represents the variance of the x-coordinates of all spatial locations in the original trajectory; This represents the mean of the y-coordinates of all spatial locations in the original trajectory; This represents the variance of the y-coordinate of all spatial locations in the original trajectory; This indicates the periodicity of the timestamps in the original trajectory; Represents a timestamp; Indicates the length of the time period; The timestamp cosine periodicity characteristic in the original trajectory is represented.

[0064] Step 103: Perform structured processing on the various spatiotemporal constraints of the original trajectory data to construct a set of conditional features, including road network adjacency matrix and node features, Gaussian kernel density distribution features of interest points, and numerical encoding of environmental information.

[0065] The preprocessing of the conditional constraint data of the original trajectory data first involves constructing the road network adjacency matrix and node feature vectors from the road network data; generating the distribution features of interest points from the interest point data using Gaussian kernel density estimation; and numerating the environmental data, such as one-hot encoding of weather types and standardizing traffic speeds.

[0066] Preprocessed trajectory data sequence tensor Conditional feature set ;in, M The number of condition types, Let be the vector dimension, indicating that the vector dimension is . , N The length of the trajectory sequence. The length of the vector dimension.

[0067] Step 104: Construct the first network model; the first network model includes: a trained Transformer encoder, a trained graph neural network (GNN), a trained long short-term memory artificial neural network (LSTM), and a trained convolutional neural network (CNN).

[0068] Step 105: Encode the preprocessed trajectory sequence tensor using a trained Transformer encoder to obtain the trajectory latent vector.

[0069] For trajectory data, the Transformer Encoder is used to extract the spatiotemporal features of the trajectory, i.e., the trajectory latent vector: ,in, For the trajectory latent vector This indicates that the Transformer encoder is used to extract the spatiotemporal features of the trajectory sequence tensor X, where X represents the trajectory sequence tensor obtained after preprocessing the original trajectory data. Indicates Transformer encoder, The dimension of the vector is . .

[0070] Step 106: For each type of spatiotemporal conditional constraint data after structured processing, use the trained graph neural network (GNN), the trained long short-term memory artificial neural network (LSTM), and the trained convolutional neural network (CNN) to encode them independently to obtain the corresponding set of conditional latent vectors.

[0071] To address the constraints, an independent encoder is used for each type of conditional data (road network, points of interest, environment, etc.). For example, a graph neural network (GNN) is used to encode road network data, a long short-term memory (LSTM) artificial neural network is used for point of interest data, and a convolutional neural network (CNN) is used for environment data. The corresponding formulas are as follows: ;in, For conditional implicit vectors, This is a conditional encoder; different types of conditions correspond to different encoders. These are conditional constraints.

[0072] Step 107: Based on the contrastive learning mechanism, perform joint optimization on the trajectory latent vector and each conditional latent vector in the set of conditional latent vectors in the unified latent space, so that the trajectory latent vector and each conditional latent vector achieve semantic alignment in the unified representation space, and output the aligned trajectory latent vector and each conditional latent vector.

[0073] Specifically, to ensure that the trajectories and representations of multiple conditions reside in the same latent space, this application introduces contrastive learning. During training, the parameters of the first neural network are optimized using positive sample pairs, negative sample pairs, and a loss function. A positive sample pair refers to the same trajectory and its corresponding conditional vector; a negative sample pair refers to different trajectories and non-corresponding conditional vectors. The loss function is the InfoNCE loss, with the following formula:

[0074] ;

[0075] in, The number of condition types, This represents a temporary intermediate variable used to iterate from 1 to M. For cosine similarity, For the trajectory latent vector For each conditional implicit vector, For temperature coefficient, The number of negative samples. This is the conditional latent vector in the negative samples.

[0076] After constructing a unified representation space based on contrastive learning, we can obtain the trajectory and conditional vector in the unified representation space, i.e., the aligned latent trajectory vector. With each conditional latent vector .

[0077] Step 108: Construct a second network model; the second network model includes: the first network model and the trained generative model.

[0078] Step 109: Match the aligned trajectory latent vector with each conditional latent vector using the trained generative model to obtain the matching vector.

[0079] Specifically, the latent vector of the trajectory in the unified representation space With each conditional latent vector Through the fusion function Perform matching , where the fusion function This is a multi-head attention mechanism.

[0080] A variational autoencoder is used as the framework for the generative model to generate a trajectory representation under conditional constraints in the latent variable space z.

[0081] Step 110: Input the matching vector into the decoder to generate a continuous spatiotemporal trajectory point sequence point by point, and map the output result back to the original geographic coordinate system to obtain the final trajectory recovery result.

[0082] Decoder D receives the matched latent vector The trajectory point sequence is generated through the inverse network Transformer Decoder. The generated trajectory is represented as a continuous spatiotemporal point sequence and mapped back to the original coordinate system. and Represents the coordinates of the original trajectory data in a unified coordinate system. This represents the timestamp corresponding to the generated trajectory points in a unified coordinate system. This represents the number of trajectory points in the generated trajectory point sequence, which is the total number of discrete points with spatiotemporal information generated by the decoder.

[0083] The trajectory recovery result is aligned with the original trajectory in both time and space, and converges to a reasonable path under various constraints.

[0084] Based on the same inventive concept, this application also provides a trajectory recovery device based on an implicit space conditional constraint generation model for implementing the trajectory recovery method based on the implicit space conditional constraint generation model described above. The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations of one or more trajectory recovery device embodiments based on implicit space conditional constraint generation models provided below can be found in the limitations of the trajectory recovery method based on implicit space conditional constraint generation models described above, and will not be repeated here.

[0085] In one exemplary embodiment, such as Figure 2 As shown, a trajectory recovery device based on a latent space condition constraint generation model is provided, comprising:

[0086] Data acquisition module 201 is used to acquire raw trajectory data and various spatiotemporal constraint data of the raw trajectory data;

[0087] Preprocessing module 202 is used to preprocess the original trajectory data to obtain a preprocessed trajectory sequence tensor;

[0088] The structured processing module 203 is used to perform structured processing on the original trajectory data for various spatiotemporal constraints, and to construct a set of conditional features including road network adjacency matrix and node features, Gaussian kernel density distribution features of interest points, and numerical encoding of environmental information.

[0089] The first network model construction module 204 is used to construct a first network model; the first network model includes: a trained Transformer encoder, a trained graph neural network GNN, a trained long short-term memory artificial neural network LSTM, and a trained convolutional neural network CNN.

[0090] The first encoding module 205 is used to encode the preprocessed trajectory sequence tensor using a trained Transformer encoder to obtain the trajectory latent vector.

[0091] The second encoding module 206 is used to independently encode each type of spatiotemporal conditional constraint data after structured processing using a trained graph neural network (GNN), a trained long short-term memory artificial neural network (LSTM), and a trained convolutional neural network (CNN) to obtain the corresponding set of conditional latent vectors.

[0092] The unified representation module 207 is used to jointly optimize the trajectory latent vector and each conditional latent vector in the set of conditional latent vectors in the unified latent space based on the contrastive learning mechanism, so that the trajectory latent vector and each conditional latent vector achieve semantic alignment in the unified representation space, and output the aligned trajectory latent vector and each conditional latent vector.

[0093] The second network model construction module 208 is used to construct a second network model; the second network model includes: a first network model and a trained generative model;

[0094] The matching module 209 is used to match the aligned trajectory latent vector with each conditional latent vector through the trained generative model to obtain the matching vector;

[0095] The decoding module 210 is used to input the matching vector into the decoder, generate a continuous spatiotemporal trajectory point sequence point by point, and map the output result back to the original geographic coordinate system to obtain the final trajectory recovery result.

[0096] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 3 As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs in the non-volatile storage media to run. The database stores trajectory recovery data based on a latent space conditional constraint generative model. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a trajectory recovery method based on a latent space conditional constraint generative model.

[0097] Those skilled in the art will understand that Figure 3 The structures shown are merely block diagrams of some structures related to the present application and do 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 shown in the figures, or combine certain components, or have different component arrangements. In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0098] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0099] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0100] 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.

[0101] 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).

[0102] 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.

[0103] 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.

[0104] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A trajectory recovery method based on a latent space conditional constraint generation model, characterized in that, The trajectory recovery method based on the latent space condition constraint generation model includes: Acquire the original trajectory data and various spatiotemporal constraint data of the original trajectory data; The original trajectory data is preprocessed to obtain a preprocessed trajectory sequence tensor; The original trajectory data is subjected to various spatiotemporal constraints and structured processing to construct a set of conditional features, including road network adjacency matrix and node features, Gaussian kernel density distribution features of interest points, and numerical encoding of environmental information. Construct a first network model; the first network model includes: a trained Transformer encoder, a trained graph neural network (GNN), a trained long short-term memory artificial neural network (LSTM), and a trained convolutional neural network (CNN); The preprocessed trajectory sequence tensor is encoded using a trained Transformer encoder to obtain the trajectory latent vector; For each type of spatiotemporal conditional constraint data after structured processing, the trained graph neural network (GNN), the trained long short-term memory artificial neural network (LSTM), and the trained convolutional neural network (CNN) are used for independent encoding to obtain the corresponding set of conditional latent vectors. Based on the contrastive learning mechanism, the trajectory latent vector and each conditional latent vector in the set of conditional latent vectors are jointly optimized in the unified latent space, so that the trajectory latent vector and each conditional latent vector achieve semantic alignment in the unified representation space, and the aligned trajectory latent vector and each conditional latent vector are output. Construct a second network model; the second network model includes: the first network model and the trained generative model; The aligned trajectory latent vectors are matched with each conditional latent vector using a trained generative model to obtain the matching vectors. The matching vector is input into the decoder to generate a continuous spatiotemporal trajectory point sequence point by point, and the output result is mapped back to the original geographic coordinate system to obtain the final trajectory recovery result.

2. The trajectory recovery method based on the latent space condition constraint generation model according to claim 1, characterized in that, The original trajectory data is preprocessed to obtain a preprocessed trajectory sequence tensor, specifically including: Project the spatial coordinates in the original trajectory data onto a unified coordinate system: , ; Map the timestamps in the original trajectory data to periodic features: , ,in, and Represents the coordinates of the original trajectory data in a unified coordinate system; and Represents the spatial coordinates of the original trajectory data; This represents the mean x-coordinate of all spatial locations in the original trajectory; This represents the variance of the x-coordinates of all spatial locations in the original trajectory; This represents the mean of the y-coordinates of all spatial locations in the original trajectory; This represents the variance of the y-coordinate of all spatial locations in the original trajectory; This indicates the periodicity of the timestamps in the original trajectory; Represents a timestamp; Indicates the length of the time period; The timestamp cosine periodicity characteristic in the original trajectory is represented.

3. The trajectory recovery method based on the latent space condition constraint generation model according to claim 1, characterized in that, The preprocessed trajectory sequence tensor is encoded to obtain the trajectory latent vector using the following formula: ; in, Represents the latent vector of the trajectory; This indicates that the Transformer encoder is used to extract the spatiotemporal features of the trajectory sequence tensor X; The vector dimension is .

4. The trajectory recovery method based on the latent space condition constraint generation model according to claim 1, characterized in that, The parameters of the first network model are optimized using the first loss function; The expression for the first loss function is as follows: ; in, Denotes the first loss function. The number of condition types, This represents a temporary intermediate variable used to iterate from 1 to M. For cosine similarity, For the trajectory latent vector For each conditional implicit vector, For temperature coefficient, The number of negative samples. This is the conditional latent vector in the negative samples. The index representing the negative sample is used to iterate from 1 to the number of negative samples. , Indicates the first The index label of the conditional latent vector corresponding to each negative sample.

5. The trajectory recovery method based on the latent space condition constraint generation model according to claim 1, characterized in that, The adoption rate of the second network model is optimized using a second loss function; The expression for the second loss function is as follows: ; in, This represents the second loss function. The mean square error loss for the position of trajectory points. To compare learning loss, For dynamic time-warped distance, To adjust the contrastive learning loss The weighting coefficient, For adjusting dynamic time warp distance The weighting coefficients.

6. The trajectory recovery method based on the latent space condition constraint generation model according to claim 1, characterized in that, The process of matching the aligned trajectory latent vector with each conditional latent vector using a trained generative model to obtain the matching vector specifically employs the following formula: ; in, Represents the matching vector. Represents the fusion function. This represents the latent vector of the aligned trajectory. This represents the aligned conditional implicit vectors. Indicates the number of condition types. This represents a temporary intermediate variable used to iterate from 1 to... .

7. A trajectory recovery device based on a latent space condition constraint generation model, characterized in that, The trajectory recovery device based on the latent space condition constraint generation model includes: The data acquisition module is used to acquire the original trajectory data and various spatiotemporal constraint data of the original trajectory data; The preprocessing module is used to preprocess the original trajectory data to obtain a preprocessed trajectory sequence tensor. The structured processing module is used to perform structured processing on the original trajectory data under various spatiotemporal constraints, and to construct a set of conditional features including road network adjacency matrix and node features, Gaussian kernel density distribution features of interest points, and numerical encoding of environmental information. The first network model construction module is used to construct the first network model; the first network model includes: a trained Transformer encoder, a trained graph neural network (GNN), a trained long short-term memory artificial neural network (LSTM), and a trained convolutional neural network (CNN). The first encoding module is used to encode the preprocessed trajectory sequence tensor using a trained Transformer encoder to obtain the trajectory latent vector; The second encoding module is used to independently encode each type of spatiotemporal conditional constraint data after structured processing using a trained graph neural network (GNN), a trained long short-term memory artificial neural network (LSTM), and a trained convolutional neural network (CNN) to obtain the corresponding set of conditional latent vectors. The unified representation module is used to jointly optimize the trajectory latent vector and each conditional latent vector in the set of conditional latent vectors in the unified latent space based on the contrastive learning mechanism, so that the trajectory latent vector and each conditional latent vector achieve semantic alignment in the unified representation space, and output the aligned trajectory latent vector and each conditional latent vector. The second network model construction module is used to construct the second network model; the second network model includes: the first network model and the trained generative model; The matching module is used to match the aligned trajectory latent vector with each conditional latent vector through the trained generative model to obtain the matching vector; The decoding module is used to input the matching vector into the decoder, generate a continuous spatiotemporal trajectory point sequence point by point, and map the output result back to the original geographic coordinate system to obtain the final trajectory recovery result.

8. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the trajectory recovery method based on the latent space condition constraint generation model according to any one of claims 1-6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the trajectory recovery method based on the latent space condition constraint generation model as described in any one of claims 1-6.

10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the trajectory recovery method based on the latent space condition constraint generation model as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Trajectory clustering method and system based on deep learning and storage medium

    CN115374375A

  • Vehicle track recovery method, computer equipment and storage medium

    CN119311479A