Similar sub-trajectory searching method based on massive heterogeneous data
Through a two-stage framework method of filtering candidate sets in massive heterogeneous trajectories and accurately locate similar sub-trajectories, the problems of inefficient search efficiency and insufficient accuracy in the prior art are solved, and efficient, accurate and robust search results are achieved.
Patent Information
- Application Number
- CN202411651028.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-11-19
AI Technical Summary
The prior art is difficult to efficiently and accurately perform similar sub-trajectory searches in massive heterogeneous trajectory data, especially when the data scale is expanded and the trajectory quality is inefficient and susceptible to misleading by low-quality trajectories.
Using a two-stage framework method, firstly, the candidate set is filtered in massive heterogeneous data through the spatial feature extraction module and the sequence dependence capture module, including sub-trajectories similar to the query trajectory, and then accurately locate similar sub-trajectories through trajectory encoding, cross-trajectory information fusion and sub-trajectory interval prediction modules during the sub-trajectory positioning stage.
It realizes efficient, accurate and robust similar subtrajectory search in massive heterogeneous data, improves search efficiency and accuracy, and is suitable for complex actual environments.
Smart Images

Figure CN119513394A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of spatiotemporal trajectory data management, and in particular to a similar sub-trajectory search method based on massive heterogeneous data, and specifically relates to a method for realizing similar sub-trajectory search by first efficiently screening a candidate set in massive heterogeneous data and then accurately locating a similar interval. Background Art
[0002] With the popularization of GPS devices and wireless communication technology, the movement trajectories of massive individuals can be effectively collected, which has promoted 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 in the trajectory dataset for a given query trajectory based on similarity measurement.
[0003] However, similar sub-trajectory searches in reality are often affected by two problems:
[0004] (1) Massive data: Trajectory data comes from many sources and is generated all the time, accumulating a huge amount of data. As the data scale increases, it becomes very time-consuming to traverse each trajectory to search for the sub-trajectory that is most similar to the query trajectory.
[0005] (2) Heterogeneous data: Due to reasons such as equipment settings and communication failures, the quality of the collected trajectory data varies. Low-quality trajectories have problems such as low sampling rate and positioning deviation, which easily reflect unclear movement patterns, making it difficult to identify similarities.
[0006] At present, the research on similar sub-trajectory search mainly focuses on the following two categories:
[0007] (1) Calculation of complete trajectory similarity;
[0008] Measuring the similarity between trajectories is the basis for searching similar sub-trajectories. Most heuristic methods use dynamic programming to determine the optimal match of point pairs, and then accumulate the distance between point pairs to represent the trajectory similarity. Although the calculation results between high-quality trajectories are reliable, the point pair matching process will cause high computational costs, 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 have trained encoding models in a supervised or self-supervised manner, reconstructed trajectories into low-dimensional vectors, and calculated the distance between vectors to represent trajectory similarity in order to improve computational 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, the most similar sub-trajectory is found in the candidate trajectory data based on a certain similarity metric. By traversing all possible sub-trajectories in the candidate trajectory, the result that is most similar to the query trajectory can be returned, but the efficiency is low.
[0012] Some works adopt heuristic methods to further improve search efficiency through approximation strategies and segmentation strategies. In recent years, some works have introduced advanced reinforcement learning and natural language processing technologies to improve search results. However, when faced with large-scale trajectory data in reality, even the most advanced works still need to traverse all trajectories and search for similar sub-trajectories in turn, which is time-consuming. In addition, due to the heterogeneity of trajectories, the above methods are likely to return incorrect search results due to misleading information from low-quality trajectories.
[0013] In summary, existing technologies cannot effectively solve search problems in real scenarios, and it is difficult to ensure efficiency and accuracy to meet the needs of practical applications. Summary of the invention
[0014] In order to solve the above technical problems, the present invention 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 dataset, wherein the candidate set contains trajectories with similar sub-trajectories to the query trajectory, thereby reducing the subsequent search space;
[0017] As an example, the candidate set screening stage achieves its function through two modules, including:
[0018] ① 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;
[0019] ② 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;
[0020] In order to improve the robustness to heterogeneous trajectories, in the candidate set screening stage, a trajectory contrast learning strategy is designed, and trajectory variants are generated through three trajectory enhancement methods to simulate the heterogeneous situations in the real world and optimize the training process.
[0021] As an example, the candidate set means that after sufficient training, the query trajectory and all trajectories in the data set are encoded as 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 the trajectories; by calculating the distance between the robust representation of the query trajectory and the robust representations 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 sub-trajectories similar to the query trajectory.
[0022] 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;
[0023] As an example, the sub-track positioning stage achieves its functions through three modules, including:
[0024] ① 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;
[0025] ② Cross-trajectory information fusion module: used to focus on the important correlation between the Robin representations of two trajectories and generate interactive representations;
[0026] ③ Sub-trajectory interval prediction module: used to predict the starting and ending points of similar sub-trajectories.
[0027] As an example, 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: the training process is guided by constructing multiple reliable heterogeneous trajectory pairs;
[0028] After the training is completed, a sub-track similar to the query track can be predicted in each candidate track; finally, all the similar sub-tracks are sorted according to the interval length, so as to determine the most similar sub-track as the final search result.
[0029] Beneficial effects of the present invention:
[0030] (1) Efficiency: This method adopts a two-stage framework to first quickly screen out a candidate set that contains trajectories with similar sub-trajectories to the query trajectory, and then specifically locate the similar sub-trajectories, thereby effectively improving the efficiency of searching in massive data.
[0031] (2) Accuracy: This method uses a variety of deep learning techniques and designs different modules and training strategies in two stages to learn the low-dimensional representation of the trajectory movement pattern and the probability of the start and end points of similar sub-trajectories, respectively, thereby effectively improving the accuracy of searching in heterogeneous data.
[0032] (3) Robustness: This method fully considers the inherent massiveness and heterogeneity of trajectory data in real scenarios, and can maintain stable search results under different data scales and heterogeneity, making it suitable for complex practical environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 The figure is a schematic diagram of the overall framework of a similar sub-trajectory search method based on massive heterogeneous data according to the present invention.
[0034] Figure 2 This is a framework diagram of the candidate set screening stage of a similar sub-trajectory search method based on massive heterogeneous data in the present invention.
[0035] Figure 3 This is a framework diagram of the sub-trajectory positioning stage of a similar sub-trajectory search method based on massive heterogeneous data in the present invention. DETAILED DESCRIPTION
[0036] Below, reference Figures 1 to 3 As shown, a similar sub-trajectory search method based on massive heterogeneous data 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 dataset, wherein the candidate set contains trajectories with similar sub-trajectories to the query trajectory, thereby reducing the subsequent search space;
[0038] As an example, the candidate set screening stage achieves its function through two modules, including:
[0039] ① 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;
[0040] As an illustration, trajectories exhibit two key mobility features in similar subtrajectory search: structural features and location features; e.g. Figure 2 As shown;
[0041] Among them, the structural features indicate the connectivity between points; the location features indicate the precise coordinates, which are helpful 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.
[0042] As an example, the comprehensive spatial embedding includes:
[0043] ① Structural embedding: used to weaken the impact of location offset;
[0044] First, the geographic area is divided into a uniform grid and each point p in the trajectory T isi Mapped to its nearest grid g i ;
[0045] 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;
[0046] Then, by using a graph node embedding algorithm, a more expressive embedding is derived for each grid based on its neighbor nodes.
[0047] 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, the graph attention network is used, and the formula is designed as follows:
[0048]
[0049]
[0050] in, Yes i and v j The attention score between and is a trainable variable, Yes i The adjacent grid set; ReLU, Softmax and Concat represent activation, probability conversion and splicing operations respectively; By i Convert to the corresponding mesh embedding Embedding sequences with compositional structures
[0051] ② Place embedding: used to accurately describe fine-grained trajectory mobility in heterogeneous situations;
[0052] The spatial feature extraction module fully extracts each point p in T i Location characteristics include:
[0053] Absolute position (lon i ,lat i ), turning angle and the average moving length
[0054] Among them, features β and l are dynamic attributes that help infer missing points and smooth noise. i Converted into the corresponding quaternion (lon i ,lat i ,β i ,l i), to generate a sequence of place embeddings
[0055] ③ Unified fusion: Considering that the structural features and position features are naturally complementary in measuring trajectory similarity, richer spatial embeddings are mined through their interaction;
[0056] First, S and L are respectively calculated through the weight matrix and Transformed into a new embedding in the same representation space
[0057] Then, these two types of embeddings are fused through the cross-attention mechanism as follows:
[0058]
[0059] Among them, α U It's U S and U L The attention score between is a learnable weight matrix;
[0060] Finally, the enhancement is embedded in S' and Splice them together to get a comprehensive spatial embedding sequence
[0061] ② 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;
[0062] In order to improve the robustness to heterogeneous trajectories, in the candidate set screening stage, a trajectory contrast learning strategy is designed, and trajectory variants are generated through three trajectory enhancement methods to simulate the heterogeneous situations in the real world and optimize the training process.
[0063] As an example, the candidate set means that after sufficient training, the query trajectory and all trajectories in the data set are encoded as 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 the trajectories; by calculating the distance between the robust representation of the query trajectory and the robust representations 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 sub-trajectories similar to the query trajectory.
[0064] Furthermore, it is not sufficient to rely solely on spatial embedding to calculate trajectory similarity; because a trajectory is a sequence of points, and the dependencies between points are also crucial to trajectory similarity, the sequence dependency capture module introduces position encoding and sequence encoder to capture the complex dependencies inherent in heterogeneous trajectories.
[0065] As an example, the position encoding scheme includes:
[0066] 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. Rotational attention encoding is used to generate the following position encoding for each point:
[0067]
[0068] in: is the rotation matrix, With θ k The angle of rotation embeds the dimension pair (2k, 2k+1), and d e =2d indicates the embedding dimension;
[0069] Then, the embedding of each point in U is updated by multiplying by the corresponding rotation matrix, resulting in
[0070] As an example, the sequence encoder is used to more efficiently model sequence data by processing all elements in the entire sequence in parallel to focus on globally important information while improving tolerance to errors;
[0071] Specifically, a multi-head self-attention mechanism with n heads is used 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] in: are the key, query, and value embeddings corresponding to U', is the output of the ith head, It is multi-head attention output. and is a trainable weight matrix, d'=d e / n indicates the dimension;
[0075] In order to retain the overall features, M is processed by mean pooling to obtain the final trajectory representation
[0076] As an example, the trajectory contrastive learning strategy refers to: further enhancing the robustness of trajectory representation by learning the similarity relationship under multiple heterogeneous trajectories; however, due to the indistinguishable movement patterns and high time cost, it is difficult to directly select similar trajectory pairs in the original heterogeneous data; therefore, a contrastive learning paradigm without negative samples is adopted to optimize the training process.
[0077] As an example, since the idea of contrastive learning is to push different samples apart and bring two variant representations of the same sample closer together, three trajectory enhancement methods are designed to simulate real heterogeneous trajectories. The three trajectory enhancement methods include:
[0078] ① Point deletion: Randomly delete trajectory points according to a certain ratio to enhance similarity learning in sparse data;
[0079] ②Point offset: introduces position deviation for trajectory points to help learn similarity under inaccurate data; the offset follows a bounded Gaussian distribution with a maximum value of 100 meters;
[0080] ③Trajectory truncation: construct different sub-trajectories by cutting the prefix, suffix or both of the trajectory, thereby helping to 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 heterogeneous sub-trajectory of T, respectively, to construct positive sample pairs for training;
[0083] Among them, after point deletion and point shifting, T1 is generated, and T2 is generated by combining the above three methods. Afterwards, the corresponding trajectory representations r1 and r2 are generated by a multi-layer perceptron projector to generate z1 and z2, and then by a multi-layer perceptron predictor to generate o1 and o2;
[0084] The training process uses a symmetric loss function To narrow the distance between positive sample pairs, the specific formula is as follows:
[0085]
[0086] 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;
[0087] After training, query trajectory T q The trajectories in the dataset D can be encoded into a robust representation; the trajectories in D are sorted according to the Euclidean distance with the query representation, and the smaller the value, the higher the similarity;
[0088] Finally, the first l trajectories with the highest similarity are selected to form the candidate set, and these trajectories contain sub-trajectories similar to the query trajectory.
[0089] As a preferred example, the number of the first l tracks is: 500 tracks.
[0090] The sub-track location stage is used to accurately identify the sub-tracks of all tracks in the candidate set that are most similar to the query track; Figure 3 As shown;
[0091] As an example, the sub-track positioning stage achieves its functions through three modules, including:
[0092] ① 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;
[0093] As an example, 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 The pre-trained spatial feature extraction module and the sequence dependency capture module are used to form a trajectory encoding 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
[0094] ② Cross-trajectory information fusion module: used to focus on the important correlation between the Robin representations of two trajectories and generate interactive representations;
[0095] As an example, the interactive representation means that: independently considering or simply concatenating the robust representations of the query trajectory and candidate trajectory may miss the important correlations between them, and it is more effective to integrate them through the attention mechanism; however, if only paying attention to the unidirectional transmission of information from one trajectory to another, inaccurate data in heterogeneous trajectories will be inappropriately emphasized; therefore, the cross-trajectory information fusion module performs point-to-point interactions in both the 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 another direction, thereby facilitating the focused analysis of relevant points;
[0096] Specifically, the cross-trajectory information fusion module uses a bidirectional attention mechanism to fuse 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] in, and After attention weight The transformed intermediate value; According to R' c The generated weighted query representation is, According to R' q The generated weighted candidate representations. It is the interactive representation after splicing all the parts.
[0102] ③ Sub-trajectory interval prediction module: used to predict the starting and ending points of similar sub-trajectories.
[0103] As an example, 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 tolerance to missing and inaccurate data; therefore, the sub-trajectory interval prediction module uses the global, start point and end point feature encoders based on the attention mechanism to extract the key points from the interaction representation R f The features corresponding to similar sub-trajectories are extracted and expressed as
[0104] Then, the probabilities of the start and end points of similar sub-trajectories are predicted respectively by adaptively merging features. 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] 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.
[0109] As an example, 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: the training process is guided by constructing multiple reliable heterogeneous trajectory pairs;
[0110] After the training is completed, a sub-track similar to the query track can be predicted in each candidate track; finally, all the similar sub-tracks are sorted according to the interval length, so as to determine the most similar sub-track as the final search result.
[0111] As an example, it is challenging to identify similar sub-trajectory intervals directly from the original heterogeneous trajectory pairs due to missing and biased point information. To this end, a training sample generation strategy is proposed to create heterogeneous trajectory pairs using data augmentation of high-quality trajectory pairs.
[0112] First, the verified high-quality trajectory pairs are screened out, and their similar sub-trajectory interval truth values are calculated;
[0113] Afterwards, heterogeneous trajectory pairs are generated by point deletion and offset;
[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 the training process, similar sub-trajectory search can be regarded as a multi-classification problem focusing on the starting and ending points of similar sub-trajectories. Therefore, cross entropy is used as the loss function for all trajectory pairs, which is specifically expressed as follows:
[0116]
[0117] Among them, p s and p e represents the probability of the predicted starting and ending points, and s i and e i is the actual starting point and end point of the i-th sample. θ includes all trainable parameters, and N represents the number of samples;
[0118] Output the starting and ending probability vectors p s and p e After that, the similar sub-trajectory interval [i, j] is further inferred;
[0119] First, calculate i = argmax(p s ) and j = argmax(p e );
[0120] If i≤j, then [i,j] is selected directly by maximizing p[i]·p[j]; if i>j, then the upper triangular matrix is calculated Derived from the index corresponding to the maximum value in M [i, j];
[0121] Finally, by comparing the lengths of the identified intervals in each candidate trajectory, the sub-trajectory most similar to the query can be determined.
[0122] In order to better illustrate the design principle of the present invention, the following specific concept definitions are provided:
[0123] The trajectory is a sequence of points that record the path of an object, and is defined as: T = {p1, p2, ..., p n}, where p i =(lon i ,lat i ) are the longitude and latitude coordinates of the ith point, and |T| is the length of the trajectory.
[0124] The sub-trajectory is a component of the trajectory and can be expressed 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 dataset includes a number of trajectories, defined as D; |D| represents the size of the dataset, that is, the number of trajectories included.
[0126] The trajectory similarity is defined as the similarity between two trajectories T and T': σ(T,T'), where σ(·,·) is a trajectory similarity measure. The sub-trajectory T[i,j] is regarded as an independent trajectory, and its similarity with T' can be measured by σ(T[i,j],T').
[0127] The similar sub-trajectory search is: given a trajectory dataset D and a query trajectory T q , similar sub-trajectory search aims to find the sub-trajectory in D that is similar to T based on the similarity measure σ(·,·). q The most similar sub-trajectory T c [i * ,j * ], where the trajectory T c ∈D,
[0128] The present invention supports a wide range of downstream applications, including susceptible population mining, abnormal route detection, carpooling service optimization, etc., which helps urban traffic management, public safety improvement, smart city construction and other fields, and provides solid support for social and economic development. When searching for similar sub-trajectories in massive heterogeneous data, this method can ensure the accuracy, efficiency and robustness of the obtained results through the collaborative cooperation of the above two stages. The novel similar sub-trajectory search method proposed in the present invention focuses on the performance of searching in massive heterogeneous data, and has many advantages over the existing technology.
[0129] The above are only preferred embodiments of the present invention. It should be understood that the description of the above embodiments is only used to help understand the method and core ideas of the present invention, and is not used to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, etc. made within the ideas and principles of the present invention should be included in the scope of protection of the present invention.
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 data set, wherein the candidate set contains trajectories with similar sub-trajectories to the query trajectory, thereby reducing the subsequent search space; The sub-track positioning stage is used to accurately identify the sub-tracks of all tracks in the candidate set that are most similar to the query track.
2. A similar sub-trajectory search method based on massive heterogeneous data according to claim 1, characterized in that: The candidate set screening stage: its functions are realized 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; In order to improve the robustness to heterogeneous trajectories, in the candidate set screening stage, a trajectory contrast learning strategy is designed, and trajectory variants are generated through three trajectory enhancement methods to simulate the heterogeneous situations in the real world and optimize the training process.
3. The similar sub-trajectory search method based on massive heterogeneous data according to claim 2 is characterized in that: Trajectories exhibit two key mobility characteristics in similar sub-trajectory searches: structural characteristics and location characteristics; Among them, the structural features indicate the connectivity between points; while the location features indicate the precise coordinates, which are helpful 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.
4. The similar sub-trajectory search method based on massive heterogeneous data according to claim 2 is characterized in that: The comprehensive spatial embedding includes: ① Structural embedding: used to weaken the impact of site offset; First, the geographic 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, the graph attention network is used, and the formula is designed as follows: in, Yes i and v j The attention score between and is a trainable variable, Yes i The adjacent grid set; ReLU, Softmax and Concat represent activation, probability conversion and splicing operations respectively; By i Convert to the corresponding mesh 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 the average moving length Features β and l are 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 that the structural features and position features are naturally complementary in measuring trajectory similarity, richer spatial embeddings are mined through their interaction; First, S and L are respectively calculated through the weight matrix and Transformed into 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 in S' and Splice them together to get a comprehensive spatial embedding sequence 5. The similar sub-trajectory search method based on massive heterogeneous data according to claim 4 is characterized in that: The candidate set means that after sufficient training, the query trajectory and all trajectories in the data set are encoded as 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 the trajectories; by calculating the distance between the robust representation of the query trajectory and the robust representations 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 sub-trajectories similar to the query trajectory.
6. The similar sub-trajectory search method based on massive heterogeneous data according to claim 2 is characterized in that: It is not sufficient to rely solely on spatial embedding to calculate trajectory similarity; because a trajectory is a sequence of points, and the dependencies between points are also crucial to trajectory similarity, the sequence dependency capture module introduces position encoding and sequence encoder to capture the complex dependencies inherent in heterogeneous trajectories.
7. The similar sub-trajectory search method based on massive heterogeneous data according to claim 6 is characterized in that: The position encoding 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. Rotational attention encoding is used 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 the embedding dimension; Then, the embedding of each point in U is updated by multiplying by the corresponding rotation matrix, resulting in The sequence encoder is used to model sequence data more effectively by processing all elements in the entire sequence in parallel to focus on important global information while improving tolerance to errors; Specifically, a multi-head self-attention mechanism with n heads is used to capture the dependencies in the comprehensive spatial embedding sequence U', which is expressed as follows: M=Concat(head1,…,head n )W O , in: are the key, query, and value embeddings corresponding to I', is the output of the ith head, It is multi-head attention output; and is a trainable weight matrix, d'=d e / n indicates the dimension; In order to retain the overall features, M is processed by mean pooling to obtain the final trajectory representation 8. The similar sub-trajectory search method based on massive heterogeneous data according to claim 7, characterized in that: The trajectory contrastive learning strategy is to further enhance the robustness of trajectory representation by learning the similarity relationship under multiple heterogeneous trajectories; however, it is difficult to directly select similar trajectory pairs in the original heterogeneous data due to the indistinguishable movement patterns and high time cost; therefore, a contrastive learning paradigm without negative samples is adopted to optimize the training process; Since the idea of contrastive learning is to push different samples further away and bring two variant representations of the same sample closer together, three trajectory enhancement methods are designed to simulate real heterogeneous trajectories. 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 position deviation for trajectory points to help learn similarity under inaccurate data; the offset follows a bounded Gaussian distribution with a maximum value of 100 meters; ③Trajectory truncation: construct different sub-trajectories by cutting the prefix, suffix or both of the trajectory, thereby helping to learn the similarity between partial sequences and complete sequences; Specifically: 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 generated by a multi-layer perceptron projector to generate z1 and z2, and then by 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 the dataset D can be encoded into a robust representation; the trajectories in D are sorted according to the Euclidean distance with the query representation, and the smaller the value, the higher the 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 l tracks is: 500 tracks.
9. The similar sub-trajectory search method based on massive heterogeneous data according to claim 1, characterized in that: The sub-trajectory positioning stage: its functions are realized 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 correlations between the robust representations of two trajectories and generate interactive representations.
10. The similar sub-trajectory search method based on massive heterogeneous data according to claim 9, 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 pre-trained spatial feature extraction module and sequence dependency capture module are used to form a trajectory encoding 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 interactive representation means that independently considering or simply concatenating the query trajectory and the candidate trajectory may miss the important correlation between them. It is more effective to integrate them through the attention mechanism. However, if only paying attention to the unidirectional transmission of information from one trajectory to another, the inaccurate data in the heterogeneous trajectory will be inappropriately emphasized. Therefore, the cross-trajectory information fusion module performs point-to-point interaction in both the query-to-candidate and candidate-to-query directions, and dynamically combines the results. This process allows reliable data from one direction to be used to mitigate errors from another direction, thus facilitating focused analysis on relevant points; Specifically, 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 qc =Softmax(R' c T R' q )' q , R cq =Softmax(max(R' c T R' q ))R' c , R f =Concat(R' c ,R qc ,R' c ⊙R qc ,R' c ⊙R cq ), in, and After attention weight The transformed intermediate 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; ③ Sub-trajectory interval prediction module: used to predict the starting and ending points of similar sub-trajectories; 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 tolerance to missing and inaccurate data; therefore, the sub-trajectory interval prediction module uses the global, start point and end point feature encoders based on the attention mechanism to extract the key points from the interaction representation R f The features corresponding to similar sub-trajectories are extracted and expressed as Then, the probabilities of the start and end points of similar sub-trajectories are predicted respectively 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. They 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, a sub-track similar to the query track can be identified in each candidate track; finally, all the similar sub-tracks are sorted according to the interval length, so as to determine the most similar sub-track as the final search result.
Citation Information
Patent Citations
Hotspot path mining method based on longest common sub-trajectory density clustering
CN111897805A
Vehicle control delay prediction method based on hypergraph model
CN114548495A
Track similarity measurement method based on track embedding
CN115062703A
Accompanying vehicle identification method based on semantic trajectory
CN115359437A
Similarity query optimization method based on trajectory representation learning
CN115544070A