Track query method and device based on adaptive space segmentation

By adopting adaptive spatial segmentation and multi-layer segmented linear approximation model methods in trajectory data query, the problem of low efficiency of trajectory data query in the prior art is solved, and efficient index storage and query performance is achieved.

CN120144643AInactive Publication Date: 2025-06-13CHINA UNIV OF GEOSCIENCES (WUHAN)

Patent Information

Application Number
CN202510622611.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-15
Publication Date
2025-06-13
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing trajectory data query methods are less efficient, especially the model complexity problems caused by different dimensions of time and space at sparse points.

Method used

The trajectory query method based on adaptive spatial segmentation is adopted to build an index space layer through a data-driven adaptive hierarchical division strategy, and an index time layer of a multi-layer segmented linear approximation model is built for each spatial partition to achieve efficient trajectory data query.

Benefits of technology

It improves the storage efficiency and query performance of trajectory data indexes, avoids excessive subdivision in sparse areas, and provides sufficient details in dense areas, realizing automatic adjustment of index granularity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120144643A_ABST
    Figure CN120144643A_ABST
Patent Text Reader

Abstract

The invention discloses a track query method and device based on adaptive space division, relates to the technical field of track data indexing, and mainly aims to solve the problem of low track data query efficiency. The method mainly comprises the following steps: constructing an index space layer of target trajectory data based on a data-driven adaptive hierarchical division strategy, and respectively constructing index time layers based on a multilayer piecewise linear approximation model for each space partition in the index space layer; in response to the trajectory data query instruction, obtaining a space range and a time range of a to-be-queried trajectory; identifying a target hierarchy matched with the spatial range and a target spatial partition under the target hierarchy from the index spatial layer, and identifying a track data storage position matched with the time range by utilizing an index time layer of the target spatial partition, and querying according to the track data storage position to obtain a track query result. The method is mainly used for constructing track indexes and querying track data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of trajectory data indexing, and particularly to a trajectory query method and device based on adaptive space segmentation. Background Art

[0002] Trajectory data refers to data that records the paths and position information of objects or individuals moving over time. Such data usually consists of a series of position points marked with time, and each position point contains specific geographical coordinates (such as longitude and latitude) and other possible relevant information (such as speed, direction, timestamp, etc.). With the popularization of location-based services such as positioning technology, a large amount of trajectory data is continuously generated and applied to various fields. Trajectory data indexing is a key technology to improve data query performance in data access and query processing.

[0003] Currently, the more common trajectory query methods mainly train a mapping model from data to storage locations through machine learning methods to achieve the purpose of reducing the index size and improving query performance. However, due to the large differences in the density of trajectory points in different spatio-temporal ranges, in the case of sparse points in the trajectory dataset and training the model for the entire data space, if all points in the multi-dimensional space are reduced to one dimension and then the model is trained on the one-dimensional ordered data, there will be disadvantages such as large prediction errors of the model, overly complex trained models, long training time, and difficulty in convergence. In addition, due to the different dimensions of time and space, the one-dimensional encoding after dimensionality reduction is too complex, so the trajectory data query efficiency will be too low. Summary of the Invention

[0004] In view of this, the present invention provides a trajectory query method based on adaptive space segmentation, mainly aiming to solve the problem of low efficiency in existing trajectory data query.

[0005] According to one aspect of the present invention, there is provided a trajectory query method based on adaptive space segmentation, including: Constructing an index space layer for target trajectory data based on a data-driven adaptive hierarchical division strategy, and respectively constructing an index time layer based on a multi-layer piecewise linear approximation model for each space partition in the index space layer; Responding to a trajectory data query instruction, obtaining the spatial range and time range of the trajectory to be queried; Identifying a target level and a target space partition under the target level in the index space layer that match the spatial range, and using the index time layer of the target space partition to identify the storage location of the trajectory data that matches the time range, so as to query the trajectory query result according to the storage location of the trajectory data.

[0006] Further, constructing an index space layer for the target trajectory data based on the data-driven adaptive hierarchical division strategy includes: Extracting the longitude and latitude coordinate extrema of the target trajectory data, and calculating the minimum area unit that completely covers the longitude and latitude coordinate extrema through the Google S2 algorithm; Using the minimum area unit and the spatial level where the minimum area unit is located as the basis for spatial division, during the process of adding trajectory points in the target trajectory data to the space, monitoring the number of trajectory points in the minimum area unit or the spatial partitions obtained by division; If it is monitored that the number of trajectory points in any spatial partition is greater than the preset trajectory point threshold, performing spatial partition subdivision processing on the spatial partition until the addition of the target trajectory data is completed, and the number of trajectory points in any spatial partition is less than or equal to the preset trajectory point threshold, and using the obtained hierarchical tree as the index space layer.

[0007] Further, the step of performing spatial partition subdivision processing on the spatial partition includes: Subdividing one spatial partition into four spatial partitions through the Google S2 algorithm; Assigning the subdivided spatial partitions to the upper level of the current spatial level where the spatial partition is located, and deleting the spatial partition from the current spatial level.

[0008] Further, constructing an index time layer based on a multi-layer piecewise linear approximation model for each spatial partition in the index space layer includes: For each spatial partition in the index space layer, respectively extracting the time dimension coordinates corresponding to all trajectory points within the spatial partition; Sorting the trajectory points according to the time order corresponding to the time dimension coordinates; Constructing a multi-layer piecewise linear approximation model that satisfies a recursive index structure based on the relationship between the time dimension coordinates of the trajectory points and the sorting order; In the multi-layer piecewise linear approximation model, associating the sorting order with the trajectory data of the corresponding trajectory point at the trajectory data storage location to obtain the index time layer.

[0009] Further, constructing a multi-layer piecewise linear approximation model that satisfies a recursive index structure based on the relationship between the time dimension coordinates of the trajectory points and the sorting order includes: Constructing at least one triple of approximate linear function segments based on the relationship between the time dimension coordinates of the trajectory points and the sorting order; Constructing a one-layer piecewise linear approximation model with a recursive index structure using the triple as a node; Extract the starting trajectory points in each of the approximate linear function segments as the trajectory points of the next-level recursive index structure, and return the step of constructing a triple of at least one approximate linear function segment based on the relationship between the time-dimensional coordinates and the sorting order of the trajectory points, and recursively construct a piecewise linear approximation model layer by layer until a unique approximate linear function segment is constructed, and stop constructing the approximate linear function segment; Use the piecewise linear approximation model corresponding to the unique approximate linear function segment as the last layer of the recursive index structure to obtain a multi-layer piecewise linear approximation model.

[0010] Further, the constructing a triple of at least one approximate linear function segment based on the relationship between the time-dimensional coordinates and the sorting order of the trajectory points includes: Map the trajectory points into a coordinate region with the order as the ordinate and the time dimension as the abscissa; Construct at least one rectangle that can cover the trajectory points in the coordinate region according to a preset rectangle height; Extract the diagonal of the rectangle as the approximate linear function segment of the trajectory points in the rectangle; Use the set of time-dimensional coordinates of the trajectory points in the rectangle as the key, and construct a triple of the approximate linear function segment based on the key, the slope and the intercept of the approximate linear function segment.

[0011] Further, the identifying the target level that matches the spatial range and the target spatial partition under the target level from the index space layer, and using the index time layer of the target spatial partition to identify the trajectory data storage location that matches the time range includes: Calculate the codes of the longitude and latitude extrema of the spatial range at the highest precision level in the index space layer, and decode the codes to obtain the central point coordinates of the extreme corner point spatial partitions where the lower left corner point and the upper right corner point of the spatial range are located respectively; Calculate the longitude and latitude intervals according to the coding precision of the highest precision level, and calculate all the target spatial partitions covered by the spatial range by using the longitude and latitude intervals and the central point coordinates; For each target spatial partition, calculate the trajectory data storage location corresponding to the time range extrema by using the multi-layer piecewise linear approximation model corresponding to the target spatial partition.

[0012] According to another aspect of the present invention, there is provided a trajectory query device based on adaptive space segmentation, including: A construction module, configured to construct an index space layer of target trajectory data based on a data-driven adaptive hierarchical division strategy, and respectively construct an index time layer based on a multi-layer piecewise linear approximation model for each spatial partition in the index space layer; An acquisition module, configured to acquire a spatial range and a time range of a trajectory to be queried in response to a trajectory data query instruction; A query module, configured to identify a target level that matches the spatial range and a target spatial partition under the target level from the index space layer, and use the index time layer of the target spatial partition to identify a trajectory data storage location that matches the time range, so as to query a trajectory query result according to the trajectory data storage location.

[0013] According to another aspect of the present invention, there is provided a storage medium storing at least one executable instruction, and the executable instruction causes a processor to perform operations corresponding to the above-described trajectory query method based on adaptive space segmentation.

[0014] According to still another aspect of the present invention, there is provided a terminal, including: a processor, a memory, a communication interface, and a communication bus, and the processor, the memory, and the communication interface complete communication with each other through the communication bus; The memory is configured to store at least one executable instruction, and the executable instruction causes the processor to perform operations corresponding to the above-described trajectory query method based on adaptive space segmentation.

[0015] By means of the above technical solutions, the technical solutions provided by the embodiments of the present invention have at least the following advantages: The present invention provides a trajectory query method and apparatus based on adaptive space segmentation. In the embodiments of the present invention, an index space layer of target trajectory data is constructed through a data-driven adaptive level division strategy, and for each spatial partition in the index space layer, an index time layer based on a multi-layer piecewise linear approximation model is respectively constructed; in response to a trajectory data query instruction, a spatial range and a time range of a trajectory to be queried are acquired; a target level that matches the spatial range and a target spatial partition under the target level are identified from the index space layer, and the index time layer of the target spatial partition is used to identify a trajectory data storage location that matches the time range, so as to query a trajectory query result according to the trajectory data storage location, realizing automatic adjustment of the index granularity according to the actual distribution of trajectory points, avoiding over-segmentation in sparse areas of trajectory points, and providing sufficient details in dense areas of trajectory points, thereby improving the storage efficiency and query performance of the index. In addition, the index time layer adopts a piecewise linear approximation model to describe the relationship between the storage location of trajectory points and the time dimension data with basic parameters, realizing minimization of space usage while maintaining high indexing performance. The above description is only an overview of the technical solutions of the present invention. In order to be able to understand the technical means of the present invention more clearly, it can be implemented according to the content of the specification. In order to make the above and other purposes, features, and advantages of the present invention more obvious and understandable, the following specifically describes the embodiments of the present invention. Description of the Drawings

[0016] By reading the following detailed description of the preferred embodiments, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered to be a limitation of the present invention. Moreover, throughout the drawings, the same reference numerals are used to represent the same components. In the drawings: Figure 1 Shows a flowchart of a trajectory query method based on adaptive space segmentation provided by an embodiment of the present invention; Figure 2 Shows a flowchart of another trajectory query method based on adaptive space segmentation provided by an embodiment of the present invention; Figure 3 Shows a schematic diagram of a hierarchical tree structure provided by an embodiment of the present invention; Figure 4 Shows a schematic diagram of a method for constructing an approximate linear function segment provided by an embodiment of the present invention; Figure 5 Shows a block diagram of a trajectory query device based on adaptive space segmentation provided by an embodiment of the present invention; Figure 6 Shows a schematic diagram of the structure of a terminal provided by an embodiment of the present invention. Detailed embodiments

[0017] Hereinafter, exemplary embodiments of the present disclosure will be described in more detail with reference to the drawings. Although the exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present disclosure can be more thoroughly understood and the scope of the present disclosure can be fully conveyed to those skilled in the art.

[0018] Regarding the problem of low efficiency in querying trajectory data. An embodiment of the present invention provides a trajectory query method based on adaptive space segmentation, as Figure 1 shown, the method includes: 101. Construct an index space layer for the target trajectory data based on a data-driven adaptive hierarchical partitioning strategy, and for each spatial partition in the index space layer, construct an index time layer based on a multi-layer piecewise linear approximation model.

[0019] In an embodiment of the present invention, the target trajectory data is the trajectory data within the target area for which the trajectory data index needs to be constructed. The target area may be a province, a city or a geographical scope covered by an administrative region, which is not specifically limited in the embodiment of the present invention. The embodiment of the present invention constructs indexes from the spatial dimension and the temporal dimension of the target trajectory data, that is, constructs an index space layer and an index time layer respectively. The index space layer includes a plurality of levels, each level includes at least one spatial partition, and the index time layer is constructed for each spatial partition separately, and is used to query the index based on the time dimension within the current spatial partition. Among them, the index time layer is a learning model constructed based on a piecewise linear approximation model and a recursive index structure. The input of this learning model is the time dimension coordinates of the trajectory point in the spatial partition, and the output is the time dimension sorting order of the trajectory point in the spatial partition to which it belongs. This time dimension sorting order is used to characterize the storage location of the data corresponding to the trajectory point.

[0020] It should be noted that the index space layer is built based on a data-driven adaptive hierarchical partitioning strategy. This strategy is used to adaptively determine whether it is necessary to perform finer and more precise partitioning on the basis of existing spatial partitions according to the number of trajectory points in the existing spatial partitions during the spatial partitioning and spatial hierarchical division process. Since the density of trajectory points in different time and space ranges varies greatly. By adaptively partitioning according to the number of trajectory points in the spatial partitions, the distribution information of the original multidimensional data space can be fully utilized, so that the granularity of the index is automatically adjusted according to the actual distribution of the trajectory points, avoiding excessive subdivision in areas with sparse trajectory point data, while providing sufficient details in areas with dense trajectory point data, thereby improving the storage efficiency and query performance of the trajectory data index.

[0021] 102. In response to a trajectory data query instruction, obtain a spatial range and a time range of a trajectory to be queried.

[0022] In the embodiment of the present invention, the trajectory to be queried is the trajectory range within the coverage of the target area, that is, the trajectory data corresponding to the trajectory to be queried is included in the target trajectory data. The trajectory data query instruction can be input by the user through the interactive terminal, or it can be triggered by tasks such as path navigation and map query, which is not specifically limited in the embodiment of the present invention. After receiving the trajectory data query instruction, the spatial range and time range corresponding to the trajectory to be queried are parsed. Among them, the spatial range includes the longitude interval and the latitude interval, and the time range includes the time interval.

[0023] 103. Identify a target level and a target space partition under the target level that match the space range from the index space layer, and identify a trajectory data storage location that matches the time range using the index time layer of the target space partition, so as to obtain a trajectory query result based on the trajectory data storage location.

[0024] In an embodiment of the present invention, during the process of querying trajectory data based on the constructed trajectory data index, first, a target spatial partition that can cover the spatial range is queried in the index space layer based on the spatial range. This target spatial partition can be one or multiple. Then, based on the time range, the time dimension sorting order that matches the time range is queried through the index time layer of the target spatial partition, that is, the storage location of the trajectory data. By querying from the spatial dimension through the index space layer, the target spatial partition (a smaller spatial range) is determined, and then the time dimension query is performed for each target spatial partition respectively, greatly reducing the complexity of data query, reducing the number of disk accesses during the query process, and thus improving the query efficiency. In addition, since the spatial partition is constructed based on a data-driven adaptive hierarchical partitioning strategy, it provides details with sufficient accuracy and further ensures the query efficiency of trajectory data.

[0025] In an embodiment of the present invention, for further illustration and limitation, as Figure 2 shown, constructing the index space layer of the target trajectory data based on the data-driven adaptive hierarchical partitioning strategy includes: 201. Extract the extreme values of the longitude and latitude coordinates of the target trajectory data, and calculate the smallest area unit that completely covers the extreme values of the longitude and latitude coordinates through the Google S2 algorithm.

[0026] 202. Taking the smallest area unit and the spatial level where the smallest area unit is located as the basis for spatial partitioning, during the process of adding trajectory points in the target trajectory data to the space, monitor the number of trajectory points in the smallest area unit or the spatial partitions obtained by partitioning.

[0027] 203. If it is monitored that the number of trajectory points in any spatial partition is greater than the preset trajectory point threshold, perform spatial partition subdivision processing on the spatial partition until the addition of the target trajectory data is completed, and the number of trajectory points in any spatial partition is less than or equal to the preset trajectory point threshold. Take the obtained hierarchical tree as the index space layer.

[0028] In the embodiments of the present invention, in order to construct an index for target trajectory data, the longitude, latitude, and time of each trajectory point in the target data are obtained, and the obtained data is preprocessed to clean and eliminate abnormal data. The index space layer is mainly constructed based on data in two dimensions, namely the longitude and latitude of the trajectory points. The maximum and minimum values of the longitude values and latitude values in the spatial range are respectively determined, that is, the longitude and latitude extreme values. A two-dimensional rectangular spatial area is defined according to the maximum and minimum longitude values and the maximum and minimum latitude values. The coordinates of the lower left corner of this rectangular spatial area correspond to the minimum longitude and latitude values, and the coordinates of the upper right corner correspond to the maximum longitude and latitude values. The minimum area unit that completely covers this rectangular spatial area is calculated by the Google S2 algorithm, that is, the S2 unit, and the spatial level corresponding to this S2 unit is identified, and this spatial level is used as the coarsest spatial level in terms of accuracy. Based on this spatial level and spatial partitioning, adaptive hierarchical partitioning of the spatial partitioning and hierarchical space is performed. The Google S2 algorithm uses the Hilbert curve to recursively partition the Earth's surface, forming a hexagonal grid with 31 levels. Each level represents a different resolution accuracy. At the coarsest level (Level 0), the Earth's surface is divided into six hexagonal cells, and the area of each cell approximately accounts for one-sixth of the Earth's surface area. As the level increases, the area of the cells gradually decreases until the finest level (Level 30). The minimum area unit that completely covers this rectangular spatial area is a spatial partition at a certain accuracy level calculated by the Google S2 algorithm.

[0029] Among them, the adaptive hierarchical partitioning is mainly based on the comparison result between the number of trajectory points in each spatial partition and the preset trajectory point threshold in the data-driven adaptive hierarchical partitioning strategy to perform a fine subdivision of the adaptive spatial partition. If the number of trajectory points in a certain spatial partition is greater than the preset trajectory point threshold, then this spatial partition is further subdivided into more partitions so that the number of trajectory points in the subdivided spatial partition is less than the preset trajectory point threshold. Among them, the number of subdivisions is not limited to once. For example, after dividing the current spatial partition into 4 partitions, if there is still one or more partitions among the four partitions where the number of trajectory points is greater than the preset trajectory point threshold, then the divided partitions are further subdivided until the number of trajectory points in the divided spatial partition is less than the preset trajectory point threshold and then the further division stops. Among them, the larger the preset trajectory point threshold, the fewer the spatial partitions and spatial levels obtained by the division, and the lower the accuracy; the smaller the preset trajectory point threshold, the more the spatial partitions and spatial levels obtained by the division, and the higher the accuracy. The specific value can be customized according to specific application requirements, and the embodiments of the present invention do not make specific limitations.

[0030] Specifically, for any spatial partition, the division is to subdivide this spatial partition into four spatial partitions through the Google S2 algorithm; the subdivided spatial partitions are divided into the upper level of the current spatial level where the spatial partition is located, and the spatial partition is deleted from the current spatial level. Each spatial partition after being divided by the Google S2 algorithm corresponds to a unique cell ID. For example, when the current spatial level is L10, if the number of trajectory points in one of the four spatial partitions is greater than the preset trajectory point threshold, then this spatial partition is divided into 4 new spatial partitions, corresponding to the spatial level L11, and the spatial level L10 contains the remaining 3 spatial partitions that have not been divided. As the target trajectory data is continuously added to the space, the number of trajectory points in the spatial partitions is continuously judged, and the spatial partitions that do not meet the preset trajectory point threshold are subdivided to obtain multiple spatial levels and multiple spatial partitions, so as to obtain a hierarchical tree as shown in Figure 3 where a is the level where the smallest area unit covering the target trajectory data is located, that is, the basic level of spatial division, and x is the total number of levels of the hierarchical tree.

[0031] In an embodiment of the present invention, for further illustration and limitation, as shown in Figure 2 constructing an index time layer based on a multi-layer piecewise linear approximation model for each spatial partition in the index space layer includes: 204. For each spatial partition in the index space layer, extract the time dimension coordinates corresponding to all the trajectory points within the spatial partition.

[0032] 205. Sort the trajectory points according to the time sequence corresponding to the time dimension coordinates.

[0033] 206. According to the relationship between the time dimension coordinates of the trajectory points and the sorting order, construct a multi-layer piecewise linear approximation model that satisfies the recursive index structure.

[0034] 207. In the multi-layer piecewise linear approximation model, associate the sorting order with the trajectory data of the corresponding trajectory points as the storage location of the trajectory data to obtain the index time layer.

[0035] In the embodiments of the present invention, the construction of the index time layer is realized based on a piecewise linear approximation model. The core idea is to sort the data according to the time dimension of the trajectory points, use the sorting order as the storage location identifier, establish a function mapping from the time dimension to its storage location, and ensure the controllability of the error between the predicted location and the actual location. According to the time dimension data of each trajectory point in each spatial partition, such as the time stamp, determine the time dimension coordinate corresponding to this trajectory point on the time axis. And sort the trajectory points in the same spatial partition according to the time dimension coordinates, so that each trajectory point corresponds to a sorting order. Among them, the sorting can be in ascending order of time or in descending order of time, and the embodiments of the present invention do not make specific limitations. Approximate the non-linear relationship between the time dimension coordinates and the sorting order of the trajectory points in each spatial partition as a multi-segment linear function, so as to construct a multi-layer piecewise linear approximation model that satisfies the recursive index structure based on the multi-segment linear function.

[0036] Specifically, according to the relationship between the time dimension coordinates and the sorting order of the trajectory points, construct at least one triple of approximate linear function segments; use the triple as a node to construct a layer of piecewise linear approximation model of the recursive index structure; extract the starting trajectory points in each approximate linear function segment as the trajectory points of the next layer of recursive index structure, and return the step of constructing at least one triple of approximate linear function segments according to the relationship between the time dimension coordinates and the sorting order of the trajectory points, and recursively construct the piecewise linear approximation model layer by layer until a unique approximate linear function segment is constructed, and stop the construction of the approximate linear function segment; use the piecewise linear approximation model corresponding to the unique approximate linear function segment as the last layer of the recursive index structure to obtain a multi-layer piecewise linear approximation model.

[0037] In an application example, constructing at least one triple of approximate linear function segments according to the relationship between the time dimension coordinates and the sorting order of the trajectory points includes: mapping the trajectory points into a coordinate area with the order as the ordinate and the time dimension as the abscissa; constructing at least one rectangle that can cover the trajectory points in the coordinate area according to a preset rectangle height; extracting the diagonal of the rectangle as the approximate linear function segment of the trajectory points in the rectangle; using the set of time dimension coordinates of the trajectory points in the rectangle as the key, and constructing the triple of the approximate linear function segment according to the key, the slope and the intercept of the approximate linear function segment.

[0038] In the embodiments of the present invention, in order to determine the approximate linear function corresponding to the trajectory points in the spatial partition, the trajectory points are mapped into a coordinate system with the order sorted by time as the ordinate and the time point as the abscissa. Such as Figure 4As shown, the trajectory points within the coordinate system are enclosed by a preset rectangular height to complete the construction of a rectangle, and then the diagonal of this rectangle is extracted to obtain an approximate linear function segment of the trajectory points within the corresponding rectangle. Among them, the preset rectangular height is preferably 2 times the error value, and the error value can be customized according to the specific application scenario, which is not specifically limited in the embodiments of the present invention. If a rectangle cannot enclose all the trajectory points in the current spatial partition, continue to construct rectangles according to the above rectangle construction method until all the trajectory points are enclosed by the corresponding rectangles, and at least one approximate linear function segment corresponding to the spatial partition is obtained. After obtaining the approximate linear function segment, for each approximate linear function segment, it is simplified into the form of a triple, that is, the set of time dimension coordinates of the trajectory points corresponding to the approximate linear function segment is used as the key, and the slope and intercept (corresponding to the starting trajectory point sequence number of this approximate linear function segment) of the approximate linear function segment are constructed into a triple, and one triple serves as a node of the piecewise linear approximation model. The function of the approximate linear function segment is . Since this function is a linear function approximately obtained from the relationship between the time dimension coordinates and the time sequence positions of the corresponding trajectory points, it can represent the corresponding relationship between the time dimension coordinates and the time sorting sequence positions. When the time dimension coordinates of a certain trajectory point are input, the corresponding time sorting sequence position, that is, the storage location of the trajectory data of the corresponding trajectory point, can be predicted through this function.

[0039] It should be noted that by adopting a piecewise linear approximation model in the index time layer, the time dimension data of scattered trajectory points are integrated into approximate linear function segments and represented in the form of triples, so that the index time layer only needs to store the basic parameters of the piecewise linear approximation model, realizing the minimization of space usage, thereby optimizing the overall memory occupancy while ensuring high indexing performance.

[0040] In an embodiment of the present invention, for further illustration and limitation, the identifying the target level and the target spatial partition under the target level that match the spatial range from the index space layer, and using the index time layer of the target spatial partition to identify the storage location of the trajectory data that matches the time range includes: Calculating the codes of the longitude and latitude extrema of the spatial range at the highest precision level in the index space layer, and decoding the codes to obtain the central point coordinates of the extreme corner point spatial partitions where the lower left corner point and the upper right corner point of the spatial range are located respectively; Calculating the longitude and latitude intervals according to the coding precision of the highest precision level, and calculating all the target spatial partitions covered by the spatial range by using the longitude and latitude intervals and the central point coordinates; For each target spatial partition, calculating the storage location of the trajectory data corresponding to the time range extrema by using the multi-layer piecewise linear approximation model corresponding to the target spatial partition.

[0041] In an embodiment of the present invention, in order to query the trajectory to be queried, a query range [lon1, lon2] of three coordinate dimensions of longitude, latitude, and time input by the user is obtained [lat1, lat2] [t1, t2], and the spatial partitions involved in the longitude and latitude coordinate range [lon1, lon2] [lat1, lat2] are calculated. Specifically, it includes: calculating the S2 codes of the lower left corner point bl (the minimum longitude and latitude value) and the upper right corner point tr (the maximum longitude and latitude value) of the longitude and latitude coordinate range at the level Level max. Decoding the calculated S2 codes to obtain the central point coordinates of the extreme value corner point spatial partitions, that is, the first central point coordinates of the minimum value corner point spatial partition where bl is located and the second central point coordinates of the maximum value corner point spatial partition where tr is located. Calculating the longitude and latitude intervals according to the coding accuracy of Level max, that is, determining the size of each spatial partition in the current level. Using the longitude and latitude intervals, the first central point coordinates, and the second central point coordinates, the large rectangular area (or a more complex shape, simplified to a rectangle here) covered between these two spatial partitions can be calculated, so as to obtain the coordinate set of all possible central points of the spatial partitions covered by the large rectangular area. Traversing the hierarchical tree of the index space layer based on this coordinate set, finding the spatial partitions where all the central points of the spatial partitions in the set are located, that is, the target spatial partitions. Then, querying is performed on each target spatial partition based on the corresponding index time layer respectively, that is, calculating the positions of t1 and t2 in the linear approximation function segment according to the learning model corresponding to the target spatial partition, so as to predict the storage location of the trajectory data of the corresponding trajectory points. After obtaining the trajectory data, the obtained trajectory data can also be filtered based on screening and filtering conditions to exclude trajectory data that does not meet specific conditions (such as geographical location, time range, etc.) to obtain the trajectory query result.

[0042] The present invention provides a trajectory query method based on adaptive space segmentation. In the embodiments of the present invention, an index space layer of target trajectory data is constructed through a data-driven adaptive hierarchical division strategy, and for each space partition in the index space layer, an index time layer based on a multi-layer piecewise linear approximation model is constructed respectively; in response to a trajectory data query instruction, the spatial range and time range of the trajectory to be queried are obtained; the target level and the target space partition under the target level that match the spatial range are identified from the index space layer, and the storage location of the trajectory data that matches the time range is identified by using the index time layer of the target space partition, so as to query and obtain a trajectory query result according to the storage location of the trajectory data, realizing that the index granularity is automatically adjusted according to the actual distribution of trajectory points, avoiding excessive subdivision in sparse areas of trajectory points, and providing sufficient details in dense areas of trajectory points, improving the storage efficiency and query performance of the index. In addition, the index time layer adopts a piecewise linear approximation model to describe the relationship between the storage location of trajectory points and the time dimension data with basic parameters, minimizing the space usage while maintaining high indexing performance. Further, as an implementation of the method described above Figure 1 shown, the embodiments of the present invention provide a trajectory query device based on adaptive space segmentation, as Figure 5 shown, the device includes: A construction module 31, configured to construct an index space layer of target trajectory data through a data-driven adaptive hierarchical division strategy, and for each space partition in the index space layer, construct an index time layer based on a multi-layer piecewise linear approximation model respectively; An acquisition module 32, configured to obtain the spatial range and time range of the trajectory to be queried in response to a trajectory data query instruction; A query module 33, configured to identify the target level and the target space partition under the target level that match the spatial range from the index space layer, and identify the storage location of the trajectory data that matches the time range by using the index time layer of the target space partition, so as to query and obtain a trajectory query result according to the storage location of the trajectory data.

[0043] Further, the construction module 31 includes: A first calculation unit, configured to extract the extreme values of the longitude and latitude coordinates of the target trajectory data, and calculate the minimum area unit that completely covers the extreme values of the longitude and latitude coordinates through the Google S2 algorithm; A monitoring unit, configured to use the minimum area unit and the spatial level where the minimum area unit is located as the basis for space division, and monitor the number of trajectory points in the minimum area unit or the space partition obtained by division during the process of adding trajectory points in the target trajectory data to the space; A subdivision processing unit, configured to, if it is monitored that the number of trajectory points in any spatial partition is greater than a preset trajectory point threshold, perform spatial partition subdivision processing on the spatial partition until the addition of the target trajectory data is completed, and the number of trajectory points in any spatial partition is less than or equal to the preset trajectory point threshold, and use the obtained hierarchical tree as the index space layer.

[0044] Further, in a specific application scenario, the subdivision processing unit is specifically configured to subdivide one spatial partition into four spatial partitions through the Google S2 algorithm; divide the subdivided spatial partitions into the upper level of the current spatial level where the spatial partition is located, and delete the spatial partition from the current spatial level.

[0045] Further, the construction module 31 further includes: An extraction unit, configured to respectively extract the time - dimension coordinates corresponding to all trajectory points within each spatial partition of the index space layer; A sorting unit, configured to sort the trajectory points according to the time sequence corresponding to the time - dimension coordinates; A construction unit, configured to construct a multi - layer piecewise linear approximation model that satisfies a recursive index structure according to the relationship between the time - dimension coordinates of the trajectory points and the sorting order; An associated storage unit, configured to, in the multi - layer piecewise linear approximation model, associate the sorting order as the trajectory data storage location with the trajectory data of the corresponding trajectory points to obtain an index time layer.

[0046] Further, in a specific application scenario, the construction unit is specifically configured to construct a triple of at least one approximate linear function segment according to the relationship between the time - dimension coordinates of the trajectory points and the sorting order; construct a one - layer piecewise linear approximation model with a recursive index structure using the triple as a node; extract the starting trajectory points in each approximate linear function segment as the trajectory points of the next - layer recursive index structure, and return the step of constructing a triple of at least one approximate linear function segment according to the relationship between the time - dimension coordinates of the trajectory points and the sorting order, and recursively construct the piecewise linear approximation model layer by layer until a unique approximate linear function segment is constructed, and stop constructing the approximate linear function segment; use the piecewise linear approximation model corresponding to the unique approximate linear function segment as the last layer of the recursive index structure to obtain a multi - layer piecewise linear approximation model.

[0047] Further, in a specific application scenario, the construction unit is specifically configured to map the trajectory points into a coordinate region with the ordinal position as the ordinate and the time dimension as the abscissa; construct at least one rectangle that can cover the trajectory points in the coordinate region according to a preset rectangle height; extract the diagonal of the rectangle as an approximate linear function segment of the trajectory points in the rectangle; use the set of time dimension coordinates of the trajectory points in the rectangle as the key, and construct a triple of the approximate linear function segment based on the key, the slope and intercept of the approximate linear function segment.

[0048] The query module 33 includes: A decoding unit, configured to calculate the encoding of the longitude and latitude extreme values of the spatial range at the highest precision level in the index space layer, and decode the encoding to obtain the central point coordinates of the extreme corner point spatial partitions where the lower left corner point and the upper right corner point of the spatial range are located respectively; A second calculation unit, configured to calculate the longitude and latitude interval according to the encoding precision of the highest precision level, and calculate all target spatial partitions covered by the spatial range by using the longitude and latitude interval and the central point coordinates; A third calculation unit, configured to, for each target spatial partition, calculate the storage location of the trajectory data corresponding to the time range extreme value by using a multi-layer piecewise linear approximation model corresponding to the target spatial partition.

[0049] The present invention provides a trajectory query device based on adaptive space segmentation. In an embodiment of the present invention, an index space layer of target trajectory data is constructed through a data-driven adaptive hierarchical division strategy, and for each spatial partition in the index space layer, an index time layer based on a multi-layer piecewise linear approximation model is respectively constructed; in response to a trajectory data query instruction, the spatial range and time range of the trajectory to be queried are obtained; the target level and the target spatial partitions under the target level that match the spatial range are identified from the index space layer, and the storage location of the trajectory data that matches the time range is identified by using the index time layer of the target spatial partition, so as to query the trajectory query result according to the storage location of the trajectory data, realizing that the index granularity is automatically adjusted according to the actual distribution of the trajectory points, avoiding excessive subdivision in sparse areas of the trajectory points, and providing sufficient details in dense areas of the trajectory points, improving the storage efficiency and query performance of the index. In addition, the index time layer adopts a piecewise linear approximation model to describe the relationship between the storage location of the trajectory points and the time dimension data with basic parameters, realizing the minimization of space usage while maintaining high index performance.

[0050] According to an embodiment of the present invention, a storage medium is provided, and the storage medium stores at least one executable instruction, and the computer executable instruction can execute the trajectory query method based on adaptive space segmentation in any of the above method embodiments.

[0051] Figure 6 The structural schematic diagram of a terminal provided according to an embodiment of the present invention is shown. The specific implementation of the present invention does not limit the specific implementation of the terminal.

[0052] As Figure 6 shown, the terminal may include: a processor 402, a communication interface 404, a memory 406, and a communication bus 408.

[0053] Among them: the processor 402, the communication interface 404, and the memory 406 complete mutual communication through the communication bus 408.

[0054] The communication interface 404 is used for network communication with other devices such as clients or other servers.

[0055] The processor 402 is used to execute the program 410, and specifically can execute the relevant steps in the above-mentioned embodiment of the trajectory query method based on adaptive space segmentation.

[0056] Specifically, the program 410 may include program codes, and the program codes include computer operation instructions.

[0057] The processor 402 may be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention. One or more processors included in the terminal may be of the same type of processor, such as one or more CPUs; or may be of different types of processors, such as one or more CPUs and one or more ASICs.

[0058] The memory 406 is used to store the program 410. The memory 406 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.

[0059] The program 410 is specifically used to enable the processor 402 to perform the following operations: Construct an index space layer of the target trajectory data based on a data-driven adaptive hierarchical partitioning strategy, and for each space partition in the index space layer, respectively construct an index time layer based on a multi-layer piecewise linear approximation model; In response to a trajectory data query instruction, obtain the spatial range and time range of the trajectory to be queried; Identify a target level that matches the spatial range and target spatial partitions under the target level from the index space layer, and identify a trajectory data storage location that matches the time range using the index time layer of the target spatial partition, so as to query a trajectory query result based on the trajectory data storage location.

[0060] Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present invention can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. Optionally, they can be implemented by program codes executable by the computing device. Thus, 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 sequence different from here, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module to be implemented. In this way, the present invention is not limited to any specific combination of hardware and software.

[0061] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A trajectory query method based on adaptive space segmentation, characterized in that: include: An index space layer of target trajectory data is constructed based on a data-driven adaptive hierarchical partitioning strategy, and an index time layer based on a multi-layer piecewise linear approximation model is constructed for each spatial partition in the index space layer; In response to the trajectory data query instruction, obtaining the spatial range and time range of the trajectory to be queried; A target level matching the spatial range and a target spatial partition under the target level are identified from the index spatial layer, and a trajectory data storage location matching the time range is identified using the index time layer of the target spatial partition, so as to obtain a trajectory query result based on the trajectory data storage location.

2. The method according to claim 1, characterized in that The data-driven adaptive hierarchical division strategy is used to construct an index space layer of target trajectory data, including: Extracting the extreme values ​​of the latitude and longitude coordinates of the target trajectory data, and calculating the minimum area unit that completely covers the extreme values ​​of the latitude and longitude coordinates by using the Google S2 algorithm; Taking the minimum area unit and the spatial level where the minimum area unit is located as the basis for spatial division, in the process of adding the trajectory points in the target trajectory data to the space, monitoring the number of trajectory points in the minimum area unit or the spatial partition obtained by division; If the number of trajectory points in any spatial partition is greater than the preset trajectory point threshold, the spatial partition subdivision processing is performed on the spatial partition until the addition of the target trajectory data is completed, and the number of trajectory points in any spatial partition is less than or equal to the preset trajectory point threshold, and the obtained hierarchical tree is used as the index space layer.

3. The method according to claim 2, characterized in that The step of performing spatial partition subdivision processing on the spatial partition comprises: Subdividing one of the spatial partitions into four spatial partitions by using the Google S2 algorithm; The spatial partition obtained by the subdivision is divided into a level above the current spatial level where the spatial partition is located, and the spatial partition is deleted from the current spatial level.

4. The method according to claim 1, characterized in that: The step of constructing an index time layer based on a multi-layer piecewise linear approximation model for each spatial partition in the index space layer includes: For each spatial partition of the index spatial layer, respectively extracting the time dimension coordinates corresponding to all trajectory points in the spatial partition; Sorting the trajectory points according to the time sequence corresponding to the time dimension coordinates; According to the relationship between the time dimension coordinates and the sorting order of the trajectory points, a multi-layer piecewise linear approximation model satisfying the recursive index structure is constructed; In the multi-layer piecewise linear approximation model, the sorting order is used as a trajectory data storage location to be associated with the trajectory data of the corresponding trajectory point to obtain an index time layer.

5. The method according to claim 4, characterized in that The method of constructing a multi-layer piecewise linear approximation model satisfying a recursive index structure based on the relationship between the time dimension coordinates of the trajectory points and the sorting order includes: Constructing at least one triple of approximate linear function segments according to the relationship between the time dimension coordinates and the sorting order of the trajectory points; A one-layer piecewise linear approximation model of a recursive index structure is constructed using the triples as nodes; Extracting the starting trajectory point in each of the approximate linear function segments as the trajectory point of the next layer of recursive index structure, and returning the step of constructing at least one triple of the approximate linear function segment based on the relationship between the time dimension coordinates and the sorting order of the trajectory point, recursively constructing the piecewise linear approximate model layer by layer until a unique approximate linear function segment is constructed, and stopping the construction of the approximate linear function segment; The piecewise linear approximate model corresponding to the unique approximate linear function segment is used as the last layer of the recursive index structure to obtain a multi-layer piecewise linear approximate model.

6. The method according to claim 5, characterized in that The step of constructing at least one triple of approximate linear function segments based on the relationship between the time dimension coordinates of the trajectory points and the sorting order comprises: Mapping the trajectory points to a coordinate region with the sequence as the ordinate and the time dimension as the abscissa; Constructing at least one rectangle capable of covering the track point in the coordinate area according to a preset rectangle height; Extracting the diagonal line of the rectangle as an approximate linear function segment of the trajectory points in the rectangle; A time dimension coordinate set of the trajectory points in the rectangle is used as a key, and a triplet of the approximate linear function segment is constructed according to the key, the slope and the intercept of the approximate linear function segment.

7. The method according to claim 1, characterized in that The step of identifying a target level and a target spatial partition under the target level that matches the spatial range from the index spatial level, and identifying a trajectory data storage location that matches the time range using the index time level of the target spatial partition, includes: Calculate the highest precision level encoding of the latitude and longitude extreme values ​​of the spatial range in the index space layer, and decode the encoding to obtain the center point coordinates of the extreme corner point space partitions where the lower left corner point and the upper right corner point of the spatial range are located respectively; Calculate the longitude and latitude intervals according to the coding accuracy of the highest accuracy level, and calculate all target spatial partitions covered by the spatial range using the longitude and latitude intervals and the center point coordinates; For each target space partition, a track data storage location corresponding to the time range extreme value is calculated using a multi-layer piecewise linear approximation model corresponding to the target space partition.

8. A trajectory query device based on adaptive space segmentation, characterized in that: include: A construction module, used to construct an index space layer of target trajectory data based on a data-driven adaptive hierarchical partitioning strategy, and to construct an index time layer based on a multi-layer piecewise linear approximation model for each spatial partition in the index space layer; An acquisition module, used to obtain the spatial range and time range of the trajectory to be queried in response to the trajectory data query instruction; The query module is used to identify the target level and the target space partition under the target level that match the spatial range from the index space layer, and use the index time layer of the target space partition to identify the trajectory data storage location that matches the time range, so as to obtain the trajectory query result based on the trajectory data storage location.

9. A storage medium storing at least one executable instruction, wherein the executable instruction enables a processor to execute operations corresponding to the trajectory query method based on adaptive space segmentation as described in any one of claims 1 to 7.

10. A terminal, comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the trajectory query method based on adaptive space segmentation according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Space-time grid index query method and system based on degraded quadtree

    CN116775971A

  • Learning type indexing method and system based on time sequence data features

    CN116881243A

  • Learning type track indexing and querying method based on homogeneous region division on directed road network

    CN117194434A

  • Storage and retrieval method and system based on spatio-temporal data density perception

    CN117370347A

Cited By

  • Multi-dimensional data clustering dimensionality reduction collaborative learning index construction method for agricultural machinery track

    CN121350038A

  • Dynamic reconstruction method and device for track in database, equipment and medium

    CN121597718A