QRB tree indexing method for massive vector data retrieval
Through the QRB tree index method, through the combination of quad-tree grid and R-tree bucket, redundant operations and fine intersection tests are reduced, the retrieval performance of massive vector data is improved, and the redundancy of existing hybrid indexes in massive data retrieval is solved. It solves the problem of additional operations and significantly improves the retrieval efficiency.
Patent Information
- Application Number
- CN202111251118.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-26
- Publication Date
- 2024-08-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing hybrid indexes have redundant operations during the retrieval process of massive vector data, which affects retrieval performance, especially in the coarse and precise retrieval stages.
Using the QRB tree index method, the space is divided into quadtree grids through quadtrees, R trees and buckets are set for each grid, the grid closest to the feature range is selected as the subordinate grid, and the features are inserted into the associated R-tree and bucket, and establish a random access structure to speed up retrieval, decompose the rectangular retrieval box into interior, boundary and corner point hit grids, retrieve candidate features from the bucket or R-tree respectively, and exclude non-intersection through fine intersection test elements.
It reduces unnecessary R-tree retrieval operations and fine intersection tests, significantly improving retrieval performance and efficiency, especially when the retrieval box is large, and has a great performance advantage.
Smart Images

Figure CN113946584B
Abstract
Description
Technical Field
[0001] The invention relates to a QRB tree indexing method for massive vector data retrieval, belonging to the technical field of large data retrieval query. Background Art
[0002] With the development of spatial information technology and the diversification of collection methods, the scale of geographic spatial data has grown exponentially. How to effectively organize and manage massive spatial data to maximize its benefits has become an urgent problem that needs to be solved. The retrieval performance of spatial index determines the efficiency of spatial data organization and management, and directly affects subsequent analysis and use. Vector data is the most common type of spatial data. Spatial indexes for vector data can be roughly divided into three categories: tree index, grid index, and hybrid index.
[0003] Among them, the typical representatives of tree index are R-tree and its variants, whose retrieval performance is easily affected by factors such as tree height and node range overlap. The typical representative of grid index is GeoHash index, whose retrieval performance is easily affected by grid size. Hybrid index is a combination of tree index and grid index, with QR tree as a typical representative. The basic idea is: use quadtree to divide the index space into grids of different levels (called quadtree grids), and each quadtree grid corresponds to an R-tree; when building the index, insert the feature into the R-tree associated with the grid where the feature is located; when searching, decompose the search frame into several quadtree grids of different levels, and then search the R-trees associated with these quadtree grids one by one to obtain the final search results. The essence of QR tree index is to decompose a large R-tree into several small R-trees with the help of quadtree grids to improve the retrieval efficiency of data, and it has the advantages of both grid index and tree index. Similar to the variants of R-tree, there are also multiple variants of QR-tree. For example, Mao et al. and Qiu Jianhua et al. replaced the R-tree in the QR-tree index with R+ tree or R* tree respectively and proposed QR+ tree and QR* tree index; Yang Zexue et al. used loose quadtree (grid boundary expansion) to replace the conventional quadtree and proposed LQR tree index; Wang et al. made a three-dimensional expansion of QR* tree and proposed 3DOR* tree index.
[0004] Spatial indexes often use the minimum bounding rectangle (MBR) of a feature to replace the true range of the feature to improve retrieval performance. For this reason, actual retrieval can be divided into two different retrieval methods: rough and precise. The retrieval results of the former are the MBRs (rather than the features themselves) that intersect with the retrieval box, so there is a certain error; the latter further excludes the features that do not intersect with the retrieval box on the basis of the former. Compared with tree indexes and grid indexes, hybrid indexes have certain advantages, but this type of index currently has more redundant operations in both the rough retrieval and precise retrieval stages, which affects the retrieval performance of this type of index. The above problems are issues that should be considered and solved in the process of massive vector data retrieval. Summary of the invention
[0005] The purpose of the present invention is to provide a QRB tree indexing method for massive vector data retrieval to solve the problem in the prior art that redundant operations affect its retrieval performance.
[0006] The technical solution of the present invention is:
[0007] A QRB tree indexing method for massive vector data retrieval includes the following steps:
[0008] S1. Construct QRB tree index: Use quadtree to divide the space where vector data is located into quadtree grids of different levels, set an R-tree and a bucket for each quadtree grid; given a vector element, select the quadtree grid that does not exceed the quadtree grid boundary and is closest to the current vector element range as the subordinate grid; insert the vector element into the R-tree and bucket associated with the subordinate grid respectively; when all vector elements are inserted, establish a random access structure to store all non-empty R-trees and non-empty buckets to form a QRB tree index;
[0009] S2. Use QRB tree for precise retrieval: given a rectangular retrieval box, decompose the rectangular retrieval box into several hit grids, classify the hit grids into internal hit grids, boundary hit grids and corner hit grids, and retrieve from the associated buckets or R trees according to the type of hit grids, and then obtain the internal candidate feature set, boundary candidate feature set and corner candidate feature set; obtain a new corner candidate feature set by excluding the features in the corner candidate feature set that do not intersect with the rectangular retrieval box through a refined intersection test; merge the internal candidate feature set, boundary candidate feature set and new corner candidate feature set to form the final retrieval result set.
[0010] Further, in step S1, a quadtree grid that does not exceed the quadtree grid boundary and is closest to the current vector element range is selected as a subordinate grid, specifically,
[0011] S11, given a vector element, calculate the level l of the quadtree grid corresponding to the current element MBR;
[0012] S12. According to the range and position of the current element MBR, the quadtree grid of the current element MBR at level 1 is calculated as the subordinate grid.
[0013] Furthermore, in step S11, the level l of the quadtree grid corresponding to the current element MBR is calculated, specifically:
[0014]
[0015] Among them, Ω x and Ω y are the dimensions of the current element MBR along the x-axis and along the y-axis respectively; if the quadtree grid is a global grid, then L 0 = a, otherwise, Among them, ω x and ω y are the dimensions of the MBR along the x-axis and along the y-axis of the entire data set containing all vector elements, respectively, and a is a fixed constant.
[0016] Furthermore, in step S1, the vector element is inserted into the bucket associated with the belonging grid, specifically,
[0017] S13, inserting the current element into the R-tree associated with the subordinate grid according to the insertion algorithm of the R-tree index;
[0018] S14. Append the ID or pointer of the current element to the array corresponding to the bucket associated with the belonging grid.
[0019] Furthermore, in step S1, a random access structure is established to store all non-empty R-trees and non-empty buckets, specifically,
[0020] S15, initialize the R-tree address array and the bucket address array, set the initial value to the empty address, the size of the R-tree address array and the bucket address array are And N k is the total number of quadtree grids at level k, L 0 is the maximum allowed level;
[0021] S16, splicing all non-empty R-trees in sequence according to the order of the quadtree grid codes, saving the results to the R-tree set file, registering the first address of each non-empty R-tree in the R-tree set file in the c-th element of the R-tree address array, where c is the code of the quadtree grid associated with the current non-empty R-tree;
[0022] S17, splicing all non-empty buckets in sequence according to the order of the quadtree grid codes, saving the results to the bucket set file, registering the first address of each non-empty bucket in the bucket set file in the cth element of the bucket address array, where c is the code of the quadtree grid associated with the current non-empty bucket;
[0023] S18. Write the R-tree address array and the bucket address array into corresponding files respectively. The R-tree address array file, the bucket address array file, the R-tree set file and the bucket set file together form a random access structure, namely, a QRB tree index.
[0024] Furthermore, in step S16 and step S17, the encoding of the quadtree grid is specifically calculated as follows:
[0025]
[0026] Among them, N k is the total number of quadtree grids at the kth level, M is the number of columns of the current grid unit in the quadtree grid at the lth level, and i and j are the column and row numbers of the current grid unit in the quadtree grid at the lth level.
[0027] In step S2, the rectangular search box is decomposed into a number of hit grids. Specifically, the current rectangular search box is divided using a quadtree grid division method to generate all levels less than L 0 And the quadtree grid that intersects with the current rectangular search box is the hit grid.
[0028] Further, in step S2, the hit grids are classified into internal hit grids, boundary hit grids and corner hit grids, and the hit grids are searched from their associated buckets or R-trees according to their types, thereby obtaining an internal candidate element set, a boundary candidate element set and a corner candidate element set; a new corner candidate element set is obtained by excluding elements in the corner candidate element set that do not intersect with the rectangular search box through a refined intersection test, specifically,
[0029] S21, load the R-tree address array file and the bucket address array file from the QRB tree index into the memory and keep them resident;
[0030] S22, according to the positional relationship between the hit grid and the rectangular search box, the hit grid is divided into an internal hit grid, a boundary hit grid and a corner hit grid; the code of each hit grid is calculated by formula (2), and the internal hit grid code set C is obtained respectively. I , boundary hit grid code set C B and corner point hit grid coding set C C ;
[0031] S23, using the internal hit grid code set C I Get the hit elements and get the internal candidate element set Π I ;
[0032] S24, using the boundary to hit the grid code set C B Get the hit features and get the boundary candidate feature set Π B ;
[0033] S25. Use corner points to hit grid code set C C Get the hit features and get the corner point candidate feature set Π C , through the refined intersection test to exclude the elements that do not intersect with the rectangular search box, a new set of corner point candidate elements Π′ is obtained C .
[0034] Further, in step S23, the internal hit grid code set C is used I Get the hit elements and get the internal candidate element set Π I , specifically,
[0035] According to the continuity of the code, the internal hit grid code set C I Partitioning is performed. For each partition, first obtain the first and last addresses of the hit bucket from the bucket address array according to the first and last grid codes of the continuous interval, that is, the element index number of the bucket address array, and then load the hit bucket information from the bucket set file according to the first and last addresses of the hit bucket. Then, read the hit element information according to the read hit bucket information and add it to the internal candidate element set Π I .
[0036] Further, in step S24, the boundary hit grid code set C is used B Get the hit features and get the boundary candidate feature set Π B , specifically,
[0037] According to the continuity of the code, the boundary hit grid code set C B Partitioning is performed. For each partition, first, the first and last grid codes of the continuous interval, i.e., the element index number of the R-tree address array, are used to obtain the first and last addresses of the hit R-tree from the R-tree address array. Then, all the index data of the hit R-tree are read from the R-tree set file at one time according to the first and last addresses. These index data are decomposed into independent hit R-tree index data in the memory. Then, each hit R-tree is searched using the current rectangular search box, and the results are added to the boundary candidate element set Π. B .
[0038] Further, in step S25, the corner point is used to hit the grid code set C C Get the hit features and get the corner point candidate feature set Π C , through the refined intersection test to exclude the elements that do not intersect with the rectangular search box, a new set of corner point candidate elements Π′ is obtained C , specifically,
[0039] S251, for the corner point hit grid code set C C For each grid code in, first obtain the R-tree head address corresponding to the current grid code from the R-tree address array;
[0040] S252: read the index data of the corresponding hit R tree from the R tree set file according to the first address, use the current rectangular search box to search the hit R tree, and add the result to the corner point candidate element set Π C ;
[0041] S253, repeat steps S251 and S252 until the corner point hits the grid code set C C After each grid is coded, the corner point candidate element set Π is obtained. C ;
[0042] S254, according to the four corner points of the rectangular search box, the corner point candidate element set Π obtained in S253 is C Divided into Π C1 , Π C2 , Π C3 and Π C4 ;
[0043] S255. For the i-th corner point, use the corner point to retrieve the R-tree corresponding to the hit grid corresponding to the corner point, and obtain the result set Then test one by one For each element in the set Π, if the element does not intersect with the current rectangular search box, remove it from the set Π Ci Eliminate;
[0044] S256: Repeat step S255 until all four corner points are processed, and merge the set Π C1 , Π C2 , Π C3 and Π C4 is the new corner point candidate feature set Π′ C .
[0045] The beneficial effects of the present invention are:
[0046] First, this QRB tree indexing method for massive vector data retrieval can speed up the positioning and reading steps of the R-tree index, reduce unnecessary R-tree retrieval operations and fine intersection test operations, thereby improving the retrieval performance of features and significantly improving the efficiency of spatial retrieval. Its advantages are particularly obvious when the retrieval box is relatively large.
[0047] 2. The method of the present invention avoids unnecessary R-tree search operations by adding a bucket index to each quadtree grid; accelerates the positioning and reading operations of hitting the R-tree and hitting the bucket through a specific random access data structure; and significantly improves the efficiency of precise retrieval by limiting the scope of the fine intersection test to the corner point hit elements among the candidate elements.
[0048] 3. Compared with the current mainstream spatial indexing technologies such as GeoHash indexing or indexing in PostGIS, the QRB tree indexing method for massive vector data retrieval has a greater performance advantage in accurate retrieval, as verified by experiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 It is a structural diagram of a QRB tree indexing method for massive vector data retrieval according to an embodiment of the present invention.
[0050] Figure 2 Schematic diagram for explaining the additional bucket index of the quadtree grid in the embodiment.
[0051] Figure 3 It is a schematic diagram for explaining the selection of a suitable quadtree grid for a vector element in the embodiment.
[0052] Figure 4 It is a schematic diagram for explaining the random access structure in the embodiment.
[0053] Figure 5 It is a schematic diagram for explaining all quadtree grids covered by a rectangular search box in a detailed search in an embodiment.
[0054] Figure 6 It is a schematic diagram comparing the time consumption of detailed retrieval of the embodiment method with that of the existing QR tree and GeoHash index on the same data. DETAILED DESCRIPTION
[0055] The preferred embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0056] Example
[0057] A QRB tree indexing method for massive vector data retrieval, such as Figure 1 , including the following steps,
[0058] S1. Build QRB tree index: Use quadtree to divide the space where vector data is located into quadtree grids of different levels, and set an R tree and a bucket for each quadtree grid, such as Figure 2 ; Given a vector element, select the quadtree grid that does not exceed the quadtree grid boundary and is closest to the current vector element range as the member grid, such as Figure 3 ; Insert the vector elements into the R-tree and bucket associated with the affiliated grid respectively; When all vector elements are inserted, establish a random access structure to store all non-empty R-trees and non-empty buckets, such as Figure 4 , forming a QRB tree index;
[0059] In step S1, a quadtree grid that does not exceed the quadtree grid boundary and is closest to the current vector element range is selected as a subordinate grid, specifically,
[0060] S11. Given a vector element, calculate the level l of the quadtree grid corresponding to the MBR of the current vector element; specifically:
[0061]
[0062] Among them, Ω x and Ω y are the dimensions of the current element MBR along the x-axis and along the y-axis respectively; if the quadtree grid is a global grid, then L 0 = a, otherwise, Among them, ω x and ω y are the dimensions of the MBR along the x-axis and along the y-axis of the entire data set containing all vector elements, respectively. a is a fixed constant, usually ranging from 7 to 9.
[0063] S12. According to the range and position of the current element MBR, the quadtree grid of the current element MBR at level 1 is calculated as the subordinate grid.
[0064] In step S1, the vector element is inserted into the bucket associated with the belonging grid, specifically,
[0065] S13, inserting the current element into the R-tree associated with the subordinate grid according to the insertion algorithm of the R-tree index;
[0066] S14, append the ID or pointer of the current element to the array corresponding to the bucket associated with the subordinate grid. In step S1, a random access structure is established to store all non-empty R-trees and non-empty buckets, specifically,
[0067] S15, initialize the R-tree address array and the bucket address array, set the initial value to the empty address, the size of the R-tree address array and the bucket address array are And N k is the total number of quadtree grids at level k, L 0 is the maximum allowed level;
[0068] S16, splicing all non-empty R-trees in sequence according to the order of the quadtree grid codes, saving the results to the R-tree set file, registering the first address of each non-empty R-tree in the R-tree set file in the c-th element of the R-tree address array, where c is the code of the quadtree grid associated with the current non-empty R-tree;
[0069] S17, splicing all non-empty buckets in sequence according to the order of the quadtree grid codes, saving the results to the bucket set file, registering the first address of each non-empty bucket in the bucket set file in the cth element of the bucket address array, where c is the code of the quadtree grid associated with the current non-empty bucket;
[0070] In step S16 and step S17, the encoding of the quadtree grid is specifically calculated as follows:
[0071]
[0072] Among them, N k is the total number of quadtree grids at the kth level, M is the number of columns of the current grid unit in the quadtree grid at the lth level, and i and j are the column and row numbers of the current grid unit in the quadtree grid at the lth level.
[0073] S18. Write the R-tree address array and the bucket address array into corresponding files respectively. The R-tree address array file, the bucket address array file, the R-tree set file and the bucket set file together form a random access structure, namely, a QRB tree index.
[0074] S2. Use QRB tree for accurate retrieval: Given a rectangular retrieval box, decompose the rectangular retrieval box into several hit grids, and divide the hit grids into internal hit grids, boundary hit grids and corner hit grids; Figure 5 , according to the category of the hit grid, retrieve from its associated bucket or R-tree, and then obtain the internal candidate feature set Π I , boundary candidate feature set Π C And the set of corner point candidate elements Π C ; Eliminate the corner point candidate feature set Π through fine intersection test C After finding the elements that do not intersect with the rectangular search box, a new set of corner point candidate elements Π′ is obtained. C ; The internal candidate element set Π I , boundary candidate feature set Π C and the new corner candidate set Π′ C Merge to form the final search result set.
[0075] In step S2, the rectangular search box is decomposed into a number of hit grids. Specifically, the current rectangular search box is divided using a quadtree grid division method to generate all levels less than L 0 And the quadtree grid that intersects with the current rectangular search box is the hit grid.
[0076] In step S2, the hit grids are classified into internal hit grids, boundary hit grids and corner hit grids, and the internal candidate element set, boundary candidate element set and corner candidate element set are obtained according to the category of the hit grid; the corner candidate element set Π is excluded by fine intersection testC After finding the elements that do not intersect with the rectangular search box, a new set of corner point candidate elements is obtained. Specifically,
[0077] S21, load the R-tree address array file and the bucket address array file from the QRB tree index into the memory and keep them resident;
[0078] S22, according to the positional relationship between the hit grid and the rectangular search box, the hit grid is divided into an internal hit grid, a boundary hit grid and a corner hit grid; the code of each hit grid is calculated by formula (2), and the internal hit grid code set C is obtained respectively. I , boundary hit grid code set C B and corner point hit grid coding set C C ;
[0079] S23, using the internal hit grid code set C I Get the hit elements and get the internal candidate element set Π I Specifically,
[0080] According to the continuity of the code, the internal hit grid code set C I Partitioning is performed. For each partition, first obtain the first and last addresses of the hit bucket from the bucket address array according to the first and last grid codes of the continuous interval, that is, the element index number of the bucket address array, and then load the hit bucket information from the bucket set file according to the first and last addresses of the hit bucket. Then, read the hit element information according to the read hit bucket information and add it to the internal candidate element set Π I .
[0081] S24, using the boundary to hit the grid code set C B Get the hit features and get the boundary candidate feature set Π B Specifically,
[0082] According to the continuity of the code, the boundary hit grid code set C B Partitioning is performed. For each partition, first, the first and last grid codes of the continuous interval, i.e., the element index number of the R-tree address array, are used to obtain the first and last addresses of the hit R-tree from the R-tree address array. Then, all the index data of the hit R-tree are read from the R-tree set file at one time according to the first and last addresses. These index data are decomposed into independent hit R-tree index data in the memory. Then, each hit R-tree is searched using the current rectangular search box, and the results are added to the boundary candidate element set Π. B .
[0083] S25. Use corner points to hit grid code set C C Get the hit features and get the corner point candidate feature set Π C , through the refined intersection test to exclude the elements that do not intersect with the rectangular search box, obtain the new corner point candidate set Π′ CSpecifically,
[0084] S251, for the corner point hit grid code set C C For each grid code in, first obtain the R-tree head address corresponding to the current grid code from the R-tree address array;
[0085] S252: read the index data of the corresponding hit R tree from the R tree set file according to the first address, use the current rectangular search box to search the hit R tree, and add the result to the corner point candidate element set Π C ;
[0086] S253, repeat steps S251 and S252 until the corner point hits the grid code set C C After each grid is coded, the corner point candidate element set Π is obtained. C ;
[0087] S254, according to the four corner points of the rectangular search box, the corner point candidate element set Π obtained in S253 is C Divided into Π C1 , Π C2 , Π C3 and Π C4 ;
[0088] S255. For the i-th corner point, use the corner point to retrieve the R-tree corresponding to the hit grid corresponding to the corner point, and obtain the result set Then test one by one For each element in the set Π, if the element does not intersect with the current rectangular search box, remove it from the set Π Ci Eliminate;
[0089] S256: Repeat step S255 until all four corner points are processed, and merge the set Π C1 , Π C2 , Π C3 and Π C4 is the new corner point candidate feature set Π′ C .
[0090] This QRB tree indexing method for massive vector data retrieval includes two steps: index construction and precise retrieval. When constructing the index, select the quadtree grid that does not exceed the quadtree grid boundary and is closest to the current vector element size as the subordinate grid; insert the current vector element into the R tree and bucket associated with the subordinate grid respectively; establish a random access structure to store all non-empty R trees and non-empty buckets to form a QRB tree index; when precisely retrieving, decompose the given rectangular search box into several hit grids; different hit grids use different strategies to retrieve the QRB tree index to obtain several candidate sets; eliminate the elements in the corner point candidate set that do not intersect with the rectangular search box through a precise intersection test; merge all candidate sets to obtain the final result set. This method can speed up the positioning and reading steps of the R tree in the QR tree index, reduce unnecessary R tree retrieval and precise intersection test operations, and thus significantly improve the efficiency of spatial retrieval.
[0091] This QRB tree indexing method for massive vector data retrieval avoids unnecessary R-tree search operations by adding a bucket index to each quadtree grid. In the embodiment method, the vector elements inserted into the R-tree index are limited to not exceed the boundary of the quadtree grid corresponding to the R-tree, so that all elements in the internal hit grid are necessarily hit by the current search box, and there is no need to further obtain them through the more time-consuming R-tree search, which effectively improves the search performance and avoids the problem of unsatisfactory search performance in the existing QR tree index, in which the corresponding hit R tree needs to be searched to obtain the final search results for the hit grid, whether it is an internal hit grid or a non-internal hit grid.
[0092] This QRB tree indexing method for massive vector data retrieval significantly improves the efficiency of accurate retrieval by limiting the scope of fine intersection testing to the corner hit elements among the candidate elements. The embodiment method performs the three classifications of the above-mentioned corner hit grids, boundary hit grids and internal hit grids, and only needs to perform fine intersection tests on the corner hit grid code sets one by one. The other two internal hit grid code sets and boundary hit grid code sets do not need further fine intersection tests, which can improve efficiency and avoid the problem of low efficiency caused by fine intersection tests on all candidate elements one by one in the existing indexing method.
[0093] In this QRB tree indexing method for massive vector data retrieval, Figure 5 , according to the position with respect to the search box, the hit grid is divided into corner hit grid, boundary hit grid and internal hit grid, and then the candidate features are divided into corner candidate feature set, boundary candidate feature set and internal candidate feature set according to different hit grids.
[0094] like Figure 5Obviously, when the search box is a rectangular box, the internal candidate elements must intersect with the rectangular search box. The boundary candidate elements are retrieved from the corresponding R-tree through the range search, and they must also intersect with the rectangular search box. If there are elements in the boundary hit grid that do not intersect with the rectangular search box, then this element will not be retrieved by the rectangular search box in the R-tree, so it will not appear in the boundary candidate elements. Figure 5 The lower two features in the second row of the boundary grid.
[0095] like Figure 5 , use the corner point search of the rectangular search box to replace the search box to search from the R-tree index associated with the corner point hit grid corresponding to the corner point, obtain the corner point candidate elements, and divide the results into corner point hit elements such as Figure 5 Elements 1, 3, 6, 7 and non-corner hit elements are as follows Figure 5 Elements 2, 4, 5, and 8 in the search box; obviously, when the search box is a rectangular box, the non-corner point hit elements in the corner point candidate elements must intersect with the search box, such as Figure 5 Element 2, element 4, element 5, element 8; test the intersection of the corner point hit elements and the rectangular search box one by one, and find the corner point hit elements that do not intersect with the rectangular search box, such as Figure 5 Element 7; remove the corner point hit elements that do not intersect with the search box from the corner point candidate elements, such as Figure 5 In element 7, the final corner point candidate elements are obtained, such as Figure 5 Elements 1, 2, 3, 4, 5, 6, and 8, together with the boundary candidate elements and the internal candidate elements, are included in the result set of the precise search.
[0096] This QRB tree indexing method for massive vector data retrieval accelerates the location and reading operations of hitting R-tree and hitting bucket through random access data structure; Figure 4 , the random access data structure is composed of an R-tree address array, a bucket address array, an R-tree set file and a bucket set file. During actual retrieval, it is necessary to locate and read the hit R-tree or hit bucket for subsequent retrieval. The prior art saves the R-tree to the disk with the encoding of its associated grid as the file name, and uses the file system to locate the R-tree file and read the corresponding information when acquiring. When the R-tree files are very small and the number is very large, the positioning and reading performance of the hit R-tree is low. The present invention can randomly locate and read the R-tree associated with a specific grid quickly through the R-tree address array and the R-tree set file; and can randomly locate and read the bucket associated with a specific grid through the bucket address array and the bucket set file.
[0097] This QRB tree indexing method for massive vector data retrieval can reduce unnecessary R-tree retrieval operations and fine intersection test operations by constructing a QRB tree index (Q: Quad treeR: R-tree B: Bucket, a hybrid spatial index based on quadtree, R-tree and bucket), speed up the positioning and reading steps of the R-tree index, and thus significantly improve the efficiency of spatial retrieval. Its advantages are particularly obvious when the retrieval box is relatively large.
[0098] It has been verified by experiments that Figure 6 As shown, the QRB tree indexing method for massive vector data retrieval in the embodiment has a retrieval time for fine retrieval that is significantly shorter than the retrieval time of the existing QR tree and GeoHash indexes. It can be seen that the efficiency of the fine retrieval of the embodiment method is better than that of the QR tree and GeoHash indexes.
[0099] The above are only specific application examples of the present invention and do not constitute any limitation on the protection scope of the present invention. Any technical solution formed by equivalent transformation or equivalent replacement (such as replacing the R tree of the QRB tree with an R tree variant) falls within the protection scope of the present invention.
Claims
1. A QRB tree indexing method for massive vector data retrieval, Features: The following steps are included: S1. Construct QRB tree index: Use quadtree to divide the space where vector data is located into quadtree grids of different levels, set an R tree and a bucket for each quadtree grid; given a vector element, select the quadtree grid that does not exceed the quadtree grid boundary and is closest to the current vector element range as the belonging grid; Insert the vector elements into the R-tree and bucket associated with the subordinate grid respectively; when all vector elements are inserted, establish a random access structure to store all non-empty R-trees and non-empty buckets to form a QRB tree index; In step S1, a random access structure is established to store all non-empty R-trees and non-empty buckets, specifically, S15, initialize the R-tree address array and the bucket address array, set the initial value to the empty address, the size of the R-tree address array and the bucket address array are And N k is the total number of quadtree grids at level k, L 0 is the maximum allowed level; S16, splicing all non-empty R-trees in sequence according to the order of the quadtree grid codes, saving the results to the R-tree set file, registering the first address of each non-empty R-tree in the R-tree set file in the c-th element of the R-tree address array, where c is the code of the quadtree grid associated with the current non-empty R-tree; S17, splicing all non-empty buckets in sequence according to the order of the quadtree grid codes, saving the results to the bucket set file, registering the first address of each non-empty bucket in the bucket set file in the cth element of the bucket address array, where c is the code of the quadtree grid associated with the current non-empty bucket; S18, writing the R-tree address array and the bucket address array into corresponding files respectively, and the R-tree address array file, the bucket address array file, the R-tree set file and the bucket set file together form a random access structure, namely, a QRB tree index; S2. Use QRB tree for precise retrieval: Given a rectangular retrieval box, decompose the rectangular retrieval box into several hit grids, and divide the hit grids into internal hit grids, boundary hit grids, and corner hit grids; retrieve from the associated buckets or R trees according to the type of hit grids, and then obtain the internal candidate feature set, boundary candidate feature set, and corner candidate feature set; obtain a new corner candidate feature set by eliminating the features in the corner candidate feature set that do not intersect with the rectangular retrieval box through a refined intersection test; merge the internal candidate feature set, boundary candidate feature set, and new corner candidate feature set to form the final retrieval result set; In step S2, the hit grids are divided into internal hit grids, boundary hit grids and corner hit grids; according to the type of the hit grid, the associated buckets or R-trees are searched respectively to obtain the internal candidate element set, the boundary candidate element set and the corner candidate element set; the new corner candidate element set is obtained by excluding the elements in the corner candidate element set that do not intersect with the rectangular search box through a refined intersection test, specifically, S21, load the R-tree address array file and the bucket address array file from the QRB tree index into the memory and keep them resident; S22, according to the positional relationship between the hit grid and the rectangular search box, dividing the hit grid into an internal hit grid, a boundary hit grid and a corner hit grid; The code of each hit grid is calculated by formula (2), and the internal hit grid code set C is obtained respectively. I , boundary hit grid code set C B and corner point hit grid coding set C C ; S23, using the internal hit grid code set C I Get the hit elements and get the internal candidate element set Π I ; S24, using the boundary to hit the grid code set C B Get the hit features and get the boundary candidate feature set Π B ; S25. Use corner points to hit grid code set C C Get the hit features and get the corner point candidate feature set Π C , through the refined intersection test to exclude the elements that do not intersect with the rectangular search box, a new set of corner point candidate elements Π′ is obtained C .
2. The QRB tree indexing method for massive vector data retrieval as claimed in claim 1, Features: In step S1, a quadtree grid that does not exceed the quadtree grid boundary and is closest to the current vector element range is selected as a subordinate grid, specifically, S11, given a vector element, calculate the level l of the quadtree grid corresponding to the MBR of the current vector element; S12. According to the range and position of the current element MBR, the quadtree grid of the current element MBR at level 1 is calculated as the subordinate grid.
3. The QRB tree indexing method for massive vector data retrieval as claimed in claim 2, Features: In step S11, the level l of the quadtree grid corresponding to the current element MBR is calculated, specifically: Among them, Ω x and Ω y are the dimensions of the current element MBR along the x-axis and along the y-axis respectively; if the quadtree grid is a global grid, then L 0 = a, otherwise, Among them, ω x and ω y are the dimensions of the MBR along the x-axis and along the y-axis of the entire data set containing all vector elements, respectively, and a is a fixed constant.
4. The QRB tree indexing method for massive vector data retrieval as claimed in claim 1, Features: In step S1, the vector element is inserted into the bucket associated with the belonging grid, specifically, S13, inserting the current element into the R-tree associated with the subordinate grid according to the insertion algorithm of the R-tree index; S14. Append the ID or pointer of the current element to the array corresponding to the bucket associated with the belonging grid.
5. The QRB tree indexing method for massive vector data retrieval as claimed in claim 1, Features: In step S16 and step S17, the encoding of the quadtree grid is specifically calculated as follows: Among them, N k is the total number of quadtree grids at the kth level, M is the number of columns of the current grid unit at the lth level quadtree grid, i and j are the column and row numbers of the current grid unit at the lth level quadtree grid; In step S2, the rectangular search box is decomposed into a number of hit grids. Specifically, the current rectangular search box is divided using a quadtree grid division method to generate all levels less than L 0 And the quadtree grid that intersects with the current rectangular search box is the hit grid.
6. The QRB tree indexing method for massive vector data retrieval as claimed in claim 1, Features: In step S23, the internal hit grid code set C is used I Get the hit elements and get the internal candidate element set Π I , specifically, According to the continuity of the code, the internal hit grid code set C I Partitioning is performed. For each partition, first obtain the first and last addresses of the hit bucket from the bucket address array according to the first and last grid codes of the continuous interval, that is, the element index number of the bucket address array, and then load the hit bucket information from the bucket set file according to the first and last addresses of the hit bucket. Then, read the hit element information according to the read hit bucket information and add it to the internal candidate element set Π I .
7. The QRB tree indexing method for massive vector data retrieval as claimed in claim 1, Features: In step S24, the boundary hit grid code set C is used B Get the hit features and get the boundary candidate feature set Π B , specifically, According to the continuity of the code, the boundary hit grid code set C B Partitioning is performed. For each partition, first, according to the first and last grid codes of the continuous interval, i.e., the element index number of the R-tree address array, the first and last addresses of the R-tree that hit the R-tree are obtained from the R-tree address array, and then all the index data of the R-tree that hit the R-tree are read from the R-tree set file at one time according to the first and last addresses; Decompose these index data into independent hit R-tree index data in memory; then use the current rectangular search box to search each hit R-tree, and add the results to the boundary candidate feature set Π B .
8. The QRB tree indexing method for massive vector data retrieval as claimed in claim 1, Features: In step S25, the corner points are used to hit the grid code set C C Get the hit features and get the corner point candidate feature set Π C , through the refined intersection test to exclude the elements that do not intersect with the rectangular search box, obtain a new set of corner point candidate elements Π' C , specifically, S251, for the corner point hit grid code set C C For each grid code in, first obtain the R-tree head address corresponding to the current grid code from the R-tree address array; S252: read the index data of the corresponding hit R tree from the R tree set file according to the first address, use the current rectangular search box to search the hit R tree, and add the result to the corner point candidate element set Π C ; S253, repeat steps S251 and S252 until the corner point hits the grid code set C C After each grid is coded, the corner point candidate element set Π is obtained. C ; S254, according to the four corner points of the rectangular search box, the corner point candidate element set Π obtained in S253 is C Divided into Π C1 , Π C2 , Π C3 and Π C4 ; S255. For the i-th corner point, use the corner point to retrieve the R-tree corresponding to the hit grid corresponding to the corner point, and obtain the result set Then test one by one For each element in the set Π, if the element does not intersect with the current rectangular search box, remove it from the set Π Ci Eliminate; S256: Repeat step S255 until all four corner points are processed, and merge the set Π C1 , Π C2 , Π C3 and Π C4 is the new corner candidate set Π′ C .
