Data query method and device

By meshing and encoding urban space, and using distributed large databases and spatial big data processing frameworks, the problem of slow data query speed in the existing technology is solved, and fast query and efficient management are achieved.

CN119202104APending Publication Date: 2024-12-27BEIDOU NAVIGATION LOCATION SERVICE (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310702980.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-14
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

When existing spatial databases deal with large-scale urban grid management, data query speed is slow and cannot effectively process large-scale data storage and retrieval, resulting in a decline in urban management level.

Method used

By performing grid division and encoding of urban space at different levels, using distributed large databases and spatial big data processing frameworks for data storage and retrieval, and establishing grid coding indexes to achieve rapid query.

Benefits of technology

It significantly improves the speed of data query, improves the efficiency and level of urban management, and can effectively process large-scale data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119202104A_ABST
    Figure CN119202104A_ABST
Patent Text Reader

Abstract

The invention relates to a data query method and device. The method comprises the following steps: obtaining each level grid of a target city and a code corresponding to each level grid according to a spatial range of the target city; storing the codes corresponding to the grids of each level of the target city and the corresponding relationship between the codes and the grids of each level into a distributed big database through a spatial big data analysis framework; acquiring codes of the city components according to the spatial position coordinates of the city components in the target city; codes of the city components and corresponding relations between the codes and the city components are also stored in the distributed big database through a space big data analysis framework; receiving query information, wherein the query information comprises a to-be-queried spatial range and a to-be-queried level; obtaining a code corresponding to the spatial range to be queried; determining a corresponding target level grid according to the to-be-queried level; and querying all corresponding component information from the target-level grids in the distributed big database according to the codes corresponding to the spatial range.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to a data query method and device. Background Art

[0002] With the improvement of digital construction and grid management level of cities, the comprehensive realization of digital empowerment of megacities and the establishment of digital governance system of megacities are inseparable from accurate spatiotemporal data services. At present, some systems have realized partial grid management of cities, digitally managing people or objects in the grid, and the relevant location attribute information of people or objects can be retrieved through the system, which improves the management level of cities.

[0003] However, the services provided by these systems are all based on small-scale grid management with small data volumes. They use spatial analysis functions provided by spatial databases such as Postsgresql+Postgis for data retrieval. As the management scope increases and the amount of data increases, these spatial databases cannot withstand large-scale data storage and retrieval, resulting in slower data query speeds. For example, if you need to query a facility contained in a certain spatial range, the traditional method requires intersecting all data in the facility data table with the spatial range and then filtering to get the result. For computers, floating-point operations are less efficient than integer operations, which results in slower data query speeds and greatly reduces the level of urban management. Summary of the invention

[0004] In order to overcome the problems existing in the related art, the embodiments of the present disclosure provide a data query method and device. The technical solution is as follows:

[0005] According to a first aspect of an embodiment of the present disclosure, a data query method is provided, including:

[0006] Obtaining grids of each level of the target city and codes corresponding to the grids of each level according to the spatial range of the target city, wherein the codes corresponding to the grids of each level of the target city include: starting codes in the longitude direction corresponding to the grids of each level of the target city, starting codes in the latitude direction corresponding to the grids of each level of the target city, and heights corresponding to the grids of each level of the target city;

[0007] The codes corresponding to the grids at each level of the target city and the corresponding relationships with the grids at each level of the target city are stored in a distributed big data database through a spatial big data analysis framework;

[0008] Acquiring a code of the city component according to the spatial position coordinates of the city component in the target city;

[0009] The codes of the city components and the corresponding relationships with the city components are also stored in the distributed big data database through the spatial big data analysis framework;

[0010] receiving query information, wherein the query information includes: a spatial range to be queried and a level to be queried;

[0011] Obtaining a code corresponding to the spatial range to be queried, the code corresponding to the spatial range comprising: a starting code in the longitude direction corresponding to the spatial range, a starting code in the latitude direction corresponding to the spatial range, an ending code in the longitude direction corresponding to the spatial range, an ending code in the latitude direction corresponding to the spatial range, and a height code corresponding to the spatial range;

[0012] Determine a corresponding target level grid according to the level to be queried;

[0013] According to the code corresponding to the spatial range, all corresponding component information is queried from the target level grid in the distributed big data database.

[0014] The present invention constructs a storage of urban space grid spatial big data and establishes an index of spatial big data by gridding and coding urban space at different levels; establishes a database of spatial location information and attribute information of urban components, and grid codes their location information and creates an index with the code; calculates the coding range of the spatial range, and realizes rapid query of grid data through the coding range with the help of the database index.

[0015] In one embodiment, the step of acquiring grids of each level of the target city and codes corresponding to the grids of each level according to the spatial range of the target city includes:

[0016] Obtaining the latitude and longitude range and altitude of the target city; the latitude and longitude range of the target city includes: the minimum longitude of the target city, the maximum longitude of the target city, the minimum latitude of the target city, and the maximum latitude of the target city;

[0017] Determine a grid division table of the target city according to a preset division method and the longitude and latitude range of the target city; the grid division table includes: division levels, and grid division information corresponding to each division level; the grid division information includes: longitude difference, latitude difference and altitude difference;

[0018] According to the minimum longitude of the target city and the longitude difference corresponding to each subdivision level, the starting longitude direction code corresponding to each level grid and the starting longitude coordinate of the subdivision grid corresponding to each level grid are obtained;

[0019] According to the minimum latitude of the target city and the latitude difference corresponding to each of the subdivision levels, the latitude direction starting code corresponding to each level of grid and the starting latitude coordinate of the subdivision grid corresponding to each level of grid are obtained;

[0020] Acquire the height direction code corresponding to each level grid according to the height of the target city and the height difference corresponding to each subdivision level;

[0021] The target city is divided into multiple level grids according to the starting longitude coordinates of the subdivided grids corresponding to the level grids, the starting latitude coordinates of the subdivided grids corresponding to the level grids, the longitude differences of the levels, and the latitude differences of the levels.

[0022] In one embodiment, the step of obtaining the starting longitude direction code corresponding to each level of grid and the starting longitude coordinate of the subdivided grid corresponding to each level of grid according to the minimum longitude of the target city and the longitude difference corresponding to each subdivision level includes:

[0023] The starting code of the longitude direction corresponding to each level of grid is obtained according to the following formula:

[0024] startX i =[minX÷dx i ]+1;

[0025] The starting longitude coordinates of the subdivided grids corresponding to the grids at each level are obtained according to the following formula:

[0026] startLng i =(startX i -1)×dx i ;

[0027] Among them, the startX i is the starting code of the longitude direction corresponding to the i-th level grid, minX is the minimum longitude of the target city, startLng i is the starting longitude coordinate of the grid corresponding to the i-th level grid; the dx i is the longitude difference of the subdivision level corresponding to the i-th level grid; the [] indicates rounding of the quotient.

[0028] In one embodiment, the step of obtaining the latitude direction start code corresponding to each level of grid and the start latitude coordinate of the subdivided grid corresponding to each level of grid according to the minimum latitude of the target city and the latitude difference corresponding to each subdivision level includes:

[0029] The latitude starting code corresponding to each level of grid is obtained according to the following formula:

[0030] startY i =[minY÷dy i ]+1;

[0031] The starting latitude coordinates of the subdivided grids corresponding to the grids of each level are obtained according to the following formula:

[0032] startLat i =(startY i -1)×dy i ;

[0033] Among them, startY i is the starting code in the latitude direction corresponding to the i-th level grid, minY is the minimum latitude of the target city, and startLat i is the grid starting latitude coordinate of the grid of the i-th level, and the dy i is the latitude difference of the subdivision level corresponding to the i-th level grid, and the [] indicates rounding of the quotient.

[0034] In one embodiment, the acquiring the code of the city component according to the spatial position coordinates of the city component in the target city includes:

[0035] The code of the city component is obtained according to the following formula:

[0036]

[0037]

[0038]

[0039] Among them, the lng is the longitude of the location of the city component, the lat is the latitude of the location of the city component, the h is the height of the location of the city component, numx is the code in the longitude direction, numy is the code in the latitude direction, numz is the code in the height direction, the [] indicates rounding of the quotient; the || indicates the absolute value; the dx is the longitude difference, the dy is the latitude difference, and the dz is the height difference.

[0040] In one embodiment, obtaining the code corresponding to the spatial range to be queried includes:

[0041] Acquire the minimum coordinate and the maximum coordinate corresponding to the spatial range to be queried, wherein the minimum coordinate corresponding to the spatial range to be queried includes: the minimum longitude and the minimum latitude corresponding to the spatial range to be queried; the maximum coordinate corresponding to the spatial range to be queried includes: the maximum longitude and the maximum latitude corresponding to the spatial range to be queried;

[0042] Obtain the code corresponding to the spatial range to be queried according to the following formula:

[0043]

[0044]

[0045]

[0046]

[0047]

[0048]

[0049] Among them, numax′ is the code of the minimum longitude direction corresponding to the spatial range to be queried, numy′ is the code of the minimum latitude direction corresponding to the spatial range to be queried, numz′ is the code of the minimum height direction corresponding to the spatial range to be queried, lng′ is the minimum longitude corresponding to the spatial range to be queried, lat′ is the minimum latitude corresponding to the spatial range to be queried, h′ is the minimum height corresponding to the spatial range to be queried, numax″ is the code of the maximum longitude direction corresponding to the spatial range to be queried, numy″ is the code of the maximum latitude direction corresponding to the spatial range to be queried, numz″ is the code of the maximum height direction corresponding to the spatial range to be queried, lng″ is the maximum longitude corresponding to the spatial range to be queried, lat″ is the maximum latitude corresponding to the spatial range to be queried, and h″ is the maximum height corresponding to the spatial range to be queried.

[0050] In one embodiment, the query information further includes: attributes of the object to be queried; the method further includes:

[0051] The target component information corresponding to the object attribute to be queried is acquired from the all component information.

[0052] According to a second aspect of an embodiment of the present disclosure, there is provided a data query device, including:

[0053] A first acquisition module is used to acquire each level of grids of the target city and codes corresponding to the grids of each level according to the spatial range of the target city, wherein the codes corresponding to the grids of the target city include: a starting code in the longitude direction corresponding to the grids of each level of the target city, a starting code in the latitude direction corresponding to the grids of each level of the target city, and a height corresponding to the grids of each level of the target city;

[0054] The first storage module is used to store the codes corresponding to the grids of each level of the target city and the corresponding relationships with the grids of each level in a distributed big data database through a spatial big data analysis framework;

[0055] A second acquisition module, used for acquiring the code of the city component according to the spatial position coordinates of the city component in the target city;

[0056] A second storage module is used to store the codes of the city components and the corresponding relationships with the city components in the distributed big data database through the spatial big data analysis framework;

[0057] A receiving module, used for receiving query information, wherein the query information includes: a spatial range to be queried and a level to be queried;

[0058] A third acquisition module is used to acquire the code corresponding to the spatial range to be queried, wherein the code corresponding to the spatial range includes: a starting code in the longitude direction corresponding to the spatial range, a starting code in the latitude direction corresponding to the spatial range, an ending code in the longitude direction corresponding to the spatial range, an ending code in the latitude direction corresponding to the spatial range, and a height code corresponding to the spatial range;

[0059] A determination module, used to determine a corresponding target level grid according to the level to be queried;

[0060] A query module is used to query all corresponding component information from the target level grid in the distributed big database according to the code corresponding to the spatial range.

[0061] According to a third aspect of an embodiment of the present disclosure, a data query device is provided, including:

[0062] processor;

[0063] a memory for storing processor-executable instructions;

[0064] Wherein, the processor is configured to:

[0065] Obtaining grids of each level of the target city and codes corresponding to the grids of each level according to the spatial range of the target city, wherein the codes corresponding to the grids of each level of the target city include: starting codes in the longitude direction corresponding to the grids of each level of the target city, starting codes in the latitude direction corresponding to the grids of each level of the target city, and heights corresponding to the grids of each level of the target city;

[0066] The codes corresponding to the grids at each level of the target city and the corresponding relationships with the grids at each level of the target city are stored in a distributed big data database through a spatial big data analysis framework;

[0067] Acquiring a code of the city component according to the spatial position coordinates of the city component in the target city;

[0068] The codes of the city components and the corresponding relationships with the city components are also stored in the distributed big data database through the spatial big data analysis framework;

[0069] receiving query information, wherein the query information includes: a spatial range to be queried and a level to be queried;

[0070] Obtaining a code corresponding to the spatial range to be queried, the code corresponding to the spatial range comprising: a starting code in the longitude direction corresponding to the spatial range, a starting code in the latitude direction corresponding to the spatial range, an ending code in the longitude direction corresponding to the spatial range, an ending code in the latitude direction corresponding to the spatial range, and a height code corresponding to the spatial range;

[0071] Determine a corresponding target level grid according to the level to be queried;

[0072] According to the code corresponding to the spatial range, all corresponding component information is queried from the target level grid in the distributed big data database.

[0073] According to a fourth aspect of an embodiment of the present disclosure, there is provided a computer-readable storage medium on which computer instructions are stored, and when the instructions are executed by a processor, the steps of any one of the methods described in the first aspect are implemented.

[0074] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0076] Figure 1 The figure is a flow chart of a data query method according to an exemplary embodiment.

[0077] Figure 2 It is a block diagram of a data query device according to an exemplary embodiment.

[0078] Figure 3 It is a block diagram of a device 90 for data query according to an exemplary embodiment. DETAILED DESCRIPTION

[0079] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0080] In order to solve the above problems, the present invention constructs urban grid data and encodes the grids, stores and retrieves data with the help of a distributed big database and a spatial big data processing framework, constructs a spatial data index through grid coding, and retrieves data with the help of coding, thereby greatly improving the retrieval speed.

[0081] In order to solve the above problems, the present invention constructs urban grid data and encodes the grids, stores and retrieves data with the help of a distributed big database and a spatial big data processing framework, constructs a spatial data index through grid coding, and retrieves data with the help of coding, thereby greatly improving the retrieval speed.

[0082] Figure 1 is a flow chart of a data query method according to an exemplary embodiment. Figure 1 As shown, the following steps S101-S108 are included:

[0083] In step S101, grids of each level of the target city and codes corresponding to the grids of each level are obtained according to the spatial range of the target city. The codes corresponding to the grids of each level of the target city include: starting codes in the longitude direction corresponding to the grids of each level of the target city, starting codes in the latitude direction corresponding to the grids of each level of the target city, and heights corresponding to the grids of each level of the target city;

[0084] In one embodiment, obtaining grids of each level of the target city and codes corresponding to grids of each level according to the spatial range of the target city includes the following sub-steps A1-A6:

[0085] A1. Obtain the latitude and longitude range and altitude of the target city. The latitude and longitude range of the target city includes: the minimum longitude of the target city, the maximum longitude of the target city, the minimum latitude of the target city, and the maximum latitude of the target city;

[0086] A2. Determine a grid partition table of the target city according to a preset partitioning method, the latitude and longitude range and the altitude of the target city; the grid partition table includes: partition levels, and grid partition information corresponding to each partition level; the grid partition information includes: longitude difference, latitude difference and altitude difference;

[0087] For example, the preset division method uses the intersection of the equatorial plane and the prime meridian plane as the origin, and divides the urban space range into the first level according to the 1:1 million map in GB / T 13989-2012, and recursively divides it into two levels from the three directions of longitude, latitude and altitude until the area of ​​the divided plane grid reaches about 1 square meter. For example, the grid specification table of the target city is shown in Table 1. Table 1 gives the corresponding relationship between different division levels and longitude difference, latitude difference and altitude difference, among which the longitude difference and latitude difference can be understood as the range size corresponding to each grid, and the altitude difference can be understood as the grid height:

[0088] Table 1

[0089]

[0090]

[0091] A3. Obtain the starting longitude direction code corresponding to each level of grid and the starting longitude coordinate of the subdivision grid corresponding to each level of grid according to the minimum longitude of the target city and the longitude difference corresponding to each subdivision level;

[0092] Specifically, the starting code of the longitude direction corresponding to each level of grid is obtained according to the following formula:

[0093] startX i =[minX÷dx i ]+1;

[0094] Obtain the starting longitude coordinates of the subdivided grid corresponding to each level of grid according to the following formula:

[0095] startLng i =(startX i -1)×dx i ;

[0096] Among them, startX i is the starting code of the longitude direction corresponding to the i-th level grid, minX is the minimum longitude of the target city, startLng i dx is the starting longitude coordinate of the grid corresponding to the i-th level grid; i is the longitude difference of the subdivision level corresponding to the i-th level grid; [] indicates rounding the quotient.

[0097] A4. According to the minimum latitude of the target city and the latitude difference corresponding to each subdivision level, obtain the latitude direction starting code corresponding to each level of grid and the starting latitude coordinate of the subdivision grid corresponding to each level of grid;

[0098] Specifically, the latitude starting code corresponding to each level of grid is obtained according to the following formula:

[0099] startY i =[minY÷dy i ]+1;

[0100] Obtain the starting latitude coordinates of the subdivided grid corresponding to each level of grid according to the following formula:

[0101] startLat i =(startY i -1)×dy i

[0102] Among them, startY i is the starting code in the latitude direction corresponding to the i-th level grid, minY is the minimum latitude of the target city, startLat i is the starting latitude coordinate of the grid, dy i is the latitude difference of the subdivision level corresponding to the i-th level grid, and [] indicates rounding the quotient.

[0103] A5. Obtain the height direction code corresponding to each level of grid according to the height of the target city and the height difference corresponding to each subdivision level.

[0104] In one embodiment, the ending longitude and latitude coordinates of each grid can also be obtained. However, the calculation of the ending longitude and latitude coordinates of the grid is relatively simple. The starting longitude and latitude coordinates of the grid are known by the above formula, and the ending longitude and latitude coordinates are obtained by adding the grid size of the current level. The ending longitude and latitude coordinates of each grid can also be written into the database as a retrieval index.

[0105] A6. Divide the target city into multiple levels of grids according to the starting longitude coordinates of the subdivided grids corresponding to each level of grids, the starting latitude coordinates of the subdivided grids corresponding to each level of grids, the longitude differences of each level, and the latitude differences of each level.

[0106] In step S102, the codes corresponding to the grids of each level of the target city and the corresponding relationships with the grids of each level are stored in a distributed big data database through a spatial big data analysis framework;

[0107] The segmented data obtained in the above steps can be stored in the distributed big data database Hbase through the spatial big data analysis framework GeoMesa to build the city digital base. The storage process can set the grid code as the grid id, so that the search can be directly based on the grid code.

[0108] In step S103, the codes of the city components are obtained according to the spatial position coordinates of the city components in the target city;

[0109] This step is used to construct a spatial vector database of urban management components. In one achievable method, the codes of urban components are obtained according to the spatial position coordinates of urban components in the target city, including:

[0110] Obtain the code of the city component according to the following formula:

[0111]

[0112]

[0113]

[0114] Among them, lng is the longitude of the location of the city component, lat is the latitude of the location of the city component, h is the height of the location of the city component, numx is the code in the longitude direction, numy is the code in the latitude direction, numz is the code in the height direction, [] means rounding the quotient; || means absolute value; dx is the longitude difference, dy is the latitude difference, and dz is the height difference.

[0115] In step S104, the codes of the city components and the corresponding relationships with the city components are also stored in the distributed big data database through the spatial big data analysis framework;

[0116] After obtaining the coding of the city components to be managed according to the grid, the coding is imported into the Hbase database through GeoMesa.

[0117] In step S105, query information is received, the query information including: a spatial range to be queried and a level to be queried;

[0118] For example, the level to be queried may be the segmentation level in Table 1.

[0119] In step S106, the code corresponding to the spatial range to be queried is obtained, and the code corresponding to the spatial range includes: a starting code in the longitude direction corresponding to the spatial range, a starting code in the latitude direction corresponding to the spatial range, an ending code in the longitude direction corresponding to the spatial range, an ending code in the latitude direction corresponding to the spatial range, and a height code corresponding to the spatial range;

[0120] In step S107, the corresponding target level grid is determined according to the level to be queried;

[0121] In one embodiment, obtaining the code corresponding to the spatial range to be queried includes:

[0122] Obtain the minimum coordinates, maximum coordinates and height corresponding to the spatial range to be queried, the minimum coordinates corresponding to the spatial range to be queried include: the minimum longitude and minimum latitude corresponding to the spatial range to be queried; the maximum coordinates corresponding to the spatial range to be queried include: the maximum longitude and maximum latitude corresponding to the spatial range to be queried;

[0123] Get the code corresponding to the spatial range to be queried according to the following formula:

[0124]

[0125]

[0126]

[0127]

[0128]

[0129]

[0130] Among them, numax′ is the code of the minimum longitude direction corresponding to the spatial range to be queried, numy′ is the code of the minimum latitude direction corresponding to the spatial range to be queried, numz′ is the code of the minimum height direction corresponding to the spatial range to be queried, lng′ is the minimum longitude corresponding to the spatial range to be queried, lat′ is the minimum latitude corresponding to the spatial range to be queried, h′ is the minimum height corresponding to the spatial range to be queried, numax″ is the code of the maximum longitude direction corresponding to the spatial range to be queried, numy″ is the code of the maximum latitude direction corresponding to the spatial range to be queried, numz″ is the code of the maximum height direction corresponding to the spatial range to be queried, lng″ is the maximum longitude corresponding to the spatial range to be queried, lat″ is the maximum latitude corresponding to the spatial range to be queried, and h″ is the maximum height corresponding to the spatial range to be queried.

[0131] In step S108, all corresponding component information is queried from the target level grid in the distributed big data database according to the code corresponding to the spatial range;

[0132] Since the distributed big database uses the code as the ID of each grid, that is, the code is used as the index of each grid, after obtaining the code corresponding to the spatial range, the corresponding component information can be queried from the distributed big database according to the code.

[0133] In an implementable manner, the query information further includes: attributes of the object to be queried; and the method further includes:

[0134] The target component information corresponding to the object attribute to be queried is obtained from all the component information.

[0135] In this step, for example, the queried components include fire hydrants, cameras, and alarms, but the only thing to be queried is fire hydrants, that is, the object attribute to be queried is fire hydrants. At this time, it is necessary to perform a secondary screening based on fire hydrants from the queried fire hydrants, cameras, and alarms, and only filter out fire hydrants, thereby improving the query accuracy. In the present disclosure, by constructing a grid code for the city and taking advantage of the query advantage of the database index, the spatial range query speed is improved under large data volumes.

[0136] The present disclosure provides a data query method, comprising: obtaining grids of each level of a target city and codes corresponding to the grids of each level according to the spatial range of the target city, wherein the codes corresponding to the grids of each level of the target city include: a starting code in the longitude direction corresponding to the grids of each level of the target city, a starting code in the latitude direction corresponding to the grids of each level of the target city, and a height corresponding to the grids of each level of the target city; storing the codes corresponding to the grids of each level of the target city and the corresponding relationship with the grids of each level in a distributed big data database through a spatial big data analysis framework; obtaining codes of urban components according to the spatial position coordinates of urban components in the target city; storing the codes of urban components and the corresponding relationship with the urban components in a distributed big data database through a spatial big data analysis framework; receiving query information, wherein the query information includes: a spatial range to be queried and a level to be queried; obtaining codes corresponding to the spatial range to be queried, wherein the codes corresponding to the spatial range include: a starting code in the longitude direction corresponding to the spatial range, a starting code in the latitude direction corresponding to the spatial range, an ending code in the longitude direction corresponding to the spatial range, an ending code in the latitude direction corresponding to the spatial range, and a height code corresponding to the spatial range; determining a corresponding target level grid according to the level to be queried; and querying corresponding all component information from the target level grid in the distributed big data database according to the code corresponding to the spatial range. The present invention constructs a storage of urban space grid spatial big data and establishes an index of spatial big data by gridding and coding urban space at different levels; establishes a database of spatial location information and attribute information of urban components, and grid codes their location information and creates an index with the code; calculates the coding range of the spatial range, and realizes rapid query of grid data through the coding range with the help of the database index.

[0137] If you need to query all the security cameras in an area, the traditional way is to construct the spatial vector data of the area, and then use this vector surface and all the devices in the device database to perform intersection calculations and conditional screening. When the number of devices in the device database is huge, this spatial vector calculation will be very slow and cannot provide a good user experience.

[0138] The following are embodiments of the apparatus of the present disclosure, which can be used to execute embodiments of the method of the present disclosure.

[0139] Figure 2 is a block diagram of a data query device according to an exemplary embodiment. The device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Figure 2 As shown, the data query device includes:

[0140] The first acquisition module 21 is used to acquire each level of grids of the target city and the codes corresponding to the grids of each level according to the spatial range of the target city, wherein the codes corresponding to the grids of the target city include: the starting codes in the longitude direction corresponding to the grids of each level of the target city, the starting codes in the latitude direction corresponding to the grids of each level of the target city and the heights corresponding to the grids of each level of the target city;

[0141] The first storage module 22 is used to store the codes corresponding to the grids of each level of the target city and the corresponding relationships with the grids of each level in a distributed big data database through a spatial big data analysis framework;

[0142] A second acquisition module 23, configured to acquire the code of the city component according to the spatial position coordinates of the city component in the target city;

[0143] A second storage module 24 is used to store the codes of the city components and the corresponding relationships with the city components in the distributed big data database through the spatial big data analysis framework;

[0144] The receiving module 25 is used to receive query information, wherein the query information includes: a spatial range to be queried and a level to be queried;

[0145] The third acquisition module 26 is used to obtain the code corresponding to the spatial range to be queried, and the code corresponding to the spatial range includes: the longitude direction start code corresponding to the spatial range, the latitude direction start code corresponding to the spatial range, the longitude direction end code corresponding to the spatial range, the latitude direction end code corresponding to the spatial range and the altitude code corresponding to the spatial range;

[0146] A determination module 27, configured to determine a corresponding target level grid according to the level to be queried;

[0147] The query module 28 is used to query all corresponding component information from the target level grid in the distributed big database according to the code corresponding to the spatial range.

[0148] In one embodiment, the first acquisition module includes:

[0149] The first acquisition submodule is used to acquire the latitude and longitude range and altitude of the target city; the latitude and longitude range of the target city includes: the minimum longitude of the target city, the maximum longitude of the target city, the minimum latitude of the target city and the maximum latitude of the target city;

[0150] The first determination submodule is used to determine the grid division table of the target city according to the preset division method and the longitude and latitude range of the target city; the grid division table includes: division levels, and grid division information corresponding to each division level; the grid division information includes: longitude difference, latitude difference and altitude difference;

[0151] The second acquisition submodule is used to acquire the starting longitude direction code corresponding to each level of grid and the starting longitude coordinate of the subdivision grid corresponding to each level of grid according to the minimum longitude of the target city and the longitude difference corresponding to each subdivision level;

[0152] The third acquisition submodule is used to acquire the latitude direction starting code corresponding to each level of grid and the starting latitude coordinate of the subdivision grid corresponding to each level of grid according to the minimum latitude of the target city and the latitude difference corresponding to each subdivision level;

[0153] A fourth acquisition submodule is used to acquire the height direction code corresponding to each level of grid according to the height of the target city and the height difference corresponding to each subdivision level;

[0154] The first sub-module is used to divide the target city into multiple levels of grids according to the starting longitude coordinates of the subdivided grids corresponding to the respective levels of grids, the starting latitude coordinates of the subdivided grids corresponding to the respective levels of grids, the longitude differences of the respective levels, and the latitude differences of the respective levels.

[0155] In one embodiment, the second acquisition submodule includes:

[0156] The first acquisition subunit is used to obtain the starting code of the longitude direction corresponding to each level of grid according to the following formula:

[0157] startX i =[minX÷dx i ]+1;

[0158] The second acquisition subunit is used to obtain the starting longitude coordinates of the subdivided grids corresponding to the grids of each level according to the following formula:

[0159] startLng i =(startX i -1)×dx i ;

[0160] Among them, the startX i is the starting code of the longitude direction corresponding to the i-th level grid, minX is the minimum longitude of the target city, startLng i is the starting longitude coordinate of the grid corresponding to the i-th level grid; the dx i is the longitude difference of the subdivision level corresponding to the i-th level grid; the [] indicates rounding of the quotient.

[0161] In one embodiment, the third acquisition submodule includes:

[0162] The third acquisition subunit is used to obtain the latitude direction starting code corresponding to each level of grid according to the following formula:

[0163] startY i =[minY÷dy i ]+1;

[0164] The fourth acquisition subunit is used to obtain the starting latitude coordinates of the subdivided grids corresponding to the grids of each level according to the following formula:

[0165] startLat i =(startY i -1)×dy i ;

[0166] Among them, startY i is the starting code in the latitude direction corresponding to the i-th level grid, minY is the minimum latitude of the target city, and startLat i is the grid starting latitude coordinate of the grid of the i-th level, and the dy i is the latitude difference of the subdivision level corresponding to the i-th level grid, and the [] indicates rounding of the quotient.

[0167] In one embodiment, the second acquisition module includes:

[0168] The fifth acquisition submodule is used to obtain the code of the city component according to the following formula:

[0169]

[0170]

[0171]

[0172] Among them, the lng is the longitude of the location of the city component, the lat is the latitude of the location of the city component, the h is the height of the location of the city component, numx is the code in the longitude direction, numy is the code in the latitude direction, numz is the code in the height direction, the [] indicates rounding of the quotient; the || indicates the absolute value; the dx is the longitude difference, the dy is the latitude difference, and the dz is the height difference.

[0173] In one embodiment, the third acquisition module includes:

[0174] The sixth acquisition submodule is used to acquire the minimum coordinate and the maximum coordinate corresponding to the spatial range to be queried, wherein the minimum coordinate corresponding to the spatial range to be queried includes: the minimum longitude and the minimum latitude corresponding to the spatial range to be queried; the maximum coordinate corresponding to the spatial range to be queried includes: the maximum longitude and the maximum latitude corresponding to the spatial range to be queried;

[0175] The seventh acquisition submodule is used to obtain the code corresponding to the spatial range to be queried according to the following formula:

[0176]

[0177]

[0178]

[0179]

[0180]

[0181]

[0182] Among them, numax′ is the code of the minimum longitude direction corresponding to the spatial range to be queried, numy′ is the code of the minimum latitude direction corresponding to the spatial range to be queried, numz′ is the code of the minimum height direction corresponding to the spatial range to be queried, lng′ is the minimum longitude corresponding to the spatial range to be queried, lat′ is the minimum latitude corresponding to the spatial range to be queried, h′ is the minimum height corresponding to the spatial range to be queried, numax″ is the code of the maximum longitude direction corresponding to the spatial range to be queried, numy″ is the code of the maximum latitude direction corresponding to the spatial range to be queried, numz″ is the code of the maximum height direction corresponding to the spatial range to be queried, lng″ is the maximum longitude corresponding to the spatial range to be queried, lat″ is the maximum latitude corresponding to the spatial range to be queried, and h″ is the maximum height corresponding to the spatial range to be queried.

[0183] In one embodiment, the query information further includes: attributes of the object to be queried; and the query module is further used to:

[0184] The target component information corresponding to the object attribute to be queried is acquired from the all component information.

[0185] The present disclosure also provides a data query device, including:

[0186] processor;

[0187] a memory for storing processor-executable instructions;

[0188] The processor is configured as follows:

[0189] Obtaining grids of each level of the target city and codes corresponding to the grids of each level according to the spatial range of the target city, wherein the codes corresponding to the grids of each level of the target city include: starting codes in the longitude direction corresponding to the grids of each level of the target city, starting codes in the latitude direction corresponding to the grids of each level of the target city, and heights corresponding to the grids of each level of the target city;

[0190] The codes corresponding to the grids at each level of the target city and the corresponding relationships with the grids at each level of the target city are stored in a distributed big data database through a spatial big data analysis framework;

[0191] Acquiring a code of the city component according to the spatial position coordinates of the city component in the target city;

[0192] The codes of the city components and the corresponding relationships with the city components are also stored in the distributed big data database through the spatial big data analysis framework;

[0193] receiving query information, wherein the query information includes: a spatial range to be queried and a level to be queried;

[0194] Obtaining a code corresponding to the spatial range to be queried, the code corresponding to the spatial range comprising: a starting code in the longitude direction corresponding to the spatial range, a starting code in the latitude direction corresponding to the spatial range, an ending code in the longitude direction corresponding to the spatial range, an ending code in the latitude direction corresponding to the spatial range, and a height code corresponding to the spatial range;

[0195] Determine a corresponding target level grid according to the level to be queried;

[0196] According to the code corresponding to the spatial range, all corresponding component information is queried from the target level grid in the distributed big data database.

[0197] The above processor may also be configured to:

[0198] In one embodiment, the step of acquiring grids of each level of the target city and codes corresponding to the grids of each level according to the spatial range of the target city includes:

[0199] Obtaining the latitude and longitude range and altitude of the target city; the latitude and longitude range of the target city includes: the minimum longitude of the target city, the maximum longitude of the target city, the minimum latitude of the target city, and the maximum latitude of the target city;

[0200] Determine a grid division table of the target city according to a preset division method and the longitude and latitude range of the target city; the grid division table includes: division levels, and grid division information corresponding to each division level; the grid division information includes: longitude difference, latitude difference and altitude difference;

[0201] According to the minimum longitude of the target city and the longitude difference corresponding to each subdivision level, the starting longitude direction code corresponding to each level grid and the starting longitude coordinate of the subdivision grid corresponding to each level grid are obtained;

[0202] According to the minimum latitude of the target city and the latitude difference corresponding to each of the subdivision levels, the latitude direction starting code corresponding to each level of grid and the starting latitude coordinate of the subdivision grid corresponding to each level of grid are obtained;

[0203] Acquire the height direction code corresponding to each level grid according to the height of the target city and the height difference corresponding to each subdivision level;

[0204] The target city is divided into multiple level grids according to the starting longitude coordinates of the subdivided grids corresponding to the level grids, the starting latitude coordinates of the subdivided grids corresponding to the level grids, the longitude differences of the levels, and the latitude differences of the levels.

[0205] In one embodiment, the step of obtaining the starting longitude direction code corresponding to each level of grid and the starting longitude coordinate of the subdivided grid corresponding to each level of grid according to the minimum longitude of the target city and the longitude difference corresponding to each subdivision level includes:

[0206] The starting code of the longitude direction corresponding to each level of grid is obtained according to the following formula:

[0207] startX i =[minX÷dx i ]+1;

[0208] The starting longitude coordinates of the subdivided grids corresponding to the grids at each level are obtained according to the following formula:

[0209] startLng i =(startX i -1)×dx i ;

[0210] Among them, the startX i is the starting code of the longitude direction corresponding to the i-th level grid, minX is the minimum longitude of the target city, startLng i is the starting longitude coordinate of the grid corresponding to the i-th level grid; the dx i is the longitude difference of the subdivision level corresponding to the i-th level grid; the [] indicates rounding of the quotient.

[0211] In one embodiment, the step of obtaining the latitude direction start code corresponding to each level of grid and the start latitude coordinate of the subdivided grid corresponding to each level of grid according to the minimum latitude of the target city and the latitude difference corresponding to each subdivision level includes:

[0212] The latitude starting code corresponding to each level of grid is obtained according to the following formula:

[0213] startY i =[minY÷dy i ]+1;

[0214] The starting latitude coordinates of the subdivided grids corresponding to the grids of each level are obtained according to the following formula:

[0215] startLat i =(startY i -1)×dy i ;

[0216] Among them, startY i is the starting code in the latitude direction corresponding to the i-th level grid, minY is the minimum latitude of the target city, and startLat i is the grid starting latitude coordinate of the grid of the i-th level, and the dy i is the latitude difference of the subdivision level corresponding to the i-th level grid, and the [] indicates rounding of the quotient.

[0217] In one embodiment, the acquiring the code of the city component according to the spatial position coordinates of the city component in the target city includes:

[0218] The code of the city component is obtained according to the following formula:

[0219]

[0220]

[0221]

[0222] Among them, the lng is the longitude of the location of the city component, the lat is the latitude of the location of the city component, the h is the height of the location of the city component, numx is the code in the longitude direction, numy is the code in the latitude direction, numz is the code in the height direction, the [] indicates rounding of the quotient; the || indicates the absolute value; the dx is the longitude difference, the dy is the latitude difference, and the dz is the height difference.

[0223] In one embodiment, obtaining the code corresponding to the spatial range to be queried includes:

[0224] Acquire the minimum coordinate and the maximum coordinate corresponding to the spatial range to be queried, wherein the minimum coordinate corresponding to the spatial range to be queried includes: the minimum longitude and the minimum latitude corresponding to the spatial range to be queried; the maximum coordinate corresponding to the spatial range to be queried includes: the maximum longitude and the maximum latitude corresponding to the spatial range to be queried;

[0225] Obtain the code corresponding to the spatial range to be queried according to the following formula:

[0226]

[0227]

[0228]

[0229]

[0230]

[0231]

[0232] Among them, numax′ is the code of the minimum longitude direction corresponding to the spatial range to be queried, numy′ is the code of the minimum latitude direction corresponding to the spatial range to be queried, numz′ is the code of the minimum height direction corresponding to the spatial range to be queried, lng′ is the minimum longitude corresponding to the spatial range to be queried, lat′ is the minimum latitude corresponding to the spatial range to be queried, h′ is the minimum height corresponding to the spatial range to be queried, numax″ is the code of the maximum longitude direction corresponding to the spatial range to be queried, numy″ is the code of the maximum latitude direction corresponding to the spatial range to be queried, numz″ is the code of the maximum height direction corresponding to the spatial range to be queried, lng″ is the maximum longitude corresponding to the spatial range to be queried, lat″ is the maximum latitude corresponding to the spatial range to be queried, and h″ is the maximum height corresponding to the spatial range to be queried.

[0233] In one embodiment, the query information further includes: attributes of the object to be queried; the method further includes:

[0234] The target component information corresponding to the object attribute to be queried is acquired from the all component information.

[0235] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0236] Figure 3 is a block diagram of a device 90 for data query according to an exemplary embodiment. For example, the device 90 can be provided as a server. The device 90 includes a processing component 902, which further includes one or more processors, and a memory resource represented by a memory 903, for storing instructions that can be executed by the processing component 902, such as an application. The application stored in the memory 903 can include one or more modules, each of which corresponds to a set of instructions. In addition, the processing component 902 is configured to execute instructions to perform the above method.

[0237] The device 90 may also include a power supply component 906 configured to perform power management of the device 90, a wired or wireless network interface 905 configured to connect the device 90 to a network, and an input / output (I / O) interface 908. The device 90 may operate based on an operating system stored in the memory 903, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.

[0238] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by the processor of the device 90, enables the device 90 to perform the above-mentioned data query method, the method comprising:

[0239] Obtaining grids of each level of the target city and codes corresponding to the grids of each level according to the spatial range of the target city, wherein the codes corresponding to the grids of each level of the target city include: starting codes in the longitude direction corresponding to the grids of each level of the target city, starting codes in the latitude direction corresponding to the grids of each level of the target city, and heights corresponding to the grids of each level of the target city;

[0240] The codes corresponding to the grids at each level of the target city and the corresponding relationships with the grids at each level of the target city are stored in a distributed big data database through a spatial big data analysis framework;

[0241] Acquiring a code of the city component according to the spatial position coordinates of the city component in the target city;

[0242] The codes of the city components and the corresponding relationships with the city components are also stored in the distributed big data database through the spatial big data analysis framework;

[0243] receiving query information, wherein the query information includes: a spatial range to be queried and a level to be queried;

[0244] Obtaining a code corresponding to the spatial range to be queried, the code corresponding to the spatial range comprising: a starting code in the longitude direction corresponding to the spatial range, a starting code in the latitude direction corresponding to the spatial range, an ending code in the longitude direction corresponding to the spatial range, an ending code in the latitude direction corresponding to the spatial range, and a height code corresponding to the spatial range;

[0245] Determine a corresponding target level grid according to the level to be queried;

[0246] According to the code corresponding to the spatial range, all corresponding component information is queried from the target level grid in the distributed big data database.

[0247] In one embodiment, the step of acquiring grids of each level of the target city and codes corresponding to the grids of each level according to the spatial range of the target city includes:

[0248] Obtaining the latitude and longitude range and altitude of the target city; the latitude and longitude range of the target city includes: the minimum longitude of the target city, the maximum longitude of the target city, the minimum latitude of the target city, and the maximum latitude of the target city;

[0249] Determine a grid division table of the target city according to a preset division method and the longitude and latitude range of the target city; the grid division table includes: division levels, and grid division information corresponding to each division level; the grid division information includes: longitude difference, latitude difference and altitude difference;

[0250] According to the minimum longitude of the target city and the longitude difference corresponding to each subdivision level, the starting longitude direction code corresponding to each level grid and the starting longitude coordinate of the subdivision grid corresponding to each level grid are obtained;

[0251] According to the minimum latitude of the target city and the latitude difference corresponding to each of the subdivision levels, the latitude direction starting code corresponding to each level of grid and the starting latitude coordinate of the subdivision grid corresponding to each level of grid are obtained;

[0252] Acquire the height direction code corresponding to each level grid according to the height of the target city and the height difference corresponding to each subdivision level;

[0253] The target city is divided into multiple level grids according to the starting longitude coordinates of the subdivided grids corresponding to the level grids, the starting latitude coordinates of the subdivided grids corresponding to the level grids, the longitude differences of the levels, and the latitude differences of the levels.

[0254] In one embodiment, the step of obtaining the starting longitude direction code corresponding to each level of grid and the starting longitude coordinate of the subdivided grid corresponding to each level of grid according to the minimum longitude of the target city and the longitude difference corresponding to each subdivision level includes:

[0255] The starting code of the longitude direction corresponding to each level of grid is obtained according to the following formula:

[0256] startX i =[minX÷dx i ]+1;

[0257] The starting longitude coordinates of the subdivided grids corresponding to the grids at each level are obtained according to the following formula:

[0258] startLng i =(startX i -1)×dx i ;

[0259] Among them, the startX i is the starting code of the longitude direction corresponding to the i-th level grid, minX is the minimum longitude of the target city, startLng i is the starting longitude coordinate of the grid corresponding to the i-th level grid; the dxi is the longitude difference of the subdivision level corresponding to the i-th level grid; the [] indicates rounding of the quotient.

[0260] In one embodiment, the step of obtaining the latitude direction start code corresponding to each level of grid and the start latitude coordinate of the subdivided grid corresponding to each level of grid according to the minimum latitude of the target city and the latitude difference corresponding to each subdivision level includes:

[0261] The latitude starting code corresponding to each level of grid is obtained according to the following formula:

[0262] startY i =[minY÷dy i ]+1;

[0263] The starting latitude coordinates of the subdivided grids corresponding to the grids of each level are obtained according to the following formula:

[0264] startLat i =(startY i -1)×dy i ;

[0265] Among them, startY i is the starting code in the latitude direction corresponding to the i-th level grid, minY is the minimum latitude of the target city, and startLat i is the grid starting latitude coordinate of the grid of the i-th level, and the dy i is the latitude difference of the subdivision level corresponding to the i-th level grid, and the [] indicates rounding of the quotient.

[0266] In one embodiment, the acquiring the code of the city component according to the spatial position coordinates of the city component in the target city includes:

[0267] The code of the city component is obtained according to the following formula:

[0268]

[0269]

[0270]

[0271] Among them, the lng is the longitude of the location of the city component, the lat is the latitude of the location of the city component, the h is the height of the location of the city component, numx is the code in the longitude direction, numy is the code in the latitude direction, numz is the code in the height direction, the [] indicates rounding of the quotient; the || indicates the absolute value; the dx is the longitude difference, the dy is the latitude difference, and the dz is the height difference.

[0272] In one embodiment, obtaining the code corresponding to the spatial range to be queried includes:

[0273] Acquire the minimum coordinate and the maximum coordinate corresponding to the spatial range to be queried, wherein the minimum coordinate corresponding to the spatial range to be queried includes: the minimum longitude and the minimum latitude corresponding to the spatial range to be queried; the maximum coordinate corresponding to the spatial range to be queried includes: the maximum longitude and the maximum latitude corresponding to the spatial range to be queried;

[0274] Obtain the code corresponding to the spatial range to be queried according to the following formula:

[0275]

[0276]

[0277]

[0278]

[0279]

[0280]

[0281] Among them, numax′ is the code of the minimum longitude direction corresponding to the spatial range to be queried, numy′ is the code of the minimum latitude direction corresponding to the spatial range to be queried, numz′ is the code of the minimum height direction corresponding to the spatial range to be queried, lng′ is the minimum longitude corresponding to the spatial range to be queried, lat′ is the minimum latitude corresponding to the spatial range to be queried, h′ is the minimum height corresponding to the spatial range to be queried, numax″ is the code of the maximum longitude direction corresponding to the spatial range to be queried, numy″ is the code of the maximum latitude direction corresponding to the spatial range to be queried, numz″ is the code of the maximum height direction corresponding to the spatial range to be queried, lng″ is the maximum longitude corresponding to the spatial range to be queried, lat″ is the maximum latitude corresponding to the spatial range to be queried, and h″ is the maximum height corresponding to the spatial range to be queried.

[0282] In one embodiment, the query information further includes: attributes of the object to be queried; the method further includes:

[0283] The target component information corresponding to the object attribute to be queried is acquired from the all component information.

[0284] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0285] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A data query method, characterized in that: include: Obtaining grids of each level of the target city and codes corresponding to the grids of each level according to the spatial range of the target city, wherein the codes corresponding to the grids of each level of the target city include: starting codes in the longitude direction corresponding to the grids of each level of the target city, starting codes in the latitude direction corresponding to the grids of each level of the target city, and heights corresponding to the grids of each level of the target city; The codes corresponding to the grids at each level of the target city and the corresponding relationships with the grids at each level of the target city are stored in a distributed big data database through a spatial big data analysis framework; Acquiring a code of the city component according to the spatial position coordinates of the city component in the target city; The codes of the city components and the corresponding relationships with the city components are also stored in the distributed big data database through the spatial big data analysis framework; receiving query information, wherein the query information includes: a spatial range to be queried and a level to be queried; Obtaining a code corresponding to the spatial range to be queried, the code corresponding to the spatial range comprising: a starting code in the longitude direction corresponding to the spatial range, a starting code in the latitude direction corresponding to the spatial range, an ending code in the longitude direction corresponding to the spatial range, an ending code in the latitude direction corresponding to the spatial range, and a height code corresponding to the spatial range; Determine a corresponding target level grid according to the level to be queried; According to the code corresponding to the spatial range, all corresponding component information is queried from the target level grid in the distributed big data database.

2. The method according to claim 1, characterized in that The step of acquiring grids of each level of the target city and codes corresponding to the grids of each level according to the spatial range of the target city includes: Obtaining the latitude and longitude range and altitude of the target city; the latitude and longitude range of the target city includes: the minimum longitude of the target city, the maximum longitude of the target city, the minimum latitude of the target city, and the maximum latitude of the target city; Determine a grid partition table of the target city according to a preset partitioning method and the longitude and latitude range of the target city; the grid partition table includes: partition levels, and grid partition information corresponding to each partition level; the grid partition information includes: longitude difference, latitude difference and altitude difference; According to the minimum longitude of the target city and the longitude difference corresponding to each subdivision level, the starting longitude direction code corresponding to each level grid and the starting longitude coordinate of the subdivision grid corresponding to each level grid are obtained; According to the minimum latitude of the target city and the latitude difference corresponding to each of the subdivision levels, the latitude direction starting code corresponding to each level of grid and the starting latitude coordinate of the subdivision grid corresponding to each level of grid are obtained; Acquire the height direction code corresponding to each level grid according to the height of the target city and the height difference corresponding to each subdivision level; The target city is divided into multiple level grids according to the starting longitude coordinates of the subdivided grids corresponding to the level grids, the starting latitude coordinates of the subdivided grids corresponding to the level grids, the longitude differences of the levels, and the latitude differences of the levels.

3. The method according to claim 2, characterized in that The step of obtaining the starting longitude direction code corresponding to each level of grid and the starting longitude coordinate of the subdivided grid corresponding to each level of grid according to the minimum longitude of the target city and the longitude difference corresponding to each subdivision level includes: The starting code of the longitude direction corresponding to each level of grid is obtained according to the following formula: startX i =[minX÷dx i ]+1; The starting longitude coordinates of the subdivided grids corresponding to the grids at each level are obtained according to the following formula: startLng i =(startX i -1)×dx i ; Among them, the startX i is the starting code of the longitude direction corresponding to the i-th level grid, minX is the minimum longitude of the target city, startLng i is the starting longitude coordinate of the grid corresponding to the i-th level grid; the dx i is the longitude difference of the subdivision level corresponding to the i-th level grid; the [] indicates rounding of the quotient.

4. The method according to claim 2 or 3, characterized in that: The step of obtaining the latitude direction start code corresponding to each level grid and the start latitude coordinate of the subdivided grid corresponding to each level grid according to the minimum latitude of the target city and the latitude difference corresponding to each subdivision level includes: The latitude starting code corresponding to each level of grid is obtained according to the following formula: starts i =[minY÷dy i ]+1; The starting latitude coordinates of the subdivided grids corresponding to the grids of each level are obtained according to the following formula: startYears i =(startY i -1)×dy i ; Among them, startY i is the starting code in the latitude direction corresponding to the i-th level grid, minY is the minimum latitude of the target city, and startLat i is the grid starting latitude coordinate of the grid of the i-th level, and the dy i is the latitude difference of the subdivision level corresponding to the i-th level grid, and the [] indicates rounding of the quotient.

5. The method according to claim 4, characterized in that The step of acquiring the code of the city component according to the spatial position coordinates of the city component in the target city includes: The code of the city component is obtained according to the following formula: Among them, the lng is the longitude of the location of the city component, the lat is the latitude of the location of the city component, the h is the height of the location of the city component, numx is the code in the longitude direction, numy is the code in the latitude direction, numz is the code in the height direction, the [] indicates rounding of the quotient; the || indicates the absolute value; the dx is the longitude difference, the dy is the latitude difference, and the dz is the height difference.

6. The method according to claim 5, characterized in that The obtaining of the code corresponding to the spatial range to be queried includes: Acquire the minimum coordinate and the maximum coordinate corresponding to the spatial range to be queried, wherein the minimum coordinate corresponding to the spatial range to be queried includes: the minimum longitude and the minimum latitude corresponding to the spatial range to be queried; the maximum coordinate corresponding to the spatial range to be queried includes: the maximum longitude and the maximum latitude corresponding to the spatial range to be queried; Obtain the code corresponding to the spatial range to be queried according to the following formula: Among them, numax′ is the code of the minimum longitude direction corresponding to the spatial range to be queried, numy′ is the code of the minimum latitude direction corresponding to the spatial range to be queried, numz′ is the code of the minimum height direction corresponding to the spatial range to be queried, lng′ is the minimum longitude corresponding to the spatial range to be queried, lat′ is the minimum latitude corresponding to the spatial range to be queried, h′ is the minimum height corresponding to the spatial range to be queried, numax″ is the code of the maximum longitude direction corresponding to the spatial range to be queried, numy″ is the code of the maximum latitude direction corresponding to the spatial range to be queried, numz″ is the code of the maximum height direction corresponding to the spatial range to be queried, lng″ is the maximum longitude corresponding to the spatial range to be queried, lat″ is the maximum latitude corresponding to the spatial range to be queried, and h″ is the maximum height corresponding to the spatial range to be queried.

7. The method according to any one of claims 1 to 6, characterized in that: The query information also includes: the object attributes to be queried; the method also includes: The target component information corresponding to the object attribute to be queried is acquired from the all component information.

8. A data query device, characterized in that: include: A first acquisition module is used to acquire each level of grids of the target city and the codes corresponding to the grids of each level according to the spatial range of the target city, wherein the codes corresponding to the grids of the target city include: the starting codes in the longitude direction corresponding to the grids of each level of the target city, the starting codes in the latitude direction corresponding to the grids of each level of the target city and the heights corresponding to the grids of each level of the target city; The first storage module is used to store the codes corresponding to the grids of each level of the target city and the corresponding relationships with the grids of each level in a distributed big data database through a spatial big data analysis framework; A second acquisition module, used for acquiring the code of the city component according to the spatial position coordinates of the city component in the target city; A second storage module is used to store the codes of the city components and the corresponding relationships with the city components in the distributed big data database through the spatial big data analysis framework; A receiving module, used for receiving query information, wherein the query information includes: a spatial range to be queried and a level to be queried; A third acquisition module is used to acquire the code corresponding to the spatial range to be queried, wherein the code corresponding to the spatial range includes: a starting code in the longitude direction corresponding to the spatial range, a starting code in the latitude direction corresponding to the spatial range, an ending code in the longitude direction corresponding to the spatial range, an ending code in the latitude direction corresponding to the spatial range, and a height code corresponding to the spatial range; A determination module, used to determine a corresponding target level grid according to the level to be queried; A query module is used to query all corresponding component information from the target level grid in the distributed big database according to the code corresponding to the spatial range.

9. A data query device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to: Obtaining grids of each level of the target city and codes corresponding to the grids of each level according to the spatial range of the target city, wherein the codes corresponding to the grids of each level of the target city include: starting codes in the longitude direction corresponding to the grids of each level of the target city, starting codes in the latitude direction corresponding to the grids of each level of the target city, and heights corresponding to the grids of each level of the target city; The codes corresponding to the grids at each level of the target city and the corresponding relationships with the grids at each level of the target city are stored in a distributed big data database through a spatial big data analysis framework; Acquiring a code of the city component according to the spatial position coordinates of the city component in the target city; The codes of the city components and the corresponding relationships with the city components are also stored in the distributed big data database through the spatial big data analysis framework; receiving query information, wherein the query information includes: a spatial range to be queried and a level to be queried; Obtaining a code corresponding to the spatial range to be queried, the code corresponding to the spatial range comprising: a starting code in the longitude direction corresponding to the spatial range, a starting code in the latitude direction corresponding to the spatial range, an ending code in the longitude direction corresponding to the spatial range, an ending code in the latitude direction corresponding to the spatial range, and a height code corresponding to the spatial range; Determine a corresponding target level grid according to the level to be queried; According to the code corresponding to the spatial range, all corresponding component information is queried from the target level grid in the distributed big data database.

10. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the instruction is executed by a processor, the steps of the method described in any one of claims 1 to 7 are implemented.