Trajectory similarity calculation method, device and equipment and computer readable storage medium

By introducing a time factor to filter out outliers and selecting time-related data points, and combining it with the Hausdorf algorithm, the problems of the Hausdorf algorithm's sensitivity to outliers and high computational complexity are solved, thereby improving the accuracy and efficiency of trajectory similarity calculation.

CN116680582BActive Publication Date: 2026-03-24PING AN BANK CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-02
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

In existing technologies, the Hausdorff algorithm is sensitive to outliers and has high computational complexity, resulting in inaccurate trajectory similarity calculations and computational complexity.

Method used

By introducing a time factor, a dynamic distance threshold is used to filter out abnormal data points, and a time threshold is used to select data points with temporal correlation. The Hausdorff algorithm is then used to calculate trajectory similarity.

Benefits of technology

It effectively identifies and removes outliers, reduces computational complexity, and improves the accuracy and efficiency of trajectory similarity calculation, especially in large-scale trajectory calculation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116680582B_ABST
    Figure CN116680582B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a trajectory similarity calculation method, a trajectory similarity calculation device, a computer device and a computer readable storage medium. The trajectory similarity calculation method comprises the following steps: obtaining a data point set of a processing object, the data point set comprising a plurality of first data points; obtaining a dynamic distance threshold according to time information and speed information of each pair of first data points, to filter out abnormal data points in the data point set to obtain second data points; obtaining a first trajectory of the processing object according to the second data points; obtaining a second trajectory, the second trajectory being composed of a plurality of third data points; obtaining a time threshold, and selecting fourth data points from the plurality of third data points according to the time threshold; and calculating the second data points and the fourth data points by using a preset algorithm to obtain a similarity of the first trajectory and the second trajectory. Therefore, the present application can make the trajectory similarity calculation more accurate by introducing a time factor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of trajectory clustering analysis technology, and in particular relates to a trajectory similarity calculation method, trajectory similarity calculation device, computer equipment, and computer-readable storage medium. Background Technology

[0002] In existing technologies, the Hausdorff algorithm is commonly used to calculate the similarity between the shapes of two trajectories. It measures the similarity between two trajectories by taking the minimum distance between each point on one trajectory and all points on the other trajectory, and taking the maximum distance among all distances from each point to the other trajectory.

[0003] However, this algorithm has the following shortcomings: 1) Sensitivity to outliers: The Hausdorff algorithm is overly sensitive to outliers. When there are a few outliers in two trajectories, the distance calculation result may be too large, thus affecting the accuracy of the similarity score. 2) High computational complexity: Since the Hausdorff algorithm needs to calculate the distance between every point on one trajectory and all points on another trajectory, its computational complexity is high when processing large-scale trajectory data. Overcoming these shortcomings when calculating trajectory similarity is a technical problem that urgently needs to be solved by those skilled in the art.

[0004] The preceding description is intended to provide general background information and does not necessarily constitute prior art. Summary of the Invention

[0005] Based on this, and to address the aforementioned problems, a trajectory similarity calculation method, a trajectory similarity calculation device, a computer device, and a computer-readable storage medium are proposed, which can make trajectory similarity calculation more accurate by introducing a time factor.

[0006] The technical problem solved by this application is achieved by the following technical solution:

[0007] This application provides a trajectory similarity calculation method, comprising the following steps: obtaining a data point set of a processing object, the data point set including multiple first data points, each first data point including time information at the time of recording; obtaining the speed information of the processing object, obtaining a dynamic distance threshold based on the time information and speed information of each pair of first data points, filtering out abnormal data points in the data point set using the dynamic distance threshold, and using the remaining data points as second data points, obtaining a first trajectory of the processing object based on the second data points; obtaining a second trajectory, the second trajectory consisting of multiple third data points, each third data point including time information at the time of recording; obtaining a time threshold, selecting a fourth data point based on the time threshold, the fourth data point being a third data point with time correlation to the second data points, the time correlation being determined by the time information of the second data points and the time information of the third data points; and calculating the similarity between the second data points and the fourth data points using a preset algorithm to obtain the similarity between the first trajectory and the second trajectory.

[0008] In an optional embodiment of this application, the first data point further includes location information at the time of recording; obtaining a dynamic distance threshold based on the time information and velocity information of each pair of first data points, and filtering out abnormal data points in the data point set using the dynamic distance threshold, includes: determining the time difference between two first data points based on the time information, determining the dynamic distance threshold based on the time difference and velocity information; determining the relative distance between two first data points based on the location information; retaining the two first data points when the relative distance is less than or equal to the dynamic distance threshold; and identifying and filtering out abnormal data points based on the time information of the first data points when the relative distance is greater than the dynamic distance threshold.

[0009] In an optional embodiment of this application, the first data point further includes location information at the time of recording; obtaining the speed information of the processing object includes: obtaining the speed information of the processing object when it is located at a certain first data point based on the location information, wherein the speed information includes at least one of the maximum speed of the corresponding location information, the real-time speed of the processing object, and the average speed of the processing object between a certain first data point and a first data point adjacent to the first data point.

[0010] In an optional embodiment of this application, obtaining a time threshold includes: obtaining a preset time threshold; and / or, when the nth second data point in the first trajectory is selected, determining the time threshold of the nth second data point based on the time information of the nth second data point and adjacent time information, wherein the adjacent time information is the time information of the (n+m)th second data point and / or the time information of the nmth second data point, where n and m are integers greater than 0, and n is greater than m; and / or, when the nth second data point in the first trajectory is selected, determining the time threshold of the nth second data point based on the time information of the nth second data point and the time information of the nth third data point.

[0011] In an optional embodiment of this application, selecting a fourth data point based on a time threshold includes: determining a time range based on the time information of the second data point and the time threshold; if the time information of the third data point is within the time range, then determining that the third data point and the second data point have a time correlation, and using the third data point as the fourth data point corresponding to the second data point; if the time information of the third data point is not within the time range, then determining that the third data point and the second data point do not have a time correlation.

[0012] In an optional embodiment of this application, a preset algorithm is used to calculate the similarity between the second data point and the fourth data point to obtain the similarity between the first trajectory and the second trajectory. This includes: obtaining the location information of the second data point and the fourth data point respectively; calculating the relative distance between each second data point and each corresponding fourth data point based on the location information; summarizing all relative distances and processing the relative distances using the preset algorithm to determine the similarity between the first trajectory and the second trajectory.

[0013] In an optional embodiment of this application, the similarity between the second data point and the fourth data point is calculated using a preset algorithm to obtain the similarity between the first trajectory and the second trajectory. The preset algorithm is the Hausdorff algorithm.

[0014] This application also provides a trajectory similarity calculation device, comprising: a data point acquisition module for acquiring a data point set of a processing object, the data point set including multiple first data points, each first data point including time information at the time of recording; a first trajectory acquisition module for acquiring speed information of the processing object, acquiring a dynamic distance threshold based on the time information and speed information of each pair of first data points, filtering out abnormal data points in the data point set using the dynamic distance threshold, and using the remaining data points as second data points, and obtaining a first trajectory of the processing object based on the second data points; a second trajectory acquisition module for acquiring a second trajectory, the second trajectory consisting of multiple third data points, each third data point including time information at the time of recording; a similarity calculation module for acquiring a time threshold, selecting a fourth data point based on the time threshold, the fourth data point being a third data point with time correlation to the second data points, the time correlation being determined by the time information of the second data points and the time information of the third data points; and calculating the similarity between the second data points and the fourth data points using a preset algorithm to obtain the similarity between the first trajectory and the second trajectory.

[0015] This application also provides a computer device including a processor and a memory: the processor is used to execute a computer program stored in the memory to implement the method as described above.

[0016] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method as described above.

[0017] The embodiments of this application have the following beneficial effects:

[0018] This application incorporates time information into both trajectory determination and similarity calculation. This allows for the identification and removal of outliers during trajectory determination, effectively preventing errors caused by excessive drift of data points. Furthermore, by limiting the computational load on data points in both the first and second trajectories through time thresholds, it is more suitable for calculating large datasets with high trajectory frequency and long time spans, preventing time misalignment and resulting in more accurate trajectory similarity calculations.

[0019] The above description is merely an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it according to the contents of the specification, and to make the above and other objects, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and do not limit this application. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] in:

[0022] Figure 1 A flowchart illustrating a trajectory similarity calculation method provided in one embodiment;

[0023] Figure 2 This is a schematic diagram illustrating the determination of a second data point using a dynamic distance threshold, as provided in one embodiment.

[0024] Figure 3 A schematic diagram illustrating the calculation of the similarity between the first and second trajectories using existing technology;

[0025] Figure 4 This is a schematic diagram illustrating how a fourth data point in a second trajectory is determined using a time threshold to calculate the similarity between a first trajectory and a second trajectory, as provided in one embodiment.

[0026] Figure 5 This is a flowchart illustrating a trajectory similarity calculation device according to one embodiment;

[0027] Figure 6 This is a schematic block diagram of the structure of a computer device provided in one embodiment. Detailed Implementation

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

[0029] With the increasing amount of vehicle spatiotemporal trajectory data, how to calculate and compare the similarity of vehicle spatiotemporal trajectories has become a key issue: commonly used algorithms are sensitive to outliers and have high computational complexity. This application proposes a trajectory similarity calculation method to overcome the above problems. For a clear description of the method provided in this embodiment, please refer to... Figures 1 to 4 This includes steps S110 to S140.

[0030] Step S110: Obtain the data point set of the processing object. The data point set includes multiple first data points, and the first data points include the time information when they were recorded.

[0031] In one embodiment, the object being processed, i.e., the object forming the trajectory, can include, but is not limited to, humans, vehicles, ships, aircraft, animals, etc.—any moving object whose trajectory can be monitored. The data point set is the point cloud obtained by capturing the object, and the data point set consists of multiple first data points. A first data point is a point in the data point set, representing the spatiotemporal information of the object at the time of recording, including time information at the time of recording, and may also include spatial information.

[0032] Step S120: Obtain the speed information of the object being processed, obtain the dynamic distance threshold based on the time and speed information of each pair of first data points, filter out abnormal data points in the data point set using the dynamic distance threshold, take the remaining data points as second data points, and obtain the first trajectory of the object being processed based on the second data points.

[0033] In one embodiment, it is understood that the data point set only records the spatiotemporal information of the object being processed, and there is no correlation between them to determine the movement trajectory of the object. Furthermore, due to various reasons, the collected data point set may contain anomalous data points. Therefore, it is necessary to perform noise removal preprocessing on the data point set to reduce the impact of data anomalies and improve the accuracy of similarity calculation. In this embodiment, a time factor is introduced for filtering; in the process of constructing the first trajectory, the time factor is represented by a dynamic distance threshold. The first trajectory is the trajectory of the object that ultimately needs to be determined based on the data point set; the specific determination process will be described in detail later.

[0034] In one embodiment, the first data point further includes location information at the time of recording; obtaining a dynamic distance threshold based on the time information and velocity information of each pair of first data points, and filtering out abnormal data points in the data point set using the dynamic distance threshold, includes: determining the time difference between two first data points based on the time information, determining the dynamic distance threshold based on the time difference and velocity information; determining the relative distance between two first data points based on the location information; retaining the two first data points when the relative distance is less than or equal to the dynamic distance threshold; and identifying and filtering out abnormal data points based on the time information of the first data points when the relative distance is greater than the dynamic distance threshold.

[0035] In one implementation, considering the time and location information carried by the first data point, a dynamic distance threshold H is introduced. The calculation of the dynamic distance threshold can be H = V × S, where V is the velocity information of the first data point (the specific acquisition process of the velocity information will be detailed later), and S is the time difference between two first data points. Therefore, the dynamic distance threshold H can be characterized as the maximum movable range of the processed object within a certain time difference. If, after calculating the dynamic distance threshold H based on the spatiotemporal information recorded by each pair of first data points, the relative distance between the two first data points is within the dynamic distance threshold H range, it indicates that neither is an abnormal data point and they can be retained. However, if the relative distance between them exceeds the dynamic distance threshold H, it indicates that one of the first data points is an abnormal data point and needs to be removed. The removal process needs to be determined based on the time information of the first data points. The determination methods can include: 1. Removing the first data point with a later time node; 2. Removing the first data point with an earlier time node; 3. Determining that there is no correlation between pairs of first data points, and automatically filtering them based on the correlation when determining the first trajectory. The first data point remaining after processing in the data point set can be identified as the second data point. The second data point is essentially the same as the first data point, but there is a strong correlation between the second data points. Based on the temporal and spatial information, the batches can form a first trajectory to represent the movement trajectory of the processed object.

[0036] The first elimination method can be applied to the implementation of calculating the first trajectory in chronological order. For ease of understanding, please refer to [reference needed]. Figure 2 , Figure 2 This is a schematic diagram illustrating the determination of a second data point using a dynamic distance threshold, as provided in one embodiment. Figure 2As shown, there are three first data points, Da, Db, and Dc, whose staggered arrangement represents the spatial relationship represented by the positional information between batches. Assume Da is recorded at time t1, and Db and Dc are recorded at time t2. Further, d1 represents the interval distance between Da and Db, d2 represents the interval distance between Da and Dc, and H is the dynamic distance threshold. It is understood that Db and Dc are both recorded at time t2, therefore the time difference S is the same. Secondly, taking the maximum speed of the processed object as an example, the maximum speed is independent of the spatiotemporal location of the processed object, therefore the speed V is also the same. Thus, the dynamic distance threshold H is the same when judging Da and Db, and Da and Dc. It is understood that since the dynamic distance threshold H is determined by the maximum speed in this embodiment, the processed object at time t2 will necessarily be within a circle with the dynamic distance threshold H as its radius, and will not exceed this range. Therefore, as... Figure 2 As shown, the relative distance d1 between Da and Db is less than H, which is within the range; while the relative distance d2 between Da and Dc is greater than H, which is outside the range. Therefore, it can be determined that there are abnormal data points in Da and Dc. Since the calculation process is performed in chronological order, t1 is earlier than t2, so Dc, whose event information is later, is marked as an abnormal data point and removed. The remaining Da and Db can then be identified as the second data point. This implementation method is preferably applicable to implementation scenarios where the starting point of the first trajectory is clearly known, and the first trajectory is accurately determined by progressively filtering according to chronological order.

[0037] The actual calculation process may not be performed sequentially, but rather at arbitrarily selected points. In such cases, this implementation method can be applied to the second elimination method. Similarly, using... Figure 2Taking the selection of Da as an example, assuming that the time difference between them is the same, the resulting dynamic distance threshold H is also the same. Based on the time information of each data point, the first data points that are adjacent in time are determined to be Db and Dc, with the time order being Dc earlier than Da, which in turn is Db. Following the same screening process as in the previous embodiment, the screening results also indicate the presence of outlier data points in Da and Dc. However, since the calculation process randomly selects the first data point, it can be determined that the earlier Dc is not the starting point of the first trajectory. Therefore, Dc can be marked as an outlier and screened out. Furthermore, it is worth noting that the screening indicates that Da and Dc are not correlated. In subsequent calculations, Dc will still be considered, but the calculation between Da and Dc will not be performed again. Then, the calculation can be re-performed based on the point earlier than the removed Dc, until the entire data point set has been traversed, thereby removing the influence of outliers on the calculation results. Finally, while removing outlier data points, the first trajectory is determined, and the first data point in the first trajectory must be the second data point. This implementation method is preferably applicable to scenarios where there are many first data points and it is uncertain which first data point is the starting point of the first trajectory, thus enabling the rapid determination of the first trajectory.

[0038] Furthermore, the elimination method can also be a third type: non-active elimination, with automatic elimination performed when the first trajectory is determined. This involves iterating through all pairwise correlations between first data points and determining a trajectory based on these correlations. Any two first data points within this trajectory must have a relative distance less than a dynamic distance threshold H. This trajectory is then identified as the first trajectory, and the first data point within it is necessarily the second data point. Data points whose first data points are not within this first trajectory are considered abnormal data points. In other words, the first trajectory is determined solely based on the dynamic distance threshold H, without the need for active elimination. This preferred implementation is suitable for scenarios with fewer data points, allowing for quick and direct determination of the first trajectory without requiring redundant filtering operations.

[0039] In one embodiment, the first data point further includes location information at the time of recording; obtaining the speed information of the processing object includes: obtaining the speed information of the processing object when it is located at a certain first data point based on the location information, wherein the speed information includes at least one of the maximum speed of the corresponding location information, the real-time speed of the processing object, and the average speed of the processing object between a certain first data point and a first data point adjacent to the first data point.

[0040] In one embodiment, the speed information can be the maximum speed, which is the theoretical maximum speed of the object being processed. However, the theoretical maximum speed can actually lead to a very large value for the dynamic distance threshold H, causing one first data point to be associated with multiple first data points, resulting in misjudgments in the filtering of first data points and the determination of the first trajectory. Therefore, considering the time factor of the dynamic distance threshold H, the spatial factor of the speed information is also applied to its acquisition. It can be understood that the first data point carries the spatiotemporal information of the object being processed, which may include the location information of the object being processed when it is recorded. The speed requirements of the object being processed may be different in different locations. For example, assuming the object being processed is a car, the maximum speed of the car is different depending on the speed limit of the road, whether it is on a highway, provincial road, or urban area. That is to say, the maximum speed corresponding to the location information is obtained, where the maximum speed refers to the speed limit when the object being processed is located at the first data point. In addition, if the information carried by the first data point is more complete, such as including the real-time speed of the object being measured when it is recorded, then the speed information can be directly determined as the actual speed. Furthermore, as mentioned earlier regarding the filtering using the dynamic distance threshold H, the filtering process is performed by selecting each pair of first data points. Therefore, velocity information can be determined by the average velocity between each pair of first data points. This allows for a more accurate determination of the dynamic distance threshold H, enabling the correct removal of abnormal data points and ensuring the accurate generation of the first trajectory.

[0041] Step S130: Obtain the second trajectory, which consists of multiple third data points, including the time information at the time of recording.

[0042] In one embodiment, the second trajectory is another trajectory used to calculate the similarity to the first trajectory. The actual acquisition process can be the same as that for the first trajectory, or it can be a pre-acquired trajectory without specific limitations. Similarly, just as the first trajectory is composed of multiple second data points, the second trajectory is composed of multiple third data points. The second and third data points are essentially the same, both carrying spatiotemporal information about the object being processed at the time of recording; however, they are distinguished by being located on different trajectories.

[0043] Step S140: Obtain a time threshold, select a fourth data point based on the time threshold. The fourth data point is a third data point that has a time correlation with the second data point. The time correlation is determined by the time information of the second data point and the time information of the third data point. Calculate the similarity between the second data point and the fourth data point using a preset algorithm to obtain the similarity between the first trajectory and the second trajectory.

[0044] In one embodiment, the second data point and the fourth data point are calculated using a preset algorithm to obtain the similarity between the first trajectory and the second trajectory. The preset algorithm is the Hausdorff algorithm.

[0045] In one embodiment, the trajectory similarity algorithm of this application can be the Hausdorff algorithm. However, the Hausdorff algorithm requires calculating the distance between each point on one trajectory and all points on another trajectory, thus its computational complexity is high when processing large-scale trajectory data. The specific calculation process can be found in [reference needed]. Figure 3 ,like Figure 3 As shown, L1 is the first trajectory, including multiple second data points: D1, D2, D3, D4...Dn; L2 is the second trajectory, including multiple third data points: D'1, D'2, D'3, D'4...D'n. In the existing Hausdorff algorithm, when calculating the similarity between L1 and L2, taking D3 of L1 as an example, it simultaneously calculates the similarity with all third data points in L2. However, based on this application, a time threshold is obtained and the third data points are filtered to obtain the fourth data point. When a second data point in the first trajectory is selected, only the corresponding fourth data point is calculated with that second data point; the remaining third data points are not processed, thus greatly reducing the computational power requirement. The fourth data point is essentially the same as the aforementioned data points, but it is a third data point with a temporal correlation to the second data points, thereby reducing the computational load. Furthermore, adding a time threshold for filtering ensures that each data point within the two trajectories is compared with data points within its time threshold, preventing time misalignment. The selection process will be detailed later.

[0046] In one embodiment, a preset algorithm is used to calculate the similarity between the second data point and the fourth data point to obtain the similarity between the first trajectory and the second trajectory. This includes: obtaining the position information of the second data point and the fourth data point respectively; calculating the relative distance between each second data point and each corresponding fourth data point based on the position information; summarizing all relative distances and processing the relative distances using the preset algorithm to determine the similarity between the first trajectory and the second trajectory.

[0047] In one embodiment, selecting a fourth data point based on a time threshold includes: determining a time range based on the time information of the second data point and the time threshold; if the time information of the third data point is within the time range, then determining that the third data point and the second data point have a time correlation, and using the third data point as the fourth data point corresponding to the second data point; if the time information of the third data point is not within the time range, then determining that the third data point and the second data point do not have a time correlation.

[0048] In one implementation, the selection of the fourth data point can be referred to Figure 4 . Figure 4 The setting of the first and second trajectories and Figure 3The same principle applies, so we won't repeat it here. Again, taking D3 in L1 as an example, the time threshold corresponding to D3 is Δt. Since the second and third data points are arranged in chronological order, when selecting D3, a time range is selected before and after the time threshold Δt. Only the third data point within this time range is considered to have a temporal correlation with D3, such as... Figure 4 As shown, only D'1, D'2, and D'3 are the fourth data points with temporal correlation to D3. Therefore, when calculating the similarity between L1 and L2 using the Hausdorff algorithm, when calculating D3, D3 only needs to calculate its relative distance with D'1, D'2, and D'3, without needing to calculate it with other data points.

[0049] In one embodiment, obtaining a time threshold includes: obtaining a preset time threshold; and / or, when the nth second data point in the first trajectory is selected, determining the time threshold of the nth second data point based on the time information of the nth second data point and adjacent time information, wherein the adjacent time information is the time information of the (n+m)th second data point and / or the time information of the nmth second data point, where n and m are integers greater than 0, and n is greater than m; and / or, when the nth second data point in the first trajectory is selected, determining the time threshold of the nth second data point based on the time information of the nth second data point and the time information of the nth third data point.

[0050] In one implementation, the time threshold can be a pre-set fixed value. Similarly, the time threshold can be dynamic for each point. For example, using... Figure 4For example, when the nth second data point in the first trajectory is selected, the time threshold of the nth second data point can be determined based on its time information and adjacent time information. The adjacent time information refers to the time information of the (n+m)th and / or the nmth second data point, where n and m are integers greater than 0. For instance, when D3 is selected, the time threshold can be determined by selecting the data points adjacent to D3; these adjacent data points can be the nearest D2 and D3. The time threshold can be determined based on the time information between D2 and D3, and D3 and D4, such as the time difference and / or the average time difference. The specific values ​​can be arbitrarily set according to the actual situation; the above are just examples. Furthermore, when the nth second data point in the first trajectory is selected, the time threshold of the nth second data point can also be determined based on its time information and the time information of the nth third data point. Specifically, for example, when D3 is selected, the time threshold for D3 can be determined based on the time information of D3 and D'3. Similarly, a time threshold can be determined for the time difference between the two, thereby defining a time range for filtering the third data point. That is to say, in this embodiment, the time threshold can also be dynamically determined, so that for each second data point, a fourth data point with time correlation with it within the corresponding range can be determined, thereby greatly reducing the amount of computation when using the Hausdorff algorithm to calculate the similarity between L1 and L2.

[0051] Therefore, this application incorporates time information into both trajectory determination and similarity calculation. This allows for the identification and removal of outliers during trajectory determination, effectively preventing errors caused by excessive drift of data points. Simultaneously, by limiting the computational load of data points in the first and second trajectories through time thresholds, it is more suitable for calculating large datasets with high trajectory frequency and long time spans, preventing time misalignment and resulting in more accurate trajectory similarity calculations.

[0052] Figure 5A schematic diagram of a trajectory similarity calculation device in one embodiment is shown. The trajectory similarity calculation device 50 includes: a data point acquisition module 51, used to acquire a data point set of the processing object, the data point set including multiple first data points, the first data points including time information when they were recorded; a first trajectory acquisition module 52, used to acquire the speed information of the processing object, acquire a dynamic distance threshold based on the time information and speed information of each pair of first data points, filter out abnormal data points in the data point set through the dynamic distance threshold, and use the remaining data points as second data points, and obtain the first trajectory of the processing object based on the second data points; a second trajectory acquisition module 53, used to acquire a second trajectory, the second trajectory consisting of multiple third data points, the third data points including time information when they were recorded; a similarity calculation module 54, used to acquire a time threshold, select a fourth data point based on the time threshold, the fourth data point being a third data point with time correlation to the second data points, the time correlation being determined by the time information of the second data point and the time information of the third data point; and calculate the similarity between the second data point and the fourth data point through a preset algorithm to obtain the similarity between the first trajectory and the second trajectory.

[0053] Figure 6 An internal structural diagram of a computer device in one embodiment is shown. This computer device can specifically be a terminal or a server. Figure 6 As shown, the computer device includes a processor, memory, and network interface connected via a system bus. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and may also store a computer program. When executed by the processor, this computer program enables the processor to implement a trajectory similarity calculation method. The internal memory may also store a computer program, which, when executed by the processor, enables the processor to perform the trajectory similarity calculation method. Those skilled in the art will understand that... Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0054] In one embodiment, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the steps of the method described above.

[0055] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0056] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0057] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for calculating trajectory similarity, characterized in that, Includes the following steps: Obtain a set of data points for the object being processed, the set of data points including multiple first data points, the first data points including time information when they were recorded; Obtain the speed information of the processing object, obtain a dynamic distance threshold based on the time information of each pair of first data points and the speed information, filter out abnormal data points in the data point set through the dynamic distance threshold, take the remaining data points as second data points, and obtain the first trajectory of the processing object based on the second data points; A second trajectory is obtained, which is composed of multiple third data points, the third data points including the time information at the time of recording; A time threshold is obtained, and a fourth data point is selected based on the time threshold. The fourth data point is a third data point that has a time correlation with the second data point. The time correlation is determined by the time information of the second data point and the time information of the third data point. The second data point and the fourth data point are calculated using a preset algorithm to obtain the similarity between the first trajectory and the second trajectory. The acquisition time threshold includes: Obtain the preset time threshold; and / or, When the nth second data point in the first trajectory is selected, a time threshold for the nth second data point is determined based on the time information of the nth second data point and the adjacent time information. The adjacent time information includes the time information of the (n+m)th second data point and / or the (nm)th second data point, where n and m are integers greater than 0, and n is greater than m; and / or, When the nth second data point in the first trajectory is selected, the time threshold of the nth second data point is determined based on the time information of the nth second data point and the time information of the nth third data point.

2. The trajectory similarity calculation method as described in claim 1, characterized in that, The first data point also includes the location information at the time of recording; The step of obtaining a dynamic distance threshold based on the time information and speed information of each pair of the first data points, and filtering out abnormal data points in the data point set using the dynamic distance threshold, includes: The time difference between the two first data points is determined based on the time information, and the dynamic distance threshold is determined based on the time difference and the speed information. The relative distance between the two first data points is determined based on the location information; When the relative distance is less than or equal to the dynamic distance threshold, retain two of the first data points; When the relative distance is greater than the dynamic distance threshold, the abnormal data points are determined and filtered out based on the time information of the first data points.

3. The trajectory similarity calculation method as described in claim 1, characterized in that, The first data point also includes the location information at the time of recording; The step of obtaining the speed information of the processing object includes: Based on the location information, obtain the speed information of the processing object when it is located at a certain first data point. The speed information includes at least one of the following: the maximum speed corresponding to the location information, the real-time speed of the processing object, and the average speed of the processing object between the certain first data point and the first data points adjacent to the certain first data point.

4. The trajectory similarity calculation method as described in claim 1, characterized in that, The step of selecting the fourth data point based on the time threshold includes: A time range is determined based on the time information of the second data point and the time threshold. If the time information of the third data point is within the time range, then it is determined that the third data point and the second data point have a time correlation, and the third data point is used as the fourth data point corresponding to the second data point; If the time information of the third data point is not within the time range, then it is determined that the third data point and the second data point are not time-related.

5. The trajectory similarity calculation method as described in claim 1, characterized in that, The step of calculating the similarity between the second data point and the fourth data point using a preset algorithm to obtain the similarity between the first trajectory and the second trajectory includes: Obtain the location information of the second data point and the fourth data point respectively; Calculate the relative distance between each second data point and each corresponding fourth data point based on the location information; All the relative distances are aggregated, and the relative distances are processed by the preset algorithm to determine the similarity between the first trajectory and the second trajectory.

6. The trajectory similarity calculation method as described in claim 1, characterized in that, The similarity between the first trajectory and the second trajectory is calculated by a preset algorithm on the second data point and the fourth data point, wherein the preset algorithm is the Hausdorff algorithm.

7. A trajectory similarity calculation device, characterized in that, include: The data point acquisition module is used to acquire a set of data points of the processing object. The set of data points includes multiple first data points, and the first data points include time information when they are recorded. The first trajectory acquisition module is used to acquire the speed information of the processing object, acquire a dynamic distance threshold based on the time information of each pair of first data points and the speed information, filter out abnormal data points in the data point set through the dynamic distance threshold, take the remaining data points as second data points, and obtain the first trajectory of the processing object based on the second data points. The second trajectory acquisition module is used to acquire a second trajectory, which is composed of multiple third data points, and the third data points include time information when they are recorded. The similarity calculation module is used to obtain a time threshold, select a fourth data point based on the time threshold, the fourth data point being a third data point that has a time correlation with the second data point, the time correlation being determined by the time information of the second data point and the time information of the third data point; and calculate the similarity between the second data point and the fourth data point using a preset algorithm to obtain the similarity between the first trajectory and the second trajectory. The acquisition time threshold includes: Obtain the preset time threshold; and / or, When the nth second data point in the first trajectory is selected, a time threshold for the nth second data point is determined based on the time information of the nth second data point and the adjacent time information. The adjacent time information includes the time information of the (n+m)th second data point and / or the (nm)th second data point, where n and m are integers greater than 0, and n is greater than m; and / or, When the nth second data point in the first trajectory is selected, the time threshold of the nth second data point is determined based on the time information of the nth second data point and the time information of the nth third data point.

8. A computer device, characterized in that, Including processor and memory; The processor is used to execute a computer program stored in the memory to implement the method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Trajectory correction method and device, terminal device and storage medium

    CN111220169A

  • Space-time trajectory information processing method and device

    CN111414444A

  • Pedestrian-vehicle association method, device and equipment based on single-point similarity and storage medium

    CN112770252A