Trajectory data processing method and device, storage medium, and electronic device

By determining and outputting the similarity of trajectory data, using bucketing rules and LCSS algorithms, the problem of difficult real-time calculation, analysis and query of trajectory data is solved, and the accuracy and efficiency of peer analysis are improved.

CN112131278BActive Publication Date: 2024-09-06ZHEJIANG DAHUA TECH CO LTD
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202011043241.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-28
Publication Date
2024-09-06
Estimated Expiration
2040-09-28

AI Technical Summary

Technical Problem

Existing technology cannot realize real-time calculation and analysis of trajectory data, and peer analysis results are difficult to query and the accuracy is not high.

Method used

By determining the trajectory data of the object to be queried in the target time period, the trajectory data of multiple objects are obtained, and output based on the trajectory data whose similarity is higher than the preset threshold. Bucketing rules are used to divide and save the trajectory data, and LCSS is used The algorithm calculates trajectory similarity.

Benefits of technology

Real-time calculation and analysis of trajectory data is realized, improving the accuracy and query efficiency of peer analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112131278B
    Figure CN112131278B
Patent Text Reader

Abstract

The present invention provides a method and device for processing trajectory data, a storage medium, and an electronic device. The method comprises: determining first trajectory data of a first object to be queried in a target time period, wherein the first trajectory data comprises: data collection points passed by the first object; acquiring multiple second trajectory data of multiple second objects, wherein the second objects all pass through the data collection points, and the second trajectory data are trajectory data of the target time period; respectively determining similarities between the multiple second trajectory data and the first trajectory data, obtaining multiple similarities, and outputting second trajectory data with similarities higher than a preset threshold. The above technical solution solves the problems in the related art that the trajectory data cannot be calculated and analyzed in real time, and the query of the peer analysis result is difficult and the accuracy is not high, thereby realizing the real-time calculation and analysis of the trajectory data, improving the accuracy of the real-time peer analysis, and improving the query efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of trajectory analysis, and in particular to a trajectory data processing method and device, a storage medium, and an electronic device. Background Art

[0002] With the popularization of intelligent electronic terminal products, a large amount of trajectory data is generated in the use of smart devices. By analyzing the similarity of the trajectory data of moving targets, it is possible to confirm whether smart devices are traveling together. Furthermore, similar paths in the trajectory data can be extracted to predict the paths of existing similar objects.

[0003] Therefore, trajectory data has a wide range of applications in various fields of trajectory analysis. In related technologies, a peer analysis method, device, equipment and medium are proposed. The Euclidean distance is used to characterize the accompanying relationship between point trajectories. Due to the method of counting the number of co-occurrences of discrete points, when two peer trajectories have large differences in time and number (for example, missing or abnormal), the accuracy of peer recognition is very low. In addition, there are many commonly used trajectory similarity measurement indicators, but most of them are based on large-scale data calculation in offline scenarios and cannot achieve real-time peer analysis.

[0004] In view of the problems in related technologies, such as the inability to perform real-time calculation and analysis of trajectory data, and the difficulty in querying peer analysis results and low accuracy, no effective technical solution has been proposed. Summary of the invention

[0005] The embodiments of the present invention provide a method and device for processing trajectory data, a storage medium, and an electronic device to at least solve the problems in the related art that trajectory data cannot be calculated and analyzed in real time, and the peer analysis results are difficult to query and have low accuracy.

[0006] An embodiment of the present invention provides a method for processing trajectory data, comprising: determining first trajectory data of a first object to be queried in a target time period, wherein the first trajectory data comprises: a data collection point passed by the first object; acquiring multiple second trajectory data of multiple second objects, wherein the second objects all pass through the data collection points, and the second trajectory data are trajectory data of the target time period; respectively determining similarities between the multiple second trajectory data and the first trajectory data, obtaining multiple similarities, and outputting second trajectory data whose similarities are higher than a preset threshold.

[0007] Optionally, before obtaining multiple second trajectory data of multiple second objects, the above method also includes: setting a time threshold for the trip slice; when it is determined that the second object passes through two data collection points within the time threshold, determining that the trajectory data corresponding to each second object passing through the two data collection points within the time threshold is the target trajectory data of the same trip.

[0008] Optionally, after determining that the trajectory data corresponding to each second object passing through two data collection points within the time threshold is the trajectory data of the same trip, the above method also includes: dividing the target trajectory data of the same trip of multiple second objects according to a bucketing rule, wherein the bucketing rule includes at least one of the following: time slicing, data collection points, the target trajectory data includes: the second trajectory data; and storing the divided trajectory data in a target storage device.

[0009] Optionally, the trajectory data of the same trip of multiple second objects are divided according to the bucketing rule, including: dividing the target trajectory data according to different data collection points to obtain multiple first sets, wherein there is a one-to-one correspondence between the data collection points and the first sets, and each of the first sets includes: the target trajectory data passing through the same data collection point; dividing the first set according to time slices to obtain multiple second sets, wherein each of the second sets includes: the target trajectory data under the same time slice.

[0010] Optionally, determining first trajectory data of a first object to be queried in a target time period includes: acquiring identification information of the first object, wherein the identification information is used to uniquely identify the first object; and determining first trajectory data of the first object corresponding to the identification information in the target time period.

[0011] Optionally, respectively determining the similarities between the plurality of second trajectory data and the first trajectory data comprises: determining a common subsequence between the plurality of second trajectory data and the first trajectory data; and determining the plurality of similarities according to the common subsequence, the plurality of second trajectory data, and the first trajectory data.

[0012] According to another embodiment of the present invention, there is further provided a trajectory data processing device, comprising: a first determination module, configured to determine first trajectory data of a first object to be queried in a target time period, wherein the first trajectory data comprises: data collection points passed by the first object; an acquisition module, configured to acquire multiple second trajectory data of multiple second objects, wherein the second objects all pass through the data collection points, and the second trajectory data are trajectory data of the target time period; and an output module, configured to respectively determine similarities between the multiple second trajectory data and the first trajectory data, obtain multiple similarities, and output second trajectory data having similarities higher than a preset threshold.

[0013] Optionally, the above-mentioned device also includes: a setting module for setting a time threshold for trip slicing; a second determination module for, when it is determined that the second object passes through two data collection points within the time threshold, determining that the trajectory data corresponding to each second object passing through two data collection points within the time threshold is the target trajectory data of the same trip.

[0014] Optionally, the above-mentioned device also includes: a division module, used to divide the target trajectory data of the same trip of multiple second objects according to bucketing rules, wherein the bucketing rules include at least one of the following: time slicing, data collection points, and the target trajectory data includes: the second trajectory data; and the divided trajectory data is stored in a target storage device.

[0015] Optionally, the above-mentioned division module is also used to divide the target trajectory data according to different data collection points to obtain multiple first sets, wherein there is a one-to-one correspondence between the data collection points and the first sets, and each of the first sets includes: target trajectory data passing through the same data collection point; divide the first set according to time slices to obtain multiple second sets, wherein each of the second sets includes: target trajectory data under the same time slice.

[0016] Optionally, the first determination module is further configured to obtain identification information of the first object, wherein the identification information is used to uniquely identify the first object; and determine first trajectory data of the first object corresponding to the identification information in the target time period.

[0017] Optionally, the output module is further configured to determine a common subsequence between the plurality of second trajectory data and the first trajectory data; and determine the plurality of similarities according to the common subsequence, the plurality of second trajectory data, and the first trajectory data.

[0018] According to yet another embodiment of the present invention, a storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when running.

[0019] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0020] By means of the present invention, first trajectory data of a first object to be queried in a target time period is determined, wherein the first trajectory data includes: data collection points passed by the first object; a plurality of second trajectory data of a plurality of second objects are obtained, wherein the second objects all pass through the data collection points, and the second trajectory data are trajectory data of the target time period; similarities between the plurality of second trajectory data and the first trajectory data are respectively determined to obtain a plurality of similarities, and second trajectory data with a similarity higher than a preset threshold is output, that is, by comparing the first trajectory data of the first object to be queried in the target time period with a plurality of second trajectory data of a plurality of second objects passing through the collection points, the second trajectory data with a similarity higher than the preset threshold is confirmed to be a peer analysis result of the first trajectory data. By adopting the above technical solution, the problems that the trajectory data cannot be calculated and analyzed in real time, the peer analysis result query is difficult and the accuracy is not high in the related art are solved, and the real-time calculation and analysis of the trajectory data is realized, and the second trajectory data of the output peer analysis result is determined by comparing the similarity with the first trajectory data, thereby improving the accuracy of the real-time peer analysis and improving the query efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0022] Figure 1 It is a hardware structure block diagram of a computer terminal of a trajectory data processing method according to an embodiment of the present invention;

[0023] Figure 2 is a flowchart of a method for processing trajectory data according to an embodiment of the present invention;

[0024] Figure 3 is a schematic diagram of a real-time peer analysis system according to an optional embodiment of the present invention;

[0025] Figure 4 This is a schematic diagram of data storage after bucketing processing according to an optional embodiment of the present invention;

[0026] Figure 5 A flowchart of a method for real-time peer analysis according to an optional embodiment of the present invention;

[0027] Figure 6 A schematic diagram of a flow chart of a real-time analysis system of vehicle trajectories in an actual application scenario according to an optional embodiment of the present invention;

[0028] Figure 7 4 is a structural block diagram of a trajectory data processing device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0029] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.

[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0031] The method provided in the embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a computer terminal of a trajectory data processing method according to an embodiment of the present invention. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the computer terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Equivalent functions or comparisons shown Figure 1The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the processing method of trajectory data in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, that is, the above method is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the computer terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof. The transmission device 106 is used to receive or send data via a network. The above-mentioned network specific examples may include a wireless network provided by a communication provider of the computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0032] According to one embodiment of the present invention, a method for processing trajectory data is provided, which is applied to the above-mentioned computer terminal. Figure 2 is a flow chart of a method for processing trajectory data according to an embodiment of the present invention. Figure 2 As shown, including:

[0033] Step S202, determining first trajectory data of a first object to be queried in a target time period, wherein the first trajectory data includes: data collection points passed by the first object;

[0034] Step S204, obtaining a plurality of second trajectory data of a plurality of second objects, wherein the second objects all pass through the data collection point, and the second trajectory data are trajectory data of the target time period;

[0035] Step S206 , respectively determining similarities between the plurality of second trajectory data and the first trajectory data, obtaining a plurality of similarities, and outputting second trajectory data having a similarity higher than a preset threshold.

[0036] Through the above steps, the first trajectory data of the first object to be queried in the target time period is determined, wherein the first trajectory data includes: the data collection points passed by the first object; a plurality of second trajectory data of a plurality of second objects are obtained, wherein the second objects all pass through the data collection points, and the second trajectory data are trajectory data of the target time period; the similarities between the plurality of second trajectory data and the first trajectory data are respectively determined to obtain a plurality of similarities, and the second trajectory data with a similarity higher than a preset threshold is output, that is, by comparing the similarities between the first trajectory data of the first object to be queried in the target time period and the plurality of second trajectory data of the plurality of second objects passing through the collection points, it is further confirmed that the second trajectory data with a similarity higher than the preset threshold is a peer analysis result of the first trajectory data. The above technical solution is adopted to solve the problems in the related art that the trajectory data cannot be calculated and analyzed in real time, and the peer analysis result is difficult to query and the accuracy is not high, and the real-time calculation and analysis of the trajectory data is realized, and the second trajectory data of the output peer analysis result is determined by comparing the similarity with the first trajectory data, thereby improving the accuracy of the real-time peer analysis and improving the query efficiency.

[0037] It should be noted that the data collection point is a location point where information can be collected from an object. For example, when the object is a vehicle, the data collection point can be a road checkpoint or a photo detection point at an intersection on the road; when the object is a pedestrian, the data collection point can be a sky eye monitoring device on each road. The present invention does not impose too many restrictions on this.

[0038] There are multiple ways to determine the acquisition of multiple second trajectory data of multiple second objects in the above step S204. In an optional embodiment, it can be implemented by the following scheme: setting a time threshold for the trip slice; when it is determined that the second object passes through two data collection points within the time threshold, determining that the trajectory data corresponding to each second object passing through the two data collection points within the time threshold is the target trajectory data of the same trip.

[0039] That is to say, the multiple second trajectory data of the multiple second objects are sliced ​​by the preset time threshold. When the second object passing through the two data collection points appears within the time threshold, the trajectory of the second object is confirmed as the target trajectory data of the same trip. When the second object passing through the two data collection points does not appear within the time threshold, it indicates that the trajectory of the second object does not exist as the target trajectory data of the same trip.

[0040] For example, when the trajectory data is the trajectory data of a vehicle, clustering is performed using the license plate number as the identification information. The time threshold for the time interval from one section of a vehicle's journey to the next section under normal circumstances is set to T. The trajectory data of the vehicle is segmented according to the preset time threshold T. Suppose there are two points A and B in a vehicle trajectory data, T B -T A >T, when the journey is S, at this time S A <S, S < S B , that is, points A and B are not in the same journey. For the same vehicle trajectory data, when the time interval between two points on the trajectory is T B -T A <T, S A <S, S B <S, indicating that points A and B are in the same journey and marking and recording the data.

[0041] In an exemplary embodiment, after determining that the trajectory data corresponding to two data collection points passed by each second object within the time threshold is the trajectory data of the same journey, the above method further includes: dividing the target trajectory data of the same journey of multiple second objects according to a bucketing rule, where the bucketing rule includes at least one of the following: time slicing, data collection points, and the target trajectory data includes: the second trajectory data; storing the divided trajectory data in a target storage device.

[0042] To improve the search for second objects of the target trajectory data determined to be of the same journey, the target trajectory data of the same journey of multiple second objects is divided according to a bucketing rule. For example, when the target trajectory data of the same journey is vehicle trajectory, bucketing in the spatial dimension is performed according to the data collection points passed by the vehicle, and each data collection point corresponds to all second objects of the target trajectory data passing through that data collection point. Then, in the time dimension, time slicing is performed on the target trajectory data under each data collection point, that is, time slicing of time periods is performed on the second objects passing through the data collection point according to the set time interval of time slicing.

[0043] Optionally, dividing the trajectory data of the same journey of multiple second objects according to a bucketing rule includes: dividing the target trajectory data according to different data collection points to obtain a plurality of first sets, where there is a one-to-one correspondence between the data collection points and the first sets, and each of the first sets includes: the target trajectory data passing through the same data collection point; dividing the first sets according to time slicing to obtain a plurality of second sets, where each of the second sets includes: the target trajectory data under the same time slice.

[0044] That is to say, since there are multiple different data collection points in the target trajectory data, when dividing, the target trajectory data can be divided according to different data collection points to obtain a first set of target trajectory data passing through the same data collection point, and in order to better perform time index search on the target trajectory data in the first set, the first set is divided into time slices, so that the target trajectory data under the same time slice constitutes a new second set, which is convenient for index search according to time.

[0045] Optionally, determining first trajectory data of a first object to be queried in a target time period includes: acquiring identification information of the first object, wherein the identification information is used to uniquely identify the first object; and determining first trajectory data of the first object corresponding to the identification information in the target time period.

[0046] It is understandable that in order to ensure the accuracy of the query, when performing a quick query on the first trajectory data of the first object in the target time period, it is necessary to obtain identification information for uniquely identifying the first object.

[0047] For example, in vehicle trajectory data, the identification information uses the license plate as the entity object, in portrait data, the identification information uses the ID card number as the object, and in MAC trajectory data, the identification information uses the MAC as the object.

[0048] Optionally, respectively determining the similarities between the plurality of second trajectory data and the first trajectory data comprises: determining a common subsequence between the plurality of second trajectory data and the first trajectory data; and determining the plurality of similarities according to the common subsequence, the plurality of second trajectory data, and the first trajectory data.

[0049] In short, in order to make it easier to determine the similarity of trajectory data, the embodiment of the present invention is based on the LCSS algorithm (Long-common-Subsequence / Substring, the longest common subsequence / longest common string, referred to as LCSS), and calculates the similarity through the point-to-line many-to-1 situation. Specifically, the sequence Cm is the target trajectory generation sequence (equivalent to the first trajectory data in the embodiment of the present invention), Qn is the real-time trajectory sequence (equivalent to the second trajectory data in the embodiment of the present invention), and Zr is the longest common subsequence of the point-to-line many-to-1. If Zr is a common subsequence, then Zr must meet the following conditions: Among them, ε is the distance threshold, is the Euclidean distance between the point and the line segment, z sis a common subsequence, r is a point on the sequence. If and only if Zr is the trajectory with the largest number of points satisfying the above conditions, it is the longest subsequence of the many-to-one trajectory from points on the trajectories Cm and Qn to the line. At this time, let f be the trajectory similarity of the many-to-one trajectory from the target trajectory Cm to the real-time trajectory Qn. The formula is as follows: Furthermore, based on the common subsequence, multiple second trajectory data, and the first trajectory data, multiple similarities can be determined to confirm the second trajectory data of the second object in the same row as the first trajectory data of the first object to be queried during the target time period.

[0050] The following explains the process of the above method for processing trajectory data in conjunction with several optional embodiments, but is not used to limit the technical solutions of the embodiments of the present invention.

[0051] An optional embodiment of the present invention provides a system for real-time same-row analysis. Figure 3 As shown in the schematic diagram of the real-time same-row analysis system according to an optional embodiment of the present invention, it includes: a travel segmentation module 32, a bucketing processing module 34, and a time algorithm module 36. Among them, the travel segmentation module 32 is used to perform rule-based segmentation on the input real-time trajectory data according to the entity object in the information and output the trajectory data of the same travel after clustering. The bucketing processing module 34 is coupled to the travel segmentation module 32, classifies the trajectory data according to rules, calculates the bucketing category to which the data is assigned according to the spatio-temporal dimension, and uses it as an index. The time algorithm module 36 is coupled to the bucketing module 34, used to extract time series information, and calculate the similarity degree of relevant target trajectories using an improved LCSS trajectory similarity algorithm.

[0052] Optionally, the travel segmentation module 32 is used to process the real-time collected trajectory data and cluster it by entity. For example, when the object is a vehicle and the trajectory data is the trajectory data of the vehicle, it is clustered with the license plate number as the identification information. The time threshold for the interval from one section of the vehicle's journey to the next section under normal circumstances is set to T. The vehicle's trajectory data is segmented according to the pre-set time threshold T. Suppose there are two points A and B in a vehicle trajectory data, T B -T A >T. When the journey is S, at this time S A <S, S < S B , that is, points A and B are not in the same journey. When it comes to the same vehicle trajectory data and the time interval between two points on the trajectory is T B -T A <T, S A <S, S B <S, indicating that points A and B are in the same journey and mark and record the data.

[0053] Optionally, the bucket processing module 34 is used to process the trip segmentation data, and classify the data in time and space based on the idea of ​​data bucketing. For example, when the object is a vehicle, the trajectory data is the trajectory data of the vehicle. At this time, the checkpoints or collection points that the vehicle passes through are bucketed based on the space dimension. First, each data is classified under its own checkpoint or collection point, and then the data under each checkpoint or collection point is bucketed based on the time dimension. According to the time slice of 10 minutes, the data is classified again into 144 slices in total, and fields containing the content of the space and time classification rules are added and indexed, and classified and stored in the storage space. Figure 4 This is a schematic diagram of data storage after bucketing in an optional embodiment of the present invention. The data is classified again into 144 slices with a time slice of 10 minutes, and fields containing spatial and temporal classification rules are added and indexed, and classified storage is performed in the storage space.

[0054] Optionally, the time algorithm module 36, in an optional embodiment of the present invention, is based on the LCSS algorithm and optimizes it. For the target object C, there is a sequence of its trajectories from small to large in time Cm = (c1, c2, ..., cm), and a real-time trajectory Q, whose time sequence Qn = (q1, q2, ..., q n ), there is a common subsequence Z r =(z1, z2, ..., zr), if Zr is the longest common subsequence of the two trajectories Cm and Qn, the similarity is compared by the length of the Zr sequence. Since the classic LCSS distance is a point-to-point 1-to-1 distance, that is, one element in the sequence corresponds to at most one element in the other sequence, and the many-to-1 situation is not considered, it is impossible to process the trajectory data that can be optionally implemented in this method. Therefore, in order to make the similarity of the trajectory data easier to determine. Optionally, the optional embodiment of the present invention is based on the LCSS algorithm (Long-common-Subsequence / Substring, the longest common subsequence / longest common string, referred to as LCSS), and calculates the similarity through the point-to-line many-to-1 situation. Specifically, the sequence Cm is used as the target trajectory to generate a sequence (equivalent to the first trajectory data in the embodiment of the present invention), Qn is a real-time trajectory sequence (equivalent to the second trajectory data in the embodiment of the present invention), and Zr is the longest common subsequence of point-to-line many-to-1. If Zr is a common subsequence, then Zr must meet the following conditions:

[0055]

[0056] Among them, ε is the distance threshold, is the Euclidean distance between the point and the line segment, z sis a common subsequence, r is a point on the sequence, and if and only if Zr is the trajectory with the most points that satisfies the above conditions, then it is the longest subsequence of the point-to-line multiple-to-1 of the trajectory Cm and Qn. At this time, let f be the point-to-line multiple-to-1 trajectory similarity between the target trajectory Cm and the real-time trajectory Qn, and the formula is: Furthermore, multiple similarities can be determined based on the common subsequence, multiple second trajectory data, and the first trajectory data, so as to confirm that the first trajectory data of the first object to be queried in the target time period has the same second trajectory data of the second object in the target time period.

[0057] Optionally, an optional embodiment of the present invention further provides a method for real-time peer analysis, such as Figure 5 As shown, the specific steps are as follows:

[0058] Step S502: Calculate the itinerary of each object in real time based on the real-time data and rules;

[0059] Step S504: bucket index the data according to the rules and store them in the storage device;

[0060] Step S506: Calculate trajectory similarity using a time series algorithm.

[0061] An optional embodiment of the present invention also provides a real-time analysis system for vehicle trajectories in an actual application scenario, which obtains peer objects by inputting information of a target vehicle. Figure 6 As shown, the specific steps are as follows:

[0062] Step S602: Enter the vehicle license plate and calculation time period to find the trajectory data that meets the conditions. And quickly find other data of the same trip of the target through the trip mark to form the target trajectory C that needs to be analyzed m .

[0063] Step S604: Use the target trip data and bucketing rules to quickly find other vehicles passing the same checkpoint and the same time slice. Find the trajectory data of each vehicle with the same trip by searching the trip mark, and use it as the trajectory data set Q with analysis. n .

[0064] Step S606: In order to improve the efficiency of calculation, a linear trajectory compression algorithm (Douglas-Peucker algorithm) is added to Q n Do compression and convert the compressed Q n and C m Substitute into f ε (C m , Q n), and finally obtain the top N license plates with the highest similarity as output results according to requirements, where N is greater than 0, as peer objects for real-time analysis of vehicle trajectories confirmed based on the input vehicle license plate.

[0065] Through the above steps, the optional embodiment of the present invention uses three methods of data preprocessing for the data to be processed: trip segmentation, data bucketing, and trajectory compression algorithm. It can quickly retrieve relevant data under large-scale data batch processing, greatly reducing the amount of data involved in the calculation and improving the query speed. In addition, the use of LCSS point-to-line many-to-1 algorithm optimization can handle asynchronous situations such as strong noise trajectories, trajectory breaks, and non-equiperiodic trajectories, and is more robust than traditional LCSS.

[0066] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0067] In this embodiment, a device for processing trajectory data is also provided, which is used to implement the above embodiments and preferred implementations, and will not be repeated here. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0068] Figure 7 is a structural block diagram of a device for processing trajectory data according to an embodiment of the present invention. Figure 7 As shown, the device comprises:

[0069] A first determination module 72 is used to determine first trajectory data of a first object to be queried in a target time period, wherein the first trajectory data includes: data collection points passed by the first object;

[0070] An acquisition module 74 is used to acquire a plurality of second trajectory data of a plurality of second objects, wherein the second objects all pass through the data collection point, and the second trajectory data is trajectory data of the target time period;

[0071] The output module 76 is used to respectively determine the similarities between the plurality of second trajectory data and the first trajectory data, obtain a plurality of similarities, and output the second trajectory data whose similarity is higher than a preset threshold.

[0072] By means of the above device, first trajectory data of a first object to be queried in a target time period is determined, wherein the first trajectory data includes: data collection points passed by the first object; a plurality of second trajectory data of a plurality of second objects are obtained, wherein the second objects all pass through the data collection points, and the second trajectory data are trajectory data of the target time period; similarities between the plurality of second trajectory data and the first trajectory data are respectively determined to obtain a plurality of similarities, and second trajectory data with a similarity higher than a preset threshold is output, that is, by comparing the similarities between the first trajectory data of the first object to be queried in the target time period and a plurality of second trajectory data of a plurality of second objects passing through the collection points, the second trajectory data with a similarity higher than the preset threshold is confirmed to be a peer analysis result of the first trajectory data. By means of the above technical solution, the problems that the trajectory data cannot be calculated and analyzed in real time, the peer analysis result query is difficult and the accuracy is not high in the related art are solved, and the real-time calculation and analysis of the trajectory data is realized, and the second trajectory data of the output peer analysis result is determined by comparing the similarity with the first trajectory data, thereby improving the accuracy of the real-time peer analysis and improving the query efficiency.

[0073] It should be noted that the data collection point is a location point where information can be collected from an object. For example, when the object is a vehicle, the data collection point can be a road checkpoint or a photo detection point at an intersection on the road; when the object is a pedestrian, the data collection point can be a sky eye monitoring device on each road. The present invention does not impose too many restrictions on this.

[0074] Optionally, the above-mentioned device also includes: a setting module for setting a time threshold for trip slicing; a second determination module for, when it is determined that the second object passes through two data collection points within the time threshold, determining that the trajectory data corresponding to each second object passing through two data collection points within the time threshold is the target trajectory data of the same trip.

[0075] That is to say, the multiple second trajectory data of the multiple second objects are sliced ​​by the preset time threshold. When the second object passing through the two data collection points appears within the time threshold, the trajectory of the second object is confirmed as the target trajectory data of the same trip. When the second object passing through the two data collection points does not appear within the time threshold, it indicates that the trajectory of the second object does not exist as the target trajectory data of the same trip.

[0076] For example, when the trajectory data is the trajectory data of a vehicle, clustering is performed using the license plate number as the identification information. The time threshold for the interval from one section of the vehicle's journey to the next section under normal circumstances is set to T. The trajectory data of the vehicle is segmented according to the preset time threshold T. Suppose there are two points A and B in a vehicle trajectory data, T B -T A >T, when the journey is S, at this time S A <S, S < S B , that is, points A and B are not in the same journey. When it comes to the same vehicle trajectory data, the time interval between two points on the trajectory is T B -T A <T, S A <S, S B <S, indicating that points A and B are in the same journey and marking and recording the data.

[0077] Optionally, the above device further includes: a partitioning module, configured to partition the target trajectory data of the same journey of multiple second objects according to a bucketing rule, where the bucketing rule includes at least one of the following: time slicing, data collection points, and the target trajectory data includes: the second trajectory data; and save the partitioned trajectory data in a target storage device.

[0078] To improve the search for second objects of the target trajectory data determined to be in the same journey, the target trajectory data of the same journey of multiple second objects is partitioned according to a bucketing rule. For example, when the target trajectory data of the same journey is vehicle trajectory, spatial dimension bucketing is performed according to the data collection points passed by the vehicle. Each data collection point corresponds to the second objects of all target trajectory data passing through that data collection point. Then, taking time as the dimension, time slicing is performed on the target trajectory data under each data collection point, that is, time slicing of time periods is performed on the second objects passing through the data collection point according to the set time interval of time slicing.

[0079] Optionally, the above partitioning module is further configured to partition the target trajectory data according to different data collection points to obtain a plurality of first sets, where there is a one-to-one correspondence between the data collection points and the first sets, and each of the first sets includes: the target trajectory data passing through the same data collection point; and partition the first sets according to time slicing to obtain a plurality of second sets, where each of the second sets includes: the target trajectory data under the same time slice.

[0080] That is to say, since there are multiple different data collection points in the target trajectory data, when dividing, the target trajectory data can be divided according to different data collection points to obtain a first set of target trajectory data passing through the same data collection point, and in order to better perform time index search on the target trajectory data in the first set, the first set is divided into time slices, so that the target trajectory data under the same time slice constitutes a new second set, which is convenient for index search according to time.

[0081] Optionally, the first determination module is further configured to obtain identification information of the first object, wherein the identification information is used to uniquely identify the first object; and determine first trajectory data of the first object corresponding to the identification information in the target time period.

[0082] It is understandable that in order to ensure the accuracy of the query, when performing a quick query on the first trajectory data of the first object in the target time period, it is necessary to obtain identification information for uniquely identifying the first object.

[0083] For example, in vehicle trajectory data, the identification information uses the license plate as the entity object, in portrait data, the identification information uses the ID card number as the object, and in MAC trajectory data, the identification information uses the MAC as the object.

[0084] Optionally, the output module is further configured to determine a common subsequence between the plurality of second trajectory data and the first trajectory data; and determine the plurality of similarities according to the common subsequence, the plurality of second trajectory data, and the first trajectory data.

[0085] In short, in order to make it easier to determine the similarity of trajectory data, the embodiment of the present invention is based on the LCSS algorithm (Long-common-Subsequence / Substring, the longest common subsequence / longest common string, referred to as LCSS), and calculates the similarity through the point-to-line many-to-1 situation. Specifically, the sequence Cm is the target trajectory generation sequence (equivalent to the first trajectory data in the embodiment of the present invention), Qn is the real-time trajectory sequence (equivalent to the second trajectory data in the embodiment of the present invention), and Zr is the longest common subsequence of the point-to-line many-to-1. If Zr is a common subsequence, then Zr must meet the following conditions: Among them, ε is the distance threshold, is the Euclidean distance between the point and the line segment, z sis a common subsequence, r is a point on the sequence, and if and only if Zr is the trajectory with the most points that satisfies the above conditions, then it is the longest subsequence of the point-to-line multiple-to-1 of the trajectory Cm and Qn. At this time, let f be the point-to-line multiple-to-1 trajectory similarity between the target trajectory Cm and the real-time trajectory Qn, and the formula is: Furthermore, multiple similarities can be determined based on the common subsequence, multiple second trajectory data, and the first trajectory data, so as to confirm that the first trajectory data of the first object to be queried in the target time period has the same second trajectory data of the second object in the target time period.

[0086] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0087] An embodiment of the present invention further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0088] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:

[0089] S1, determining first trajectory data of a first object to be queried in a target time period, wherein the first trajectory data includes: data collection points passed by the first object;

[0090] S2, acquiring a plurality of second trajectory data of a plurality of second objects, wherein the second objects all pass through the data collection point, and the second trajectory data are trajectory data of the target time period;

[0091] S3, respectively determining similarities between the plurality of second trajectory data and the first trajectory data to obtain a plurality of similarities, and outputting second trajectory data with similarities higher than a preset threshold.

[0092] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.

[0093] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0094] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0095] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0096] S1, determining first trajectory data of a first object to be queried in a target time period, wherein the first trajectory data includes: data collection points passed by the first object;

[0097] S2, acquiring a plurality of second trajectory data of a plurality of second objects, wherein the second objects all pass through the data collection point, and the second trajectory data are trajectory data of the target time period;

[0098] S3, respectively determining similarities between the plurality of second trajectory data and the first trajectory data to obtain a plurality of similarities, and outputting second trajectory data with similarities higher than a preset threshold.

[0099] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.

[0100] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0101] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0102] 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 principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for processing trajectory data, characterized in that: include: Determine first trajectory data of a first object to be queried in a target time period, wherein the first trajectory data includes: data collection points passed by the first object; Acquire multiple second trajectory data of multiple second objects, wherein the second objects all pass through the data collection point, and the second trajectory data are trajectory data of the target time period, and the multiple second trajectory data are determined in the following manner: taking time as a dimension, time slicing the target trajectory data at each data collection point; respectively determining similarities between the plurality of second trajectory data and the first trajectory data, obtaining a plurality of similarities, and outputting second trajectory data having a similarity higher than a preset threshold; The respectively determining the similarities between the plurality of second trajectory data and the first trajectory data includes: Determine a common subsequence of the plurality of second trajectory data and the first trajectory data; The plurality of similarities are determined according to the common subsequence, the plurality of second trajectory data, and the first trajectory data.

2. The method according to claim 1, characterized in that Before acquiring a plurality of second trajectory data of a plurality of second objects, the method further includes: Set the time threshold for trip slicing; When it is determined that the second object passes through two data collection points within the time threshold, the trajectory data corresponding to each second object passing through the two data collection points within the time threshold is determined as target trajectory data of the same trip.

3. The method according to claim 2, characterized in that After determining that the trajectory data corresponding to each second object passing through two data collection points within the time threshold is trajectory data of the same trip, the method further includes: Dividing the target trajectory data of the same trip of multiple second objects according to a bucketing rule, wherein the bucketing rule includes at least one of the following: time slices, data collection points, and the target trajectory data includes: the second trajectory data; The divided trajectory data is stored in a target storage device.

4. The method according to claim 3, characterized in that The trajectory data of the same trip of multiple second objects are divided according to the bucketing rule, including: Dividing the target trajectory data according to different data collection points to obtain a plurality of first sets, wherein there is a one-to-one correspondence between the data collection points and the first sets, and each of the first sets includes: target trajectory data passing through the same data collection point; The first set is divided according to time slices to obtain multiple second sets, wherein each of the second sets includes: target trajectory data in the same time slice.

5. The method according to claim 1, characterized in that Determining first trajectory data of a first object to be queried in a target time period includes: Acquire identification information of the first object, wherein the identification information is used to uniquely identify the first object; Determine first trajectory data of a first object corresponding to the identification information in the target time period.

6. A trajectory data processing device, characterized in that: include: A first determination module is used to determine first trajectory data of a first object to be queried in a target time period, wherein the first trajectory data includes: data collection points passed by the first object; an acquisition module, configured to acquire a plurality of second trajectory data of a plurality of second objects, wherein the second objects all pass through the data collection point, and the second trajectory data are trajectory data of the target time period, and the plurality of second trajectory data are determined in the following manner: taking time as a dimension, time slicing the target trajectory data at each data collection point; An output module, configured to respectively determine similarities between the plurality of second trajectory data and the first trajectory data, obtain a plurality of similarities, and output second trajectory data having a similarity higher than a preset threshold; The output module is further configured to determine a common subsequence between the plurality of second trajectory data and the first trajectory data; and determine the plurality of similarities according to the common subsequence, the plurality of second trajectory data, and the first trajectory data.

7. The device according to claim 6, characterized in that The device also includes: a setting module for setting a time threshold for the trip slice; and a second determination module for, when it is determined that the second object passes through two data collection points within the time threshold, determining that the trajectory data corresponding to each second object passing through the two data collection points within the time threshold is the target trajectory data of the same trip.

8. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 5 when executed.

9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • A vehicle behavior similarity calculation method based on bayonet data

    CN109242024A

  • Motion trajectory display method and device

    CN109542997A

  • Trajectory clustering method and device, and storage medium

    CN110826594A

  • Trajectory similarity determination method and device, electronic equipment and storage medium

    CN111046128A

  • Data processing method, device and system

    CN111241217A