A similar sub-trajectory search method based on massive heterogeneous data

By employing a two-stage framework for screening candidate sets and identifying similar subtrajectories, this method addresses the efficiency and accuracy issues in searching for similar subtrajectories in massive heterogeneous data, achieving efficient and accurate similar subtrajectory search.

CN119513394BActive Publication Date: 2025-10-17BEIJING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411651028.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-10-17
Estimated Expiration
2044-11-19

AI Technical Summary

Technical Problem

Existing technologies are inefficient and inaccurate when searching for similar sub-trajectories in massive heterogeneous data, making it difficult to meet practical application needs.

Method used

A two-stage framework is adopted. First, the candidate set is screened through spatial feature extraction and sequence dependency capture modules, and a robust representation is generated using a trajectory contrast learning strategy. Then, similar sub-trajectories are identified through trajectory encoding, cross-trajectory information fusion, and sub-trajectory interval prediction modules.

Benefits of technology

It improves the efficiency and accuracy of searching for similar subtrajectories in massive heterogeneous data, adapts to complex real-world environments, and maintains stable search results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119513394B_ABST
    Figure CN119513394B_ABST
Patent Text Reader

Abstract

The application provides a similar sub-trajectory search method based on massive heterogeneous data, which comprises a candidate set screening stage and a sub-trajectory positioning stage; the candidate set screening stage is used for selecting a candidate set with a fixed size from a large-scale trajectory data set, and the candidate set contains trajectories with similar sub-trajectories to a query trajectory, so as to reduce the subsequent search space; the sub-trajectory positioning stage is used for accurately identifying the most similar sub-trajectories of all trajectories in the candidate set to the query trajectory, and the application supports a wide range of downstream applications, including susceptible population mining, abnormal route detection, carpool service optimization and the like, and helps the fields of urban traffic management, public safety improvement and smart city construction, and when similar sub-trajectory search is performed in massive heterogeneous data, the accuracy, efficiency and robustness of the obtained results can be ensured, and the application has many advantages compared with the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of space-time trajectory data management, and particularly relates to a similar sub-trajectory search method based on massive heterogeneous data, and specifically relates to a method for searching similar sub-trajectories by efficiently screening a candidate set in massive heterogeneous data and then accurately positioning a similar interval. BACKGROUND

[0002] With the popularity of GPS devices and wireless communication technology, the mobile trajectories of a large number of individuals can be effectively collected, which promotes the development of various trajectory analysis methods. Among them, similar sub-trajectory search is a key task, which aims to find the most similar sub-trajectory to a given query trajectory in the trajectory dataset based on similarity measurement.

[0003] However, the similar sub-trajectory search in reality is often affected by two problems:

[0004] (1) Massive data: trajectory data has many sources and is generated at all times, accumulating a large amount of data. As the data size expands, it will be very time-consuming to search for the most similar sub-trajectory to the query trajectory by traversing each trajectory.

[0005] (2) Heterogeneous data: due to device settings, communication failures and other reasons, the quality of collected trajectory data is uneven. Low-quality trajectories have problems such as low sampling rate and positioning deviation, which easily show unclear movement patterns, making it difficult to identify similarity.

[0006] Currently, the research on similar sub-trajectory search mainly focuses on the following two categories:

[0007] (1) Complete trajectory similarity calculation;

[0008] Measuring the similarity between trajectories is the basis for similar sub-trajectory search. Most heuristic methods determine the optimal matching of point pairs based on dynamic programming, and then accumulate the distance between point pairs to represent the similarity between trajectories. Although the calculation results between high-quality trajectories are reliable, the point pair matching process will cause high computational cost, and low-quality trajectories may cause incorrect point pair matching, which seriously affects the efficiency and accuracy of the calculation;

[0009] With the rapid development of deep learning, many works train encoding models in a supervised or self-supervised manner to reconstruct trajectories into low-dimensional vectors and calculate the distance between vectors to represent the similarity between trajectories, in order to improve the calculation efficiency. However, these works only focus on the overall movement pattern and are not suitable for understanding the similarity relationship between sub-trajectories and trajectories.

[0010] (2) Local similar sub-trajectory search;

[0011] The local similar sub-trajectory search problem focuses on searching within a pair of trajectories, that is, given a query trajectory, find the most similar sub-trajectory in the candidate trajectory data based on a certain similarity measure; by traversing all possible sub-trajectories in the candidate trajectory, the most similar result can be returned, but the efficiency is low;

[0012] Some works use heuristic methods to further improve search efficiency through approximation strategies and segmentation strategies; in recent years, some works introduce advanced reinforcement learning and natural language processing technologies to improve search results; however, when facing large-scale trajectory data in reality, even the most advanced work still needs to traverse all trajectories and search similar sub-trajectories one by one, which is time-consuming; in addition, due to the heterogeneity of trajectories, the above methods may return incorrect search results due to misleading information from low-quality trajectories.

[0013] In summary, the prior art cannot effectively solve the search problem in the real scene, and it is difficult to guarantee efficiency and accuracy to meet the needs of actual applications. SUMMARY

[0014] To solve the above technical problems, the present application provides a similar sub-trajectory search method based on massive heterogeneous data, which can realize efficient, accurate and robust similar sub-trajectory search from massive heterogeneous data, and support a wide range of downstream applications.

[0015] A similar sub-trajectory search method based on massive heterogeneous data, comprising a candidate set screening stage and a sub-trajectory positioning stage;

[0016] The candidate set screening stage aims to select a fixed-size candidate set from a large-scale trajectory data set, the candidate set containing trajectories with similar sub-trajectories to the query trajectory, thereby reducing the search space in the subsequent stage;

[0017] As an example, the candidate set screening stage achieves its function through two modules, including:

[0018] ① Space feature extraction module: used to extract the structure and location features of the trajectory, and fuse the structure and location features of the trajectory into a comprehensive space embedding;

[0019] ② Sequence-dependent capture module: introduces point position relationship to capture the correlation between trajectory points in parallel to generate the representation of the entire trajectory;

[0020] In order to improve the robustness of heterogeneous trajectories, the candidate set screening stage designs a trajectory contrast learning strategy, generates trajectory variants through three trajectory enhancement methods to simulate the heterogeneous situation in the real world, and optimizes the training process.

[0021] As an example, the candidate set refers to: after sufficient training, the query trajectory and all trajectories in the data set are encoded into corresponding robust representations; the distance between the robust representations reflects the actual similarity between the trajectories, that is, the smaller the distance between the robust representations, the greater the similarity between the trajectories; by calculating the distance between the robust representation of the query trajectory and the robust representation of all trajectories in the data set, the first l trajectories with the smallest distance are selected to form the candidate set, and these trajectories contain similar sub-trajectories with the query trajectory.

[0022] The sub-trajectory positioning stage: for accurately identifying the most similar sub-trajectory of all trajectories in the candidate set and the query trajectory;

[0023] As an example, the sub-trajectory positioning stage: achieves its function implementation through three modules, including:

[0024] ① Trajectory encoding module: using a pre-trained spatial feature extraction module and a sequence dependence capture module as an encoder to efficiently obtain the robust representation of the query trajectory and the candidate trajectory;

[0025] ② Cross-trajectory information fusion module: for focusing on the important association between the robust representations of the two trajectories to generate an interactive representation;

[0026] ③ Sub-trajectory interval prediction module: for predicting the start and end points of the similar sub-trajectory.

[0027] As an example, in order to strengthen the identification of similar sub-trajectory intervals in different heterogeneous situations, the sub-trajectory positioning stage designs a heterogeneous sample construction strategy: by constructing multiple reliable heterogeneous trajectory pairs to guide the training process;

[0028] After training, the similar sub-trajectory with the query trajectory can be predicted in each candidate trajectory; finally, all the similar sub-trajectories are sorted according to the interval length, so as to determine the most similar sub-trajectory as the final search result.

[0029] The beneficial effects of the present application are:

[0030] (1) Efficiency: the method adopts a two-stage framework, first quickly selects a candidate set containing trajectories with similar sub-trajectories to the query trajectory, and then specifically locates the similar sub-trajectory, thereby effectively improving the efficiency of searching in massive data.

[0031] (2) Precision: the method uses various deep learning techniques, designs different modules and training strategies in the two-stage, respectively learns the low-dimensional representation of preserving the moving pattern of the trajectory and the probability of the start and end points of the similar sub-trajectory, thereby effectively improving the accuracy of searching in heterogeneous data.

[0032] (3) Robustness: The method fully considers the inherent mass and heterogeneity of trajectory data in real scenarios, and can maintain stable search results under different data sizes and heterogeneity levels, suitable for complex practical environments. BRIEF DESCRIPTION OF DRAWINGS

[0033] Fig. 1 The figure is a schematic diagram of the overall framework of the similar sub-trajectory search method based on massive heterogeneous data.

[0034] Fig. 2 The figure is a candidate set screening stage framework diagram of the similar sub-trajectory search method based on massive heterogeneous data.

[0035] Fig. 3 The figure is a sub-trajectory positioning stage framework diagram of the similar sub-trajectory search method based on massive heterogeneous data. DETAILED DESCRIPTION

[0036] Below, referring to Figs. 1 to 3 The figure is a similar sub-trajectory search method based on massive heterogeneous data, which includes a candidate set screening stage and a sub-trajectory positioning stage.

[0037] The candidate set screening stage aims to select a fixed size candidate set from a large scale trajectory data set, the candidate set contains trajectories with similar sub-trajectories to the query trajectory, thereby reducing the search space in the subsequent stage.

[0038] As an example, the candidate set screening stage achieves its function realization through two modules, including:

[0039] ① Spatial feature extraction module: used to extract the structure feature and location feature of the trajectory, and fuse the structure and location features of the trajectory into comprehensive spatial embedding;

[0040] As an example, trajectories exhibit two key movement features in similar sub-trajectory search: structure feature and location feature; as Fig. 2 shown;

[0041] Among them, the structure feature indicates the connectivity between points; while the location feature indicates the precise coordinates, which are respectively helpful for learning the overall and detailed similarity; the spatial feature extraction module comprehensively utilizes the structure feature and the location feature to generate comprehensive spatial embedding of heterogeneous trajectories.

[0042] As an example, the comprehensive spatial embedding includes:

[0043] ① Structure embedding: used to weaken the influence of location offset;

[0044] First, the geographic area is divided into a unified grid, and each point p in the trajectory T is represented asi map to its nearest grid g i ;

[0045] Since the spatial connectivity between grids reflects the actual adjacency relationship, further create a graph G(V,E), where V represents the grid set, and E represents the edge between adjacent grids;

[0046] Then, by using the graph node embedding algorithm, derive a more expressive embedding for each grid according to its neighbor nodes

[0047] In addition, considering the potential missing points in heterogeneous trajectories, the spatial feature extraction module further refines the embedding by adaptively aggregating adjacent features, specifically using a graph attention network, and the formula is designed as follows:

[0048]

[0049]

[0050] where, is the attention score between v i and v j , and are trainable variables, is the adjacent grid set of g i ; ReLU, Softmax and Concat represent activation, probability conversion and concatenation operation respectively; by converting each trajectory point p i in the trajectory T into the corresponding grid embedding to form a structural embedding sequence

[0051] ② Location embedding: used to accurately describe the fine-grained trajectory mobility in heterogeneous cases;

[0052] The spatial feature extraction module fully extracts the location features of each point p i in T, including:

[0053] absolute position (lon i , lat i ), turning angle and average moving length

[0054] where, the features β and l as dynamic attributes are helpful to infer missing points and smooth noise. By converting each point p i into the corresponding four-tuple (lon i , lat i , β i , l i), to generate the location embedding sequence

[0055] ③ Unified fusion: considering the natural complementarity of the structure feature and the location feature in measuring trajectory similarity, a more rich spatial embedding is mined through their interaction;

[0056] Firstly, S and L are converted into new embeddings in the same representation space via weight matrices and

[0057] Then, the two types of embeddings are fused by a cross-attention mechanism as follows:

[0058]

[0059] where, α U is the attention score between U S and U L , is a learnable weight matrix;

[0060] Finally, the enhanced embeddings S' and are concatenated to obtain the comprehensive spatial embedding sequence

[0061] ② Sequence dependency capturing module: after introducing the point position relationship, the correlation between trajectory points is captured in parallel to generate the representation of the entire trajectory;

[0062] In order to improve the robustness to heterogeneous trajectories, the candidate set screening stage designs a trajectory contrast learning strategy, generates trajectory variants through three trajectory enhancement methods to simulate the heterogeneous situation in the real world, and optimizes the training process.

[0063] As an example, the candidate set refers to: after sufficient training, the query trajectory and all trajectories in the data set are encoded into corresponding robust representations; the distance between the robust representations reflects the actual similarity between trajectories, that is, the smaller the distance between the robust representations, the greater the similarity between trajectories; by calculating the distance between the robust representation of the query trajectory and the robust representation of all trajectories in the data set, the first l trajectories with the smallest distance are selected to form the candidate set, and these trajectories contain similar sub-trajectories to the query trajectory.

[0064] Further, trajectory similarity calculation is insufficient relying on spatial embedding alone; because a trajectory is a sequence of points, and the dependency relationship between points is also crucial to trajectory similarity, therefore, the sequence dependency capturing module introduces position encoding and sequence encoder to capture the inherent complex dependency relationship in heterogeneous trajectories. ​

[0065] As an example, the position encoding scheme includes:

[0066] Heterogeneous trajectories often have missing points, which affect the reliability of the absolute position; in contrast, the relative position between points remains stable; therefore, consider capturing the relative position relationship to improve robustness; use rotation attention encoding to generate the following position encoding for each point:

[0067]

[0068] where: is a rotation matrix, rotates the embedding dimension pair (2k, 2k+1) by θ k , and d e = 2d represents the embedding dimension;

[0069] Then, update the embedding of each point in U by multiplying the corresponding rotation matrix, to get

[0070] As an example, the sequence encoder: for more efficient modeling of sequence data, by processing all elements in the whole sequence in parallel, to focus on global important information, while improving the tolerance to errors;

[0071] Specifically, use a multi-head self-attention mechanism with n heads to capture the dependencies in the comprehensive spatial embedding sequence U', which is expressed as follows:

[0072]

[0073] M = Concat(head1, …, head n ) W O ,

[0074] where: is the key, query and value embedding corresponding to U', is the output of the i-th head, is the multi-head attention output. and are trainable weight matrices, d' = d e / n represents the dimension;

[0075] In order to retain the overall features, the mean pooling processing is performed on M to obtain the final trajectory representation

[0076] As an example, the trajectory contrast learning strategy refers to: by learning the similarity relationship under multiple heterogeneous trajectories, the robustness of the trajectory representation is further enhanced; but due to difficult-to-distinguish movement patterns and high time cost, it is difficult to directly select similar trajectory pairs in the original heterogeneous data; therefore, a contrast learning paradigm without negative samples is used to optimize the training process.

[0077] As an example, since the idea of contrast learning aims to push away different samples and simultaneously pull the distance between two variant representations of the same sample, three trajectory enhancement methods are designed to simulate real heterogeneous trajectories, including:

[0078] ①Point deletion: randomly delete trajectory points in a certain proportion to enhance similarity learning in sparse data;

[0079] ②Point offset: introduce position bias to trajectory points to help learn similarity under inaccurate data; wherein the offset follows a bounded Gaussian distribution with a maximum value of 100 meters;

[0080] ③Trajectory truncation: by cutting the prefix, suffix or both of the trajectory, different sub-trajectories are constructed to help learn the similarity between partial sequences and complete sequences;

[0081] Specifically:

[0082] Each trajectory T is processed into two different variants T1 and T2, which represent the complete heterogeneous trajectory and the heterogeneous sub-trajectory of T, respectively, to construct the positive sample pair for training;

[0083] Wherein, T1 is generated after point deletion and point offset, and T2 is generated by integrating the above three methods. Then, the trajectory representations r1 and r2 corresponding to the two are projected by a multi-layer perceptron projector to generate z1 and z2, and by a multi-layer perceptron predictor to generate o1 and o2;

[0084] The training process uses a symmetric loss function to pull the distance between the positive sample pairs, and the specific formula is as follows:

[0085]

[0086] Wherein, F is used to calculate the negative cosine similarity, stopgrad represents stopping gradient backpropagation to avoid gradient collapse problem, and the total loss is the average value calculated on all samples;

[0087] After training, the query trajectory T q and the trajectories in the data set D can be encoded into robust representations; the trajectories in D are sorted according to the Euclidean distance with the query representation, and the smaller the value is, the higher the similarity is;

[0088] Finally, the top l trajectories with the highest similarity are selected to form the candidate set, which contains sub-trajectories similar to the query trajectory.

[0089] As a preferred example, the number of top l is 500 trajectories.

[0090] The sub-trajectory positioning stage is used to accurately identify the most similar sub-trajectory of the query trajectory in all trajectories in the candidate set, such as Fig. 3 ;

[0091] As an example, the sub-trajectory positioning stage achieves its function by three modules, including:

[0092] ① Trajectory encoding module: using a pre-trained spatial feature extraction module and a sequence-dependent capture module as an encoder to efficiently obtain a robust representation of the query trajectory and candidate trajectory;

[0093] As an example, in order to find similar sub-trajectories in trajectory pairs, a robust representation of heterogeneous query trajectory T q and candidate trajectory T c must be obtained efficiently; the trajectory encoding module is composed of a pre-trained spatial feature extraction module and a sequence-dependent capture module; in order to preserve the features of each trajectory point in subsequent interactions, all outputs are preserved as representations of query trajectories and candidate trajectories, i.e. and

[0094] ② Cross-trajectory information fusion module: used to focus on important associations between the robust representations of the two trajectories, generating an interactive representation;

[0095] As an example, the interactive representation means that independent consideration or simple splicing of the robust representations of the query trajectory and the candidate trajectory may miss important relevance between them, and it is more effective to integrate them through attention mechanism; however, if only the information is unidirectionally transmitted from one trajectory to another, the inaccurate data in the heterogeneous trajectory will be improperly emphasized; therefore, the cross-trajectory information fusion module performs point-to-point interaction in both query-to-candidate and candidate-to-query directions, and dynamically combines the results; this process allows the use of reliable data from one direction to mitigate errors from the other direction, thereby facilitating focused analysis of relevant points;

[0096] Specifically, the cross-trajectory information fusion module uses a bidirectional attention mechanism to fuse the trajectory representations as follows:

[0097] R’ q = R q W q ,R’c = R c W c ,

[0098] R qc = Softmax(R c T R q )R q ,

[0099] R cq = Softmax(max(R c T R q ))R c ,

[0100] R f = Concat(R c ,R qc ,R c ⊙R qc ,R c ⊙R cq ),

[0101] where, and are the intermediate values after attention weight transformation; is the weighted query representation generated according to R c , is the weighted candidate representation generated according to R q , and is the interaction representation after splicing all parts.

[0102] ③ Sub-trajectory interval prediction module: used for predicting the start and end points of similar sub-trajectories.

[0103] As an example, after obtaining the interaction representation R f , the next goal is to capture the key points contained in the similar sub-trajectory; the sub-trajectory has a start point, an end point and a global feature; the start point and the end point are used to identify the interval boundary, while the global feature ensures the internal consistency with the query trajectory; separate processing of these features helps to improve the tolerance to missing and inaccurate data; therefore, the sub-trajectory interval prediction module uses global, start point and end point feature encoders based on attention mechanism to extract the features corresponding to the similar sub-trajectory pair from the interaction representation R f , respectively represented as

[0104] Then, the start point and the end point of the similar sub-trajectory are respectively predicted by adaptively merging the features, and the specific formula is as follows:

[0105] H' s = ReLU(Concat(H s ,H w )W1+b1),

[0106] H' e = ReLU(Concat(H e ,H w )W2+b2),

[0107] p s = Softmax(H' s W s ),p e = Softmax(H' e W e ),

[0108] where are the updated start and end representations, are the predicted start and end probability outputs. b1,b2∈R d and are trainable variables.

[0109] As an example, in order to strengthen the recognition of similar sub-trajectory intervals in different heterogeneous cases, the sub-trajectory positioning stage designs a heterogeneous sample construction strategy: by constructing multiple reliable heterogeneous trajectory pairs to guide the training process;

[0110] After training, similar sub-trajectories can be predicted in each candidate trajectory; finally, all the similar sub-trajectories are sorted according to the interval length, so as to determine the most similar sub-trajectory as the final search result.

[0111] As an example, due to the lack of point information and deviation, it is challenging to directly identify similar sub-trajectory intervals from original heterogeneous trajectory pairs; therefore, a training sample generation strategy is proposed, which uses data enhancement of high-quality trajectory pairs to create heterogeneous trajectory pairs;

[0112] First, high-quality trajectory pairs verified are screened out, and their similar sub-trajectory interval true values are calculated;

[0113] Then, heterogeneous trajectory pairs are generated by deleting points and offsetting;

[0114] Finally, the true value of the original trajectory pair is adjusted according to the deleted points in the candidate trajectory, as the similar sub-trajectory interval of the heterogeneous trajectory pair;

[0115] During training, the similar sub-trajectory search can be regarded as a multi-classification problem focusing on the start and end points of similar sub-trajectories, so cross-entropy is used as the loss function of all trajectory pairs of samples, and the specific expression is as follows:

[0116]

[0117] where p s and p e represent the predicted start and end point probabilities, and s i and e i are the actual start and end points of the i-th sample. θ includes all trainable parameters, and N represents the number of samples.

[0118] After outputting the start and end point probability vectors p s and p e , the similar sub-trajectory interval [i,j] is further inferred.

[0119] First, i = argmax(p s ) and j = argmax(p e ) are calculated.

[0120] If i ≤ j, then [i,j] is directly selected by maximizing p[i]·p[j]; if i > j, then the upper triangular matrix M is calculated [i,j] is derived from the index corresponding to the maximum value in M.

[0121] Finally, by comparing the length of the identified interval in each candidate trajectory, the most similar sub-trajectory to the query can be determined.

[0122] In order to better illustrate the design principle of the present application, the following specific concept definitions are explained as follows:

[0123] The trajectory: is a sequence of points recording the moving path of an object, defined as: T = {p1, p2, …, p n}, where p i = (lon i , lat i ) is the longitude and latitude coordinates of the i-th point, and |T| is the length of the trajectory.

[0124] The sub-trajectory: is a component of the trajectory, which can be represented as: T[i,j], 1 ≤ i ≤ j ≤ |T|, that is, the continuous part from the i-th point to the j-th point of the trajectory T.

[0125] The data set: includes a number of trajectories, defined as D; |D| represents the size of the data set, that is, the number of trajectories contained.

[0126] The trajectory similarity refers to the similarity between two trajectories T and T', which is defined as: sigma (T, T'), wherein sigma (·, ·) is a trajectory similarity measure. The sub-trajectory T[i, j] in T is regarded as an independent trajectory, and the similarity between the sub-trajectory and T' can be measured by sigma (T[i, j], T').

[0127] The similar sub-trajectory search refers to: given a trajectory dataset D and a query trajectory T q , the similar sub-trajectory search aims to find the most similar sub-trajectory T q [i c ,j * ] to T * in D based on the similarity measure sigma (·, ·), wherein the trajectory T c ∈D,

[0128] The present application supports a wide range of downstream applications, including susceptible population mining, abnormal route detection, carpool service optimization, etc., and helps urban traffic management, public safety improvement and smart city construction, etc., providing solid support for social and economic development; when searching for similar sub-trajectories in massive heterogeneous data, the present application can ensure the accuracy, efficiency and robustness of the results through the cooperation of the above two stages; the novel similar sub-trajectory search method proposed by the present application focuses on the performance of searching in massive heterogeneous data, and has many advantages compared with the prior art.

[0129] The above description is only a preferred embodiment of the present application, and it should be understood that the above embodiment description is only used to help understand the method of the present application and its core idea, and is not used to limit the protection scope of the present application, and any modification, equivalent replacement, etc. within the idea and principle of the present application should be included in the protection scope of the present application.

Claims

1. A similar sub-trajectory search method based on massive heterogeneous data, characterized in that: include: Candidate set screening stage and sub-trajectory positioning stage; The candidate set screening stage is used to select a fixed-size candidate set from a large-scale trajectory dataset, where the candidate set contains trajectories with similar subtrajectories to the query trajectory, thereby reducing the subsequent search space; The sub-trajectory positioning stage is used to accurately identify the sub-trajectory of all trajectories in the candidate set that is most similar to the query trajectory; The candidate set screening stage is implemented through two modules, including: ① Spatial feature extraction module: used to extract the structural features and location features of the trajectory, and fuse the structural and location features of the trajectory into a comprehensive spatial embedding; ② Sequence dependency capture module: After introducing the point position relationship, it captures the association between trajectory points in parallel to generate a representation of the entire trajectory; To improve the robustness to heterogeneous trajectories, a trajectory contrast learning strategy is designed in the candidate set screening stage. Trajectory variants are generated through three trajectory enhancement methods to simulate the heterogeneous conditions in the real world and optimize the training process. The three trajectory enhancement methods include: ① Point deletion: Randomly delete trajectory points according to a certain ratio to enhance similarity learning in sparse data; ②Point offset: Introduces positional deviations for trajectory points to help learn similarities under inaccurate data; the offset follows a bounded Gaussian distribution with a maximum value of 100 meters; ③Trajectory truncation: By cutting the prefix, suffix, or both of the trajectory, different sub-trajectories are constructed to help learn the similarity between partial sequences and complete sequences; Trajectories exhibit two key mobility characteristics in similar sub-trajectory searches: structural characteristics and location characteristics; The structural features indicate the connectivity between points, while the location features indicate the precise coordinates, which help to learn the similarity of the whole and details respectively. The spatial feature extraction module comprehensively utilizes the structural features and location features to generate a comprehensive spatial embedding of heterogeneous trajectories. The sub-trajectory positioning stage achieves its functions through three modules, including: ① Trajectory Encoding Module: Uses the pre-trained spatial feature extraction module and sequence dependency capture module as encoders to efficiently obtain robust representations of the query trajectory and candidate trajectories; ② Cross-trajectory information fusion module: used to focus on the important correlation between the robust representations of two trajectories and generate interactive representations; ③Sub-trajectory interval prediction module: used to predict the starting and ending points of similar sub-trajectories.

2. A similar sub-trajectory search method based on massive heterogeneous data according to claim 1, characterized in that: The comprehensive spatial embedding includes: ① Structural embedding: used to weaken the impact of location offset; First, the geographical area is divided into a uniform grid, and each point p in the trajectory T is i Mapped to its nearest grid g i ; Since the spatial connectivity between grids reflects the actual adjacent relationship, we further create a graph G(V,E), where V represents the grid set and E represents the edges between adjacent grids; Then, by using a graph node embedding algorithm, a more expressive embedding is derived for each grid based on its neighbor nodes. In addition, considering the potential missing points in heterogeneous trajectories, the spatial feature extraction module further improves the embedding by adaptively aggregating adjacent features. Specifically, it uses the graph attention network and the formula is designed as follows: in, It is v i and v j The attention score between and is a trainable variable, It is g i The adjacent grid set; ReLU, Softmax and Concat represent activation, probability conversion and splicing operations respectively; by i Convert to the corresponding grid embedding Embedding sequences with compositional structures ② Place embedding: used to accurately describe fine-grained trajectory mobility in heterogeneous situations; The spatial feature extraction module fully extracts each point p in T i Location characteristics include: Absolute position (lon i ,lat i ), turning angle and average moving length Features β and l serve as dynamic attributes that help infer missing points and smooth noise; by i Converted into the corresponding quaternion (lon i ,lat i ,β i ,l i ), to generate a sequence of place embeddings ③ Unified Fusion: Considering the natural complementarity of the structural features and positional features in measuring trajectory similarity, a richer spatial embedding is mined through the interaction between them; First, S and L are respectively passed through the weight matrix and Convert to a new embedding in the same representation space Then, these two types of embeddings are fused through the cross-attention mechanism as follows: Among them, α U It's U S and U L The attention score between is a learnable weight matrix; Finally, the enhancement is embedded into S ′ and Splice them together to get a comprehensive spatial embedding sequence 3. The similar sub-trajectory search method based on massive heterogeneous data according to claim 2 is characterized in that: The candidate set refers to: after sufficient training, the query trajectory and all trajectories in the dataset are encoded into corresponding robust representations; the distance between the robust representations reflects the actual similarity between the trajectories, that is, the smaller the distance between the robust representations, the greater the similarity between the trajectories; by calculating the distance between the robust representation of the query trajectory and the robust representations of all trajectories in the dataset, the top l trajectories with the smallest distance are selected to form the candidate set. These trajectories contain subtrajectories similar to the query trajectory.

4. The similar sub-trajectory search method based on massive heterogeneous data according to claim 3 is characterized in that: Trajectory similarity calculation relying solely on spatial embedding is insufficient; because a trajectory is a sequence of points, and the dependencies between points are also crucial for trajectory similarity, the sequence dependency capture module introduces position encoding and sequence encoder to capture the complex dependencies inherent in heterogeneous trajectories.

5. The similar sub-trajectory search method based on massive heterogeneous data according to claim 4 is characterized in that: The position coding scheme includes: Heterogeneous trajectories often have missing points, which affects the reliability of absolute positions. In contrast, the relative positions between points remain stable. Therefore, we consider capturing the relative position relationship to improve robustness. We use rotational attention encoding to generate the following position encoding for each point: in: is the rotation matrix, With θ k The angle of rotation embeds the dimension pair (2k, 2k+1), and d e =2d indicates embedding dimension; Then, the embedding of each point in U is updated by multiplying it by the corresponding rotation matrix, resulting in The sequence encoder is used to more efficiently model sequence data by processing all elements in the entire sequence in parallel to focus on important global information while improving tolerance to errors. Specifically, it uses a multi-head self-attention mechanism with n heads to capture the comprehensive spatial embedding sequence U ′ The dependency relationship in is expressed as follows: Q i =U ′ W i Q , M=Concat(head1,…,head n )W O , in: It's U ′ The corresponding key, query and value embeddings, is the output of the i-th head, It is multi-head attention output; and is the trainable weight matrix, d ′ =d e / n indicates dimension; In order to retain the overall features, M is processed by mean pooling to obtain the final trajectory representation 6. The similar sub-trajectory search method based on massive heterogeneous data according to claim 5, characterized in that: Each trajectory T is processed into two different variants T1 and T2, which represent the complete heterogeneous trajectory and heterogeneous sub-trajectory of T respectively to construct positive sample pairs for training; Among them, after point deletion and point shifting, T1 is generated, and T2 is generated by combining the above three methods; then, the corresponding trajectory representations r1 and r2 are passed through a multi-layer perceptron projector to generate z1 and z2, and then through a multi-layer perceptron predictor to generate o1 and o2; The training process uses a symmetric loss function F to narrow the distance between positive sample pairs. The specific formula is as follows: Among them, F is used to calculate the negative cosine similarity, stopgrad means stopping the gradient backpropagation to avoid the gradient collapse problem, and the total loss is the average value calculated on all samples; After training, query trajectory T q The trajectories in dataset D are encoded into robust representations; the trajectories in D are sorted according to the Euclidean distance to the query representation, with smaller values ​​indicating higher similarity; Finally, the first l trajectories with the highest similarity are selected to form the candidate set, which contains sub-trajectories similar to the query trajectory; The number of the first 1 tracks is 500.

7. The similar sub-trajectory search method based on massive heterogeneous data according to claim 6 is characterized in that: In order to find similar sub-trajectories in a trajectory pair, the heterogeneous query trajectory T must be obtained efficiently. q and candidate trajectory T c Robust representation; the trajectory encoding module is composed of a pre-trained spatial feature extraction module and a sequence dependency capture module; in order to retain the features of each trajectory point in subsequent interactions, all outputs are retained as representations of query trajectories and candidate trajectories, that is, and The cross-trajectory information fusion module uses a bidirectional attention mechanism to fuse trajectory representations as follows: R ′ q =R q W q ,R ′ c =R c W c , R f =Concat(R ′ c ,R qc ,R ′ c ⊙R qc ,R ′ c ⊙R cq ), in, and is the attention weight The transformed median value; According to R ′ c The generated weighted query representation is, According to R ′ q The generated weighted candidate representations; and It is the interactive representation after all parts are spliced ​​together; In obtaining the interaction representation R f After that, the next goal is to capture the key points contained in similar sub-trajectories; sub-trajectories have start points, end points and global features; the start points and end points are used to identify interval boundaries, while the global features ensure internal consistency with the query trajectory; processing these features separately helps to improve the tolerance to missing and inaccurate data; therefore, the sub-trajectory interval prediction module uses the global, start point and end point feature encoder based on the attention mechanism to extract the key points from the interaction representation R f Extract the features corresponding to similar sub-trajectories and express them as Then, the probabilities of the start and end points of similar sub-trajectories are predicted separately by adaptively merging features. The specific formula is as follows: H s ′ =ReLU(Concat(H s ,H w )W1+b1), H e ′ =ReLU(Concat(H e ,H w )W2+b2), p s =Softmax(H s ′ W s ),p e =Softmax(H e ′ W e ), in, are the updated start and end representations, respectively. are the predicted start and end probability outputs respectively; b1,b2∈R d and is a trainable variable; In order to enhance the recognition of similar sub-trajectory intervals under different heterogeneous situations, a heterogeneous sample construction strategy is designed in the sub-trajectory localization stage: multiple reliable heterogeneous trajectory pairs are constructed to guide the training process; After the training is completed, sub-trajectories similar to the query trajectory can be identified in each candidate trajectory; finally, all the similar sub-trajectories are sorted according to the interval length, so as to determine the most similar sub-trajectory as the final search result.

Citation Information

Patent Citations

  • Hotspot path mining method based on longest common sub-trajectory density clustering

    CN111897805A

  • Similarity query optimization method based on trajectory representation learning

    CN115544070A