CPC G06F 16/2272 (2019.01) [G06F 16/2246 (2019.01)] | 8 Claims |
1. An R-tree index merging and updating method based on a Hilbert curve, comprising:
step S1, acquiring a first R-tree to be merged and a second R-tree into which the first R-tree is to be inserted, wherein a height of the first R-tree is not greater than a height of the second R-tree, and wherein in each R-tree, information stored in each leaf node comprises minimal bounding rectangles of spatial objects and primary key pointers of the spatial objects, and stored information in each non-leaf node comprises a minimal bounding rectangle of all child nodes, a primary key pointer set of all child nodes, a maximum Hilbert value of all spatial objects in the minimal bounding rectangle and a minimum Hilbert value of all spatial objects in the minimal bounding rectangle;
step S2, querying and obtaining, according to a level-by-level querying order from a root node level to a leaf node level based on Hilbert value information stored in each node, a node to be inserted into a leaf node level of the second R-tree from each merged leaf node in a leaf node level of the first R-tree;
step S3, inserting, according to an order of the Hilbert values, spatial objects contained in each leaf node in the first R-tree into the node to be inserted in the step S2, to merge the first R-tree and the second R-tree, and in case a capacity of a leaf node overflows when merging, splitting the second R-tree, and redistributing 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, updating, according to an order from a leaf node to a root node, the stored information in each node level by level for the second R-tree merged with the first R-tree.
|