A method for constructing a hubert tree learning index with error constraint on a directed road network

By constructing an error-constrained Hilbert tree learning index on a directed road network and using the Hilbert curve to divide logical units and the error-constrained Hilbert tree model, the redundant query and prediction accuracy problems of the multidimensional learning index are solved, and the query efficiency and accuracy are improved.

CN119396835BActive Publication Date: 2025-10-10NANJING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411542870.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-10-10
Estimated Expiration
2044-10-31

AI Technical Summary

Technical Problem

Existing multidimensional learning indexes suffer from redundant query problems when processing large amounts of high-dimensional trajectory data, which increases the burden of disk I/O operations, reduces prediction accuracy, and increases search costs when facing skewed data.

Method used

An error-constrained Hilbert tree learning indexing method is adopted on a directed road network. The evenly distributed logical units are divided by the Hilbert curve, and an error-constrained Hilbert tree model is constructed to reduce data redundant scanning and improve search efficiency.

Benefits of technology

It reduces index size and build time, reduces disk IO during query, improves index search efficiency and prediction accuracy, and supports batch processing and incremental sorting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396835B_ABST
    Figure CN119396835B_ABST
Patent Text Reader

Abstract

The application belongs to the field of computer application, and discloses a directed road network error limited Hilbert tree learning index construction method, which projects a space-time sample into a position-time grid, sorts cells of the grid based on a Hilbert curve, then divides the sorted sample into logical blocks and stores the logical blocks into a disk, and simultaneously establishes a binary tree for dividing nodes according to Hilbert curve serial numbers, representing a mapping relationship between the Hilbert serial numbers and the logical blocks, and ensuring that the mapping error of leaf nodes is less than a specified error. The application divides a two-dimensional space according to the Hilbert curve, ensures that trajectory data in the position-time grid is uniformly distributed, ensures full recall of query data through bounded error, and thus improves the query performance on inclined data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of computer applications, and in particular relates to an error-constrained Hilbert tree learning index on a directed road network. Background Art

[0002] With the widespread use of mobile devices and the increasing accuracy of positioning devices in recent years, a large number of mobile trajectories have been collected and stored in mobile data trajectory libraries. This data contains the behavioral characteristics and traffic information of mobile objects. By mining trajectory data, we can analyze the movement patterns of people and improve road network traffic conditions. In the current environment, trajectory data is characterized by its large quantity, high dimensionality and complexity. How to efficiently query trajectory data has become a key issue.

[0003] Current multidimensional learning-based indexes can be categorized into model-fitting layout and model-generating layout. In the model-fitting layout, the data storage order is predetermined. The data is sorted and placed according to a fixed pattern. A model is then trained based on this sorted order to predict the data's location. The data layout determines the training model. Qi Jianzhong et al. proposed the RSMI index in their paper "Effectively Learning Spatial Indices." The core idea of ​​this index is to map points in multidimensional space to a ranking space, sort the data points using a space-filling curve, and assign each data point a curve value. After sorting, the data points are partitioned according to the curve value. A multilayer perceptron is trained to learn the index from the point coordinates to the storage block location. The data is partitioned and the model is learned recursively until the number of points in each partition does not exceed a set threshold. Zhang Songnian et al. proposed the SPRIG+ index in their paper "Efficient Learned Spatial Index With Interpolation Function Based Learned Model." The core idea of ​​this index is to construct an adaptive grid based on the data distribution, dividing the space into multiple cells. An IH-tree+ index is then constructed using spatial interpolation functions and dynamic encoding techniques. When performing a range query, the position of the query point in the grid is predicted through the interpolation model, and the query is performed through the IH-tree+ structure.

[0004] In the model-generated layout mode, a model that reasonably represents the data layout is first selected. This model is then trained to determine the data's storage distribution. The data model directly determines the data layout. In their paper "LISA: A Learned Index Structure for Spatial Data," Li Pengfei et al. proposed the LISA index, which divides space into grid cells and numbers and sorts them according to the coordinate axes. LISA then constructs a partial monotonic function based on the cell boundaries, using this prediction function to map the data from multidimensional space to one-dimensional space.

[0005] Existing multidimensional learning indexes face the problem of redundant queries when processing large amounts of high-dimensional trajectory data. During disk read operations, the system may access duplicate or unnecessary data, increasing the burden of disk I / O operations and reducing overall query performance. Although the aforementioned learning indexing methods process and place data through methods such as dimensionality reduction, space-filling curves, and interpolation functions, and train machine learning models to learn the distribution of sample sets, they are all limited by the problem of redundant data scanning. In addition, when dealing with skewed data, the uneven data density distribution can also lead to reduced prediction accuracy of the learning model and increased search costs. Summary of the Invention

[0006] In order to solve the above technical problems, the present invention provides a Hilbert tree learning index construction method with limited error on a directed road network. This method not only realizes the projection of spatiotemporal samples to a position-time grid, but also divides a plurality of evenly distributed logical units through the Hilbert curve, which greatly reduces the redundant scanning of data, improves the search efficiency of the index, and reduces the model size and construction time.

[0007] In order to achieve the above object, the present invention is implemented through the following technical solutions:

[0008] The present invention is a method for constructing an error-constrained Hilbert tree learning index on a directed road network, the method specifically comprising the following steps:

[0009] Step 1: Project a set of spatiotemporal samples on a directed road network into a location-time network and recursively divide the location-time grid in a two-dimensional plane.

[0010] Step 2: Adjust the number of rows and columns of the position-time grid, use a k-order Hilbert curve to traverse all cells in the position-time grid, sort all spatiotemporal samples, and assign a unique Hilbert number to each cell;

[0011] Step 3: Divide the sorted spatiotemporal samples into a series of logical blocks and save them on disk, ensuring that the number of samples in each logical block is less than or equal to the set threshold. Then assign a logical block number to each logical block for use in subsequent index construction.

[0012] Step 4: Build an error-constrained Hilbert tree model for the spatiotemporal samples as a predictor of the trajectory point storage location. During training, the input is the Hilbert sequence number of the spatiotemporal sample in the position-time grid, and the output is the stored logical block number, ensuring that the predicted error value is within the given error range.

[0013] A further improvement of the present invention is that: the directed road network consists of intersections and road sections, each of the road sections has a unique serial number after sorting, the position-time grid consists of a position dimension and a time dimension, the position value of the position dimension is a floating point number, the integer part represents the serial number of the road section, and the decimal part represents the relative position of the trajectory point relative to the starting point of the road section.

[0014] A further improvement of the present invention is that in step 1, the recursive division of the position-time grid specifically includes the following steps:

[0015] Step 1.1: Determine the rectangles corresponding to all spatiotemporal samples on the two-dimensional plane and set the cell sample number threshold;

[0016] Step 1.2: Take the center point of the rectangular area and draw two straight lines in the horizontal and vertical directions to divide the grid into four sub-areas. If the number of points in a sub-area exceeds the cell sample number threshold, recursively divide the sub-area according to the above method until the number of points in each sub-area is less than the cell sample number threshold. When dividing the rectangular area, store the values ​​of the split pos axis in ascending order in the pos_scale list, and store the values ​​of the split t axis in ascending order in the t_scale list.

[0017] A further improvement of the present invention is that in step 2, traversing all cells in the position-time grid using a k-order Hilbert curve specifically includes the following steps:

[0018] Step 2.1. Assume that the lengths of the two lists pos_scale and t_scale are m and n respectively. If the number of intervals in the pos axis direction and the t axis direction is not equal to 2k, then further split the pos axis and t axis. For the pos axis and t axis, calculate the distance between adjacent elements in the lists pos_scale and t_scale respectively, find the maximum interval and split it at the midpoint, and update the lists pos_scale and t_scale at the same time. Repeat this process until both the pos axis and the t axis are equally divided into two. kintervals, that is, the number of intervals in the pos axis direction and the t axis direction is equal and equal to 2 k ;

[0019] Step 2.2: Traverse all the spatiotemporal sample point sets, determine the position number of the sample point on the pos axis and t axis according to the list pos_scale and the list t_scale, and then call the Hilbert function to calculate the Hilbert number of the sample point. The points in the same cell in the position-time grid are assigned the same Hilbert number.

[0020] A further improvement of the present invention is that in step 3, the sorted spatiotemporal samples are divided into a series of logical blocks and stored on a disk, which specifically includes the following steps:

[0021] Step 3.1: Set a threshold for the number of logical block samples and sort all cells according to the Hilbert sequence number.

[0022] Step 3.2: Add the points in the cell to the logical block one by one. All points in a cell must be placed in the same logical block. If the capacity of the current logical block is about to exceed the logical block sample number threshold, a new logical block is created to continue storing subsequent points. All logical blocks are assigned logical block numbers in sequence starting from 0.

[0023] Step 3.3. Assume that a physical page size corresponds to n logical block sizes. Write all logical blocks to the disk. When writing, first count the number of physical blocks required, then traverse the points in the logical block, and write the coordinates of each point in binary format to the file. If a physical block is not filled, fill it with (0, 0) at the end of the filled data, and insert the point (-1, -1) at the end of each physical block as a paging identifier.

[0024] A further improvement of the present invention is that in step 4, an error-constrained Hilbert tree model is established for the spatiotemporal samples, specifically comprising the following steps:

[0025] Step 4.1. Construct a Hilbert tree for the spatiotemporal sample set. It is a binary tree with internal nodes and leaf nodes. Each spatiotemporal sample ps i Corresponding to a training instance tn i =(ht i ,ad i ), Hilbert tree model input ht i Represents the Hilbert sequence number value corresponding to the trajectory point, output ad i Represents the logical block number where the trajectory point is located. The internal node in the binary tree stores a Hilbert sequence number threshold, which is used to divide the samples into the left set and the right set. The leaf node contains a linear model to characterize the logical block number distribution of the data. The logical block number of the spatiotemporal sample ps in the leaf node is predicted as:

[0026] M(ps)=β·ht(ps)+α

[0027] The prediction error is

[0028] err(ps)=ad-β·ht(ps)-α

[0029] Where: β is the slope of the linear model, α is the intercept of the linear model, ht is the Hilbert number corresponding to the trajectory point, and ad is the logical block number where the trajectory point is located;

[0030] Step 4.2: Set a maximum error threshold eb and use the gradient descent method to calculate the linear function β and α for a sample set containing m spatiotemporal samples. The gradient is:

[0031]

[0032] Then, on the spatiotemporal sample set ND, we use the formula

[0033]

[0034] Adjust the value of α;

[0035] Step 4.3: Calculate the maximum prediction error err on the current sample set ND ND :

[0036]

[0037] Step 4.4: Calculate the fitting function M on the sample set ND and calculate the error err ND , and err ND Compared with the maximum error threshold eb, if err ND <eb,不需要划分子树,如果err ND >eb, take the mean Hilbert number of adjacent sample points on the sample set ND to generate a threshold set, then traverse the threshold set, use the threshold as the Hilbert number of the internal node of the binary tree during traversal, divide the binary tree into left and right subtrees, calculate the fitting function M and the corresponding maximum error of the left and right subtrees respectively, when the maximum errors of the left and right subtrees are both less than the maximum error threshold eb and the sum of squared errors is minimized, stop traversing the set and form the left and right subtrees of the binary tree according to the current Hilbert number threshold, repeat step 4.4 on the left and right subtrees until the errors of all areas are less than eb.

[0038] The beneficial effects of the present invention are:

[0039] The present invention takes the connectivity of road sections into consideration and performs a divide-and-conquer operation on the sample set through the Hilbert curve, which not only supports batch processing but is also applicable to incremental sorting.

[0040] This paper proposes to construct an error-constrained Hilbert tree to predict the logical block position of sample points. Since the maximum error of the sample set is used as the error boundary, it covers all qualified samples within the given error range, achieving 100% recall of the query. At the same time, this paper uses tight strips to model the data distribution, greatly reducing the data scanning cost during the query.

[0041] The present invention constructs an error-constrained Hilbert tree and continuously recursively splits the left and right subtrees, which not only greatly reduces the index size and storage cost, but also controls the error of the model, thereby reducing disk IO during query, reducing redundant data scanning, and improving the search efficiency of the index. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 Flowchart of the index construction method of the present invention.

[0043] Figure 2 2 is a trajectory diagram of an embodiment of the present invention. DETAILED DESCRIPTION

[0044] The following describes embodiments of the present invention. For clarity, many practical details are included in the following description. However, it should be understood that these practical details are not intended to limit the present invention. In other words, in some embodiments of the present invention, these practical details are not essential.

[0045] A directed road network consists of intersections and road segments, and each of the road segments is sorted and has a unique sequence number.

[0046] like Figure 2 As shown, there are a total of 8 directional segments in this embodiment of the present invention, namely seg1, seg2, seg3, seg4, seg5, seg6, seg7, and seg8. There are multiple trajectory sampling points on each segment, for a total of 19 sampling points. The segment and corresponding trajectory point distribution arrays are as follows:

[0047] Road segment number Trajectory sampling points on a road segment seg1 p1, p2 seg2 p3, p4 seg3 p5, p6 seg4 p7, p8 seg5 p9, p10 seg6 p11, p12 seg7 p13, p14, p15, p16, p17, p18 Seg8 p19

[0048] The coordinates of a track point are composed of two components: the position dimension and the time dimension. The position value of the position dimension is a floating point number. The integer part represents the sequence number of the road section, and the decimal part represents the relative position of the track point relative to the starting point of the road section. The specific data is as follows:

[0049] p1=(0.15,0), p2=(0.27,3), p3=(1.2,9), p4=(1.31,10),

[0050] p5=(2.55,20), p6=(2.67,25), p7=(3.33,30), p8=(3.44,42),

[0051] p9=(4.56,50), p10=(4.67,58), p11=(5.56,80), p12=(5.61,83),

[0052] p13=(6.26,101), p14=(6.27,120), p15=(6.62,130),

[0053] p16=(6.63,140), p17=(6.93,145), p18=(6.98,149), p19=(13.57,417);

[0054] like Figure 1 As shown, the present invention is a method for constructing an error-constrained Hilbert tree learning index on a directed road network, comprising the following steps:

[0055] Step 1: Project a set of spatiotemporal samples on a directed road network into a location-time network, and recursively divide the location-time grid in a two-dimensional plane.

[0056] The recursive partitioning of the position-time grid is as follows: First, determine the rectangle corresponding to all samples on the two-dimensional plane, with the lower left corner of the rectangle at (0.15, 0) and the upper right corner at (13.57, 417). Set the cell sample number threshold to 3. Take the center point of the rectangular area (6.86, 208.5) and draw two lines x = 6.86 and y = 208.5 in the horizontal and vertical directions, respectively, to divide the grid into four subregions. It turns out that p1-p16 are located in the lower left subregion, p17 and p18 are located in the lower right subregion, and p19 is located in the upper right subregion. No point is located in the upper left subregion. The number of points in the lower left subregion exceeds the cell sample number threshold. Then, recursively partition the lower left and upper right subregions using the above method until the number of points in each subregion is less than the cell sample number threshold of 3. When performing rectangular region partitioning, store the values ​​of the split pos axis in ascending order in the pos_scale list, and store the values ​​of the split t axis in ascending order in the t_scale list. The pos_scale list is [0.15, 0.98875, 1.8275, 2.66625, 3.505, 5.1825, 6.86, 13.57], and the t_scale list is [0, 26.0625, 52.125, 104.25, 208.5, 417.0].

[0057] Step 2: Adjust the number of rows and columns of the position-time grid, use a k-order Hilbert curve to traverse all cells in the position-time grid, sort all spatiotemporal samples, and assign a unique Hilbert number to each cell.

[0058] The step of traversing all cells in the position-time grid using a k-order Hilbert curve specifically includes the following steps:

[0059] Step 2-1: The lengths of the two lists pos_scale and t_scale are calculated to be 8 and 6 respectively, and the number of intervals in the pos direction and t direction are 7 and 5 respectively. Since the number of intervals is not equal and not equal to the power of 2k, the pos axis and t axis need to be further subdivided. For the pos axis and t axis, calculate the spacing between adjacent elements in the lists pos_scale and t_scale respectively, find the maximum interval [6.86, 13.57] and [208.5, 417] and take the midpoint for segmentation, and update the list at the same time. pos_scale is [0.15, 0.98875, 1.8275, 2.66625, 3.505, 5.1825, 6.86, 10.215, 13.57] and t_scale is [0, 26.0625, 52.125, 104.25, 208.5, 312.75, 417]. At this time, the number of intervals in the pos direction and the t direction are 8 and 6 respectively. You only need to continue to split the t_scale list so that the number of intervals in the pos direction and the t direction are both equal to 2. 3 That is 8. Repeat step 2-1 to get the final list pos_scale and t_scale as [0.15, 0.98875, 1.8275, 2.66625, 3.505, 5.1825, 6.86, 10.215, 13.57] and [0, 26.0625, 52.125, 104.25, 156.375, 208.5, 260.625, 312.75, 417];

[0060] Step 2-2: Traverse all sample points and determine the positional indices of the sample points in both dimensions using the lists pos_scale and t_scale. Then, call the Hilbert function to calculate the Hilbert number for each point. Points in the same cell of the grid are assigned the same Hilbert number. The set of (Hilbert Key, points) is as follows: (0, {p1, p2}), (3, {p3, p4}), (4, {p5}), (5, {p6}), (6, {p7, p8}), (42, {p19}), (51, {p17, p18}), (52, {p14, p15, p16}), (54, {p10}), (55, {p11, p12, p13}), and (57, {p9}).

[0061] Step 3: Divide the sorted spatiotemporal samples into a series of logical blocks and save them on disk, ensuring that the number of samples in each logical block is less than or equal to the specified threshold. Then assign a logical block number to each logical block for use in subsequent index construction. The process of dividing and saving logical blocks includes the following steps:

[0062] Step 3-1: Set the sample number threshold of a logical block to 5 and sort all cells according to the Hilbert number;

[0063] Step 3-2: Add the points within the cell to the logical block one by one. All points within a cell must be placed in the same logical block. Initialize an empty logical block, iterate over each cell, and attempt to add the samples within the cell to the logical block. If the number of samples within the logical block after addition is less than the threshold, continue adding cells to the logical block. If the current logical block is full or cannot accommodate all the samples within the current cell, abandon adding the cell, save the logical block, and create a new empty logical block to continue inserting the samples within the cell. All logical blocks are assigned logical block numbers sequentially, starting from 0. After the first logic block 0 is placed in p1, p2, p3, p4, and p5 in sequence, it cannot accommodate the cell (5, {p6}) after reaching the quantity threshold of 5, so the logic block 0 is saved, and a new logic block 1 is created to continue storing subsequent points. According to the above process, 4 logic blocks are finally created. The first logic block has a block number of 0, and the corresponding Hilbert sequence number set stored is [0, 3, 4]. The second logic block has a block number of 1, and the corresponding Hilbert sequence number set stored is [5, 6, 42]. The third logic block has a block number of 2, and the corresponding Hilbert sequence number set stored is [51, 52]. The fourth logic block has a block number of 3, and the corresponding Hilbert sequence number set stored is [54, 55, 57]. In the above 4 logic blocks, the number of points in logic block 1 is 4, and the other 3 logic blocks have been filled to reach the threshold, so the number of samples in each logic block is roughly the same;

[0064] Step 3-3: Assume that a physical page size corresponds to 2 logical block sizes, that is, 10. Write all logical blocks to the disk. When writing, first count the number of physical blocks required as 2. Then traverse the points in the logical block and write the coordinates of each point in binary format to the file. If a physical block is not filled, fill it with (0, 0) at the end of the filled data. Insert the point (-1, -1) at the end of each physical block as a page identifier. Since the number of points in logical block 1 is 4, which does not meet the logical block sample number threshold of 5, there is a sample point missing in physical page 0, so it is filled with (0, 0). Since the other logical blocks have reached the threshold, physical page 1 does not need additional padding.

[0065] Step 4: Build an error-constrained Hilbert tree model for the spatiotemporal samples as a predictor of the trajectory point storage location. During training, the input is the Hilbert sequence number of the spatiotemporal sample in the position-time grid, and the output is the stored logical block number, ensuring that the predicted error value is within the given error range.

[0066] Among them, establishing a Hilbert tree model includes the following steps:

[0067] Step 4-1: Construct a Hilbert tree for the sample set, which is a binary tree with internal nodes and leaf nodes. Each spatiotemporal sample ps i Corresponding to a training instance tn i =(ht i ,ad i ), this model input ht i Represents the Hilbert sequence number value corresponding to the trajectory point, output ad i Represents the logical block number where the track point is located, such as ps0 = (0, 0), ps3 = (3, 0), ps 17 =(51, 2), the internal nodes in the tree store a Hilbert number threshold, which is used to divide the samples into the left set and the right set. The leaf nodes contain a linear model to characterize the logical block number distribution of the data. The logical block number of the sample ps in the leaf node is predicted to be:

[0068] M(ps)=β·ht(ps)+α

[0069] The prediction error is

[0070] err(ps)=ad-β·ht(ps)-α

[0071] Where: β is the slope of the linear model, α is the intercept of the linear model, ht is the Hilbert number corresponding to the trajectory point, and ad is the logical block number where the trajectory point is located;

[0072] Step 4-2: Set a maximum error threshold eb = 0.5, and use the gradient descent method to calculate the β and α of the linear function for the sample set containing 19 samples. The gradient is:

[0073]

[0074] The calculated linear function β = 0.042 and α = 0.174,

[0075] Then, on the spatiotemporal sample set ND, we use the formula

[0076]

[0077] Adjust the value of α to 0.747;

[0078] Step 4-3: Calculate the maximum prediction error err on the current sample set ND ND :

[0079]

[0080] Calculate the maximum prediction error err on the current sample set ND ND =0.573;

[0081] Step 4-4: Calculate the fitting function M on the sample set ND and calculate the error err ND =0.573, err ND Comparing with , we can get err ND >eb, take the mean Hilbert sequence number of adjacent sample points on the sample set ND to generate the threshold set [1.5, 3.5, 4.5, 5.5, 24, 46.5, 51.5, 53, 54.5, 56], then traverse the threshold set, take the first value 1.5 of the threshold set as the Hilbert sequence number of the internal node of the binary tree for the first time, and divide the binary tree into left and right subtrees. The Hilbert sequence number set of the left subtree is [0], and the Hilbert sequence number set of the right subtree is [3, 4, 5, 6, 42, 51, 52, 54, 55, 57]. Calculate the fitting function M and the corresponding maximum error of the left and right subtrees respectively. The error of the left subtree is 0, and the error of the right subtree is 0.98. Since the maximum error of the right subtree is greater than eb, continue to traverse the threshold set. When traversing to the value 24, the Hilbert sequence number set of the left subtree is [0, 3, 4, 5, 6], and the Hilbert sequence number set of the right subtree is [42, 51, 52, 54, 55, 57]. Calculate the fitting function M and the corresponding maximum error of the left and right subtrees respectively. The error of the left subtree is 0.471, and the error of the right subtree is 0.357. At this time, the maximum errors of the left and right subtrees are both less than eb and the sum of squared errors is the smallest. Stop traversing the set and form the left and right subtrees of the binary tree according to the current Hilbert sequence number threshold of 24. Repeat steps 4-4 on the left and right subtrees. Calculate the errors of the left and right subtrees are both less than eb. Thus, an error-constrained Hilbert tree is generated based on the sample set.

[0082] The present invention divides the road network space according to the Hilbert curve, ensuring uniform distribution of trajectory data within the position-time grid. The error range of the model is controlled through the error-constrained Hilbert tree, ensuring 100% recall of query data, improving prediction accuracy, reducing the size of the index model, and optimizing the query performance of tilted data.

[0083] The foregoing is merely an embodiment of the present invention and is not intended to limit the present invention. It will be apparent to those skilled in the art that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention are intended to be included within the scope of the claims of the present invention.

Claims

1. A method for constructing an error-constrained Hilbert tree learning index on a directed road network, characterized by: The Hilbert tree learning index construction method comprises the following steps: Step 1: Project a set of spatiotemporal samples on a directed road network into a location-time network and recursively divide the location-time grid in a two-dimensional plane. Step 2: Adjust the number of rows and columns of the position-time grid, use a k-order Hilbert curve to traverse all cells in the position-time grid, sort all spatiotemporal samples, and assign a unique Hilbert number to each cell; Step 3: Divide the sorted spatiotemporal samples into a series of logical blocks and save them on disk, ensuring that the number of samples in each logical block is less than or equal to the set threshold. Then assign a logical block number to each logical block for use in subsequent index construction. Step 4: Establish an error-constrained Hilbert tree model for the spatiotemporal samples as a predictor of the trajectory point storage location. During training, the input is the Hilbert sequence number of the spatiotemporal sample in the position-time grid, and the output is the stored logical block number, ensuring that the predicted error value is within a given error range. Establishing an error-constrained Hilbert tree model for the spatiotemporal samples specifically includes the following steps: Step 4.1: Construct a Hilbert tree for the spatiotemporal sample set. It is a binary tree with internal nodes and leaf nodes. Each spatiotemporal sample Corresponding to a training instance , Hilbert tree model input Represents the Hilbert sequence number value corresponding to the trajectory point, output Represents the logical block number where the trajectory point is located. The internal node in the binary tree stores a Hilbert sequence number threshold, which is used to divide the samples into the left set and the right set. The leaf node contains a linear model to characterize the logical block number distribution of the data. The spatiotemporal samples in the leaf node The logical block number is predicted to be: , The prediction error is , in: is the slope of the linear model, is the intercept of the linear model, is the Hilbert number corresponding to the trajectory point, is the logical block number where the trajectory point is located; Step 4.2: Set a maximum error threshold , for the The sample set of spatiotemporal samples uses the gradient descent method to calculate the linear function and , the gradient is: , Then, in the spatiotemporal sample set By formula , Adjustment The value size of Step 4.3, calculate the current sample set The maximum prediction error on : , Step 4.4: In the sample set Calculate the fitting function M and calculate the error ,Will and the maximum error threshold Compare, if , no subtree division is required, if , take the sample set The threshold set is generated by the mean of the Hilbert numbers of the adjacent sample points, and then the threshold set is traversed. The threshold is used as the Hilbert number of the internal node of the binary tree during traversal, and the binary tree is divided into left and right subtrees. The fitting function M and the corresponding maximum error of the left and right subtrees are calculated respectively. When the maximum errors of the left and right subtrees are both less than the maximum error threshold When the sum of squared errors is minimum, stop traversing the set and form the left and right subtrees of the binary tree according to the current Hilbert sequence threshold. Repeat step 4.4 in the left and right subtrees until the errors in all regions are less than .

2. The method for constructing an error-constrained Hilbert tree learning index on a directed road network according to claim 1, characterized in that: The directed road network consists of intersections and road sections, each of which has a unique sequence number after sorting. The position-time grid consists of a position dimension and a time dimension. The position value of the position dimension is a floating point number, the integer part represents the sequence number of the road section, and the decimal part represents the relative position of the trajectory point relative to the starting point of the road section.

3. The method for constructing an error-constrained Hilbert tree learning index on a directed road network according to claim 1, characterized in that: In step 1, the recursive division of the position-time grid specifically includes the following steps: Step 1.1: Determine the rectangles corresponding to all spatiotemporal samples on the two-dimensional plane and set the cell sample number threshold; Step 1.2, take the center point of the rectangular area and draw two straight lines in the horizontal and vertical directions to divide the grid into four sub-areas. If the number of points in a sub-area exceeds the cell sample number threshold, recursively divide the sub-area according to the above method until the number of points in each sub-area is less than the cell sample number threshold. When dividing the rectangular area, the sub-area is divided. The axis values ​​are stored in ascending order In the list, split The axis values ​​are stored in ascending order list.

4. The method for constructing an error-constrained Hilbert tree learning index on a directed road network according to claim 3, characterized in that: In step 2, traversing all cells in the position-time grid using a k-order Hilbert curve specifically includes the following steps: Step 2.1: Set up two lists and The lengths are and ,if Axis direction and The number of intervals in the axis direction is not equal and not equal to 2 The power is Axis and The axis is further divided into Axis and Axis, calculate the list separately and The spacing between adjacent elements in the list is updated at the same time. and , repeating this process until Axis and The axis is divided into interval, i.e. Axis direction and The number of intervals in the axial direction is equal and equal to ; Step 2.2, traverse all the spatiotemporal sample point sets, according to the list and list Determine the sample point Axis and The position number on the axis is then used to call the Hilbert function to calculate the Hilbert number of the sample point. Points in the same cell in the position-time grid are assigned the same Hilbert number.

5. The method for constructing an error-constrained Hilbert tree learning index on a directed road network according to claim 1, characterized in that: In step 3, the sorted spatiotemporal samples are divided into a series of logical blocks and saved on disk, which specifically includes the following steps: Step 3.1: Set a threshold for the number of logical block samples and sort all cells according to the Hilbert sequence number. Step 3.2: Add the points in the cell to the logical block one by one. All points in a cell must be placed in the same logical block. If the capacity of the current logical block is about to exceed the logical block sample number threshold, a new logical block is created to continue storing subsequent points. All logical blocks are assigned logical block numbers in sequence starting from 0. Step 3.3, set a physical page size corresponding to The logical block size is used to write all logical blocks to the disk. When writing, the number of physical blocks required is first counted, and then the points in the logical block are traversed, and the coordinates of each point are written to the file in binary format. If a physical block is not filled, (0,0) is filled at the end of the filled data, and a point (-1,-1) is inserted at the end of each physical block as a paging identifier.

Citation Information

Patent Citations

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

    CN117194434A

  • Updatable spatial learning index method and device based on partition and dimension reduction

    CN118820537A