CN114048203A - Beidou grid space indexing and retrieval method and device based on database B-tree index - Google Patents

Beidou grid space indexing and retrieval method and device based on database B-tree index Download PDF

Info

Publication number
CN114048203A
CN114048203A CN202111143727.1A CN202111143727A CN114048203A CN 114048203 A CN114048203 A CN 114048203A CN 202111143727 A CN202111143727 A CN 202111143727A CN 114048203 A CN114048203 A CN 114048203A
Authority
CN
China
Prior art keywords
grid
beidou
subdivision
level
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111143727.1A
Other languages
Chinese (zh)
Inventor
杨光辉
张建学
赵子豪
王焰辉
张敬亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongke Star Map Co ltd
Original Assignee
Zhongke Star Map Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongke Star Map Co ltd filed Critical Zhongke Star Map Co ltd
Priority to CN202111143727.1A priority Critical patent/CN114048203A/en
Publication of CN114048203A publication Critical patent/CN114048203A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2425Iterative querying; Query formulation based on the results of a preceding query
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Remote Sensing (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The utility model provides a big dipper grid space index and retrieval method based on database B-tree index, including: receiving target space range data to be queried and query precision, wherein the target space range data are WTK data in a GIS standard form; determining a first grid level corresponding to a target space range according to the query precision; determining Beidou split grid codes with grid levels being first grid levels and intersecting with a target space range, and generating a grid set; determining brother grids of each Beidou subdivision grid code in the grid set; and summarizing data associated with the Beidou subdivision grids intersected with the target query range and descendant grids of the second grid level of the brother grids corresponding to the Beidou subdivision grids, and generating a query result. In this way, the efficiency of spatial retrieval can be improved while saving computing resources.

Description

Beidou grid space indexing and retrieval method and device based on database B-tree index
Technical Field
The embodiment of the disclosure relates to the technical field of geographic information processing, in particular to a Beidou grid space indexing and retrieval method and device based on a database B-tree index.
Background
With the rapid development of information technology, the cost for acquiring satellite remote sensing and satellite navigation data is reduced, and the requirements for storage, management and retrieval of mass spatial data are higher and higher.
The Spatial database has been developed for 20 years, and many excellent relational Spatial database products, such as Oracle Spatial and PostGIS, are emerged at home and abroad. These databases commonly employ a Geometry data model composed of coordinates or coordinate sequences, and spatial indexing commonly employs an R-Tree index. The traditional space geometric data model and space index have a plurality of problems in the aspects of data precision and massive data retrieval performance.
In the existing database, grid coding and hierarchical field storage are carried out, and data encapsulation and consistency cannot be guaranteed; the non-point elements and the grids are in one-to-many relationship, so that data management is inconvenient; storing data in a database, calculating the data outside the database, and inputting and outputting the data into the database for multiple times to generate a large number of redundant IO; and the parallel computing capability of the database cannot be fully utilized by computing outside the database. Meanwhile, when the existing data is used for spatial retrieval, networks of different levels need to be constructed according to the requirement of retrieval accuracy, a large amount of data redundancy is generated, and when the requirement of retrieval accuracy changes, grid codes need to be regenerated according to the levels of retrieval grids, so that the waste of computing resources is caused, and the retrieval efficiency is influenced.
Disclosure of Invention
According to the embodiment of the disclosure, the Beidou grid space indexing and retrieval scheme based on the database B-tree index is provided, which can improve the space retrieval efficiency while saving the computing resources.
In a first aspect of the disclosure, a Beidou grid space indexing and retrieval method based on a database B-tree index is provided, which includes:
receiving target space range data to be queried and query precision, wherein the target space range data are WTK data in a GIS standard form;
determining a first grid level corresponding to a target space range according to the query precision;
determining a Beidou subdivision grid with a grid level being a first grid level and intersecting with a target space range, and generating a grid set;
determining brother grids of each Beidou subdivision grid in the grid set;
and summarizing data associated with the Beidou subdivision grids intersected with the target query range and descendant grids of the second grid level of the brother grids corresponding to the Beidou subdivision grids, and generating a query result.
In some embodiments, the determining, according to the query precision, a first grid level corresponding to a target spatial range includes:
and determining a corresponding first grid level from a pre-stored precision table according to the query precision, wherein the query precision is distance precision, and distance values corresponding to different grid levels are stored in the precision table.
In some embodiments, the determining the Beidou split mesh with the mesh level as the first mesh level and intersecting the target space range, and generating the mesh set includes:
determining a minimum external rectangle of the boundary of the target space range, verifying whether the Beidou subdivision grid with the level of the minimum external rectangle being the first grid level is intersected with the boundary of the target space range or is positioned in the target space range, summarizing the Beidou subdivision grids intersected with the boundary of the target space range or positioned in the target space range, and generating a grid set.
In some embodiments, the target spatial range data includes line type data, face type data, and volume type data.
In some embodiments, the coordinate information in the relational database is stored in a grid cell form, the grid cell form is stored by using a tb _ location table as a model, and the tb _ location table includes longitude and latitude, elevation fields and grid fields of a coordinate system, wherein the grid fields include a level field level, a longitude and latitude subdivision coding field code and an elevation subdivision coding field zcode.
In some embodiments, the method further includes a data warehousing process, specifically including:
receiving attribute information and position coordinate information of a user side, storing the position coordinate information in a grid cell gridcell mode, and adding a pointer in the grid cell gridcell to point to the attribute information.
In some embodiments, the determining a sibling lattice of each beidou split lattice code in the lattice set includes:
and regarding each Beidou subdivision grid code in the grid set, taking the grid which is the same as the Beidou subdivision grid code at the front 2(n-1) bits as a brother grid, wherein n is the level of the Beidou subdivision grid code in the grid set.
In a second aspect of the present disclosure, a Beidou grid spatial indexing and retrieving device based on database B-tree index is provided, which includes:
the data receiving module is used for receiving target space range data to be inquired and inquiry precision, wherein the target space range data is WTK data in a GIS standard form;
the grid level determining module is used for determining a first grid level corresponding to the target space range according to the query precision;
the grid set generation module is used for determining the Beidou subdivision grid with the grid level being the first grid level and intersecting with the target space range, and generating a grid set;
the brother grid determining module is used for determining brother grids of each Beidou subdivision grid in the grid set;
and the query result generation module is used for summarizing data related to descendant grids of the second grid level of the Beidou subdivision grid intersected with the target query range and the brother grids corresponding to the Beidou subdivision grid, so as to generate a query result.
In a third aspect of the present disclosure, an electronic device is provided, comprising a memory having stored thereon a computer program and a processor implementing the method as described above when executing the program.
In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the method as set forth above.
By the query method based on the spatial range of the relational database, spatial retrieval can be performed according to the requirement of retrieval precision, and the spatial retrieval efficiency is improved while computing resources are saved.
It should be understood that the statements herein reciting aspects are not intended to limit the critical or essential 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 apparent from the following description.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. In the drawings, like or similar reference characters designate like or similar elements, and wherein:
FIG. 1 shows a flowchart of a Beidou grid space indexing and retrieval method based on database B-tree indexing in a first embodiment of the present disclosure;
fig. 2 shows a flowchart of a method for generating a spatial database based on a Beidou grid relational database according to a second embodiment of the disclosure;
FIG. 3 shows a schematic structural diagram of a Beidou grid spatial indexing and retrieval device based on database B-tree indexing in a third embodiment of the present disclosure;
fig. 4 shows a schematic structural diagram of a Beidou grid space indexing and retrieval device based on a database B-tree index according to a fourth embodiment of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are some, but not all embodiments of the present disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
In addition, the term "and/or" herein is only one kind of association relationship describing an associated object, and means that there may be three kinds of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
According to the Beidou grid space indexing and retrieval method based on the database B-tree index, space retrieval can be performed according to the requirement of retrieval precision, and the space retrieval efficiency is improved while computing resources are saved. Specifically, as shown in fig. 1, the method is a flowchart of a Beidou grid space indexing and retrieval method based on a database B-tree index according to a first embodiment of the present disclosure. As can be seen from fig. 1, the Beidou grid space indexing and retrieval method based on database B-tree indexing of the present embodiment may include the following steps:
s101: and receiving target space range data to be queried and query precision, wherein the target space range data is WTK data in a GIS standard form.
With the development of the Beidou subdivision grid code technology, when space retrieval is carried out, a grid code is generated through longitude and latitude coordinates in a traditional space database, the grid code is associated with position data, and association between grids in different levels and each position coordinate data needs to be established according to the difference of position data precision and space query scale, so that a large amount of data redundancy can be generated. In query, the spatial range of the query is converted into a grid set, and then the location data associated with each grid in the set is queried from the library. That is, when querying, the same spatial coordinates for different levels need to be queried separately.
In the method in the embodiment, separate queries for the same spatial coordinates of different levels are not required. Specifically, the storage structure of the spatial database in the embodiment of the present disclosure is different from that of the existing database. The existing storage structure of the spatial database is generally a Geometry (longitude and latitude coordinate implementation model), in which one coordinate represents one ground point and a plurality of coordinate sequences represent a line, a plane or a volume. Because the common spatial database does not have a Beidou meshing code special data model, generating, converting, calculating and analyzing functions aiming at the meshing code model are not provided, and spatial indexes based on the meshing code model are not provided.
The spatial database of this embodiment may be based on a relational database, and coordinate information in the relational database is converted into a beidou subdivision code, and the converted beidou subdivision code is composed of two parts: trellis coding and trellis hierarchy. Grid coding is used to characterize geographic locations and grid hierarchies are used to express grid granularity. The common relational spatial database does not have a special storage model for Beidou subdivision codes, and grid codes and grids need to be stored separately in the actual application process; for the case of lines and polygons, one Geometry corresponds to multiple lattice codes, and the relationship between multiple lattice codes and one Geometry needs to be maintained in the database.
In this embodiment, when constructing the spatial database according to the embodiment of the present disclosure, reference may be made to a flowchart of a method for generating a spatial database based on a relational database in fig. 2, where the method specifically includes the following steps:
s201: acquiring two-dimensional coordinate information or three-dimensional coordinate information in a relational database, wherein the two-dimensional coordinate information or the three-dimensional coordinate information is stored in the relational database in a tb _ location table form.
The method comprises the steps of firstly obtaining two-dimensional coordinate information or three-dimensional coordinate information in a relational database, wherein the two-dimensional coordinate information or the three-dimensional coordinate information is stored in the relational database in a tb _ location table form.
S202: and determining the corresponding Beidou subdivision grid code hierarchy according to the actual application scene of the two-dimensional coordinate information or the three-dimensional coordinate information, and generating a corresponding hierarchy field level.
After the two-dimensional coordinate information or the three-dimensional coordinate information in the relational database is obtained, the corresponding Beidou subdivision grid code hierarchy needs to be further determined, and a corresponding hierarchy field level is generated.
S203: and converting the two-dimensional coordinate information or the three-dimensional coordinate information into Beidou subdivision grid codes of corresponding levels, and generating corresponding longitude and latitude subdivision code fields and elevation subdivision code fields zcode.
S204: and packaging the level field level, the longitude and latitude subdivision coding field code and the elevation subdivision coding field zcode into a same field grid, storing the field grid in a tb _ location table corresponding to two-dimensional coordinate information or three-dimensional coordinate information in the relational database, and generating grid cells.
The grid cells gridcell are of a composite type and are used for representing a 2D or 3D unit grid in the Beidou subdivision, and the 2D or 3D unit grid is coordinate information in the relational data. The Beidou subdivision grid is divided into a 2D grid and a 3D grid, wherein the 2D grid is subjected to binary subdivision through latitude and longitude respectively, and then combined into one-dimensional binary codes through Morton codes. The grid level is from 1-32 levels, each level is expressed by 2 binary bits, and 32-level two-dimensional codes can be stored by using 64-bit unsigned Long shape (unsigned Long). The 3D grid is added with elevation subdivision codes on the basis of the 2D grid, the range of elevation subdivision is also 1-32 levels, and 1 binary bit represents the first-level subdivision. A 32-bit unsigned Int may be used to store a 32-level program code. The hierarchy ranges from 1 to 32, and an unscheduled char can be used to store the hierarchy; since gridcell is compatible with 2D/3D, a type mark dim needs to be specified to distinguish two-dimensional grids from three-dimensional grids.
In summary, the structure of gridcell data types is as follows:
Figure BDA0003284946830000081
the variables in the structure are as follows:
Figure BDA0003284946830000082
in either 32-bit or 64-bit operating systems, after memory alignment, the memory space occupied by a gridcell object is 16 bytes.
And two three-dimensional gridcell generating functions are respectively realized, and the prototype is as follows:
gridcell ST_AsGridcell(double lng,double lat,integer level)
gridcell ST_AsGridcell3D(double lng,double lat,double height,integer level)
taking ST _ AsGridcell3D as an example, the calculation steps are described as follows:
tb _ location is a table in the relational database, and long, lat, height are coordinates longitude, latitude, elevation, respectively.
2. Adding a field named grid with the type of gridcell to the tb _ location table
3. Determining the level of the grid according to the business requirement
4. The grid field in tb _ location is updated by the update statement.
Update tb_location set grid=st_AsGridcell(lng,lat,height,level)。
5. And in st _ AsGridcell, for the lng, lat, height and level transmitted into each group, generating a corresponding longitude and latitude subdivision code and an elevation subdivision code zcode through a Beidou mesh subdivision algorithm, and packaging the longitude and latitude subdivision code and the elevation subdivision code together with the level into a gridcell object to return.
Serializing each gridcell object by an Update statement and writing the serialized gridcell object into a grid field
7. The execution loops until all rows in the table are executed.
By the method, the coordinate information in the relational database can be converted into the form of the Beidou subdivision grid code and stored. And the coordinate information in the Beidou grid code form and the original coordinate information in the relational database are packaged together, so that the data packaging property and consistency are ensured, the data management is convenient, and meanwhile, the conversion technology of the coordinate information coding form is completed in the database, so that the parallel computing capability of the database can be fully utilized.
The target spatial range data in this embodiment is WTK data in a GIS standard format, and the WTK data is a GIS standard language, and will not be described in detail here.
S102: and determining a first grid level corresponding to the target space range according to the query precision.
When the spatial database of the embodiment of the disclosure is required to be used for spatial retrieval, a first grid level corresponding to a target spatial range is determined according to the query precision of target spatial range data.
In this embodiment, after the coordinate information in the relational database is converted into the form of the beidou subdivision grid code and stored, the association between the grids of different levels and the coordinate data of each position can be established according to the actual application scene. For example, for the same set of Beidou terminal position data, data needs to be retrieved according to the scales of 30 kilometers, 1 kilometer and 100 meters in an application scene, three fields with field names grid11, grid16 and grid19 of bigint types need to be created, integer grid codes corresponding to 11 levels, 16 levels and 19 levels corresponding to each coordinate data are calculated and stored in the fields, wherein grid11, grid16 and grid19 are fields representing grid levels. Of course, in some other embodiments of the present disclosure, other levels of grid codes corresponding to the coordinate data may also be calculated.
S103: and determining the Beidou subdivision grids with the grid level being the first grid level and intersecting with the target space range, and generating a grid set.
In this embodiment, after the grid level corresponding to the target space range is determined, the beidou subdivision grid code, of which the grid level is also the first grid level and is intersected with the target space range, may be further determined. For example, if the grid level corresponding to the target space range is grid11, the Beidou subdivision grid is determined in the grid level of grid11, and a grid set is generated.
In this embodiment, a target space range is usually expressed by coordinates of continuous points on a boundary of the target space range, when a beidou subdivision grid code whose grid level is also a first grid level and intersects with the target space range is determined, a minimum circumscribed rectangle of the boundary of the target space range may be determined, whether a beidou subdivision grid whose level is the first grid level in the minimum circumscribed rectangle intersects with the boundary of the target space range or is located in the target space range is verified, and beidou subdivision grids intersecting with the boundary of the target space range or located in the target space range are collected to generate a grid set.
S104: and determining brother grids of each Beidou subdivision grid in the grid set.
In this embodiment, after the Beidou split meshes whose mesh levels are the first mesh level and intersect with the target space range are determined and the mesh set is generated, the sibling mesh of each Beidou split mesh in the generated mesh set is determined. The relationship between grids is described in a specific example, wherein A, B represents two 8-level grids, B grid is the next sibling grid of a grid (the first 16 bits of B grid code are 1 greater than the first 16 bits of a grid), Aa, Ab, Ac, Ad are all 9-level grids, and all are descendant grids of a, and the six grids are numbered as follows:
CodeA:
10111000110101010000000000000000000000000000000000000000000
CodeB:
101110001101011000000000000000000000000000000000000000000000
CodeAa:
10111000110101010000000000000000000000000000000000000000000
CodeAb:
101110001101010101000000000000000000000000000000000000000000
CodeAc:
101110001101010110000000000000000000000000000000000000000000
CodeAd:
101110001101010111000000000000000000000000000000000000000000
as can be seen from the trellis coding, the trellis coding ranges of Aa, Ab, Ac, Ad are within the [ codeA, codeB) interval, that is, the larger a unit trellis level is, the smaller the spatial region range represented by it is. The spatial extent of all descendant meshes of a cell mesh is encompassed by the mesh extent. The value range of the grid integer code of a generation grid cellA is as follows: [ codeA, codeB), where codeA is the integer code of A and codeB is the integer code of A's subsequent sibling lattice B. Gridding A is an ancestor of gridding Aa, Ab, Ac and Ad, and gridding Aa, Ab, Ac and Ad are descendants of gridding A. Based on the theory, the ancestor grids are used for inquiring the descendant grids, and the descendant grids are converted into interval inquiry of [ codeA, codeB).
A B-tree index is predefined in a spatial database, and a Gridcell AbsCmp comparison function of gridcell is defined firstly, and the main logic is as follows: if the integer codes of the two gridcells are not equal, the integer codes are smaller than the smaller gridcells; if the integer codes of the two gridcells are equal and the two levels are not equal, the smaller gridcell is the level; two gridcells are equal if their integer codes are equal and the two levels are equal.
An operator class btree _ gridcell _ ops is created, a B-tree index is registered for a gridcell type, and a size comparison function gridcell absCmp (gridcell ) is specified.
Figure BDA0003284946830000121
Gridcell realizes B-tree indexing and cross-layer grid indexing, so that grids with multiple precisions do not need to be generated in data storage based on the scheme.
Data storage process:
tb _ location is a table in the relational database, and long, lat, height are coordinates longitude, latitude, elevation, respectively.
2. Adding a field named grid with the type of gridcell to the tb _ location table
3. And determining the grid level maxLevel corresponding to the highest query precision according to the query requirement.
4. Calling the update statement of the sql, generating gridcell functions through the longitude and latitude, and constructing gridcell objects.
Update tb_location set grid=st_AsGridcell(lng,lat,height,level)。
Serializing each gridcell object by an Update statement and writing the serialized gridcell object into a grid field
6. The execution loops until all rows in the table are executed.
Then, in the query process, the sibling grid of each beidou subdivision grid code in the grid set can be determined based on the defined B-tree index.
S105: and summarizing the data associated with the Beidou subdivision grid code intersected with the target query range and the descendant grids of the second grid level of the brother grids corresponding to the Beidou subdivision grid code, and generating a query result.
In this embodiment, the descendant grids of the second grid level of the grid of the first grid level are associated with data, for example, taxis, corresponding services, platforms and the like associated with the descendant grid of a certain second grid level, and since the taxis can report information through the beidou system, other information of the taxis can be associated with the grid of the second grid level corresponding to the position information of the taxis. In an application scenario, when how many taxis exist in a target area range, the taxis can be inquired in the manner, because the inquired taxis exist, the inquiry precision can be determined according to the actual running condition of the taxis, for example, the minimum grid level corresponding to the area of the taxis, then the minimum grid level upper grid corresponding to the area of the taxis, namely the grid of the first grid level, and the taxi data associated with the descendant grid of the grid of which the grid level is the first grid level is determined by determining the brother grid of the first grid level, so that how many taxis exist in the target area range is determined, and the minimum grid level corresponding to the area of the taxis is the second grid level.
According to the Beidou grid space indexing and retrieval method based on the database B-tree index, space retrieval can be performed according to the requirement of retrieval precision, and the space retrieval efficiency is improved while computing resources are saved.
Furthermore, in some embodiments, the determining a first grid level corresponding to a target spatial range according to the query precision includes: and determining a corresponding first grid level from a pre-stored precision table according to the query precision, wherein the query precision is distance precision, and distance values corresponding to different grid levels are stored in the precision table.
In some embodiments, the target spatial range data includes line type data, face type data, and volume type data.
In some embodiments, the method further comprises:
and for the area type data and the volume type data, determining the value ranges of the Beidou subdivision grid codes of the longitude, the latitude and the elevation after the WTK data of each point on each boundary line are converted into the Beidou subdivision grid codes, and taking the Beidou subdivision grid codes in the value ranges as the Beidou subdivision grid codes covered by the target space range.
As another embodiment of the present disclosure, in the above embodiment, when determining the sibling mesh of each beidou subdivision mesh code in the mesh set, the determination may be performed according to the following method:
and regarding each Beidou subdivision grid in the grid set, taking the grid which is the same as the Beidou subdivision grid code of the first 2(n-1) bits as a brother grid of the Beidou subdivision grid, wherein n is the level of the Beidou subdivision grid code in the grid set.
It is noted that while for simplicity of explanation, the foregoing method embodiments have been described as a series of acts or combination of acts, it will be appreciated by those skilled in the art that the present disclosure is not limited by the order of acts, as some steps may, in accordance with the present disclosure, occur in other orders and concurrently. Further, those skilled in the art should also appreciate that the embodiments described in this specification are all alternative embodiments and that the acts and modules involved are not necessarily essential to the disclosure.
The above is a description of embodiments of the method, and the embodiments of the apparatus are further described below.
Fig. 3 is a schematic structural diagram of a Beidou grid spatial indexing and retrieval device based on a database B-tree index according to a third embodiment of the present disclosure. The big dipper grid space index and retrieval device based on database B-tree index of this embodiment includes:
the data receiving module 301 is configured to receive target spatial range data to be queried and query accuracy, where the target spatial range data is WTK data in a GIS standard form.
And a grid level determining module 302, configured to determine, according to the query accuracy, a first grid level corresponding to the target spatial range.
And the grid set generating module 303 is configured to determine a Beidou subdivision grid of which the grid level is the first grid level and which intersects with the target space range, and generate a grid set.
A sibling mesh determining module 304, configured to determine a sibling mesh of each beidou subdivision mesh in the mesh set.
And the query result generating module 305 is configured to collect data associated with descendant grids of the second grid level of the beidou subdivision grid intersecting the target query range and the sibling grid corresponding to the beidou subdivision grid, and generate a query result.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the described module may refer to the corresponding process in the foregoing method embodiment, and is not described herein again.
FIG. 4 shows a schematic block diagram of an electronic device 400 that may be used to implement an embodiment method of the present disclosure. As shown, the arrangement 400 includes a Central Processing Unit (CPU)401 that can perform various appropriate actions and processes in accordance with computer program instructions stored in a Read Only Memory (ROM)402 or loaded from a storage unit 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the device 400 can also be stored. The 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 bus 404.
A number of components in device 400 are connected to I/O interface 405, including: an input unit 406 such as a keyboard, a mouse, or the like; an output unit 407 such as various types of displays, speakers, and the like; a storage unit 408 such as a magnetic disk, optical disk, or the like; and a communication unit 409 such as a network card, modem, wireless communication transceiver, etc. The communication unit 409 allows the device 400 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
Processing unit 401 performs the various methods and processes described above, and is tangibly embodied in a machine-readable medium, such as storage unit 408. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 400 via the ROM 402 and/or the communication unit 409. When the computer program is loaded into RAM 403 and executed by CPU 401, one or more steps of the method described above may be performed. Alternatively, in other embodiments, the CPU 401 may be configured to perform the above-described method in any other suitable manner (e.g., by way of firmware).
The functions described herein above 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: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a load programmable logic device (CPLD), and the like.
Program code for implementing the methods 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, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The 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, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
Further, while operations are depicted in a particular order, this should be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single implementation. Conversely, various features that are described in the context of a single implementation can also be implemented in multiple implementations separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (10)

1. A Beidou grid space indexing and retrieval method based on a database B-tree index is characterized by comprising the following steps:
receiving target space range data to be queried and query precision, wherein the target space range data are WTK data in a GIS standard form;
determining a first grid level corresponding to a target space range according to the query precision;
determining a Beidou subdivision grid with a grid level being a first grid level and intersecting with a target space range, and generating a grid set;
determining brother grids of each Beidou subdivision grid in the grid set;
and summarizing data associated with the Beidou subdivision grids intersected with the target query range and descendant grids of the second grid level of the brother grids corresponding to the Beidou subdivision grids, and generating a query result.
2. The Beidou grid spatial indexing and retrieval method based on database B-tree indexing of claim 1, wherein the determining the first grid level corresponding to the target spatial range according to the query precision comprises:
and determining a corresponding first grid level from a pre-stored precision table according to the query precision, wherein the query precision is distance precision, and distance values corresponding to different grid levels are stored in the precision table.
3. The database B-tree index-based Beidou grid space indexing and retrieval method according to claim 2, wherein the step of determining the Beidou split grid with the grid level being the first grid level and intersecting with the target space range to generate the grid set comprises the steps of:
determining a minimum external rectangle of the boundary of the target space range, verifying whether the Beidou subdivision grid with the level of the minimum external rectangle being the first grid level is intersected with the boundary of the target space range or is positioned in the target space range, summarizing the Beidou subdivision grids intersected with the boundary of the target space range or positioned in the target space range, and generating a grid set.
4. The database B-tree index-based Beidou grid spatial indexing and retrieval method according to claim 3, wherein the target spatial range data comprises line type data, face type data and volume type data.
5. The Beidou grid space indexing and retrieval method based on database B-tree indexes, as set forth in claim 4, is characterized in that coordinate information in the relational database is stored in a grid cell form, the grid cell is stored by taking a tb _ location table as a model, the tb _ location table comprises longitude and latitude and elevation fields of a coordinate system and a grid field, wherein the grid field comprises a level field level, a longitude and latitude subdivision coding field code and an elevation subdivision coding field zcode.
6. The Beidou grid space indexing and retrieval method based on database B-tree indexes as claimed in claim 5, further comprising a data warehousing process, specifically comprising:
receiving attribute information and position coordinate information of a user side, storing the position coordinate information in a grid cell gridcell mode, and adding a pointer in the grid cell gridcell to point to the attribute information.
7. The database B-tree index-based Beidou grid spatial indexing and retrieval method of claim 6, wherein the determining of the sibling grid of each Beidou subdivision grid in the grid set comprises:
and regarding each Beidou subdivision grid in the grid set, taking the grid which is the same as the Beidou subdivision grid code of the first 2(n-1) bits as a brother grid of the Beidou subdivision grid, wherein n is the level of the Beidou subdivision grid code in the grid set.
8. The utility model provides a big dipper grid space index and retrieval device based on database B-tree index which characterized in that includes:
the data receiving module is used for receiving target space range data to be inquired and inquiry precision, wherein the target space range data is WTK data in a GIS standard form;
the grid level determining module is used for determining a first grid level corresponding to the target space range according to the query precision;
the grid set generation module is used for determining the Beidou subdivision grid with the grid level being the first grid level and intersecting with the target space range, and generating a grid set;
the brother grid determining module is used for determining brother grids of each Beidou subdivision grid in the grid set;
and the query result generation module is used for summarizing data related to descendant grids of the second grid level of the Beidou subdivision grid intersected with the target query range and the brother grids corresponding to the Beidou subdivision grid, so as to generate a query result.
9. An electronic device comprising a memory and a processor, the memory having stored thereon a computer program, wherein the processor, when executing the program, implements the method of any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
CN202111143727.1A 2021-09-28 2021-09-28 Beidou grid space indexing and retrieval method and device based on database B-tree index Pending CN114048203A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111143727.1A CN114048203A (en) 2021-09-28 2021-09-28 Beidou grid space indexing and retrieval method and device based on database B-tree index

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111143727.1A CN114048203A (en) 2021-09-28 2021-09-28 Beidou grid space indexing and retrieval method and device based on database B-tree index

Publications (1)

Publication Number Publication Date
CN114048203A true CN114048203A (en) 2022-02-15

Family

ID=80204726

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111143727.1A Pending CN114048203A (en) 2021-09-28 2021-09-28 Beidou grid space indexing and retrieval method and device based on database B-tree index

Country Status (1)

Country Link
CN (1) CN114048203A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115374237A (en) * 2022-10-26 2022-11-22 北京数字政通科技股份有限公司 Vector space data storage and query method based on Beidou grid code
CN115688148A (en) * 2022-12-30 2023-02-03 北京四维图新科技股份有限公司 Coordinate conversion method, device, equipment, medium and system of map data
CN117033526A (en) * 2023-10-09 2023-11-10 中国地质大学(武汉) Data storage method, data query method, device, equipment and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115374237A (en) * 2022-10-26 2022-11-22 北京数字政通科技股份有限公司 Vector space data storage and query method based on Beidou grid code
CN115374237B (en) * 2022-10-26 2023-01-03 北京数字政通科技股份有限公司 Vector space data storage and query method based on Beidou grid code
CN115688148A (en) * 2022-12-30 2023-02-03 北京四维图新科技股份有限公司 Coordinate conversion method, device, equipment, medium and system of map data
CN117033526A (en) * 2023-10-09 2023-11-10 中国地质大学(武汉) Data storage method, data query method, device, equipment and storage medium
CN117033526B (en) * 2023-10-09 2023-12-29 中国地质大学(武汉) Data storage method, data query method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN114048203A (en) Beidou grid space indexing and retrieval method and device based on database B-tree index
CN110199273B (en) System and method for loading, aggregating and bulk computing in one scan in a multidimensional database environment
CN112115198B (en) Urban remote sensing intelligent service platform
CN102306180B (en) Modeling method based on mass laser radar grid point cloud data
CN114048204A (en) Beidou grid space indexing method and device based on database inverted index
CN114048271A (en) Storage method and device of Beidou grid data model in database
CN102411616B (en) Method and system for storing data and data management method
CN103514243A (en) Spatio-temporal data management system, spatio-temporal data management method, and program thereof
CN108009265B (en) Spatial data indexing method in cloud computing environment
CN112181980B (en) Large-scale analysis-oriented space-time big data cube organization method and system
Li et al. Method for managing and querying geo-spatial data using a grid-code-array spatial index
CN114238488B (en) Multi-professional digital fruit integration and data interaction method and system
CN113010620A (en) Natural resource data index statistical method and system based on geographical multilevel grids
Zhang et al. Improving NoSQL storage schema based on Z-curve for spatial vector data
CN116775661A (en) Big space data storage and management method based on Beidou grid technology
CN116049521A (en) Space-time data retrieval method based on space grid coding
CN113742505B (en) Mass synthetic aperture radar interferometry (InSAR) data online visualization method
CN202533938U (en) Touch query machine/mobile equipment-based land grading and evaluation processing system
CN115145930A (en) GIS vector data hierarchical coding method and device based on tree hierarchical index
CN112597262B (en) Industry address serial number generation method and device based on space grid
CN117290455A (en) Integrated management system and method for multisource geospatial data
Wang et al. A storage method for remote sensing images based on google s2
CN109241216B (en) Method for realizing gridding management by using power grid level storage database architecture
CN113485638B (en) Access optimization system for massive astronomical data
CN113312823B (en) Finite element post-processing data processing method, system, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination