Error-limited Hilbert tree learning index construction method on directed road network
By using the Hilbert tree with limited error learning index construction method on directed road network, the problem of redundant query of high-dimensional trajectory data is solved, and efficient index search and optimized model performance is achieved.
Patent Information
- Application Number
- CN202411542870.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-10-31
AI Technical Summary
Existing multidimensional learning indexes will face the problem of redundant queries when processing large amounts of high-dimensional trajectory data, resulting in an increase in disk I/O operation burden and reduce query performance. Especially when facing skewed data, the prediction accuracy of the learning model will decrease. Search costs are rising.
A Hilbert tree learning index construction method with limited errors on directed road network is proposed. Multiple uniformly distributed logical units are divided through Hilbert curves, reducing data redundant scanning, improving index search efficiency, and passing errors The constrained Hilbert tree model predicts the logical block position of sample points.
It effectively reduces redundant scanning of data, improves the search efficiency of indexes, reduces model size and construction time, ensures 100% recall of queries, and optimizes the query performance of skewed data.
Smart Images

Figure CN119396835A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of computer application, and in particular relates to a Hilbert tree learning index with limited error on a directed road network. Background Art
[0002] In recent years, with the widespread use of mobile devices and the improvement of positioning equipment accuracy, a large number of mobile trajectories have been collected and stored in the mobile data trajectory library. These data contain the action characteristics and traffic information of mobile objects. By mining trajectory data, we can summarize the movement patterns of people and improve the traffic conditions of road networks. In the current environment, trajectory data presents the characteristics of large quantity, high dimensionality and complexity. How to efficiently query trajectory data has become a key issue.
[0003] The current multidimensional learning index can be divided into model fitting layout mode and model generation layout mode. In the model fitting layout mode, the storage order of data is predetermined. The data is sorted and placed according to a fixed pattern, and then the model is trained based on this sorting order to predict the location of the data. The data layout determines the training model. Qi Jianzhong et al. proposed the RSMI index in the paper "Effectively Learning Spatial Indices". The core idea of this index is to map points in multidimensional space to ranking space, sort data points using space filling curves, and assign a curve value to each data point. After sorting, the data points are divided into blocks according to the curve value, and a multilayer perceptron is trained to learn the index of the coordinates of the points 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 the set threshold. Zhang Songnian et al. proposed the SPRIG+ index in the paper "Efficient Learned Spatial Index With Interpolation Function Based Learned Model". The core idea of this index is to build an adaptive grid based on data distribution and divide the space into multiple cells. Then the IH-tree+ index is constructed using spatial interpolation functions and dynamic coding technology. 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 generation layout mode, a model that can reasonably represent the data layout is first selected. The storage distribution of the data is determined by training this model. The data model directly determines the data layout. Li Pengfei et al. proposed the LISA index in the paper "LISA: A Learned Index Structure for Spatial Data". The index divides the space into grid cells and sorts them by number according to the coordinate axis. Then LISA constructs a partial monotonic function based on the boundaries of the cell, and maps the data from the multidimensional space to the one-dimensional space through this prediction function.
[0005] Existing multi-dimensional learning indexes face the problem of redundant queries when processing large amounts of high-dimensional trajectory data. When performing disk read operations, the system may access duplicate or unnecessary data, increasing the burden of disk I / O operations and reducing the overall query performance. Although the above-mentioned learning indexing methods process, place data, and train machine learning models to learn the distribution of sample sets through methods such as dimensionality reduction, space filling curves, and interpolation functions, they are all limited by the problem of redundant data scanning. In addition, when facing skewed data, the uneven data density distribution will also lead to a decrease in the prediction accuracy of the learning model and an increase in the search cost. Summary of the invention
[0006] In order to solve the above technical problems, the present invention provides a method for constructing a Hilbert tree learning index with limited error on a directed road network. The 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 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 by the following technical solutions:
[0008] The present invention is a method for constructing a Hilbert tree learning index with limited error on a directed road network, and the method specifically comprises 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 sequence 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, and then assign a logical block number to each logical block for use in subsequent index construction;
[0012] Step 4: Establish an error-constrained Hilbert tree model for the spatiotemporal samples as a predictor of the location of the trajectory points. The input during training is the Hilbert sequence number of the spatiotemporal samples in the position-time grid, and the output is the stored logical block number to ensure 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 is composed of intersections and road sections, each of the road sections is sorted and has a unique serial number, the position-time grid is composed 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 quantity 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 value of the split pos axis in ascending order in the pos_scale list, and store the value 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, let the lengths of the two lists pos_scale and t_scale be m and n respectively. If the number of intervals in the pos axis direction and the t axis direction is not equal to 2 to the power of k, then further split the pos axis and the t axis. For the pos axis and the t axis, calculate the spacing between adjacent elements in the lists pos_scale and t_scale respectively, find the maximum interval and take the midpoint for splitting, and update the lists pos_scale and t_scale at the same time. Repeat this process until 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 space-time sample point sets, determine the position number of the sample point on the pos axis and the 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 of 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. The 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 threshold of the number of logical block samples, a new logical block is created to continue to store 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, first count the number of physical blocks required when writing, 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 a 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, a Hilbert tree model with limited error is established for the spatiotemporal samples, which specifically includes 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 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 sequence 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 β and α of the linear function for a sample set containing m spatio-temporal samples. The gradient is:
[0031]
[0032] Then, on the spatio-temporal sample set ND, through 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 compare err ND with the maximum error threshold eb. If err ND < eb, there is no need to divide the sub-tree. If err ND > eb, take the average of the Hilbert sequence numbers of adjacent sample points on the sample set ND to generate a threshold set, and then traverse the threshold set. When traversing, use this threshold as the Hilbert sequence number of the internal node of the binary tree, divide the binary tree into left and right sub-trees, calculate the fitting function M and the corresponding maximum error of the left and right sub-trees respectively. When the maximum errors of the left and right sub-trees are both less than the maximum error threshold eb and the sum of the squared errors is the smallest, stop traversing the set and form the left and right sub-trees of the binary tree according to the current Hilbert sequence number threshold. Repeat Step 4.4 in the left and right sub-trees until the errors in all regions are less than eb.
[0038] The beneficial effects of the present invention are:
[0039] The present invention takes into account the connectivity of the road segments, and performs a divide-and-conquer operation on the sample set through the Hilbert curve, which not only supports batch processing but also is suitable for incremental sorting;
[0040] The present invention proposes to construct an error-constrained Hilbert tree to predict the logical block position of the sample point. 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, the present invention uses a tight strip to model the data distribution, which greatly reduces 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 scanning of data, and improving the search efficiency of the index. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 The present invention is a flowchart of the index construction method.
[0043] Figure 2 It is a trajectory diagram of an embodiment of the present invention. DETAILED DESCRIPTION
[0044] The following will disclose the embodiments of the present invention. For the purpose of clear description, many practical details will be described together in the following description. However, it should be understood that these practical details should not be used to limit the present invention. That is, in some embodiments of the present invention, these practical details are not necessary.
[0045] The directed road network consists of intersections and road sections, and each of the road sections is sorted and has a unique serial number.
[0046] like Figure 2 As shown, there are a total of 8 directional segments in the embodiment of the present invention, namely seg1, seg2, seg3, seg4, seg5, seg6, seg7, seg8, and each segment has multiple trajectory sampling points, with a total of 19 sampling points. The segment and corresponding trajectory point distribution array are as follows:
[0047] Section No. Trajectory sampling points on the 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 a Hilbert tree learning index with limited error 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 specific method of recursively dividing the position-time grid is as follows: first determine the rectangle corresponding to all samples on the two-dimensional plane, the lower left corner of the rectangle is (0.15, 0), the upper right corner is (13.57, 417), and the cell sample number threshold is set to 3. Take the center point of the rectangular area (6.86, 208.5) and draw two straight lines x=6.86 and y=208.5 in the horizontal and vertical directions to divide the grid into four sub-areas. It can be obtained that p1-p16 is located in the lower left sub-area, p17 and p18 are located in the lower right sub-area, and p19 is located in the upper right sub-area. No point is located in the upper left sub-area. The number of points in the lower left sub-area exceeds the cell sample number threshold. Then, the lower left and upper right sub-areas are recursively divided according to the above method until the number of points in each sub-area is less than the cell sample number threshold of 3. When dividing the rectangular area, the values of the split pos axis are stored in the pos_scale list in ascending order, and the values of the split t axis are stored in the t_scale list in ascending order. 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 sequence 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 2 to the power of k, 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 intervals [6.86, 13.57] and [208.5, 417] and take the midpoint for segmentation, and update the lists 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 point sets, determine the position sequence of the sample points in two dimensions according to the lists pos_scale and t_scale, and then call the Hilbert function to calculate the Hilbert sequence of the point. Points in the same cell in the grid are assigned the same Hilbert sequence. The (Hilbert Key, points) set 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}), (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, and then assign a logical block number to each logical block for use in subsequent index construction. The division and storage of logical blocks includes the following steps:
[0062] Step 3-1: Set a logic block sample number threshold to 5, and sort all cells according to the Hilbert sequence number;
[0063] Step 3-2: Add the points in the cell to the logic block one by one. The points in a cell must be placed in the same logic block. Initialize an empty logic block, traverse each cell, and try to add the samples in the cell to the logic block. If the number of samples in the logic block after adding is less than the threshold, continue to add cells to the logic block. If the current logic block is full or cannot accommodate all the samples in the current cell, give up adding the cell, save the logic block, and then create a new empty logic block to continue inserting the samples in the cell. All logic blocks are assigned logic block numbers in sequence 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 to store subsequent points. According to the above process, 4 logic blocks are finally created. The block number of the first logic block is 0, and the corresponding Hilbert sequence number set stored is [0, 3, 4]. The block number of the second logic block is 1, and the corresponding Hilbert sequence number set stored is [5, 6, 42]. The block number of the third logic block is 2, and the corresponding Hilbert sequence number set stored is [51, 52]. The block number of the fourth logic block is 3, and the corresponding Hilbert sequence number set stored is [54, 55, 57]. Among 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, and insert the point (-1, -1) at the end of each physical block as a paging identifier. Since the number of points in logical block No. 1 is 4, it does not reach the threshold of 5 for the number of logical block samples, so there is a sample point vacant in physical page No. 0, so it is filled with (0, 0). Since the threshold has been reached for other logical blocks, physical page No. 1 does not need additional filling.
[0065] Step 4: Establish an error-constrained Hilbert tree model for the spatiotemporal samples as a predictor of the location of the trajectory points. The input during training is the Hilbert sequence number of the spatiotemporal samples in the position-time grid, and the output is the stored logical block number to ensure 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 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 left and right sets. 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 as:
[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 linear function β=0.042 and α=0.174 are calculated.
[0075] Next, 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 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, first take the first value 1.5 of the threshold set as the Hilbert number of the internal node of the binary tree, divide the binary tree into left and right subtrees, the left subtree Hilbert number set is [0], the right subtree Hilbert number set is [3, 4, 5, 6, 42, 51, 52, 54, 55, 57] respectively calculate the fitting function M and the corresponding maximum error of the left and right subtrees, the left subtree error is 0, the right subtree error is 0.98, because 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, and calculate that the errors of the left and right subtrees are both less than eb. Thus, an error-constrained Hilbert tree is generated according to the sample set.
[0082] The present invention divides the road network space according to the Hilbert curve, ensures the uniform distribution of trajectory data in the position-time grid, controls the error range of the model through the error-constrained Hilbert tree, ensures 100% recall of query data, improves prediction accuracy, reduces the size of the index model, and optimizes the query performance of tilted data.
[0083] The above description is only an embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention should be included in 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 in that: 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 sequence 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, and 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 location of the trajectory points. The input during training is the Hilbert sequence number of the spatiotemporal samples in the position-time grid, and the output is the stored logical block number to ensure that the predicted error value is within the given error range.
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 is sorted and has a unique serial number. 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.
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 quantity 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, store the value of the split pos axis in ascending order in the pos_scale list, and store the value of the split t axis in ascending order in the t_scale 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, let the lengths of the two lists pos_scale and t_scale be m and n respectively. If the number of intervals in the pos axis direction and the t axis direction is not equal and not equal to 2 to the power of k, then further split the pos axis and the t axis. For the pos axis and the t axis, calculate the spacing between adjacent elements in the lists pos_scale and t_scale respectively, find the maximum interval and take the midpoint for splitting, and update the lists pos_scale and t_scale at the same time. Repeat this process until the pos axis and the t axis are equally divided into two k intervals, that is, the number of intervals in the pos axis direction and the t axis direction is equal and equal to 2 k ; Step 2.2, traverse all the space-time sample point sets, determine the position number of the sample point on the pos axis and the 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.
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 the disk, which specifically includes the following steps: Step 3.1, set a threshold of 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. The 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 threshold of the number of logical block samples, a new logical block is created to continue to store subsequent points. All logical blocks are assigned logical block numbers in sequence starting from 0. Step 3.3: Assume that a physical page size corresponds to n logical block sizes, write all logical blocks to the disk, 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 a point (-1,-1) at the end of each physical block as a paging identifier.
6. 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 4, an error-constrained Hilbert tree model is established for the spatiotemporal samples, which 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 ps i Corresponding to a training instance tn i =(ht i ,ad i ), Hilbert tree model input ht i Represents the Hilbert sequence number 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: M(ps)=β·ht(ps)+α The prediction error is err(ps)=ad-β·ht(ps)-α 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; Step 4.2: Set a maximum error threshold eb, and use the gradient descent method to calculate the linear function β and α for the sample set containing m spatiotemporal samples. The gradient is: Next, on the spatiotemporal sample set ND, we use the formula Adjust the value of α; Step 4.3: Calculate the maximum prediction error err on the current sample set ND ND : Step 4.4: Calculate the fitting function M on the sample set ND and calculate the error err ND , and compare err ND with the maximum error threshold eb. If err ND < eb, there is no need to divide the sub-tree. If err ND > eb, generate a threshold set by taking the mean of the Hilbert sequence numbers of adjacent sample points on the sample set ND. Then traverse the threshold set. When traversing, use this threshold as the Hilbert sequence number of the internal node of the binary tree, divide the binary tree into left and right sub-trees, calculate the fitting function M and the corresponding maximum error of the left and right sub-trees respectively. When the maximum errors of both the left and right sub-trees are less than the maximum error threshold eb and the sum of the squared errors is the smallest, stop traversing the set and form the left and right sub-trees of the binary tree according to the current Hilbert sequence number threshold. Repeat Step 4.4 in the left and right sub-trees until the errors of all regions are less than eb.
Citation Information
Patent Citations
Method of constructing Hilbert R-tree index on equivalent cloud platform
CN103617162A
Spatial-temporal index constructing method oriented to massive track point data
CN107220285A
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
ORGANOMETALLIC compound, light emitting device including the same and electronic apparatus including the light emitting device
KR1020230001560A