Method, device and medium for merging and updating R-tree indexes based on Hilbert curves
The improved Hilbert R-tree merging method addresses inefficiencies in spatial data management by optimizing merging operations through a hierarchical query and adjustment algorithm, enhancing both merging efficiency and query performance.
Patent Information
- Application Number
- JP2023519043
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2020-09-25
- Filing Date
- 2020-10-16
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2040-10-16
AI Technical Summary
Existing spatial data management systems face inefficiencies in index update and query performance due to the high frequency of spatiotemporal data insertion and the resource-intensive merging operations of R-trees, particularly in LSM R-trees.
An improved Hilbert R-tree merging method that utilizes a 'top-to-bottom' hierarchical query algorithm and 'bottom-to-top' hierarchical adjustment algorithm, optimizing the merging process by reducing disk reads and writes, and implementing bulk insertion and uniform partitioning to enhance node filling rates and space utilization.
The method significantly improves the efficiency of Hilbert R-tree merging by minimizing disk operations and enhances query efficiency, resulting in improved space utilization and faster query performance.
Smart Images

Figure 0007605527000001 
Figure 0007605527000002 
Figure 0007605527000003
Abstract
Description
[Technical field]
[0001] The present invention relates to the technical field of data search and update, and in particular to a merge update technique for Hilbert R-Tree indexes. [Background technology]
[0002] The update frequency of spatial data is gradually increasing with the development of geographic information data collection devices, and spatial data management not only needs to meet the needs of efficient queries, but also needs to consider the needs of rapid updates. A spatial index combining an LSM tree structure can effectively support the needs of frequent insertion and update of spatial data, and an LSM R-tree index is more versatile and stable than DBH trees, DHVB trees, and SHB trees. However, the actual application process of an LSM R-tree often involves the merge operation of a large number of R-trees, and the R-tree occupies a certain amount of internal memory and calculation resources of the system during the merge process, which affects the efficiency of operations such as query, insert, and delete on the index. Therefore, an efficient Hilbert R-tree merge algorithm is needed to improve the efficiency of R-tree merges and thereby improve the overall availability of LSM R-trees. Summary of the Invention [Problem to be solved by the invention]
[0003] The objective of the present invention is to overcome the problem of low index update efficiency and low query efficiency when inserting high-frequency spatio-temporal data in the prior art, and to provide an improved R-tree index based on the Hilbert curve. [Means for solving the problem]
[0004] The specific technical solutions used in the present invention are as follows:
[0005] A method for merging and updating an R-Tree index based on a Hilbert curve, comprising: Step S1 of obtaining a first R-tree to be merged and a second R-tree into which the first R-tree is to be inserted, the height of the first R-tree being equal to or less than the height of the second R-tree, and in each R-tree, the storage information of each leaf node includes the minimum bounding rectangle of a spatial object and its primary key pointer, and the storage information of each non-leaf node includes the minimum bounding rectangle of all child nodes, the primary key pointer set of all child nodes, the maximum Hilbert value of all spatial objects in the minimum bounding rectangle, and the minimum Hilbert value of all spatial objects in the minimum bounding rectangle; Step S2 of querying and obtaining an insertion target node in the leaf node layer of the second R-tree for each merged leaf node in the leaf node layer of the first R-tree according to the order of querying one layer at a time from the root node layer to the leaf node layer based on the Hilbert value information stored in each node; Step S3: for each leaf node in the first R-tree, insert the spatial object contained therein into the insertion target node determined in S2 according to the order of Hilbert values to realize merging of the two R-trees, and if the capacity of the leaf node overflows during the merging process, perform node splitting on the second R-tree, and reassign all spatial objects contained in the first R-tree and the second R-tree to all leaf nodes of the split second R-tree according to the order of Hilbert values; and step S4 of updating the stored information of each node, layer by layer, in the second R-tree after merging with the first R-tree, in the order from the leaf node to the root node. Effect of the Invention
[0006] Compared with the prior art, the present invention has the following beneficial effects:
[0007] The present invention can realize the fast merge update of Hilbert R-tree by using "top-down" hierarchical query algorithm and "bottom-up" hierarchical adjustment algorithm. During the merge process, each inserted node is read only once, and each node is written and split only once. Compared with the one-by-one insertion method, the number of magnetic disk reads and writes is greatly reduced, the efficiency of Hilbert R-tree merge is improved, and the impact of R-tree merge on the entire spatial index operation is reduced. At the same time, the improved Hilbert R-tree uses the method of batch insertion and uniform splitting, which can improve the node filling rate to a certain extent and improve the space utilization rate of R-tree, and therefore improve the query efficiency to a certain extent. [Brief description of the drawings]
[0008] [Figure 1] Figure 1 is a spatial Hilbert filling curve. [Diagram 2] FIG. 2 shows an improved Hilbert R-tree structure. [Diagram 3] FIG. 3 shows experimental data. [Figure 4] Figure 4 shows a line graph comparing the merge time between R-Tree and R-Tree with different data volumes. [Diagram 5] Figure 5 shows a line graph comparing the query efficiency of spatial coverage of R-trees. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0009] The present invention will be further described in detail and explained below by specific embodiments with reference to the drawings. Unless conflicting with each other, all technical features of the embodiments of the present invention may be combined with each other.
[0010] During the merging process, the R-tree occupies a certain amount of internal storage and computational resources of the system, which affects the efficiency of operations such as query, insert, and delete on the index. Therefore, an efficient Hilbert R-tree merging method can reduce the occurrence of the above situation and improve the overall usage efficiency of the tree space index. The present invention improves the conventional Hilbert R-tree structure and designs an improved Hilbert R-tree merging method to realize efficient merging of Hilbert R-trees.
[0011] As shown in FIG. 1, a preferred embodiment of the present invention provides a merge update method for an R-tree index based on a Hilbert curve, and the steps of the method are as follows:
[0012] In S1, first, two R-trees are obtained, which are the first R-tree to be merged and the second R-tree into which the first R-tree is to be inserted. For ease of description, the first R-tree is denoted as R1 and the second R-tree is denoted as R2 below. Since index merging is always performed from lower layers to higher layers, the height of tree R2 is always equal to or greater than the height of tree R1.
[0013] In the present invention, the tree R1 and the tree R2 are both improved Hilbert R-trees, and the basic structure of the two R-trees is the same. In order to make the meaning of terms consistent, hereinafter, the leaf node of the R-tree is defined as a node in the R-tree that has no child node, i.e., a node in the last layer, the root node of the R-tree is a node in the first layer, i.e., a node in the top layer, and the hierarchy of the nodes in the R-tree is set as the first layer from the root node to the root node, and the second layer is set as the layer of the child nodes of the root node. By analogy, if the hierarchy of a node is the Lth layer, the hierarchy of its child node is the L+1th layer, and the height of the R-tree is the maximum value of the hierarchy of all nodes in the R-tree.
[0014] For each R-tree, the leaf node C of the improved Hilbert R-tree l is the same as the leaf node structure of a normal Hilbert R-tree, and the storage information of each leaf node is the minimum bounding rectangle of a spatial object and its primary key pointer, i.e., C l=(R, object_id).
[0015] However, non-leaf node C n In contrast, the two improved Hilbert R-trees are both based on the structure of the non-leaf nodes of the original dynamic Hilbert R-tree, and the minimum Hilbert value is added and stored. Therefore, the storage information of each non-leaf node is the minimum bounding rectangle R of all child nodes of the node, the primary key pointer set ptr of all child nodes of the node, the maximum Hilbert value maxLHV of all spatial objects in the minimum bounding rectangle R, and the minimum Hilbert value minLHV of all spatial objects in the minimum bounding rectangle R, that is, C n = (R, ptr, maxLHV, minLHV).
[0016] 2 is a schematic diagram of the improved Hilbert R-tree structure, and as can be seen from the figure, node I, node II, and node III are three non-leaf nodes. Take node II as an example, it contains three spatial objects, whose Hilbert values are 5010, 7671, and 13646 respectively, so the maximum Hilbert value maxLHV stored in node II is 13646, and the minimum Hilbert value minLHV is 5010. The root node includes node I, node II, and node III, so the maximum Hilbert value LHV that needs to be stored in the root node is 14033, and the minimum Hilbert value minLHV is 415.
[0017] By recording the Hilbert value ranges of all spatial objects at a node in the improved Hilbert R-Tree, it is possible to determine the path of insertion of spatial objects at this node at non-leaf nodes in the Hilbert R-Tree without having to query from the root node for each spatial object insertion, thereby reducing the number of disk reads and writes and improving merge efficiency.
[0018] In the improved Hilbert R-tree of the present invention, there are various methods for calculating the Hilbert value of the minimum bounding rectangle. The first method is to calculate the center point of the rectangle as a two-dimensional Hilbert value, the second method is to calculate the lower left corner coordinate and the upper right corner coordinate as a four-dimensional Hilbert value, and the third method is to calculate the center point of the rectangle and the distance d from the center to the rectangle boundary. x , d y is calculated as the Hilbert value of the 4D point. Different calculation methods for the Hilbert value result in multiple concentration situations.
[0019] In this embodiment, the one-dimensional code value on the Hilbert curve of the two-dimensional coordinates of the center point of the minimum bounding rectangle of the spatial object is preferably used as the Hilbert value of each spatial object. The encoding process of the Hilbert value may use any conventional technology. For ease of understanding, the encoding process is provided below: If the degree of the Hilbert curve is n and the coordinates of the spatial data are x and y, then In step 1, the two-dimensional coordinates x and y of the center point of the minimum circumscribing rectangle are read and the x and y values are converted to a length of 2 n Convert it to the binary value x B , y B and In step 2, take each x in turn. B and y B Extract and combine the 1-bit binary values in to obtain a binary value section, and denote the i-th set of binary value sections as x i B y i B As written, In step 3, convert all binary value sections, converting "00" to 00, "01" to 01, "10" to 11, and "11" to 10; In step 4, all the converted binary value sections are recombined in order to obtain the complete binary value, which is then converted to a decimal or Hilbert value.
[0020] In addition, for ease of understanding, the construction process of the Hilbert R-tree is described in detail below. However, it should be noted that the construction process of the R-tree is not a necessary step for the present invention, and the present invention may be for merging the constructed R-trees. The construction process of the Hilbert R-tree is as follows: S11, after calculating the Hilbert of each spatial object, arranging all spatial objects in ascending order according to the Hilbert value; S12: extracting the top c spatial objects and constructing them in the first leaf node of one R-tree based on the capacity c of each node of the R-tree, and then extracting the next c spatial objects and constructing them in the next leaf node, until all spatial objects are extracted and k leaf nodes are obtained and added to the first-in-first-out queue according to the construction order of the nodes; constructing non-leaf nodes layer by layer in the order from the leaf nodes to the root node, and for the non-leaf nodes of each layer, extracting all nodes in the first-in-first-out queue to obtain the current non-leaf node layer and adding all non-leaf nodes therein to a new first-in-first-out queue in the node construction order for use in constructing non-leaf nodes of the next layer, extracting the top c nodes from the first-in-first-out queue of the child node layer to construct them as the first non-leaf node, and then extracting the top c nodes from the first-in-first-out queue to construct them as the next non-leaf node, and so on.
[0021] In S2, based on the Hilbert value information stored in each node, the insertion target node in the leaf node layer of the second R-tree of each merged leaf node in the leaf node layer of the first R-tree is queried and obtained according to the order of querying one layer at a time from the root node layer to the leaf node layer. In the query process, the determination principle of the insertion target node is to make the Hilbert value range of the merged node as completely as possible within the Hilbert value range of the inserted node.
[0022] In this embodiment, the query process in S2 uses a "top-down" hierarchical query algorithm, and the specific implementation process of the hierarchical query algorithm is as follows:
[0023] In S21, the level n of the current search target node layer in the first R-tree is set to 1, the level m of the current search target node layer in the second R-tree is set to 1, the height of the first R-tree is H1, the height of the second R-tree is H2, the first levels of the nodes in the first R-tree and the second R-tree are both root nodes, and the root node of the second R-tree is set as an insertion target node corresponding to the root node of the first R-tree; In S22, for each node in the nth layer of the first R-tree, i n The set of all child nodes of X i n+1 and also extract the node x from the second R-tree. i n The set Y of all child nodes of the node to be inserted that corresponds to i n+1 Get and set X i n+1 For each node x in i n+1 For node x i n+1 The maximum Hilbert value maxLHV stored in i and the minimum Hilbert value minLHV i Based on the set Y i n+1 The maximum Hilbert value from all nodes in i Find the first node pointer A that is greater than i n+1 The maximum Hilbert value from all nodes in i Find the pointer B of the first node that is greater than i n+1 The node whose pointer value is in the interval [A,B] is called node x i n The node to be inserted is the node.
[0024] When executing S22, set Y i n+1 Alternatively, the nodes corresponding to pointer A and pointer B may be searched for using a binary search method from among all the nodes included in the list.
[0025] In S23, after adding 1 to the values of n and m respectively, S22 is repeated, In S24, until the values of n and m both become H1, S23 is continuously repeated to obtain the corresponding insertion target nodes in the second R-tree for each leaf node in the first R-tree, In S25, the judgment process is continuously executed. When m < H2, the value of n is maintained without change and 1 is added to the m value, then S22 is repeated. When m = H2, the query is completed, and each merged leaf node in the leaf node layer of the first R-tree finds the corresponding insertion target node from the leaf node layer of the second R-tree.
[0026] In this hierarchical query algorithm, when step S22 is executed for the first time, the insertion target node of the root node is queried correspondingly. First, the root node of R1 is read, and the set X of its child nodes i 2 is obtained. The subscript i represents the i-th node, and the same applies hereinafter. Based on the characteristics of the improved Hilbert R-tree node, the Hilbert value range of the spatial object in the node is stored in the node in the set X i 2 For each node x i 2 in the set X, based on its minimum Hilbert value minLHV i 2 and the maximum Hilbert value LHV i and maximum Hilbert value LHV, using the binary search method, the pointer of the first child node in the child node set Y i of the root node of the R2 tree where the maxLHV is greater than minLHV i 2 is calculated and recorded as fromPage i i Similarly, the pointer of the first child node in the child node Y i 2 i i i 2 The page position of the magnetic disk where the spatial object should be inserted is fromPage i <=Page<=toPage i is satisfied, that is, fromPage i FromPage i Insert into nodes in the range of X. i 2 fromPage of each node in i and toPage i , and at this time, each node in the second layer of the R1 tree finds the pointer of the node at the insertion position from the root node of the R2 tree. After that, when S23 is executed, the node in the second layer of the R2 tree is found based on the pointer value, and then the position corresponding to the node in the third layer of the R2 tree in the node in the third layer of the R1 tree is found in the same manner as above. When the hierarchy is searched in this manner, and the hierarchy reaches a spatial object corresponding to a leaf node of the R1 tree, the R1 tree cannot be further searched and subdivided, but if the R2 tree finds further leaf nodes in the process of executing S24, the corresponding spatial objects in the R1 tree are inserted into the leaf nodes in a batch.
[0027] In S3, for each leaf node in the first R-tree, the spatial objects contained therein are inserted into the insertion target node determined in S2 according to the order of Hilbert values, thereby merging the two R-trees. If the capacity of the leaf node overflows during the merging process, it is necessary to perform node splitting on the second R-tree and reassign all spatial objects contained in the first R-tree and the second R-tree to all leaf nodes of the split second R-tree according to the order of Hilbert values.
[0028] The method of performing node splitting on the second R-tree may be processed by the node index splitting method in the prior art. In this embodiment, in order to realize a batch and rapid R-tree merging, a "bottom-up" hierarchical adjustment algorithm is provided, which facilitates node index splitting on the second R-tree. The construction method is shown in S31 to S33. In S31, the number of overflow objects of the total number of all spatial objects included in the first R-tree and the second R-tree with respect to the node capacity of the second R-tree is calculated; In S32, splitting leaf nodes of the second R-tree to create the minimum number of additional leaf nodes to accommodate all overflow objects; In S33, all spatial objects included in the first R-tree and the second R-tree are arranged in ascending order according to the Hilbert value, and then reassigned to each leaf node of the second R-tree in order after division; In S34, a node capacity overflow judgment is performed for non-leaf nodes in each layer of the 2nd R-tree in the order of adjusting one layer at a time from the leaf node layer to the root node layer. If a node capacity overflow occurs in a non-leaf node in a layer, node split is performed for the non-leaf node in that layer, and all child nodes of the non-leaf node in that layer are reassigned to the non-leaf nodes in that layer after the split. Finally, after completing the adjustment of the root node, the node splitting process of the 2nd R-tree is completed.
[0029] Based on this method, we first realize the insertion and splitting of spatial object data for all leaf nodes in the last layer, and then adjust the non-leaf nodes in the previous layer upwards. As the node splitting in the leaf node layer increases, the number of nodes will increase, which may cause an overflow situation of the non-leaf nodes in the second layer counting from the bottom. Therefore, we then adjust the nodes in the second layer counting from the bottom, and perform node splitting in the same manner until we reach the root node. If the node capacity overflow occurs in the root node, we split the root node into two nodes and reconstruct the two nodes as child nodes into one root node.
[0030] In addition, in the process of merging two R-trees, when the spatial objects of the first R-tree are inserted into the insertion target node of the second R-tree, they should be inserted in the order of Hilbert values, so that all spatial objects in each final leaf node are arranged in ascending order according to Hilbert values, and all leaf nodes as a whole are also arranged in ascending order according to the maximum Hilbert value.
[0031] In S4, after the nodes are merged and split, the spatial objects stored therein change, so the storage information of the nodes changes, and therefore, for the second R-tree after merging with the first R-tree, the storage information of each node needs to be updated layer by layer in the order from the leaf node to the root node. In the case of a leaf node, the storage information to be updated includes the minimum bounding rectangle R of the spatial object, and the primary key pointer object_id, and in the case of a non-leaf node, the storage information to be updated includes the minimum bounding rectangle R of the spatial object, the primary key pointer set prt, the maximum Hilbert value maxLHV, and the minimum Hilbert value minLHV.
[0032] To further illustrate the technical effects of the present invention, a specific example is taken below to demonstrate the effect of the above-mentioned Hilbert curve-based R-Tree index merge update method on specific spatial data.
[0033] Working Example The steps and specific implementation of this embodiment are the same as the above steps, that is, steps S1 to S4, and step S2 is specifically realized by S21 to S25, and step S3 is specifically realized by S31 to S34, and detailed description is omitted here. The implementation process and some implementation results are shown below.
[0034] In this embodiment, the spatial data type of the surface is taken as the research object, and the building area data of the whole of China downloaded from OpenStreetMap is used, and the total number of elements is 1,000,192. Figure 3 shows the spatial data of the research object. As can be seen from the figure, the spatial data has different sizes and uneven distribution, and the data density has a certain randomness, which can be used as the experimental sample.
[0035] A total of 50 sets of data, each containing 1,000 to 50,000 records, are randomly selected, and update operations are performed on the improved R-tree index based on the Hilbert curve, the normal R-tree index, and the Hilbert R-tree index to verify the high efficiency of the improved Hilbert R-tree merging algorithm of the present invention. By comparing the query efficiency after merging, it is proven that the LH R-tree merging algorithm can ensure higher space concentration and higher query efficiency.
[0036] In Fig. 4, the horizontal axis indicates the size of the merged R-tree, and the vertical axis indicates the time required for merging the R-trees. From top to bottom in the line graph, the yellow line indicates the time required for merging the normal R-trees, the gray line indicates the time required for merging the dynamic Hilbert R-trees, the orange line indicates the time required for merging the static Hilbert R-trees, and the blue line indicates the time required for merging the improved Hilbert R-trees according to the present invention. As can be seen from the figure, the dynamic Hilbert R-tree merging method is superior to the normal R-tree merging method, the improved Hilbert R-tree merging method according to the present invention is superior to the static Hilbert R-tree merging method, and the time required for the improved Hilbert R-tree merging method according to the present invention and the static Hilbert R-tree merging method is obviously shorter than the two methods of inserting and merging one by one.
[0037] In FIG. 5, the horizontal axis indicates the rectangular search range, with longitude and latitude as units, and the vertical axis indicates the number of times the magnetic disk of the R tree is read, with the unit being 10,000 pages. In the R tree query, when the query range is narrower, the query speed is faster and the error value of the obtained query time is larger. Since the read and write speed of the magnetic disk is much faster than the internal memory search, the range query time can be replaced by the number of times the magnetic disk page is read, and this experiment uses the number of times the magnetic disk is read as the basis for comparing the query efficiency. From top to bottom in the figure, respectively, are a line graph of the spatial query efficiency of the normal R tree, a line graph of the spatial query efficiency of the dynamic Hilbert R tree, a line graph of the spatial query efficiency of the improved Hilbert R tree according to the present invention, and a line graph of the spatial query of the static Hilbert R tree. As can be seen from the figure, the spatial query efficiency of the four types of R trees is almost the same with the increasing change trend of the spatial range. However, the fact that the query efficiency of the dynamic Hilbert R tree is better than that of the normal R tree is explained by the fact that the spatial concentration of the Hilbert R tree is higher than that of the normal R tree. The query efficiency of the R-tree obtained by the batch merge algorithm is obviously higher than the above two kinds of R-trees, and the efficiency of the static Hilbert R-tree is a little higher than the improved Hilbert R-tree of the present invention. However, the improved Hilbert R-tree of the present invention is 52% higher than the average query efficiency of the R-tree, 41% higher than the average query efficiency of the dynamic Hilbert R-tree, and 5% lower than the query efficiency of the static Hilbert R-tree.
[0038] In another embodiment, a merge update device for an R-tree index based on a Hilbert curve may be further provided, a memory for storing a computer program; and a processor for implementing the above-mentioned Hilbert curve based R-Tree index merge update method when the computer program is executed.
[0039] In another embodiment, a computer-readable storage medium can be further provided, and a computer program can be stored in the storage medium. When the computer program is executed by a processor, the above-mentioned Hilbert curve-based R-tree index merge update method can be realized.
[0040] The above-described embodiments are merely preferred solutions of the present invention, and are not intended to limit the present invention. Those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention. Therefore, any technical solutions obtained by equivalent replacement or equivalent conversion are included in the scope of protection of the present invention.
Claims
1. A method for merging and updating an R-tree index based on a Hilbert curve, the method being executed by a computer and including the following steps S1 to S4: In the step S1, a first R-tree to be merged and a second R-tree into which the first R-tree is inserted are obtained, the height of the first R-tree is equal to or less than the height of the second R-tree, in each of the first R-tree and the second R-tree, the storage information of each leaf node includes a minimum bounding rectangle of a spatial object and a primary key pointer of the spatial object, and the storage information of each non-leaf node includes a minimum bounding rectangle of all child nodes, a primary key pointer set of all the child nodes, a maximum Hilbert value among the Hilbert values of all spatial objects in the minimum bounding rectangle of all the child nodes, and a minimum Hilbert value among the Hilbert values of all spatial objects in the minimum bounding rectangle of all the child nodes, In step S2, based on the Hilbert value information stored in each node, in accordance with the order of querying one layer at a time from the root node layer to the leaf node layer, query and obtain an insertion target node in the leaf node layer of the second R-tree for each leaf node to be merged in the leaf node layer of the first R-tree; In step S3, for each leaf node in the first R-tree, the spatial objects included in the storage information of each leaf node in the first R-tree are inserted into the insertion target node determined in step S2 in accordance with the order of Hilbert values, and the first R-tree is merged into the second R-tree. If the capacity of the leaf node of the second R-tree overflows during the merging process, node splitting is performed on the second R-tree, and all spatial objects included in the first R-tree and the second R-tree are reassigned to all leaf nodes of the second R-tree after node splitting in accordance with the order of Hilbert values. In step S4, for the second R-tree obtained by merging with the first R-tree, the stored information in each node is updated layer by layer in the order from the leaf node to the root node; The step S2 includes the following steps S21 to S25: In step S21, the level n of the current search target node layer in the first R-tree is set to 1, the level m of the current search target node layer in the second R-tree is set to 1, the height of the first R-tree is H 1 , the height of the second R-tree is H 2 , the first levels of the nodes in the first R-tree and the second R-tree are both root nodes, and the root node of the second R-tree is set as an insertion target node corresponding to the root node of the first R-tree; In step S22, for the nodes in the nth layer in the first R-tree, all child node sets X i n+1 of each node x i n are obtained, and all child node sets Y i n+1 of the insertion target node corresponding to node x i n are obtained from the second R-tree. For each node x i n+1 included in set X i n+1, based on the maximum Hilbert value maxLHV i and the minimum Hilbert value minLHV i stored in node x i n+1, a pointer A of the first node included in set Y i n+1 whose maximum Hilbert value is greater than minLHV i is searched for, and a pointer B of the first node included in set Y i n+1 whose maximum Hilbert value is greater than maxLHV i is searched for, and a node in set Y i n+1 whose pointer value is within the [A, B] interval is determined as the insertion target node for node x i n. In step S23, 1 is added to each of the values of n and m, and then step S22 is repeated. In step S24, step S23 is repeated until the values of n and m are both H 1 to obtain a corresponding insertion target node in the second R-tree for each leaf node in the first R-tree; In step S25, the judgment process continues to be performed. If m<H2, keep the value of n unchanged and add 1 to the value of m, and then repeat step S22. When m=H2, the query is completed, and each merged leaf node in the leaf node layer of the first R-tree finds a corresponding insertion target node in the leaf node layer of the second R-tree. A method for merging and updating an R-tree index based on a Hilbert curve, comprising:
2. In the R-tree, the Hilbert value of each spatial object is a one-dimensional code value on the Hilbert curve of the two-dimensional coordinates of the center point of the minimum bounding rectangle of the spatial object. The method for merging and updating an R-tree index based on a Hilbert curve according to claim 1 .
3. The R-tree construction process of the R-tree index merge update method includes the following steps S11 to S13: In step S11, all spatial objects are arranged in ascending order according to Hilbert value; In step S12, the top c spatial objects are extracted and constructed in the first leaf node of one R-tree based on the capacity c of each node of the R-tree, and the next c spatial objects are extracted and constructed in the next leaf node, and so on, until all spatial objects are extracted, k leaf nodes are obtained, and added to the first-in-first-out queue according to the construction order of the nodes; In step S13, non-leaf nodes are constructed layer by layer in the order from the leaf node to the root node, and for each non-leaf node in each layer, all nodes in the first-in-first-out queue are extracted to obtain the current non-leaf node layer, and all non-leaf nodes therein are added to a new first-in-first-out queue in the node construction order for use in constructing the non-leaf node in the next layer. The top c nodes are then extracted from the first-in-first-out queue of the child node layer to construct the first non-leaf node, and the top c nodes are then extracted from the first-in-first-out queue to construct the next non-leaf node. The method for merging and updating an R-tree index based on a Hilbert curve according to claim 1 .
4. In step S22, set Y i n+1 Search for the nodes corresponding to pointer A and pointer B using a binary search method from all the nodes included in The method for merging and updating an R-tree index based on a Hilbert curve according to claim 1 .
5. In the step S3, if the capacity of a leaf node of the second R-tree overflows in the process of merging the first R-tree into the second R-tree, the following steps S31 to S33 are carried out to split the node of the second R-tree for the overflow, In the step S31, the number of overflow objects of the total number of all spatial objects included in the first R-tree and the second R-tree with respect to the node capacity of the second R-tree is calculated; In step S32, splitting leaf nodes of the second R-tree to create the minimum number of additional leaf nodes to accommodate all overflow objects; In step S33, all spatial objects included in the first R-tree and the second R-tree are arranged in ascending order according to the Hilbert value, and then reassigned in order to each leaf node after division of the second R-tree; In step S34, a node capacity overflow judgment is performed for the non-leaf nodes of each layer of the second R-tree in the order of adjusting one layer at a time from the leaf node layer to the root node layer. If a node capacity overflow occurs in a non-leaf node of a layer, node split is performed for the non-leaf node of that layer, and all child nodes of the non-leaf node of that layer are reassigned to the non-leaf node of that layer after the split. Finally, after completing the adjustment of the root node, the node splitting process of the second R-tree is completed. The method for merging and updating an R-tree index based on a Hilbert curve according to claim 1 .
6. In step S34, if a node capacity overflow occurs in the root node, the root node is divided into two nodes, and a single root node is newly constructed with the two nodes as child nodes. The method for merging and updating R-tree indexes based on Hilbert curves according to claim 5.
7. In step S3, after merging the first R-tree into the second R-tree, the spatial objects in each leaf node of the second R-tree are arranged in ascending order according to the Hilbert value. The method for merging and updating R-tree indexes based on Hilbert curves according to claim 5.
8. 1. A merge update apparatus for an R-tree index based on a Hilbert curve, comprising: A processor; A memory storing a computer program for causing the processor to execute the method for merging and updating an R-tree index based on a Hilbert curve according to any one of claims 1 to 7.
2. A merge update device for an R-tree index based on a Hilbert curve.
9. A computer-readable storage medium storing a computer program for causing a processor of a computer to execute the method for merging and updating an R-tree index based on a Hilbert curve according to any one of claims 1 to 7.
Citation Information
Patent Citations
Information processor and control method of the same
JP2013164813A
Information processor, information processing method, and program
JP2015055914A
Pretreatment device, index addition tree data correction method and index addition tree data correction program
JP2018045286A
Data management device, data search method and program
JP2020135530A
Method of storing and retrieving multi-dimensional data using the hilbert curve
US20030004938A1
