Space-time trajectory similarity query method based on improved LCSS
Through the improved LCSS algorithm and distributed architecture, combined with heading information, the trajectory similarity comprehensively evaluates the trajectory similarity of traditional methods when dealing with inland ship trajectory data is solved, and a more accurate and efficient space-time trajectory similarity query is achieved.
Patent Information
- Application Number
- CN202411838462.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-08
AI Technical Summary
When processing inland ship trajectory trajectory data, traditional spatiotemporal trajectory similarity matching methods are difficult to accurately reflect the actual similarity between trajectories, especially in the presence of noise and outliers.
The improved LCSS algorithm is adopted, combined with heading information, and the similarity between trajectories is comprehensively evaluated, and the query process is optimized through a distributed architecture to improve efficiency.
It improves the accuracy and efficiency of space-time trajectory similarity query, can more accurately identify navigation trajectories with similar motion patterns, and effectively handle noise and outliers.
Smart Images

Figure CN119782438A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of waterway traffic control and relates to a space-time trajectory similarity query method based on improved LCSS. Background Art
[0002] The Automatic Identification System (AIS) is a widely used digital navigation aid system and equipment. Ship dynamic information such as ship position, speed, rate of change of heading and heading, as well as ship static information such as ship name, call sign, draft, dangerous goods, etc. can be broadcast and communicated between AIS stations and AIS base stations via VHF radio waves to ensure maritime traffic safety. At present, there are hundreds of thousands of ships installed with AIS in the world, and the global monthly AIS data volume can reach hundreds of GB. Among them, each AIS dynamic message can be regarded as a time and space trajectory point of the ship. Therefore, these accumulated AIS data contain a large amount of historical ship trajectory data. Through the analysis and mining of historical ship trajectory data, it can provide good solutions for route optimization, abnormal behavior monitoring, false target identification, port throughput statistical analysis, etc.
[0003] Inland AIS spatiotemporal trajectory similarity query is a data analysis technology that can identify navigation trajectories with similar motion patterns or behavioral characteristics from a spatiotemporal trajectory database. This technology uses a predefined similarity metric (similarity criterion) to judge the similarity of two trajectories and find trajectories from the data set that are close to a given sample or query object in specific features. Its main goal is to support applications such as navigation behavior analysis, navigation safety monitoring, and waterway management optimization by revealing the similarities between ships in terms of motion direction, speed, stay time, and path selection.
[0004] At present, the technical methods for spatiotemporal trajectory similarity matching are mainly based on information technologies such as data mining and machine learning. By preprocessing the spatiotemporal trajectory data, extracting features, and calculating similarity, the similarity evaluation between different ship trajectories can be achieved. Among them, similarity calculation is the core link, and commonly used methods include Euclidean distance and dynamic time warping (DTW). These methods can reflect the similarity between trajectories to a certain extent, but they still face some challenges when processing inland ship trajectory data. For example, the navigation speed of inland ships is usually slow, the time span of trajectory data is large, and it is greatly affected by the environment. Therefore, traditional similarity calculation methods may not accurately reflect the actual similarity between trajectories. In addition, the trajectory data of inland ships often contains noise and outliers, which also increases the difficulty of similarity matching.
[0005] Compared with other similarity measurement algorithms, the traditional LCSS algorithm has the ability to handle trajectories of different lengths and reduce the impact of noise. At the same time, it can solve the problem of using Euclidean distance to measure similarity when the number of trajectory points is different and the problem of being unable to handle strong noise point restrictions. However, there are still some shortcomings in the traditional LCSS distance measurement of trajectory similarity. The main reasons are as follows: When evaluating the similarity of two spatiotemporal trajectory data sequences, the traditional longest common subsequence (LCSS) distance algorithm mainly focuses on the matching of spatial positions, but does not fully integrate the comprehensive information of time and space dimensions, which is crucial in inland waterway analysis. When the similarity is measured based solely on spatial position, if the two spatiotemporal trajectories are close in space but significantly different in time dimension, the method may still misjudge the two spatiotemporal trajectories as highly similar. In this case, although the spatial positions are close, the significant difference in time points to the essential difference of the trajectories. Similarly, if only time matching is considered and spatial differences, such as heading changes, are ignored, it may also lead to an incorrect assessment of trajectory similarity. Therefore, the similarity measurement based solely on spatial position cannot fully reflect the actual similarity relationship between trajectories. Summary of the invention
[0006] In view of this, the purpose of the present invention is to provide a space-time trajectory similarity query method based on improved LCSS. For the spatial position similarity query of short space-time trajectory segments and specific short time periods, similarity analysis is performed by comprehensively calculating the spatial position distance between two ship trajectories, thereby improving the query accuracy. At the same time, through the distributed architecture, the efficiency of the query process is further optimized.
[0007] In order to achieve the above object, the present invention provides the following technical solutions:
[0008] A spatiotemporal trajectory similarity query method based on improved LCSS includes the following steps:
[0009] S1: Input the trajectory to be queried and the query time range, and set the similarity distance threshold and time span threshold;
[0010] S2: Analyze the spatial range of the trajectory to be checked and generate spatial range partitions;
[0011] S3: According to the spatial range and time range, query the space-time range spatiotemporal trajectory database, then perform voyage extraction on the retrieved data to generate a set of spatiotemporal trajectories to be matched;
[0012] S4: Calculate the time span of the spatiotemporal trajectory data to be queried, and then compare this time span with the time span of each trajectory in the spatiotemporal trajectory set to be matched, preliminarily screen out the trajectories whose time length falls within a preset interval, and form a screened new spatiotemporal trajectory set;
[0013] S5: assigning the filtered spatiotemporal trajectory set to a distributed cluster for similarity distance calculation, wherein the similarity distance calculation adopts an LCSS distance algorithm and introduces heading information to evaluate the similarity between trajectories;
[0014] S6: According to the similarity distance calculation result, the trajectories whose LCSS distance to the query trajectory is greater than or equal to the preset threshold are retained as similar trajectories, otherwise they are not retained. Finally, the retained trajectories are sorted according to the similarity to obtain the final similar trajectory list.
[0015] In S5, the filtered spatiotemporal trajectory set Tras news Assign to the distributed cluster, consider two ship trajectories respectively A=(a1,a2,...,a m ) and B=(b1,b2,...,b n ), where a m represents the mth trajectory point, b n Represents the nth trajectory point, and the LCSS distance between trajectories A and B is defined as follows:
[0016]
[0017] Where ε represents the threshold for measuring the similarity between trajectory points, i = 1, 2, ..., m, j = 1, 2, ..., n; dist(a i ,b j ) represents the distance between two points. i is a point in trajectory A, b j is a track point in track B, and the distance is calculated using the Euclidean distance:
[0018]
[0019] in, Represents trajectory point a i longitude and latitude; Represent the trajectory point b j longitude and latitude;
[0020] If dist(a i ,b i )≤ε, then the two points are considered similar; the longest common subsequence LCSS(A,B) represents the number of pairs of points judged to be similar in the two trajectories. The larger the ratio of the total number of points in the entire trajectory, the greater the similarity of the two trajectories; the trajectory similarity expression is as follows:
[0021]
[0022] In the formula, max(n,m) represents the maximum value of the total number of points of the two trajectories; when D L The value of (A,B) is [0,1]. The closer to 1, the more similar the trajectories are. A value of 1 indicates that the two trajectories overlap, and a value of 0 indicates that the two trajectories are completely dissimilar.
[0023] Furthermore, the similarity distance calculation adopts a distributed architecture, and the similarity distance calculation task is assigned to multiple nodes for parallel processing.
[0024] The beneficial effects of the present invention are:
[0025] (1) The improved LCSS algorithm not only considers the spatial position of the trajectory, but also introduces heading information to more comprehensively evaluate the similarity between trajectories, thereby improving the query accuracy and being able to more accurately identify navigation trajectories with similar motion patterns or behavioral characteristics.
[0026] (2) The LCSS algorithm itself has strong anti-noise ability and can effectively process noise and outliers in trajectory data, further improving the reliability of query results.
[0027] (3) Through the distributed architecture, the similarity distance calculation task is assigned to multiple nodes for parallel processing, which greatly improves the query efficiency and can quickly respond to the query needs of large-scale spatiotemporal trajectory data.
[0028] (4) The present invention supports the query of short spatiotemporal trajectory segments and specific short time periods, and can meet the query requirements in different application scenarios.
[0029] (5) The present invention can be applied to multiple fields such as route optimization, abnormal behavior monitoring, false target identification, port throughput statistical analysis, etc., providing effective technical support for inland waterway traffic control.
[0030] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:
[0032] Figure 1 It is a flow chart of the present invention. DETAILED DESCRIPTION
[0033] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.
[0034] Among them, the drawings are only used for illustrative explanations, and they only represent schematic diagrams rather than actual pictures, and should not be understood as limitations on the present invention. In order to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.
[0035] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "front", "rear", etc. indicate the orientation or position relationship, they are based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation. Therefore, the terms describing the position relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.
[0036] A large-scale trajectory data similarity query method based on multi-level index structure (202110340933.5) proposes a query method based on a grid index module based on the spatial grid index idea and a start-end index-feature point index secondary index mechanism based on feature trajectory representation.
[0037] Although the spatiotemporal trajectory similarity query method based on local sensitive hashing has the characteristics of efficient index structure, fast query response and good scalability in solving large-scale spatiotemporal trajectory data, its accuracy and efficiency are still insufficient when processing short trajectory segments and specific short time period queries. At the same time, this method focuses more on analyzing the movement changes of trajectories, and is still insufficient in application scenarios that require more accurate similarity queries on the spatial positions of spatiotemporal trajectories.
[0038] LCSS distance (Longest Common Subsequence Distance) provides a method to evaluate the similarity of two sequences by finding the longest common subsequence in the two sequences:
[0039] Consider two ship trajectory time series A = (a1, a2, a3, ..., a n ) and B=(b1,b2,b3,...,b n ), by calculating the LCSS distance between the two trajectories, their similarity can be measured. The core of the LCSS distance is to identify the longest common subsequence in the two trajectories that maintains the same relative order, and then comprehensively evaluate the similarity between the trajectories based on the characteristics of this longest common subsequence. This method considers both the spatial attributes of the trajectory and the temporal attributes of the trajectory when processing trajectory data, making the similarity evaluation more comprehensive and accurate. The definition expression of the LCSS distance between trajectories A and B is as follows:
[0040]
[0041] Where ε represents the threshold for measuring the similarity between trajectory point pairs, i = 1, 2, ..., m, j = 1, 2, ..., n. dist(a i ,b j ) represents the distance measurement formula between two points. If dist(a i ,b i )≤ε, then the two points are considered similar. The longest common subsequence LCSS(A,B) represents the number of pairs of points in the two trajectories that are determined to be similar. The greater the ratio of the total number of points in the entire trajectory, the greater the similarity of the two trajectories. The trajectory similarity expression is as follows:
[0042]
[0043] In the formula, max(n,m) represents the maximum value of the total number of points of the two trajectories. L The value of (A,B) is [0,1]. The closer to 1, the more similar the trajectories are. A value of 1 indicates that the two trajectories overlap, and a value of 0 indicates that the two trajectories are completely dissimilar.
[0044] See also Figure 1 The present invention proposes a spatiotemporal trajectory similarity query method based on improved LCSS, comprising the following steps:
[0045] S1: Input the trajectory to be queried Q and the query time range T range , set the similarity distance threshold ε and time span threshold λ.
[0046] S2: Use Google's S2 algorithm to analyze the spatial range of the trajectory Q to be queried and generate spatial range partitions;
[0047] S3: According to the spatial range and time range, query the space-time range spatiotemporal trajectory database, then perform voyage extraction on the retrieved data to generate a spatiotemporal trajectory set Tras to be matched.
[0048] S4: Calculate the time span T of the spatiotemporal trajectory data to be queried, and then compare this time span with the time span of each trajectory in the spatiotemporal trajectory set Tras to be matched. The purpose is to preliminarily select those trajectories whose time length falls within the interval [T-λT,T+λT] to form a new spatiotemporal trajectory set Tras after screening. news .
[0049] S5: Calculate the similarity distance. news Assign to the distributed cluster, consider two ship trajectories respectively A=(a1,ab2,...,a m ) and B=(b1,b2,...,b n ), the LCSS distance between trajectories A and B is defined as follows:
[0050]
[0051] Where ε represents the threshold for measuring the similarity between trajectory point pairs, i = 1, 2, ..., m, j = 1, 2, ..., n. dist(a i ,b j ) represents the distance measurement formula between two points. The distance can be calculated using the Euclidean distance.
[0052]
[0053] If dist(a i ,b i )≤ε, then the two points are considered similar. The longest common subsequence LCSS(A,B) represents the number of pairs of points in the two trajectories that are determined to be similar. The greater the ratio of the total number of points in the entire trajectory, the greater the similarity of the two trajectories. The trajectory similarity expression is as follows:
[0054]
[0055] In the formula, max(n,m) represents the maximum value of the total number of points of the two trajectories. L The value of (A,B) is [0,1]. The closer it is to 1, the more similar the trajectories are. A value of 1 indicates that the two trajectories overlap, and a value of 0 indicates that the two trajectories are completely dissimilar.
[0056] S6: Dist(a in LCSS distance algorithm i ,b j ) In addition to calculating the spatial position distance between the point on trajectory A and the point on trajectory B, heading information is also introduced to more comprehensively evaluate the similarity between trajectories. The improved LCSS distance algorithm is calculated as follows:
[0057]
[0058] in β is the trajectory point a i With trajectory point b j The heading difference is θ, where θ is the heading angle. i ,b j ) is the trajectory point a i With trajectory point b j The comprehensive distance.
[0059] For those trajectories whose LCSS distance to the query trajectory is greater than or equal to the threshold ε, they are retained as similar trajectories; conversely, if the distance is less than ε, these trajectories are not considered. In this way, similar trajectories are evaluated and retained one by one, and finally the retained trajectories are sorted according to similarity to obtain the final list of similar trajectories.
[0060] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.
Claims
1. A spatiotemporal trajectory similarity query method based on improved LCSS, characterized by: The following steps are involved: S1: Input the trajectory to be queried and the query time range, and set the similarity distance threshold and time span threshold; S2: Analyze the spatial range of the trajectory to be checked and generate spatial range partitions; S3: According to the spatial range and time range, query the space-time range spatiotemporal trajectory database, then perform voyage extraction on the retrieved data to generate a set of spatiotemporal trajectories to be matched; S4: Calculate the time span of the space-time trajectory data to be queried, and then compare this time span with the time span of each trajectory in the space-time trajectory set to be matched, preliminarily screen out the trajectories whose time length falls within a preset interval, and form a screened new space-time trajectory set; S5: assigning the filtered spatiotemporal trajectory set to a distributed cluster for similarity distance calculation, wherein the similarity distance calculation adopts an LCSS distance algorithm and introduces heading information to evaluate the similarity between trajectories; S6: According to the similarity distance calculation result, the trajectories whose LCSS distance to the query trajectory is greater than or equal to the preset threshold are retained as similar trajectories, otherwise they are not retained. Finally, the retained trajectories are sorted according to the similarity to obtain the final similar trajectory list.
2. The spatiotemporal trajectory similarity query method based on improved LCSS according to claim 1, characterized in that: In S5, the filtered spatiotemporal trajectory set Tras news Assign to the distributed cluster, consider two ship trajectories respectively A=(a1,a2,…,a m ) and B=(b1,b2,…,b n ), where a m represents the mth trajectory point, b n Represents the nth trajectory point, and the LCSS distance between trajectories A and B is defined as follows: Where ε represents the threshold for measuring the similarity between trajectory points, i = 1, 2, ..., m, j = 1, 2, ..., n; dist(a i ,b j ) represents the distance measurement formula between two points, a i is a point in trajectory A, b j is a track point in track B, and the distance is calculated using the Euclidean distance: in, Represents trajectory point a i longitude and latitude; Represent the trajectory point b j longitude and latitude; If dist(a i ,b i )≤ε, then the two points are considered similar; the longest common subsequence LCSS(A,B) represents the number of pairs of points judged to be similar in the two trajectories. The larger the ratio of the total number of points in the entire trajectory, the greater the similarity of the two trajectories; the trajectory similarity expression is as follows: In the formula, max(n,m) represents the maximum value of the total number of points of the two trajectories; when D L The value of (A,B) is [0,1]. The closer to 1, the more similar the trajectories are. A value of 1 indicates that the two trajectories overlap, and a value of 0 indicates that the two trajectories are completely dissimilar.
3. A spatiotemporal trajectory similarity query method based on improved LCSS according to claim 1 or 2, characterized in that: The similarity distance calculation adopts a distributed architecture, and the similarity distance calculation task is assigned to multiple nodes for parallel processing.
Citation Information
Patent Citations
A similarity query method for large-scale trajectory data based on multi-level index structure
CN113051359B
Mass trajectory similarity calculation method based on improved LCSS algorithm
CN111523577A
Ship AIS trajectory clustering method and device based on convolution auto-encoder
CN111694913A
Space-time trajectory similarity query method based on pivot point
CN118035575A
Cited By
Inland ship trajectory complementing method and system based on multi-source data
CN120973878A