A trajectory similarity matching method based on low-precision random sampling data
By preprocessing and segmenting low-precision non-continuous trajectory data, the effective distance, effective length and effective trajectory points of the trajectory are calculated, which solves the problem that traditional methods cannot analyze the similarity of low-precision trajectory, and realizes the effective similarity of low-precision data degree assessment.
Patent Information
- Application Number
- CN202111195764.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-14
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2041-10-14
AI Technical Summary
Traditional methods cannot effectively analyze trajectory similarity when processing low-precision discontinuous trajectory data.
By preprocessing the original data of low-precision non-continuous trajectory points, segmenting the trajectory points of different targets, finding similar trajectory segments of the trajectory, and calculating the effective distance, effective length and number of effective trajectory points, and finally calculating the similarity of the trajectory.
In the case of low-precision random sampling data, this method can effectively evaluate the trajectory similarity, avoid the shortcomings of traditional methods, can process low-precision data and provide accurate similarity rankings.
Smart Images

Figure CN114048792B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of trajectory similarity matching, and in particular to a trajectory similarity matching method based on low-precision random sampling data. Background Art
[0002] Trajectory information has important value in the fields of transportation, navigation, aerospace, etc., and is now inseparable from people's production and life. People's research on trajectory similarity is also constantly developing and improving. The higher the accuracy of the trajectory points in the trajectory information and the denser the sampling, the easier it is to evaluate the trajectory similarity and the higher the accuracy.
[0003] However, in actual production life, the trajectory information we obtain may have low accuracy of trajectory points and uncertain sampling intervals due to technical reasons, which greatly increases the difficulty of analyzing the target trajectory. When all points in the target's trajectory may have deviations within a certain range, the trajectory will appear chaotic, and the traditional method cannot be used to analyze the similarity of the trajectory. Summary of the invention
[0004] The present invention aims to provide a trajectory similarity matching method based on low-precision randomly sampled data to solve the problem that traditional methods cannot analyze trajectory similarity in the case of low-precision non-continuous data.
[0005] The present invention provides a trajectory similarity matching method based on low-precision random sampling data, comprising the following steps:
[0006] Step 1: preprocessing the original data of low-precision discontinuous trajectory points to obtain target data;
[0007] Step 2: determine the trajectory points of different targets in the target data and segment the trajectory points belonging to different targets to obtain the trajectories of different targets;
[0008] Step 3: Find two different targets and pair all the trajectories under different targets.
[0009] Step 4: Process the two paired trajectories under two different targets to obtain two similar trajectory segments of the two trajectories;
[0010] Step 5, calculating the effective distance, effective length and effective trajectory points of the two trajectories respectively according to the two similar trajectory segments;
[0011] Step 6, calculating the similarity of the two trajectories according to the effective distance, effective length and effective trajectory points of the two trajectories;
[0012] Step 7: Repeat steps 3 to 6 until the similarities of all trajectories under all targets are calculated;
[0013] Step 8: sort the similarities of all trajectories under all targets to obtain the similarity ranking of each trajectory with other trajectories.
[0014] Furthermore, the method for preprocessing the raw data of low-precision discontinuous trajectory points in step 1 is:
[0015] The original data of low-precision non-continuous trajectory points are classified according to the target, and the trajectory points are time-sorted according to the time of the trajectory points. After the time sorting is completed, the target data is obtained.
[0016] Furthermore, in step 2, the method for judging the trajectory points of different targets in the target data and segmenting the trajectory points belonging to different targets is:
[0017] The trajectory points of different targets in the target data are judged. When the time interval between two trajectory points is greater than the set time threshold, the two trajectory points are considered to belong to two segments of trajectory. The trajectory points are segmented to obtain the trajectories of different targets.
[0018] Furthermore, in step 4, the two paired trajectories under two different targets are processed to obtain two similar trajectory segments of the two trajectories as follows:
[0019] Process the paired trajectories A and B under two different targets, and find the trajectory points in trajectory A and trajectory B whose distance is less than the set distance threshold as sets {a} and {b};
[0020] According to the starting trajectory point and the ending trajectory point in the set {a}, the trajectory segment A1 in the trajectory A is intercepted, and according to the starting trajectory point and the ending trajectory point in the set {b}, the trajectory segment B1 in the trajectory B is intercepted. The trajectory segment A1 and the trajectory segment B1 are similar trajectory segments of the two trajectories.
[0021] Furthermore, in step 5, the method for calculating the number of valid trajectory points of the two trajectories according to the two similar trajectory segments is:
[0022] The number of trajectory points of the trajectory segment A1 and the trajectory segment B1 is the number of valid trajectory points N and M of the two trajectories.
[0023] Furthermore, if the number of trajectory points in trajectory segment A1 or trajectory segment B1 is less than a set number threshold, it is considered that trajectory A and trajectory B are not similar, and their similarity is 0.
[0024] Furthermore, in step 5, the method for respectively calculating the effective distances of the two trajectories according to the two similar trajectory segments is:
[0025] Determine the shorter and longer trajectories of trajectory A and trajectory B;
[0026] Find the track point in the shorter track that is closest to the longer track, and the track point in the longer track that is closest to the shorter track, take these two track points out, and then take the two closest track points from the remaining track points, until all the track points in the shorter track are taken out, and calculate the first distance between the two track points taken out each time;
[0027] Find the trajectory point closest to the shorter trajectory from the remaining trajectory points of the longer trajectory, and calculate the second distance between each remaining trajectory point of the longer trajectory and the shorter trajectory;
[0028] The average of the first distance and the second distance is calculated as the effective distance for evaluating the two trajectories.
[0029] Furthermore, in step 5, the method for respectively calculating the effective lengths of the two trajectories according to the two similar trajectory segments is:
[0030] The maximum value a0 and the minimum value a1 of the longitude, the maximum value b0 and the minimum value b1 of the latitude of trajectory segment A1 are obtained; the maximum value a2 and the minimum value a3 of the longitude, the maximum value b2 and the minimum value b3 of the latitude of trajectory segment B1 are obtained; the four longitude values of trajectory segment A1 and trajectory segment B1 are sorted and formed into a set {a0, a1, a2, a3}, and the four latitude values are sorted and formed into a set {b0, b1, b2, b3}; the product of |a1-a2| and |b1-b2| is the similarity area of the two trajectories, and the ratio of the similarity area of the two trajectories to the effective distance of the two trajectories is taken as the effective length of the two trajectories.
[0031] Furthermore, if the minimum longitude and latitude of one trajectory are both greater than the maximum longitude and latitude of another trajectory, the similarity between the two trajectories is considered to be 0.
[0032] Furthermore, in step 6, the method for calculating the similarity of the two trajectories according to the effective distance, effective length and effective trajectory points of the two trajectories is:
[0033]
[0034] Among them, P is the similarity of the two trajectories; H is the effective distance between the two trajectories; L is the effective length of the two trajectories.
[0035] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:
[0036] 1. Compared with the traditional trajectory similarity matching technology, the present invention has a better effect when the trajectory data has a higher precision and a higher sampling rate. When the positioning data has a poor precision and the data sampling rate is uncertain, the method can still evaluate the trajectory similarity well, while the traditional trajectory similarity matching technology is not suitable for processing low-precision randomly sampled trajectory data.
[0037] 2. The present invention can evaluate the trajectory similarity as a whole. It does not directly calculate the similarity of the trajectory. Instead, it first extracts similar trajectory segments from the trajectory and then processes the similar trajectory segments. This will remove the singular trajectory points at the head or tail of the trajectory, and can more truly reflect the similarity of the trajectory. At the same time, the improved dynamic path planning algorithm is used to evaluate the effective distance of the trajectory, and the ratio of the similar area of the trajectory to the effective distance of the trajectory is used as the effective length of the trajectory. Both of these evaluate the trajectory similarity from a holistic perspective.
[0038] 3. The present invention does not directly use the number of trajectory points of two trajectories to evaluate the trajectory similarity, but evaluates it based on the number of valid trajectory points. At the same time, the number of valid trajectory points of the two trajectories and the ratio of the minimum to the maximum number of valid trajectory points in the two trajectories are used as the measurement indicators of trajectory similarity. When the number of valid trajectory points is larger and the trajectory distribution is more balanced, the similarity is higher; the logarithmic function is used to process its influence to prevent linear growth, which is more in line with the actual situation. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0040] Figure 1 The figure is a flow chart of a trajectory similarity matching method based on low-precision random sampling data according to an embodiment of the present invention.
[0041] Figure 2 Schematic diagram of similar trajectory segment extraction according to an embodiment of the present invention. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0043] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0044] Example
[0045] like Figure 1 As shown, this embodiment proposes a trajectory similarity matching method based on low-precision random sampling data, including the following steps:
[0046] Step 1: Preprocess the raw data of low-precision discontinuous trajectory points to obtain target data:
[0047] The original data of low-precision non-continuous trajectory points are classified according to the target, and the trajectory points are time-sorted according to the time of the trajectory points. After the time sorting is completed, the target data is obtained.
[0048] Step 2: judge the trajectory points of different targets in the target data and segment the trajectory points belonging to different targets to obtain the trajectories of different targets:
[0049] The trajectory points of different targets in the target data are judged. When the time interval between two trajectory points is greater than the set time threshold, the two trajectory points are considered to belong to two segments of trajectory. The trajectory points are segmented to obtain the trajectories of different targets.
[0050] Step 3: Find two different targets and pair all the trajectories under different targets.
[0051] Step 4: Process the two paired trajectories under two different targets to obtain two similar trajectory segments of the two trajectories:
[0052] Process the paired trajectories A and B under two different targets, and find the trajectory points in trajectory A and trajectory B whose distance is less than the set distance threshold as sets {a} and {b};
[0053] According to the starting trajectory point and the ending trajectory point in the set {a}, the trajectory segment A1 in the trajectory A is intercepted, and according to the starting trajectory point and the ending trajectory point in the set {b}, the trajectory segment B1 in the trajectory B is intercepted. The trajectory segment A1 and the trajectory segment B1 are similar trajectory segments of the two trajectories.
[0054] like Figure 2 As shown, the similar trajectory segment between trajectory A and trajectory B is a n+1 a m With b i+1 b j , an+1 The previous trajectory point and a m The distance from the subsequent trajectory point to all trajectory points of trajectory B is greater than the set distance threshold, b i+1 The previous trajectory point and b j The distances from the subsequent trajectory points to all trajectory points in trajectory A are greater than the set distance threshold.
[0055] Step 5: Calculate the effective distance, effective length and effective trajectory points of the two trajectories based on the two similar trajectory segments:
[0056] (1) Valid points
[0057] The number of trajectory points of trajectory segment A1 and trajectory segment B1 is the number of valid trajectory points N and M of the two trajectories. If the number of trajectory points in trajectory segment A1 or trajectory segment B1 is less than a set number threshold (the set number threshold can be taken as 2), it is considered that trajectory A and trajectory B are not similar, and their similarity is 0.
[0058] (2) Effective distance
[0059] Determine the shorter and longer trajectories of trajectory A and trajectory B;
[0060] Find the track point in the shorter track that is closest to the longer track, and the track point in the longer track that is closest to the shorter track, take these two track points out, and then take the two closest track points from the remaining track points, until all the track points in the shorter track are taken out, and calculate the first distance between the two track points taken out each time;
[0061] Find the trajectory point closest to the shorter trajectory from the remaining trajectory points of the longer trajectory, and calculate the second distance between each remaining trajectory point of the longer trajectory and the shorter trajectory;
[0062] The mean value H of the distance is obtained according to the first distance and the second distance as the effective distance for evaluating the two trajectories.
[0063] (3) Effective length
[0064] The maximum value a0 and the minimum value a1 of the longitude of the trajectory segment A1, the maximum value b0 and the minimum value b1 of the latitude are obtained; the maximum value a2 and the minimum value a3 of the longitude of the trajectory segment B1, the maximum value b2 and the minimum value b3 of the latitude are obtained; the four longitude values of the trajectory segment A1 and the trajectory segment B1 are sorted and formed into a set {a0, a1, a2, a3}, and the four latitude values are sorted and formed into a set {b0, b1, b2, b3}; the product of |a1-a2| and |b1-b2| is the similarity area of the two trajectories, and the ratio of the similarity area of the two trajectories to the effective distance of the two trajectories is taken as the effective length L of the two trajectories. Among them, if the minimum values of the longitude and latitude of one trajectory are both greater than the maximum values of the longitude and latitude of the other trajectory, the similarity of the two trajectories is considered to be 0.
[0065] Step 6: Calculate the similarity of the two trajectories based on their effective distance, effective length, and effective trajectory points:
[0066]
[0067] Among them, P is the similarity of the two trajectories. When the effective distance between the two trajectories is closer, the effective length is longer, the number of trajectory points is more, and the distribution is balanced, the similarity is higher; the logarithmic function is used to process its influence to prevent linear growth.
[0068] Step 7: Repeat steps 3 to 6 until the similarities of all trajectories under all targets are calculated;
[0069] Step 8: sort the similarities of all trajectories under all targets to obtain the similarity ranking of each trajectory with other trajectories.
[0070] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A trajectory similarity matching method based on low-precision random sampling data, characterized in that: The steps include: Step 1: preprocessing the original data of low-precision discontinuous trajectory points to obtain target data; Step 2: judge the trajectory points of different targets in the target data and segment the trajectory points belonging to different targets to obtain the trajectories of different targets; Step 3: Find two different targets and pair all the trajectories under different targets. Step 4: Process the two paired trajectories under two different targets to obtain two similar trajectory segments of the two trajectories; Step 5, calculating the effective distance, effective length and effective trajectory points of the two trajectories respectively according to the two similar trajectory segments; The method for calculating the effective distance between two trajectories based on two similar trajectory segments is: Determine the shorter and longer trajectories in paired trajectories A and B under two different goals; Find the track point in the shorter track that is closest to the longer track, and the track point in the longer track that is closest to the shorter track, take these two track points out, and then take the two closest track points from the remaining track points, until all the track points in the shorter track are taken out, and calculate the first distance between the two track points taken out each time; Find the trajectory point closest to the shorter trajectory from the remaining trajectory points of the longer trajectory, and calculate the second distance between each remaining trajectory point of the longer trajectory and the shorter trajectory; The average of the first distance and the second distance is calculated as the effective distance for evaluating the two trajectories; The method for calculating the effective lengths of two trajectories based on two similar trajectory segments is: Get the maximum longitude of track segment A1 a 0 and minimum value a 1. Maximum value of latitude b 0 and minimum value b 1; Get the longitude of track segment B1 a 2 Maximum and minimum values a 3. Maximum value of latitude b 2 and minimum b 3; The four longitude values of the track segment A1 and the track segment B1 are sorted and formed into a set { a 0, a 1, a 2, a 3}, sort the four latitude values and form a set { b 0, b 1, b 2, b 3};| a 1- a 2|with| b 1- b The product of 2| is the similar area of the two trajectories, and the ratio of the similar area of the two trajectories to the effective distance of the two trajectories is the effective length of the two trajectories; The method for calculating the number of effective trajectory points of two trajectories based on two similar trajectory segments is: The number of trajectory points of trajectory segment A1 and trajectory segment B1 is the number of valid trajectory points N and M of the two trajectories; Step 6: Calculate the similarity of the two trajectories based on their effective distance, effective length, and effective trajectory points: Among them, P is the similarity of the two trajectories; H is the effective distance between the two trajectories; L is the effective length of the two trajectories; Step 7: Repeat steps 3 to 6 until the similarities of all trajectories under all targets are calculated; Step 8: sort the similarities of all trajectories under all targets to obtain the similarity ranking of each trajectory with other trajectories.
2. The trajectory similarity matching method based on low-precision random sampling data according to claim 1 is characterized in that: The method for preprocessing the raw data of low-precision discontinuous trajectory points in step 1 is: The original data of low-precision non-continuous trajectory points are classified according to the target, and the trajectory points are time-sorted according to the time of the trajectory points. After the time sorting is completed, the target data is obtained.
3. The trajectory similarity matching method based on low-precision random sampling data according to claim 2 is characterized in that: In step 2, the method for judging the trajectory points of different targets in the target data and segmenting the trajectory points belonging to different targets is: The trajectory points of different targets in the target data are judged. When the time interval between two trajectory points is greater than the set time threshold, the two trajectory points are considered to belong to two segments of trajectory. The trajectory points are segmented to obtain the trajectories of different targets.
4. The trajectory similarity matching method based on low-precision random sampling data according to claim 3 is characterized in that: In step 4, the two paired trajectories under two different targets are processed to obtain two similar trajectory segments of the two trajectories as follows: Process the paired trajectories A and B under two different targets, and find the trajectory points in trajectory A and trajectory B whose distance is less than the set distance threshold as sets {a} and {b}; According to the starting trajectory point and the ending trajectory point in the set {a}, the trajectory segment A1 in the trajectory A is intercepted, and according to the starting trajectory point and the ending trajectory point in the set {b}, the trajectory segment B1 in the trajectory B is intercepted. The trajectory segment A1 and the trajectory segment B1 are similar trajectory segments of the two trajectories.
5. The trajectory similarity matching method based on low-precision random sampling data according to claim 4 is characterized in that: If the number of trajectory points in trajectory segment A1 or trajectory segment B1 is less than the set number threshold, it is considered that trajectory A and trajectory B are not similar, and their similarity is 0.
6. The trajectory similarity matching method based on low-precision random sampling data according to claim 5 is characterized in that: If the minimum longitude and latitude of one trajectory are both greater than the maximum longitude and latitude of another trajectory, the similarity between the two trajectories is considered to be 0.