Beidou grid spatial indexing method and device based on database inverted index

By using the Beidou grid spatial index method based on database inversion index in relational databases, the problem of increasing calculation overhead when the data volume increases is solved, and efficient spatial data query is achieved.

CN114048204BActive Publication Date: 2025-02-14GEOVIS CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111143748.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-28
Publication Date
2025-02-14
Estimated Expiration
2041-09-28

AI Technical Summary

Technical Problem

When traditional R-Tree index processes spatial data, as the data volume increases, the index gradually increases, the calculation overhead increases, and the retrieval performance decreases.

Method used

The Beidou grid spatial index method based on the database inverted index is adopted. By obtaining the target query range, the corresponding Beidou grid collection is determined, and the corresponding spatial object of each Beidou grid is determined in the relational database based on the GIN inverted index. Generate a collection of spatial objects.

Benefits of technology

Reduces the amount of index data, reduces the calculation overhead, and improves query performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114048204B_ABST
    Figure CN114048204B_ABST
Patent Text Reader

Abstract

The disclosed embodiment provides a Beidou grid spatial indexing method and device based on a database inverted index, the method comprising: obtaining a target query range, determining a Beidou grid set corresponding to the target query range; for each Beidou grid in the Beidou grid set, based on a GIN inverted index, determining a spatial object corresponding to the Beidou grid in a relational database, traversing all Beidou grids in the Beidou grid set, determining the corresponding spatial object, and generating a spatial object set. In this way, the amount of index data can be reduced in the process of querying spatial objects, and the computational overhead can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure generally relate to the field of geographic information processing technology, and more specifically, to a Beidou grid spatial indexing method and device based on a database inverted index. Background Art

[0002] Traditional spatial databases often use R-Tree to build indexes for spatial data types (geometry) to meet the need to improve retrieval performance.

[0003] The core idea of ​​R-Tree index is to aggregate nodes with similar distances and represent them as the minimum bounding rectangle of these nodes in the upper layer of the tree structure. This minimum bounding rectangle becomes a node in the upper layer. Because all nodes are in their minimum bounding rectangle, a query that does not intersect with a certain rectangle must not intersect with all nodes in this rectangle. Each rectangle on the leaf node represents an object, and the nodes are aggregates of objects, and the higher the level, the more objects are aggregated.

[0004] In an R-Tree index, all table records are stored in leaf nodes. When the space occupied by a leaf node reaches a page in the database, it will be split to generate an intermediate node. When the space occupied by an intermediate node reaches a page in the database, it will continue to be split. As the amount of data grows, more intermediate nodes will be generated, causing the index to gradually increase.

[0005] At the same time, the minimum enclosing rectangle can only roughly estimate the relationship between spatial data, and there is a certain precision error. Therefore, in order to meet the requirements of correctness, it is necessary to further perform a recheck operation to accurately locate the relationship between the calculated data, which will increase the computing overhead and reduce the retrieval performance. Summary of the invention

[0006] According to an embodiment of the present disclosure, a Beidou grid spatial indexing solution based on a database inverted index is provided, which has a small index data volume and low computational overhead.

[0007] In a first aspect of the present disclosure, a Beidou grid spatial indexing method based on a database inverted index is provided, comprising:

[0008] Obtain a target query range, and determine a Beidou grid set corresponding to the target query range;

[0009] For each Beidou grid in the Beidou grid set, based on the GIN inverted index, the spatial object corresponding to the Beidou grid is determined in the relational database, all Beidou grids in the Beidou grid set are traversed, the corresponding spatial objects are determined, and a spatial object set is generated.

[0010] In some embodiments, the Beidou grid set corresponding to the target query range includes grids of the same and / or different grid levels.

[0011] In some embodiments, the coordinate information in the relational database is stored in the form of grid cells, and the grid cells are stored based on the tb_location table as a model. The tb_location table includes the longitude and latitude and elevation fields of the coordinate system and the grid field, wherein the grid field includes the grid level field level, the longitude and latitude division code field code, and the elevation division code field zcode.

[0012] In some embodiments, the method further comprises:

[0013] The spatial objects in the relational database are stored in the form of a grid cell set geomgrids, which includes a latitude and longitude subdivision coding field code and a grid level field level of the grid cells in the corresponding two-dimensional spatial object, or a latitude and longitude subdivision coding field code, a grid level field level and an elevation subdivision coding field zcode of the grid cells in the three-dimensional spatial object.

[0014] In some embodiments, the method further comprises:

[0015] The index of spatial objects and grid cells is established in advance, and the GIN inverted index of spatial objects and grid cells is established based on the grid cell.

[0016] In some embodiments, the pre-spatial object and the establishment of the index of the grid cell, and the establishment of the GIN inverted index of the spatial object and the grid cell based on the grid cell gridcell, include:

[0017] The minimum grid level grid unit contained in each spatial object is determined in advance, an index of the spatial object and the minimum grid level grid unit is established, and a GIN inverted index of the spatial object and the grid unit is established based on the minimum grid level grid unit.

[0018] In some embodiments, the method further comprises:

[0019] Within the interval corresponding to the grid level corresponding to the minimum grid level grid cell, indexes between grid cells are established based on the hierarchical relationship.

[0020] In a second aspect of the present disclosure, a Beidou grid spatial indexing device based on a database inverted index is provided, comprising:

[0021] A query request receiving module, used to obtain a target query range and determine a Beidou grid set corresponding to the target query range;

[0022] The spatial object set generation module is used to determine the spatial object corresponding to each Beidou grid in the Beidou grid set in a relational database based on the GIN inverted index, traverse all Beidou grids in the Beidou grid set, determine the corresponding spatial object, and generate a spatial object set.

[0023] In a third aspect of the present disclosure, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the program, the method described above is implemented.

[0024] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method described above is implemented.

[0025] The Beidou grid spatial indexing method based on database inverted index disclosed in the present invention can reduce the amount of index data and reduce the computing overhead.

[0026] It should be understood that the contents described in the summary of the invention are not intended to limit the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:

[0028] Figure 1 A flowchart of a Beidou grid spatial indexing method based on a database inverted index according to a first embodiment of the present disclosure is shown;

[0029] Figure 2 A flow chart of a method for generating a spatial database based on a Beidou grid relational database according to a second embodiment of the present disclosure is shown;

[0030] Figure 3 A schematic diagram of the structure of a Beidou grid spatial indexing device based on a database inverted index according to a third embodiment of the present disclosure is shown;

[0031] Figure 4 A structural schematic diagram of a Beidou grid spatial indexing device based on a database inverted index according to a fourth embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0033] In addition, the term "and / or" in this article is only a description of the association relationship between the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0034] The Beidou grid spatial indexing method based on the database inverted index of the embodiment of the present disclosure can reduce the amount of index data and reduce the computing overhead in the process of querying spatial objects. Figure 1 FIG. 1 is a flowchart of a Beidou grid spatial indexing method based on a database inverted index according to a first embodiment of the present disclosure. Figure 1 It can be seen that the Beidou grid spatial indexing method based on the database inverted index of this embodiment may include the following steps:

[0035] S101: Acquire a target query range, and determine a Beidou grid set corresponding to the target query range.

[0036] The method of this embodiment can be applied to the query of spatial objects within a certain area, such as how many schools or communities are there in a certain urban area. The certain urban area is the target query range mentioned in this embodiment, and the school (or community) is the spatial object mentioned in this embodiment. The method of this embodiment is based on the pre-built Beidou grid relational database. When building the Beidou grid relational database, you can refer to Figure 2 The flowchart of the method for generating a spatial database based on the Beidou grid relational database specifically includes the following steps:

[0037] S201: Acquire two-dimensional coordinate information or three-dimensional coordinate information in a relational database, wherein the two-dimensional coordinate information or three-dimensional coordinate information is stored in the relational database in the form of a tb_location table.

[0038] First, two-dimensional coordinate information or three-dimensional coordinate information is obtained from a relational database, wherein the two-dimensional coordinate information or three-dimensional coordinate information is stored in the relational database in the form of a tb_location table.

[0039] S202: Determine the level of the corresponding Beidou grid subdivision code according to the actual application scenario of the two-dimensional coordinate information or the three-dimensional coordinate information, and generate a corresponding level field level.

[0040] After obtaining the two-dimensional coordinate information or three-dimensional coordinate information in the relational database, it is necessary to further determine the level of the corresponding Beidou grid code and generate the corresponding level field level.

[0041] S203: Convert the two-dimensional coordinate information or the three-dimensional coordinate information into a Beidou grid code of a corresponding level, and generate a corresponding longitude and latitude grid code field code and an elevation grid code field zcode.

[0042] S204: Encapsulate the level field level, the latitude and longitude subdivision code field code and the elevation subdivision code field zcode into the same field grid, and store the field grid in the tb_location table corresponding to the two-dimensional coordinate information or the three-dimensional coordinate information in the relational database to generate a grid cell gridcell.

[0043] The grid cell gridcell is a composite type, which is used to represent a 2D or 3D unit grid in Beidou subdivision. The 2D or 3D unit grid is the coordinate information in relational data. Beidou subdivision grids are divided into 2D grids and 3D grids. The 2D grid is divided into binary by latitude and longitude respectively, and then merged into a one-dimensional binary code through Morton coding. The grid level ranges from 1 to 32, each level is expressed by 2 binary bits, and 32 levels of two-dimensional codes can be stored in a 64-bit unsigned long integer (unsigned Long). On the basis of the 2D grid, the 3D grid adds elevation subdivision code. The range of elevation subdivision is also 1-32, and one binary bit is used to represent the first level of subdivision. A 32-bit unsigned integer (unsigned Int) can be used to store 32 levels of elevation code. The level range is 1-32, and unsigned char can be used to store the level; because gridcell is compatible with 2D / 3D, a type flag dim needs to be specified to distinguish between two-dimensional and three-dimensional grids.

[0044] To summarize, the structure of the gridcell data type is as follows:

[0045]

[0046] The variables in the structure are as follows:

[0047]

[0048]

[0049] No matter in 32-bit operating system or 64-bit operating system, after memory alignment, a gridcell object occupies 16 bytes of memory space.

[0050] The two-dimensional and three-dimensional gridcell generation functions are implemented respectively, and their prototypes are as follows:

[0051] gridcell ST_AsGridcell(double lng,double lat,integer level)

[0052] gridcell ST_AsGridcell3D(double lng,double lat,double height,integerlevel) Taking ST_AsGridcell3D as an example, the calculation steps are explained:

[0053] 1. tb_location is a table in a relational database, where lng, lat, and height are the coordinates of longitude, latitude, and elevation, respectively.

[0054] 2. Add a field named grid in the tb_location table, and the field type is gridcell

[0055] 3. Determine the level of the grid based on business needs

[0056] 4. Update the grid field in tb_location using the update statement.

[0057] Update tb_location set grid=st_AsGridcell(lng,lat,height,level).

[0058] 5. Inside st_AsGridcell, for each group of lng, lat, height, and level passed in, the Beidou gridding algorithm is used to generate the corresponding longitude and latitude code and elevation code, and then encapsulate them together with the level into a gridcell object and return them.

[0059] 6. The Update statement serializes each gridcell object and writes it to the grid field

[0060] 7. Loop until all rows in the table are executed.

[0061] Through the above method, the coordinate information in the relational database can be converted into the form of Beidou grid code for storage. The coordinate information in the form of Beidou grid code and the original coordinate information in the relational database are encapsulated together to ensure data encapsulation and consistency, and facilitate data management. At the same time, the conversion technology of the coordinate information encoding form is completed within the database, so that the parallel computing capability of the database can be fully utilized.

[0062] In addition, in the Beidou grid relational database, spatial objects are also defined. The spatial objects in the relational database are stored in the form of a grid cell set geomgrids. The grid cell set geomgrids includes the latitude and longitude subdivision coding field code and the grid level field level of the grid cell in the corresponding two-dimensional spatial object, or the latitude and longitude subdivision coding field code, the grid level field level and the elevation subdivision coding field zcode of the grid cell in the three-dimensional spatial object. There may be unit grids of different levels in a grid cell set geomgrids. The level of the highest level grid cell is the level of the geomgrids object, called detailLevel. That is to say, in the Beidou grid relational database, the spatial object is in one-to-one correspondence with the grid cell set geomgrids. In order to achieve a one-to-one correspondence between the spatial object and the grid cell set geomgrids, an index of the spatial object and the grid cell can be established, and a GIN inverted index of the spatial object and the grid cell can be established based on the grid cell gridcell. Specifically, the minimum grid level grid cell contained in each spatial object is determined in advance, an index of the spatial object and the minimum grid level grid cell is established, and a GIN inverted index of the spatial object and the grid cell is established based on the minimum grid level grid cell. In addition, within the interval corresponding to the grid level corresponding to the minimum grid level grid cell, an index between grid cells is established based on the hierarchical relationship.

[0063] In simple terms, one spatial data record corresponds to one geomgrids data, one geomgrids data corresponds to multiple gridcell data, and each gridcell data and grid data related to the gridcell are stored in the index structure as the key value of the GIN index.

[0064] After explaining the data structure in the Beidou grid relational database, the scheme of the disclosed embodiment is further explained below by taking a specific example as an example. First, establish an association relationship between a spatial object and a grid unit set geomgrids. The spatial object here is not limited to schools and communities, but can also be other objects, such as jurisdictions, lakes, overpasses, etc. Taking schools as an example, determine the Beidou grids contained in each school, and the included Beidou grids are the grids with the lowest level. For example, an 8-level grid includes 4 9-level grids, and the 8-level grid and the 4 9-level grids it includes are all within the area of ​​the school. Then, only the association relationship between the school and the 8-level grid is established, and the association relationship with the other 4 9-level grids is not established, that is, the code corresponding to the 8-level grid represents the area in the school, rather than the code corresponding to the 4 9-level grids. In the above manner, the Beidou grids contained in all schools are established. Similarly, the Beidou grids contained in all communities can be determined. Then, according to the same method, a Beidou grid is established that includes an area larger than the school area, such as a city, township, county, city, province, etc., or a Beidou grid that includes an area smaller than the school area can be established, such as a dormitory, canteen, teaching building, etc. The community can establish a Beidou grid included in parking spaces, green belts, etc. Then, an index of the spatial object and the minimum grid level grid unit is established, and a GIN inverted index of the spatial object and the grid unit is established based on the minimum grid level grid unit. Moreover, within the interval corresponding to the grid level corresponding to the minimum grid level grid unit, an index between grid cells is established based on the hierarchical relationship. GIN (Generalized Inverted Index) is an index structure that stores a set of (key, posting list), where key is a key value, and posting list is a group of TIDs (thread control identifiers) where the key has appeared. For each attribute in the table, when creating an index, each item may be parsed into multiple keys. The same TID may appear in multiple posting lists, and each key value is only stored once. Therefore, when the same key appears multiple times in an item, the GIN index is very concise.

[0065] S102: For each Beidou grid in the Beidou grid set, based on the GIN inverted index, determine the spatial object corresponding to the Beidou grid in the relational database, traverse all Beidou grids in the Beidou grid set, determine the corresponding spatial object, and generate a spatial object set.

[0066] In this embodiment, the target query range can be a spatial object or a set of several spatial objects, or it can be an area. After determining the Beidou grid set corresponding to the target query range, for each Beidou grid in the Beidou grid set (the Beidou grid is a Beidou grid at the minimum grid level), based on the GIN inverted index, the spatial object corresponding to the Beidou grid is determined in the relational database, that is, the spatial object with which the grid has an index relationship. For example, if the grid is in a spatial object, there is one spatial object with which the grid has an index relationship. If the grid is partially in one spatial object and partially in another spatial object, there are two spatial objects with which the grid has an index relationship. Similarly, there can be multiple spatial objects with which the grid has an index relationship. In the same way, all Beidou grids in the Beidou grid set are traversed to determine the corresponding spatial objects, generate a spatial object set, and thereby determine the pre-queried spatial objects within the target query range.

[0067] The above process of this embodiment is only to illustrate the principle of the query process. For querying different types of spatial objects, for example, how to determine whether the queried spatial object is a community or a school, a field can be added to the grid unit set geomgrids corresponding to the spatial object. This field represents the properties of the control object, such as school, community, etc. In this way, in the process of querying the spatial object, it is possible to query only from the school or only from the community.

[0068] Since the number of grid units in the world is also fixed, there will be no sharp increase in index data as the amount of data increases. Therefore, the amount of index data can be reduced. In addition, the accurate judgment of the Beidou segmentation code grid index relationship can accurately match the data relationship through the binary bit operation method of integer data during the index retrieval process. No further relationship judgment is required, which reduces the computing overhead and increases the query performance.

[0069] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present disclosure is not limited by the order of the actions described, because according to the present disclosure, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present disclosure.

[0070] The above is an introduction to the method embodiment. The following is a further explanation of the scheme disclosed in the present invention through an apparatus embodiment.

[0071] like Figure 3, which is a schematic diagram of the structure of a Beidou grid spatial indexing device based on a database inverted index according to Embodiment 3 of the present disclosure. The Beidou grid spatial indexing device based on a database inverted index according to this embodiment includes:

[0072] The query request receiving module 301 is used to obtain a target query range and determine a Beidou grid set corresponding to the target query range.

[0073] The spatial object set generation module 302 is used to determine the spatial object corresponding to each Beidou grid in the Beidou grid set in the relational database based on the GIN inverted index, traverse all Beidou grids in the Beidou grid set, determine the corresponding spatial object, and generate a spatial object set.

[0074] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the described module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0075] Figure 4 A schematic block diagram of an electronic device 400 that can be used to implement the embodiment method of the present disclosure is shown. As shown in the figure, the device 400 includes a central processing unit (CPU) 401, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 402 or computer program instructions loaded from a storage unit 408 into a random access memory (RAM) 403. In RAM 403, various programs and data required for the operation of the device 400 can also be stored. CPU 401, ROM 402 and RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0076] A number of components in the device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a disk, an optical disk, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the device 400 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0077] The processing unit 401 performs the various methods and processes described above, which are tangibly contained in a machine-readable medium, such as a storage unit 408. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 400 via the ROM 402 and / or the communication unit 409. When the computer program is loaded into the RAM 403 and executed by the CPU 401, one or more steps of the method described above can be performed. Alternatively, in other embodiments, the CPU 401 can be configured to perform the above method in any other suitable manner (e.g., by means of firmware).

[0078] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip systems (SOCs), load programmable logic devices (CPLDs), and the like.

[0079] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0080] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0081] In addition, although each operation is described in a specific order, this should be understood as requiring such operation to be performed in the specific order shown or in a sequential order, or requiring that all illustrated operations should be performed to obtain desired results. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single implementation in combination. On the contrary, the various features described in the context of a single implementation can also be implemented in multiple implementations individually or in any suitable sub-combination mode.

[0082] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A Beidou grid spatial indexing method based on database inverted index, characterized in that: include: Obtain a target query range, and determine a Beidou grid set corresponding to the target query range; For each Beidou grid in the Beidou grid set, predetermine the minimum grid level grid unit contained in each spatial object, establish an index of the spatial object and the minimum grid level grid unit; based on the minimum grid level grid unit, establish a GIN inverted index of the spatial object and the grid unit; In the interval range corresponding to the grid level corresponding to the minimum grid level grid cell, indexes between grid cells are established based on the hierarchical relationship; Based on the GIN inverted index, determine the spatial object corresponding to the Beidou grid in the relational database, traverse all Beidou grids in the Beidou grid set, determine the corresponding spatial object, and generate a spatial object set; Among them, the relational database pre-defines a gridcell field and a geomgrids field. The gridcell field is used to represent a 2D or 3D unit grid in Beidou segmentation; the geomgrids field is used to represent a grid cell set; and the spatial object is stored in the form of a grid cell set geomgrids.

2. The Beidou grid spatial indexing method based on database inverted index according to claim 1, characterized in that: The Beidou grid set corresponding to the target query range includes grids of the same and / or different grid levels.

3. The Beidou grid spatial indexing method based on database inverted index according to claim 1 is characterized in that: The coordinate information in the relational database is stored in the form of grid cells, and the grid cells are stored based on the tb_location table as a model. The tb_location table includes the longitude and latitude and elevation fields of the coordinate system and the grid field, wherein the grid field includes the grid level field level, the longitude and latitude subdivision code field code and the elevation subdivision code field zcode.

4. The Beidou grid spatial indexing method based on database inverted index according to claim 3 is characterized in that: The method further comprises: The grid cell set geomgrids includes the latitude and longitude subdivision coding field code and the grid level field level of the grid cells in the corresponding two-dimensional space object, or the latitude and longitude subdivision coding field code, the grid level field level and the elevation subdivision coding field zcode of the grid cells in the three-dimensional space object.

5. A Beidou grid spatial indexing device based on database inverted index, characterized in that: include: A query request receiving module, used to obtain a target query range and determine a Beidou grid set corresponding to the target query range; A spatial object set generation module is used to predetermine the minimum grid level grid unit contained in each spatial object for each Beidou grid in the Beidou grid set, establish an index of the spatial object and the minimum grid level grid unit; and establish a GIN inverted index of the spatial object and the grid unit based on the minimum grid level grid unit; In the interval range corresponding to the grid level corresponding to the minimum grid level grid cell, indexes between grid cells are established based on the hierarchical relationship; Based on the GIN inverted index, determine the spatial object corresponding to the Beidou grid in the relational database, traverse all Beidou grids in the Beidou grid set, determine the corresponding spatial object, and generate a spatial object set; Among them, the relational database pre-defines a gridcell field and a geomgrids field. The gridcell field is used to represent a 2D or 3D unit grid in Beidou segmentation; the geomgrids field is used to represent a grid cell set; and the spatial object is stored in the form of a grid cell set geomgrids.

6. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the program, the method according to any one of claims 1 to 4 is implemented.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Data storage, query and generation method, database engine and storage medium

    CN112347118A