Trajectory proximity query method, apparatus, electronic device, and readable storage medium
The trajectory proximity query method addresses inefficiencies in conventional methods by constructing a spatial range index and performing clipping and pruning processes, resulting in improved efficiency, accuracy, and reliability for large-scale trajectory data analysis.
Patent Information
- Application Number
- JP2023540697
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2020-12-28
- Filing Date
- 2021-09-07
- Publication Date
- 2025-05-26
- Estimated Expiration
- 2041-09-07
AI Technical Summary
Conventional trajectory proximity query methods are inefficient due to the large calculation amount of the Fréchet distance and the inability to handle large-scale trajectory data effectively.
A trajectory proximity query method that constructs a spatial range index using trajectory signatures and spatial position index codes, performs clipping and pruning processes to reduce unnecessary calculations, and randomly stores indices in a distributed server for improved efficiency and reliability.
Enhances the efficiency and accuracy of identifying adjacent trajectories within the query target area, reduces the computational load of the Fréchet distance calculation, and improves the reliability and scalability of trajectory proximity queries.
Smart Images

Figure 0007683010000012 
Figure 0007683010000013 
Figure 0007683010000014
Abstract
Description
Technical Field
[0001] This disclosure claims priority to a Chinese patent application with application number 202011583540.9, titled "Trajectory Proximity Query Method, Apparatus, Electronic Device, and Readable Storage Medium", filed on December 28, 2020, and all contents of the Chinese patent application are incorporated herein by reference in their entirety.
[0002] This disclosure relates to the field of computer technology, and more particularly to a trajectory proximity query method, apparatus, electronic device, and readable storage medium.
Background Art
[0003] A trajectory k-nearest neighbor query means finding the k trajectories that are spatially closest to a given trajectory based on the Fréchet distance.
[0004] Conventional query technologies are mainly as follows. The surrounding spatial range centered on the query trajectory is continuously expanded, and at the same time, all trajectories in that space are traversed and sorted by the distance from the query trajectory until the k nearest trajectories are found.
[0005] However, with the wide application of smart devices and location-based services, large-scale trajectory data is generated, and conventional methods based on relational databases can no longer support a large amount of data storage and analysis operations.
[0006] Since the number of trajectory points on the trajectory is large, the calculation amount of the Fréchet distance is large, and there are serious efficiency problems in existing trajectory proximity queries.
[0007] It should be noted that the information disclosed in the above background art section is only used to enhance the understanding of the background of the present disclosure, and may include information that does not constitute prior art known to those skilled in the art.
Summary of the Invention
Problems to be Solved by the Invention
[0008] An object of the present disclosure is to provide a trajectory proximity query method, apparatus, electronic device, and readable storage medium that overcome at least to some extent the problems caused by the inefficiency of trajectory proximity queries in related technologies.
[0009] Other characteristics and advantages of the present disclosure will become apparent from the following detailed description or will be acquired in part by practicing the present disclosure.
Means for Solving the Problem
[0010] According to an aspect of the present disclosure, a trajectory proximity query method is provided, including steps of obtaining a first trajectory to be queried and determining spatial position information of the first trajectory; generating a trajectory signature based on a positional relationship between the spatial position information of the first trajectory and a query target area; determining a spatial position index code of the first trajectory by XZ-Ordering; and constructing a spatial range index of the first trajectory based on the trajectory signature and the spatial position index code.
[0011] In an embodiment of the present disclosure, the method further includes steps of determining a label of the first trajectory and adding the label of the first trajectory to a postfix of the spatial range index.
[0012] In an embodiment of the present disclosure, the method further includes steps of obtaining a random number of the first trajectory, adding the random number to a prefix of the spatial range index, and randomly storing the spatial range index in a distributed server based on the prefix.
[0013] In one embodiment of the present disclosure, the method further includes the steps of: retrieving one query target area from the first priority queue storing the query target areas; determining the code length of the spatial position index code of the query target area; and based on the magnitude relationship between the code length and a preset length, expanding the query target area or stopping the division of the query target area.
[0014] In one embodiment of the present disclosure, the step of expanding the query target area or stopping the division of the query target area based on the magnitude relationship between the code length and the preset length includes: determining whether the code length is greater than the preset length; if it is determined that the code length is greater than the preset length, not dividing the query target area; and performing a spatial range query process within the query target area.
[0015] In one embodiment of the present disclosure, the step of expanding the query target area or stopping the division of the query target area based on the magnitude relationship between the code length and the preset length includes: determining whether the code length is greater than the preset length; if it is determined that the code length is less than or equal to the preset length, continuously dividing the query target area until the code length of the sub-node query target area is greater than or equal to the preset length, and further including the step of generating a sub-node query target area of the query target area. Quadtree recursive partitioning After stopping the division of the query target area, the method further includes the steps of determining a second trajectory within the query target area and storing the second trajectory in a second priority queue.
[0016] In one embodiment of the present disclosure, after Quadtree recursive partitioning stopping the division of the query target area, the method further includes the steps of determining a second trajectory within the query target area and storing the second trajectory in a second priority queue.
[0017] In one embodiment of the present disclosure, the method further includes determining a first Fréchet distance between the first trajectory and the query target region, determining whether the first Fréchet distance is greater than or equal to a maximum distance threshold, performing region clipping processing on the query target region when it is determined that the first Fréchet distance is greater than or equal to the maximum distance threshold, and updating the maximum distance threshold based on the result of the region clipping processing.
[0018] In one embodiment of the present disclosure, the method further includes determining a lower bound position of the first trajectory and a lower bound position of a second trajectory within the query target region, and performing lower bound clipping processing on the second trajectory of the query target region based on the lower bound position of the first trajectory and the lower bound position of the second trajectory, where the lower bound position includes at least one of a start point lower bound position, an end point lower bound position, and a trajectory signature lower bound position.
[0019] In one embodiment of the present disclosure, the step of performing lower bound clipping processing on the second trajectory of the query target region based on the lower bound position of the first trajectory and the lower bound position of the second trajectory includes determining a start point Fréchet distance between the start point lower bound position of the first trajectory and the start point lower bound position of the second trajectory, and performing a first lower bound clipping processing on the second trajectory based on a magnitude relationship between the start point Fréchet distance and a first preset distance.
[0020] In one embodiment of the present disclosure, the step of performing lower bound clipping processing on the second trajectory of the query target region based on the lower bound position of the first trajectory and the lower bound position of the second trajectory further includes determining an end point Fréchet distance between the end point lower bound position of the first trajectory and the end point lower bound position of the second trajectory, and performing a second lower bound clipping processing on the second trajectory based on a magnitude relationship between the end point Fréchet distance and a second preset distance.
[0021] In one embodiment of the present disclosure, the step of generating a trajectory signature based on the positional relationship between the spatial position information of the first trajectory and the query target region includes: performing ordinal encoding on the four sub-node query target regions of any one of the query target regions; using the sub-node query target regions passed by the first trajectory as the first label, and using the sub-node query target regions not passed by the first trajectory as the second label; and further including the step of determining the trajectory signature of the first trajectory based on the ordinal encoding, the first label, and the second label.
[0022] In one embodiment of the present disclosure, the step of performing lower bound pruning processing on the second trajectory of the query target region based on the lower bound position of the first trajectory and the lower bound position of the second trajectory includes: determining the trajectory signature Frechet distance between the trajectory signature lower bound of the first trajectory and the trajectory signature lower bound of the second trajectory; and further including the step of performing a third lower bound pruning process on the second trajectory based on the magnitude relationship between the trajectory signature Frechet distance and the third preset distance.
[0023] According to another aspect of the present disclosure, a trajectory proximity query device is provided, including an acquisition module configured to acquire a first trajectory of a query target and determine the spatial position information of the first trajectory; a signature module configured to generate a trajectory signature based on the positional relationship between the spatial position information of the first trajectory and the query target region; a determination module configured to determine the spatial position index code of the first trajectory by XZ-Ordering; and an index module configured to construct a spatial range index of the first trajectory based on the trajectory signature and the spatial position index code.
[0024] According to still another aspect of the present disclosure, an electronic device is provided, including a processor and a memory for storing executable instructions of the processor, wherein the processor is configured to execute the trajectory proximity query method according to any one of the above items by executing the executable instructions.
[0025] According to still another aspect of the present disclosure, there is provided a computer-readable storage medium storing a computer program, which when executed by a processor, realizes the trajectory proximity query method according to any one of the above items.
[0026] The trajectory proximity query scheme provided by the present disclosure constructs a spatial range index of the first trajectory, thereby enhancing the index and efficiency of the query target area, and further enhancing the efficiency and accuracy of identifying the trajectories adjacent to the query target trajectory within the query target area.
[0027] Furthermore, by performing clipping processing on the query target area through area clipping, the query range of the second trajectory is simplified, the efficiency of the spatial range query is enhanced, and the query process is accelerated.
[0028] Furthermore, by performing lower bound clipping processing on the second trajectory, the calculation amount of the Fréchet distance is reduced, and unnecessary trajectory queries and query time are reduced.
[0029] Finally, by randomly storing the spatial range index in a distributed server, the maintenance pressure of the trajectory data is reduced, and the reliability of the trajectory proximity query is improved.
[0030] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory and are not intended to limit the present disclosure.
[0031] Here, the drawings are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure and used together with the specification to explain the principles of the present disclosure. Obviously, the drawings in the following description are only some embodiments of the present disclosure, and those skilled in the art can obtain other drawings based on these drawings without creative efforts.
Brief Description of the Drawings
[0032]
Figure 1A
Figure 1B
Figure 1C
Figure 1D
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9
Figure 10
Figure 11
Figure 12
Figure 13
Figure 14
Figure 15
Figure 16
Figure 17
Figure 18
Figure 19
Figure 20
Figure 21
DETAILED DESCRIPTION OF THE INVENTION
[0033] Next, with reference to the drawings, exemplary embodiments will be described in more detail. However, the exemplary embodiments can be implemented in various forms and should not be understood as being limited to the examples described herein. In contrast, these embodiments are provided to make the present disclosure more comprehensive and complete and to fully convey the concept of the exemplary embodiments to those skilled in the art. The features, structures, or characteristics described can be incorporated into one or more embodiments in any suitable manner.
[0034] Also, the drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings indicate the same or similar parts, so duplicate descriptions are omitted. Some of the block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software form, or may be implemented in one or more hardware modules or integrated circuits, or may be implemented in different networks and / or processor devices and / or microcontroller devices.
[0035] The scheme provided by the present disclosure constructs a spatial range index of the first trajectory, enhances the index and efficiency of the query target area, and further improves the efficiency and accuracy of identifying the trajectories adjacent to the query target trajectory within the query target area. Furthermore, by performing pruning processing on the query target area through area pruning, the query range of the second trajectory is simplified, the efficiency of the spatial range query is enhanced, and the query process is accelerated. Furthermore, by performing lower bound pruning processing on the second trajectory, the calculation amount of the Fréchet distance is reduced, and unnecessary trajectory queries and query time are reduced. Finally, by randomly storing the spatial range index in a distributed server, the maintenance pressure of the trajectory data is reduced, and the reliability of the trajectory proximity query is improved.
[0036] As shown in FIG. 1, the trajectory proximity query scheme of the present disclosure is related to the following several important concepts: (1) GPS Point (GPSPoint): The GPS point p = (lat; lng; t) includes one latitude lat, one longitude lng, and one timestamp t. It indicates that the moving object is located at the geographical coordinate position (lat; lng) at time t.
[0037]
Number
[0038]
Number
[0039] [Number]
[0040] [Number]
[0041] (6) NoSQL: Generally refers to a non-relational database. Its data storage does not require a fixed table mode. It emerges to solve the challenges brought by multiple data types in large data sets, especially the problems in big data applications.
[0042] (7) HBase: A distributed storage system with high reliability, high performance, column-oriented and scalability. It can build a large-scale structured storage cluster on inexpensive machines and is a type of NoSQL.
[0043] (8) Fréchet distance: The Fréchet Distance, which is a description of path space similarity and is often used to measure the similarity between trajectories.
[0044] (9) XZ-Ordering: An encoding method of a space-filling curve combined with time information. (10) Priority queue: A general data structure in which elements are assigned priorities and the element with the highest priority is deleted first. Therefore, compared with the first-in-first-out of a normal queue, the priority queue has the characteristic of first-out of the highest priority.
[0045] The scheme provided by the embodiments of the present disclosure relates to technologies such as postfix trees, path decomposition, and distributed architectures, and will be specifically described by the following embodiments.
[0046] The above trajectory proximity query scheme can be realized by the interaction between multiple terminals and a server cluster.
[0047] The terminal can be a mobile terminal such as a mobile phone, a game console, a tablet, an e - book reader, smart glasses, an MP4 (Moving Picture Experts Group Audio Layer IV) player, a smart home device, an AR (Augmented Reality) device, a VR (Virtual Reality) device, etc., or the terminal can be a personal computer (PC) such as a laptop portable computer or a desktop computer.
[0048] Here, an application for providing a trajectory proximity query may be installed on the terminal.
[0049] The terminal and the server cluster are connected via a communication network. Optionally, the communication network is a wired network or a wireless network.
[0050] The server cluster is a server, composed of multiple servers, a virtualization platform, or a cloud computing service center. The server cluster is used to provide background services for an application that provides a trajectory proximity query. Optionally, the server cluster is responsible for primary computing operations and the terminal is responsible for secondary computing operations. Or, the server cluster is responsible for secondary computing operations and the terminal is responsible for primary computing operations. Or, joint computing is performed between the terminal and the server cluster using a distributed computing architecture.
[0051] In some example embodiments, the postfix tree index is used to first index strings, which can improve the performance of string postfix searches. In trajectory data management, the trajectory after matching can be regarded as a string, the label of each road segment is equivalent to one character of the string, and a path query (without considering time filter conditions) can be mapped to a string postfix search problem, that is, a search using a road segment identification sequence can be regarded as a search using a character sequence.
[0052] Optionally, the clients of the applications installed on different terminals are the same, or the clients of the applications installed on two terminals are clients of the same type of application on different control system platforms. Based on the differences in terminal platforms, the specific forms of the application clients may be different. For example, the application client may be a mobile phone client, a PC client, or a global wide area network client, etc.
[0053] A person skilled in the art can recognize that the number of the above terminals may be more or less. For example, the above terminal may be one, or the above terminal may be dozens or hundreds, or more. The embodiments of the present disclosure do not limit the number and device type of the terminals.
[0054] Optionally, the system can further include a management device connected to a server cluster via a communication network. Optionally, the communication network is a wired network or a wireless network.
[0055] Optionally, the above wireless network or wired network uses standard communication technologies and / or protocols. The network is usually the Internet, but can be any network, including, but not limited to, a Local Area Network (LAN), a Metropolitan Area Network (MAN), a Wide Area Network (WAN), a mobile, wired or wireless network, a private network, or any combination of virtual private networks. In some embodiments, technologies and / or formats including Hyper Text Mark-up Language (HTML), Extensible Markup Language (XML), etc. are used to represent data exchanged over the network. Additionally, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec), etc. can be used to encrypt all or some of the links. In some other embodiments, customized and / or proprietary data communication technologies can be used or added instead of the above data communication technologies.
[0056] Hereinafter, each step of the trajectory proximity query method in this exemplary embodiment will be described in more detail with reference to the drawings and examples.
[0057] FIG. 2 shows a flowchart of the trajectory proximity query method in an embodiment of the present disclosure. The method provided by the embodiment of the present disclosure can be executed by any electronic device with computing processing capabilities, and is exemplarily described with a server cluster as the execution subject.
[0058] As shown in FIG. 2, the server cluster executes a trajectory proximity query method including the following steps.
[0059] In step S202, obtain the first trajectory of the query target, and determine the spatial position information of the first trajectory.
[0060] In step S204, generate a trajectory signature based on the positional relationship between the spatial position information of the first trajectory and the query target area.
[0061] In the above embodiment, the query target area is divided into β×β same-sized areas, where β is an integer greater than or equal to 1, and each area is encoded from 0. That is, the spatial position information of the trajectory tr can be represented by a β×β binary sequence.
[0062] For example, when at least one GPS point in the trajectory is located in an area, the corresponding binary position is 1, otherwise it is set to 0.
[0063] In step S206, determine the spatial position index code of the first trajectory by XZ-Ordering.
[0064] In the above embodiment, the spatial position index code is a code generated based on XZ-Ordering. First, obtain the quaternary sequence of one trajectory, and then convert this quaternary sequence into a single decimal long integer number.
[0065] In step S208, construct the spatial range index of the first trajectory based on the trajectory signature and the spatial position index code.
[0066] In the above embodiment, by constructing the spatial range index of the first trajectory, the index of the query target area and the efficiency of the query are improved. Furthermore, the efficiency and accuracy of identifying the trajectories adjacent to the query target trajectory within the query target area are improved. Additionally, by performing pruning processing on the query target area through area pruning, the query range of the second trajectory is simplified, the efficiency of the spatial range query is increased, and the query process is accelerated. Moreover, by performing lower bound pruning processing on the second trajectory, the calculation amount of the Fréchet distance is reduced, and unnecessary trajectory queries and query time are reduced.
[0067] Based on the steps shown in FIG. 2, as shown in FIG. 3, the trajectory proximity query method further includes the following steps.
[0068] In step S302, determine the label of the first trajectory. In step S304, add the label of the first trajectory to the postfix of the spatial range index.
[0069] In the above-mentioned embodiment, by adding the label of the first trajectory to the postfix of the spatial range index, the spatial range query is supported. That is, by specifying the query space, all trajectory records within the space can be queried.
[0070] Based on the steps shown in FIG. 2, as shown in FIG. 4, the trajectory proximity query method further includes the following steps.
[0071] In step S402, obtain the random number of the first trajectory. In step S404, add the random number to the prefix of the spatial range index.
[0072] In step S406, randomly store the spatial range index in the distributed server based on the prefix.
[0073] In the above embodiment, by randomly storing the spatial range index in the distributed server, data can be efficiently distributed to different data servers, enhancing load balancing and the pressure on data hotspots, reducing the maintenance pressure of high-level trajectory data, and enhancing the reliability of trajectory proximity queries.
[0074] Based on the steps shown in FIG. 2, as shown in FIG. 5, the trajectory proximity query method further includes the following steps.
[0075] In step S502, one query target area is taken out from the first priority queue storing the query target areas.
[0076] In step S504, the code length of the spatial position index code of the query target area is determined.
[0077] In step S506, based on the magnitude relationship between the code length and the preset length, the query target area is expanded or the division of the query target area is stopped.
[0078] In the above embodiment, the larger the code length of the spatial position index code of the query target area, the more accurate the spatial representation of the trajectory. Therefore, the accuracy of the query target area is controlled by the preset length.
[0079] Based on the steps shown in FIGS. 2 and 5, as shown in FIG. 6, expanding the query target area or stopping the division of the query target area based on the magnitude relationship between the code length and the preset length includes the following steps.
[0080] In step S6062, it is determined whether the code length is greater than the preset length. If so, step S6064 is executed; if not, step S6068 is executed.
[0081] In step S6064, if it is determined that the code length is greater than the preset length, the query target area is not divided.
[0082] In step S6066, spatial range query processing is executed within the query target area.
[0083] In the above embodiment, when it is determined that the code length is greater than the preset length, the query target area is not divided, spatial range query processing is executed within the query target area, and on the premise that the query accuracy is guaranteed, the query range of the second trajectory is effectively reduced.
[0084] Based on the steps shown in FIGS. 2 and 5, as shown in FIG. 6, expanding the query target area or stopping the division of the query target area based on the magnitude relationship between the code length and the preset length further includes the following steps.
[0085] In step S6062, it is determined whether the code length is greater than the preset length.
[0086] In step S6068, when it is determined that the code length is less than or equal to the preset length, the query target area is Quadtree recursive partitioning divided until the code length of the sub-node query target area becomes greater than or equal to the preset length, thereby generating a sub-node query target area of the query target area.
[0087] In the above embodiment, when it is determined that the code length is less than or equal to the preset length, the query target area is Quadtree recursive partitioning divided until the code length of the sub-node query target area becomes greater than or equal to the preset length, thereby accurately controlling the division process of the query target area.
[0088] Based on the steps shown in FIG. 2, as shown in FIG. 7, the trajectory proximity query method further includes the following steps.
[0089] In step S702, after stopping the Quadtree recursive partitioning of the query target area, determine a second trajectory within the query target area and store the second trajectory in a second priority queue.
[0090] In the above embodiment, after stopping the Quadtree recursive partitioning of the query target area, determine a second trajectory within the query target area, store the second trajectory in a second priority queue, and the number of second trajectories in the second priority queue meets the requirements of the query number.
[0091] Also, the second trajectories in the second priority queue also have priorities, and the element with the highest priority is deleted first. That is, during subsequent lower bound pruning processing, it is preferentially pruned, and a second trajectory that meets the query distance requirement can be obtained more quickly.
[0092] Specifically, when the code sequence length of the query target area is less than a constant g given by the system, add the four 4-tree sub-nodes of the query target area to the first priority queue, and then check the next area of the first priority queue. When the code sequence length of the query target area reaches a predetermined constant g, without dividing the query target area, directly use the query target area to execute a spatial range query to obtain a trajectory result set T SR to obtain.
[0093] Based on the steps shown in FIG. 2, as shown in FIG. 8, the trajectory proximity query method further includes the following steps.
[0094] In step S802, determine a first Fréchet distance between the first trajectory and the query target area.
[0095] In step S804, determine whether the first Fréchet distance is greater than or equal to a maximum distance threshold. If so, execute step S806; if not, execute step S810.
[0096] In step S806, when it is determined that the first Fréchet distance is greater than or equal to the maximum distance threshold, region clipping processing is performed on the query target region.
[0097] In step S808, the maximum distance threshold is updated based on the result of the region clipping processing.
[0098] In step S810, a second trajectory within the query target region is queried. In the above embodiment, the inventor determined as follows through verification and inference. Region_LB fF (q,r)>d max If so, f F (q,tr)>d max holds, and f F (q,tr) is the Fréchet distance between the trajectory and the query target space, and the trajectory tr is the trajectory first searched when performing a spatial range query by the query target space.
[0099] Specifically, when the second trajectory is not searched for the first time, that is, when it is searched in a previous "internal" query region, it is necessary to check whether there is a result set of the k-nearest trajectory query.
[0100] Also, when the second trajectory is searched for the first time, the following formula holds.
[0101]
Equation
[0102] Based on this, by clipping the query target region according to the first Fréchet distance, the invalid region of the query target region can be effectively removed, and thus the efficiency and reliability of the trajectory proximity query can be improved.
[0103] Based on the steps shown in FIG. 2, as shown in FIG. 9, the trajectory proximity query method further includes the following steps.
[0104] In step S902, determine the lower bound position of the first trajectory and the lower bound position of the second trajectory within the query target region.
[0105] In step S904, based on the lower bound position of the first trajectory and the lower bound position of the second trajectory, perform a lower bound pruning process on the second trajectory in the query target region, where the lower bound position includes at least one of the start point lower bound position, the end point lower bound position, and the trajectory signature lower bound position.
[0106] In the above embodiment, since the pruning process is performed based on the Fréchet distance between the lower bound position of the first trajectory and the lower bound position of the second trajectory, the computational amount of distance calculation for all trajectory points of the first trajectory and the second trajectory is avoided, and the time complexity is reduced.
[0107] Based on the steps shown in FIG. 2, as shown in FIG. 10, the step of performing a lower bound pruning process on the second trajectory in the query target region based on the lower bound position of the first trajectory and the lower bound position of the second trajectory includes the following steps.
[0108] In step S1002, determine the start point Fréchet distance between the start point lower bound position of the first trajectory and the start point lower bound position of the second trajectory.
[0109] In step S1004, based on the magnitude relationship between the start point Fréchet distance and the first preset distance, perform a first lower bound pruning process on the second trajectory.
[0110] Based on the steps shown in FIGS. 2 and 9, as shown in FIG. 11, the step of performing a lower bound pruning process on the second trajectory in the query target region based on the lower bound position of the first trajectory and the lower bound position of the second trajectory further includes the following steps.
[0111] In step S11042, determine the end point Fréchet distance between the end point lower bound position of the first trajectory and the end point lower bound position of the second trajectory.
[0112] In step S11044, based on the magnitude relationship between the end Fresnel distance and the second preset distance, a second lower bound clipping process is performed on the second trajectory.
[0113] In the above embodiment, the present disclosure proposes a lower bound on the start and end point distances of similar trajectories (the return value of Lower Bound, lower_bound() is an iterator that points to the position of the first value greater than or equal to the key) based on the start and end points of the trajectory. When the lower bound of the distance is greater than a predetermined similarity threshold ε, the first trajectory and the second trajectory are not necessarily similar, and based on this, the second trajectory in the query target area is quickly clipped.
[0114] Based on the steps shown in FIG. 2, as shown in FIG. 12, the step of generating a trajectory signature based on the positional relationship between the spatial position information of the first trajectory and the query target area further includes the following steps.
[0115] In step S12042, ordinal encoding is performed on the four sub-node query target areas of any of the query target areas.
[0116] In step S12044, the sub-node query target area passed by the first trajectory is used as the first label, and the sub-node query target area not passed by the first trajectory is used as the second label.
[0117] In step S12046, based on the ordinal encoding, the first label, and the second label, the trajectory signature of the first trajectory is determined.
[0118] In the above embodiment, the first label may be binary "1", the second label may be binary "0", and a trajectory signature with uniqueness is generated according to the order of the ordinal encoding.
[0119] Based on the steps shown in FIGS. 2 and 9, as shown in FIG. 13, the step of performing a lower bound clipping process on the second trajectory of the query target region based on the lower bound position of the first trajectory and the lower bound position of the second trajectory further includes the following steps.
[0120] In step S13042, determine the trajectory signature Fréchet distance between the trajectory signature lower bound of the first trajectory and the trajectory signature lower bound of the second trajectory.
[0121] In step S13044, perform a third lower bound clipping process on the second trajectory based on the magnitude relationship between the trajectory signature Fréchet distance and a third preset distance.
[0122]
Number
[0123] Thereby, since the trajectory signature can represent the position information of the trajectory more accurately, the present disclosure proposes a means for the signature lower bound. When the signature lower bounds of two trajectories are greater than a predetermined threshold ε, the first trajectory and the second trajectory are never similar, and more efficient high-speed clipping is performed on the second trajectory of the query target region.
[0124] FIGS. 14 to 19 show an embodiment of a trajectory proximity query scheme. In the trajectory k-nearest neighbor query, the present disclosure regards the spatial range query as a sub-operation.
[0125]
Number
[0126]
Number
[0127] As shown in FIG. 15, the inventor uses the first trajectory tr 1 and the second trajectory tr 2For the similarity, lower bound pruning and trajectory signature pruning are proposed, and the following theorem is proposed and verified to improve the reliability and efficiency of trajectory neighbor queries.
[0128]
Number
[0129] Theorem 3. MBR Pruning Theorem: If the trajectory tr is not completely contained in the region S, that is, if there is at least one GPS point p located outside the region S in tr, then for the Fréchet distance, tr is definitely not similar to q.
[0130]
Number
[0131] According to the embodiments of the present disclosure, by inputting the query point q, the Fréchet distance function f F , and the number k of trajectories to be returned, the output is the k-nearest point query trajectory result set T knn , and specifically, it can be divided into the following three steps.
[0132] The first step of the query: mainly to initialize some variables. Here, cdq is the second priority queue for storing the second trajectory, req is used to identify the first priority queue and record the spatial region range to be inspected, and d max is the maximum value of the distances between the current query trajectory q and all the trajectories in cdq.
[0133] The second step of the query: Take out a spatial region r from req. If there are already k trajectories in the candidate set cdq and the distance between the spatial region r and the query trajectory q is greater than d max , it means that the un-searched trajectories definitely do not exist in the result set (see Theorem 2, which is called region pruning in the present disclosure), and the query process can end.
[0134] If the code sequence length of r is less than a constant g given by the system, the present disclosure adds the four 4-tree sub-nodes of r to req and then examines the next area in req.
[0135] When the code sequence length of r reaches a predetermined constant g, the present disclosure executes a spatial range query directly using r without splitting r, and obtains the result set T SR thereof.
[0136]
Number
[0137] If tr satisfies all the above lower bounds, the present disclosure adds the candidate result set cdq and then updates d max thereof.
[0138] The third stage of the query: When all candidate areas in req have been examined, the present disclosure returns the trajectories in the candidate result cdq as the final result.
[0139] Figures 16 to 19 provide the performance test results and query performance results of the trajectory proximity query of the present disclosure.
[0140] (1) Performance test results This disclosure verifies the performance of the proposed method of this disclosure using two datasets: 1) T-Drive [1], which is a publicly available dataset that includes GPS point information of over 10,000 taxis in Beijing, with a time span of seven days from February 2, 2008, to February 8, 2008; 2) Lorry, which is a GPS trajectory dataset of trucks, including one-month GPS trajectory information of nearly 50,000 JD Logistics trucks in Guangzhou, with a time span from March 1, 2014, to March 31, 2014. In this disclosure, Spark preprocessing is used to process the trajectories, and HBase is stored as the underlying NoSQL. All experiments are executed on a cluster with five nodes, each node installed with the Centos 7.4 operating system, having an 8-core CPU, 32GB of memory, and a 1T normal mechanical disk.
[0141] As shown in FIGS. 16 and 17, the proposed method of this disclosure is TM, and three comparative experiments are proposed: 1) Dita, which is a typical memory-based trajectory management system. It proposes an effective data partitioning method to solve the data locality problem and also proposes a cost-based technique to achieve load balancing. Its main idea is to identify representative GPS points, and then design a tree-structured index based on these representative points to efficiently filter dissimilar trajectories. 2) TM nps , which is a variant of the TM method and does not adopt the PosCode technology in the spatial range index table. 3) TM nlb , which is another variant of the TM method and does not adopt the lower bound pruning strategy in the process of similar queries.
[0142] When considering the trajectory similarity metric, this disclosure uses the Fréchet distance f F , and the experimental results of other distance metric functions, such as the Hausdorff distance f H and the dynamic time warping f D are similar.
[0143] (2) Query performance comparison. As shown in FIGS. 18 and 19, the change situation of the similar query time in the case of different data amounts was compared. The similarity threshold is 3 km by default.
[0144] In all methods, as the data amount increases, the time required for similar queries increases. This is because as the data amount increases, for the same similarity threshold, the number of return trajectories also increases. TM is slightly faster than TM nps because the spatial range query is called at the lowest level of the similar query, and PosCode can reduce unnecessary trajectory scans and improve query efficiency.
[0145] When the lower bound pruning filtering algorithm is not used, in the present disclosure, it is necessary to call the Fréchet distance calculation formula to verify all trajectories that satisfy the spatial range query, which is very time-consuming, so TM nlb is a little slower than TM. Dita is much slower than TM. As described above, Dita constructs a large index in memory, and for each query, Dita scans the index file, which takes a long time.
[0146] On the other hand, TM can directly generate a query window and then convert it into a parallel SCAN operation at the lowest level. Because a large amount of memory overhead is required, Dita has high requirements for clusters and its scalability is limited.
[0147] Actually, when the Lorry (load) dataset exceeds 60%, Dita throws a memory overflow exception, but TM can still operate very well. Even when the Lorry dataset reaches 100%, TM can operate smoothly, showing the strong scalability of the TM method.
[0148] As shown in FIGS. 18 and 19, with the increase of the similarity threshold ε, for all methods, the time overhead of similar queries also increases slightly, which is to return trajectories that satisfy more conditions. TM and its variant methods are much faster than Dita, and in some cases, they achieve an efficiency improvement of three orders of magnitude, which further proves the efficiency of the present disclosure.
[0149] Hereinafter, with reference to FIG. 20, a trajectory proximity query device (2000) according to such an embodiment of the present disclosure will be described. The trajectory proximity query device (2000) shown in FIG. 20 is merely an example and does not impose any limitations on the functions and usage scopes of the embodiments of the present disclosure.
[0150] The trajectory proximity query device (2000) is represented in the form of a hardware module. The components of the trajectory proximity query device (2000) can include, but are not limited to, an acquisition module (2002), a signature module (2004), a decision module (2006), and an index module (2008).
[0151] The acquisition module (2002) is configured to acquire a first trajectory to be queried and determine the spatial position information of the first trajectory.
[0152] The signature module (2004) is configured to generate a trajectory signature based on the positional relationship between the spatial position information of the first trajectory and the query target area.
[0153] The decision module (2006) is configured to determine the spatial position index code of the first trajectory by XZ-Ordering.
[0154] The index module (2008) is configured to construct a spatial range index of the first trajectory based on the trajectory signature and the spatial position index code.
[0155] The present disclosure proposes a trajectory proximity query scheme. By constructing a spatial range index for the first trajectory, the index of the query target area and the efficiency of the query are improved. Furthermore, the efficiency and accuracy of identifying the trajectories adjacent to the query target trajectory within the query target area are enhanced. Additionally, by performing a clipping process on the query target area through area clipping, the query range of the second trajectory is simplified, the efficiency of the spatial range query is increased, and the query process is accelerated. Moreover, by performing a lower bound clipping process on the second trajectory, the computational amount of the Fréchet distance is reduced, and unnecessary trajectory queries and query time are reduced. Finally, by randomly storing the spatial range index in a distributed server, the maintenance pressure of the trajectory data is reduced, and the reliability of the trajectory proximity query is improved.
[0156] Hereinafter, with reference to FIG. 21, an electronic device (2100) according to such an embodiment of the present disclosure will be described. The electronic device (2100) shown in FIG. 21 is merely an example and does not impose any limitations on the functions and usage ranges of the embodiments of the present disclosure.
[0157] As shown in FIG. 21, the electronic device (2100) is represented as a general-purpose computing device. The components of the electronic device (2100) may include, but are not limited to, the at least one processing unit (2110), the at least one storage unit (2120), and a bus (2130) that connects different system components (including the storage unit (2120) and the processing unit (2110)).
[0158] Here, the storage unit stores program code, and the program code can be executed by the processing unit (2110) such that the processing unit (2110) executes the steps according to various embodiments of the present disclosure described in the "exemplary method" section above. For example, the processing unit (2110) can execute the steps of the trajectory proximity query method as shown in FIGS. 2 to 13 and other steps limited to the trajectory proximity query method of other embodiments of the present disclosure.
[0159] The memory unit (2120) can include a readable medium in the form of a volatile memory unit such as a random access memory unit (RAM) (21201) and / or a cache memory unit (21202), and can further include a read-only memory unit (ROM) (21203).
[0160] The memory unit (2120) can also include a program / utility (21204) having a set (at least one) of program modules (21205), and such program modules (21205) include, but are not limited to, an operating system, one or more applications, other program modules, and program data. Implementations of a network environment may be included in each or some combination of these examples.
[0161] The bus (2130) can represent one or more of several classes of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, a graphics accelerator port, a processing unit, or a local bus using any of the bus structures of the plurality of bus structures.
[0162] The electronic device (2100) can also communicate with one or more external devices (2140) such as a keyboard, a pointing device, a Bluetooth device, etc., and can also communicate with one or more devices that enable a user to interact with the electronic device, and / or can communicate with any device (such as a router, a modem, etc.) that enables the electronic device (2100) to communicate with one or more other computing devices. This communication can be performed via an input / output (I / O) interface (2150). Also, the electronic device (2100) can communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter (2160). The network adapter (2160) communicates with other modules of the electronic device (2100) via a bus (2130). Although not shown, other hardware and / or software modules can be used in combination with the electronic device, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RA identification systems, tape drives, and data backup storage systems.
[0163] From the description of the above embodiments, those skilled in the art can easily understand that the exemplary embodiments described in this specification may be implemented by software, or may be implemented by combining the necessary hardware with software. Therefore, the technical aspects according to the embodiments of the present disclosure may be embodied in the form of a software product, and the software product may be stored on a non-volatile storage medium (which may be a CD-ROM, a USB disk, a mobile hard disk, etc.) or on a network, and includes several instructions for causing a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
[0164] In an exemplary embodiment of the present disclosure, a computer-readable storage medium storing a program product capable of implementing the methods described herein is also provided. In some possible embodiments, various aspects of the present disclosure may be embodied in the form of a program product including program code, and when the program product is operating on a terminal device, the program code causes the terminal device to execute steps according to various embodiments of the present disclosure described in the "exemplary methods" section above.
[0165] A program product for implementing the above-described method according to an embodiment of the present disclosure employs a portable compact disc read-only memory (CD-ROM), includes program code, and can operate on a terminal device such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this file, the readable storage medium may be any tangible medium including or storing a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
[0166] A computer-readable signal medium can include a data signal contained within a baseband carrying a readable program code or propagated as part of a carrier wave. The data signal propagated in this way can take various forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. The readable signal medium may be any readable medium other than the readable storage medium, and the readable medium can transmit, propagate, or send a program used by or in combination with an instruction execution system, apparatus, or device.
[0167] The program code included in the readable medium can be transmitted through any suitable medium, including, but not limited to, wireless, wired, optical cable, RF, or any suitable combination of the above.
[0168] The program code for executing the operations of the present disclosure can be described in any combination of one or more programming languages including object-oriented programming languages such as Java, C++, etc., and also includes conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, executed as an independent package, executed partially on the user computing device and partially on a remote computing device, or executed entirely on a remote computing device or server. When related to a remote computing device, the remote computing device can be connected to the user computing device via any type of network including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
[0169] In addition, in the above detailed description, some modules or units of the device for operation execution were mentioned, but such division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of the above two or more modules or units can be embodied in one module or unit. Conversely, the features and functions of the above one module or unit can be further divided and embodied in a plurality of modules or units.
[0170] In addition, in the accompanying drawings, each step of the method in the present disclosure is described in a specific order, but this does not require or imply that these steps must be executed in that specific order, or that all steps must be executed to achieve the desired result. Additionally or alternatively, some steps can be omitted, multiple steps can be integrated and executed as one step, and / or one step can be divided into multiple steps for execution.
[0171] From the description of the above embodiments, those skilled in the art can easily understand that the exemplary embodiments described in this specification may be implemented by software, or may be implemented by combining the necessary hardware with software. Therefore, the technical aspects according to the embodiments of the present disclosure may be embodied in the form of a software product, and the software product can be stored on a non-volatile storage medium (which can be a CD-ROM, a USB disk, a mobile hard disk, etc.) or on a network, and includes several instructions for causing a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
[0172] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any modifications, uses, or adaptations of the present disclosure, including known common general knowledge or conventional technical means in the technical field not disclosed in the present disclosure, in accordance with the general principles of the present disclosure. The specification and examples are to be regarded as merely illustrative, and the true scope and spirit of the present disclosure are pointed out by the appended claims.
Claims
1. Obtaining a first trajectory of a query target and determining spatial position information of the first trajectory; Generating a trajectory signature based on a positional relationship between the spatial position information of the first trajectory and a query target area; Determining a spatial position index code of the first trajectory by XZ-Ordering; Constructing a spatial range index of the first trajectory based on the trajectory signature and the spatial position index code A trajectory proximity query method characterized by the above.
2. Determining a label of the first trajectory; Further comprising the step of adding the label of the first trajectory to a postfix of the spatial range index The method according to claim 1, characterized by the above.
3. Obtaining a random number of the first trajectory; Adding the random number to a prefix of the spatial range index; Further comprising the step of randomly storing the spatial range index in a distributed server based on the prefix The method according to claim 2, characterized by the above.
4. Taking out one query target area from a first priority queue storing the query target area; Determining a code length of a spatial position index code of the query target area; Further comprising the step of expanding the query target area or stopping the division of the query target area based on a magnitude relationship between the code length and a preset length The method according to claim 1, characterized by the above.
5. The step of expanding the query target area or stopping the division of the query target area based on a magnitude relationship between the code length and a preset length includes: Determining whether the code length is greater than the preset length; When it is determined that the code length is greater than the preset length, not dividing the query target area; Executing a spatial range query process within the query target area The method according to claim 4, characterized by the above.
6. The step of expanding the query target area or stopping the division of the query target area based on a magnitude relationship between the code length and a preset length includes: Determining whether the code length is greater than the preset length; When it is determined that the code length is less than or equal to the preset length, until the code length of the sub-node query target area becomes greater than or equal to the preset length, the query target area is recursively divided into a quadtree to generate a sub-node query target area of the query target area. The method according to claim 4, characterized in that.
7. After stopping the quadtree recursive division of the query target area, further comprising the steps of determining a second trajectory within the query target area and storing the second trajectory in a second priority queue. The method according to claim 1, characterized in that.
8. Determining a first Fréchet distance between the first trajectory and the query target area; Determining whether the first Fréchet distance is greater than or equal to a maximum distance threshold; When it is determined that the first Fréchet distance is greater than or equal to the maximum distance threshold, performing an area clipping process on the query target area; Further comprising the step of updating the maximum distance threshold based on the result of the area clipping process. The method according to claim 1, characterized in that.
9. Determining a lower bound position of the first trajectory and a lower bound position of a second trajectory within the query target area; Further comprising the step of performing a lower bound clipping process on the second trajectory of the query target area based on the lower bound position of the first trajectory and the lower bound position of the second trajectory, The lower bound position includes at least one of a start point lower bound position, an end point lower bound position, and a trajectory signature lower bound position. The method according to claim 1, characterized in that.
10. The step of performing a lower bound clipping process on the second trajectory of the query target area based on the lower bound position of the first trajectory and the lower bound position of the second trajectory includes: Determining a start point Fréchet distance between the start point lower bound position of the first trajectory and the start point lower bound position of the second trajectory; Performing a first lower bound clipping process on the second trajectory based on the magnitude relationship between the start point Fréchet distance and a first preset distance. The method according to claim 9, characterized in that.
11. The step of performing a lower bound clipping process on the second trajectory of the query target area based on the lower bound position of the first trajectory and the lower bound position of the second trajectory includes: Determining an end point Fréchet distance between the end point lower bound position of the first trajectory and the end point lower bound position of the second trajectory; Further comprising the step of performing a second lower bound pruning process on the second trajectory based on the magnitude relationship between the end Fresnel distance and the second preset distance The method according to claim 9, characterized in that
12. Based on the positional relationship between the spatial position information of the first trajectory and the query target area, the step of generating a trajectory signature includes The step of performing ordered encoding on the four sub-node query target areas of any one of the query target areas Using the sub-node query target area passed by the first trajectory as the first label, and using the sub-node query target area not passed by the first trajectory as the second label Further comprising the step of determining the trajectory signature of the first trajectory based on the ordered encoding, the first label, and the second label The method according to claim 1, characterized in that
13. Based on the lower bound position of the first trajectory and the lower bound position of the second trajectory, the step of performing a lower bound pruning process on the second trajectory of the query target area includes The step of determining the trajectory signature Fresnel distance between the trajectory signature lower bound of the first trajectory and the trajectory signature lower bound of the second trajectory Further comprising the step of performing a third lower bound pruning process on the second trajectory based on the magnitude relationship between the trajectory signature Fresnel distance and the third preset distance The method according to claim 9, characterized in that
14. An acquisition module configured to acquire a first trajectory of a query target and determine the spatial position information of the first trajectory A signature module configured to generate a trajectory signature based on the positional relationship between the spatial position information of the first trajectory and the query target area A determination module configured to determine the spatial position index code of the first trajectory by XZ-Ordering Comprising an index module configured to construct a spatial range index of the first trajectory based on the trajectory signature and the spatial position index code A trajectory proximity query device, characterized in that
15. A processor A memory for storing executable instructions of the processor The processor is configured to execute the trajectory proximity query method according to any one of claims 1 to 13 by executing the executable instructions An electronic device, characterized in that
16. A computer program is stored, and when the computer program is executed by a processor, the trajectory proximity query method according to any one of claims 1 to 13 is realized. A computer-readable storage medium characterized by the above.
Citation Information
Patent Citations
Onboard communication device
JP2009064318A
Channel information processor, method and program
JP2016110337A
Extended search algorithm based on trajectory query with interest regions
WO2019024346A1