CN114490748A - Method, device and equipment for querying statistical information of vector data and storage medium - Google Patents

Method, device and equipment for querying statistical information of vector data and storage medium Download PDF

Info

Publication number
CN114490748A
CN114490748A CN202111617879.0A CN202111617879A CN114490748A CN 114490748 A CN114490748 A CN 114490748A CN 202111617879 A CN202111617879 A CN 202111617879A CN 114490748 A CN114490748 A CN 114490748A
Authority
CN
China
Prior art keywords
vector data
grid scale
statistical
query
range
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
CN202111617879.0A
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.)
BEIJING GEOWAY INFORMATION TECHNOLOGY Inc
Original Assignee
BEIJING GEOWAY INFORMATION TECHNOLOGY Inc
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 BEIJING GEOWAY INFORMATION TECHNOLOGY Inc filed Critical BEIJING GEOWAY INFORMATION TECHNOLOGY Inc
Priority to CN202111617879.0A priority Critical patent/CN114490748A/en
Publication of CN114490748A publication Critical patent/CN114490748A/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/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24553Query execution of query operations
    • 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
    • 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/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management

Landscapes

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

Abstract

The invention discloses a method, a device, equipment and a storage medium for querying statistical information of vector data, and belongs to the technical field of query of vector data. When a query instruction of a user is received, determining a statistical range according to the query instruction; determining a corresponding spatial index according to the statistical range; querying a database based on the corresponding spatial index, and determining an initial grid scale; inquiring cache data based on the initial grid scale and the statistical range to obtain an inquiry result; the statistical range of user query is determined through a query instruction of a user, the corresponding spatial index is determined according to the statistical range, the initial grid scale is determined through the spatial index query database, the database is queried based on the initial grid scale, effective cache data are obtained, more cache data can be flexibly and effectively hit according to the size of the statistical range, and the efficiency of querying the cache data is improved.

Description

Method, device and equipment for querying statistical information of vector data and storage medium
Technical Field
The invention relates to the technical field of vector data query, in particular to a method, a device, equipment and a storage medium for querying vector data statistical information.
Background
The traditional vector data statistical information caching technology generally adopts an administrative division of a designated level to divide units, the division scale is relatively fixed, unit graphs are complex and irregular, more caches cannot be hit flexibly and effectively according to the size of a statistical range, the cache hit rate is low, the calculation time is long, and the concurrent response capability is weak.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a method, a device, equipment and a storage medium for querying statistical information of vector data, and aims to solve the technical problem of low efficiency of querying the vector data in the prior art.
In order to achieve the above object, the present invention provides a method for querying statistical information of vector data, the method comprising the following steps:
when a query instruction of a user is received, determining a statistical range according to the query instruction;
determining a corresponding spatial index according to the statistical range;
querying a database based on the corresponding spatial index, and determining an initial grid scale;
and inquiring cache data based on the initial grid scale and the statistical range to obtain an inquiry result.
Optionally, the querying, based on the initial grid scale and the statistical range, cache data to obtain a query result includes:
and when the statistical range is completely covered by the initial grid scale, taking the cache data of the initial grid scale as a query result.
Optionally, the querying, based on the initial grid scale and the statistical range, cache data to obtain a query result includes:
when the statistical range is not completely covered by the initial grid scale, counting the cache data covered by the initial grid scale as first cache data;
determining a target grid scale according to the initial grid scale;
when the statistical range is completely covered by the target grid scale, second cache data are obtained based on the statistical range and the target grid scale;
and merging the first cache data and the second cache data to obtain a query result.
Optionally, the querying, based on the initial grid scale and the statistical range, cache data to obtain a query result includes:
when the statistical range is not completely covered by any grid scale, calculating according to a database to obtain statistical data in the statistical range;
and merging the statistical data and the cache data to obtain a query result.
Optionally, before determining the corresponding spatial index according to the statistical range, the method further includes:
acquiring spatial information of original vector data;
carrying out level division on the original vector data according to the spatial information to obtain statistical information of the vector data of each grid scale and the level of each grid scale;
and storing the statistical information of the vector data of each grid scale into a database, and establishing a spatial index according to the grade of each grid scale.
Optionally, the performing level division on the original vector data according to the spatial information to obtain statistical information of the vector data of each grid scale and a level of each grid scale includes:
obtaining a minimum circumscribed rectangle of the original vector data based on the spatial information;
obtaining grids of a target quantity and target vector data corresponding to the grids of the target quantity according to the minimum circumscribed rectangle;
taking the grid scale with the granularity and proportion meeting preset requirements in the grid with the target quantity as an initial grid scale, and acquiring statistical information of vector data corresponding to the initial grid scale;
and performing step-by-step reduction coding based on the initial grid scale and the statistical information of the vector data corresponding to the initial grid scale to generate the statistical information of the vector data of each grid scale and the level of each grid scale.
Optionally, after performing respective reduction editing step by step based on the initial grid scale and the statistical information of the vector data corresponding to the initial grid scale, and generating the statistical information of the vector data of each grid scale and the level of each grid scale, the method further includes:
obtaining grids of associated vector data based on the vector data of each grid scale;
acquiring the grid level of associated vector data, and establishing a parent-child relationship;
and storing the statistical information of the associated vector data in a database, and establishing a spatial index based on the grid level.
In addition, in order to achieve the above object, the present invention further provides a vector data statistics information query apparatus, including:
the receiving module is used for determining a statistical range according to a query instruction when the query instruction of a user is received;
the determining module is used for determining the corresponding spatial index according to the statistical range;
the determining module is further configured to query a database based on the corresponding spatial index, and determine an initial grid scale;
and the query module is used for querying the cache data based on the initial grid scale and the statistical range to obtain a query result.
In addition, in order to achieve the above object, the present invention further provides a vector data statistics information query device, including: a memory, a processor, and a vector data statistics query program stored on the memory and executable on the processor, the vector data statistics query program configured to implement the steps of the vector data statistics query method as described above.
In addition, to achieve the above object, the present invention further provides a storage medium, on which a vector data statistics query program is stored, and the vector data statistics query program, when executed by a processor, implements the steps of the vector data statistics query method as described above.
When a query instruction of a user is received, determining a statistical range according to the query instruction; determining a corresponding spatial index according to the statistical range; querying a database based on the corresponding spatial index, and determining an initial grid scale; inquiring cache data based on the initial grid scale and the statistical range to obtain an inquiry result; the statistical range of user query is determined through a query instruction of a user, the corresponding spatial index is determined according to the statistical range, the initial grid scale is determined through the spatial index query database, the database is queried based on the initial grid scale, effective cache data are obtained, more cache data can be flexibly and effectively hit according to the size of the statistical range, and the efficiency of querying the cache data is improved.
Drawings
Fig. 1 is a schematic structural diagram of a vector data statistics information query device of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for querying statistical information of vector data according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating a second embodiment of a method for querying statistical information of vector data according to the present invention;
FIG. 4 is a flowchart illustrating a method for querying statistical information of vector data according to a third embodiment of the present invention;
FIG. 5 is a query flowchart of a third embodiment of a method for querying statistical information about vector data according to the present invention;
FIG. 6 is a flowchart illustrating a method for querying statistical information of vector data according to a fourth embodiment of the present invention;
FIG. 7 is a schematic view of an overall process of querying vector data according to a fourth embodiment of the method for querying statistical information of vector data according to the present invention;
fig. 8 is a block diagram of a first embodiment of a vector data statistics information query device according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a device for querying vector data statistics information in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the vector data statistics information query device may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to implement connection communication among these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a Wireless interface (e.g., a Wireless-Fidelity (Wi-Fi) interface). The Memory 1005 may be a Random Access Memory (RAM) Memory, or a Non-Volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration shown in fig. 1 does not constitute a limitation of the vector data statistics querying device and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a storage medium, may include therein an operating system, a network communication module, a user interface module, and a vector data statistics query program.
In the vector data statistics information query apparatus shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 of the vector data statistical information query device of the present invention may be disposed in the vector data statistical information query device, and the vector data statistical information query device invokes the vector data statistical information query program stored in the memory 1005 through the processor 1001 and executes the vector data statistical information query method provided by the embodiment of the present invention.
An embodiment of the present invention provides a method for querying statistical information of vector data, and referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of the method for querying statistical information of vector data according to the present invention.
In this embodiment, the method for querying statistical information of vector data includes the following steps:
step S10: and when receiving a query instruction of a user, determining a statistical range according to the query instruction.
It should be noted that the execution subject in this embodiment may be software or a platform for querying the vector data statistics information, and may also be other devices capable of querying the vector data statistics information, which is not limited in this embodiment. The query instruction may include vector data that the user needs to query, and the vector data may include coordinate data, such as two-dimensional coordinates and three-dimensional coordinates. The statistical range includes a range of vector data to be queried, which may be a specific range or a range larger than the specific range, so as to cover the queried vector data completely, and may include spatial data of the shape and position of the vector data, such as a spatial range and spatial reference information.
In specific implementation, the query instruction of the user is analyzed to obtain the vector data which the user wants to query, and the statistical range of the vector data is obtained, so that the vector data can be quickly searched according to the statistical range of the vector data which the user needs to query.
Step S20: and determining the corresponding spatial index according to the statistical range.
It should be understood that a spatial index refers to a data structure that is arranged in a certain order according to the position and shape of spatial objects or some spatial relationship between spatial objects. In this embodiment, corresponding statistics and establishment of corresponding spatial indexes are performed according to spatial information of vector data, when a user needs to query, the corresponding spatial indexes are searched according to relevant features of the vector data, which is equivalent to that a dictionary establishes a corresponding directory according to characteristics and a corresponding relationship of characters, and when a specific character needs to be queried, character search is performed according to the directory. The unimportant data can be filtered through the spatial index, and the information related to the vector data which needs to be inquired by a user can be quickly found.
Step S30: and querying a database based on the corresponding spatial index, and determining an initial grid scale.
It should be noted that the database is a database of vector data, and is used to store vector data cached in advance, and may include one or more of a mysql database, an sql database, a postgreSQL database, a Kingbase database, a higo database, and an oracle database, and may also be other databases that can store cached vector data, which is not limited in this embodiment.
It should be understood that the initial grid scale is the grid scale of the first level determined after the division is performed according to the statistical range of the user, and may be the minimum range in the statistical range, for example, the statistical range of the user is 500m, the initial grid scale is 50m if 500m is divided into 10 grids.
Step S40: and inquiring cache data based on the initial grid scale and the statistical range to obtain an inquiry result.
In this embodiment, the cache data includes vector data stored in a database, and the database is retrieved by obtaining a statistical range of a user and an initial grid scale, and the cache data is queried to obtain vector data desired by the user.
In the embodiment, when a query instruction of a user is received, a statistical range is determined according to the query instruction; determining a corresponding spatial index according to the statistical range; querying a database based on the corresponding spatial index, and determining an initial grid scale; inquiring cache data based on the initial grid scale and the statistical range to obtain an inquiry result; the statistical range of user query is determined through a query instruction of a user, the corresponding spatial index is determined according to the statistical range, the initial grid scale is determined through the spatial index query database, the database is queried based on the initial grid scale, effective cache data are obtained, more cache data can be hit flexibly and effectively according to the size of the statistical range, and the hit rate of the cache data is improved.
Referring to fig. 3, fig. 3 is a flowchart illustrating a method for querying statistical information of vector data according to a second embodiment of the present invention.
Based on the first embodiment, the step S40 of the method for querying statistical information of vector data in this embodiment specifically includes:
step S401: and when the statistical range is completely covered by the initial grid scale, taking the cache data of the initial grid scale as a query result.
It should be understood that the statistical range is completely covered by the initial grid scale, that is, the range of the vector data that the user needs to query is all within the initial grid scale range, that is, the statistical range is equal to the initial grid scale, that is, the statistical range is completely hit by the initial grid scale.
In a specific implementation, when a statistical query instruction of a user is obtained, a platform or software starts to perform statistics on vector data that the user needs to query, where a current grid level is i, and when i is 1, a current grid scale is an initial grid scale, and a maximum grid scale is n, where n may be divided according to a specific statistical requirement and a statistical index, for example, n is 5, 10. For example, the vector data range is 100m, 100m is divided into 10 levels, the cache data of the initial grid scale is 10m, the cache data of the second level grid scale can be 20m, and the cache data of grids of all scales are obtained by stepwise contracted editing according to the division rule. And if the statistical range is completely covered by the initial grid scale range, combining the statistical information to obtain the queried statistical result.
This embodiment is through statistics scope quilt when initial graticule mesh yardstick covers completely, will the cache data of initial graticule mesh yardstick is as the inquiry result, adopts different yardstick graticule meshes as cache statistical unit, when user's statistics scope is in initial graticule mesh yardstick in the database, regards this cache data of initial graticule mesh yardstick as the inquiry result, effectively reduces the statistical data calculated amount.
Referring to fig. 4, fig. 4 is a flowchart illustrating a method for querying statistical information of vector data according to a third embodiment of the present invention.
A third embodiment of the vector data statistical information query method according to the present invention is proposed based on the first embodiment or the second embodiment, and in this embodiment, the description is made based on the first embodiment, and the step S40 specifically includes:
step S402: and when the statistical range is not completely covered by the initial grid scale, counting the cache data covered by the initial grid scale as first cache data.
It should be noted that, when the statistical range exceeds the initial grid scale, the range of the current initial grid scale is smaller than the statistical range. It is therefore desirable to expand the mesh size that needs to be retrieved. The first cache data refers to cache data of a grid scale coinciding with the statistical range in the initial grid scale.
In this embodiment, the statistical range may completely include the initial mesh scale range, or the initial mesh scale range may not be completely within the statistical range, for example, the initial mesh scale range is smaller than the statistical range, and a half of the mesh scale range in the initial mesh scale range coincides with the statistical range.
Step S403: and determining the scale of the target grid according to the initial grid scale.
It should be understood that, the target grid scale is larger than the initial grid scale, and may be a second-level grid scale, a third-level grid scale, or a maximum-level grid scale, when the initial grid scale is smaller than the statistical range, the grid scale may be expanded to the second-level grid scale, the second-level grid scale is compared with the statistical range, if the second-level grid scale does not completely cover the statistical range, it indicates that the second-level grid scale is also smaller than the statistical range, and then the next-level grid scale is used for hit calculation until the statistical range is completely covered by the target grid scale.
Step S404: and when the statistical range is completely covered by the target grid scale, obtaining second cache data based on the statistical range and the target grid scale.
In specific implementation, when the statistical range is completely covered by the target grid scale, which indicates that the target grid scale at this time is equal to the statistical range, the cache data of the target grid scale is used as the second cache data of the query.
Step S405: and merging the first cache data and the second cache data to obtain a query result.
It should be noted that, since the statistical range belongs to the range of adding the initial grid scale and the target grid scale, the cache data queried according to the statistical range is a query result obtained by merging the first cache data and the second cache data.
It should be understood that when the statistical range is not completely covered by the initial grid scale, the first cache data partially covered by the initial grid scale is obtained through calculation, hit calculation is performed by using the next-level grid scale, that is, the second-level grid scale, and when the statistical range is completely covered by the second-level grid scale, the cache data of the second-level grid scale is used as the second cache data, and the first cache data and the second cache data are merged to obtain the queried cache data result. And when the statistical range is not completely covered by the second-level grid scale, performing hit calculation by using the next-level grid scale, namely calculating by using the third-level grid scale, repeating the calculation process until the statistical range is completely covered by the target grid scale, and merging the cache data of the hit target grid scale to obtain a query result.
In a specific implementation, there is a case that the maximum-level grid scale does not completely cover the statistical range, and therefore when the statistical range is not completely covered by any grid scale, the step S40 queries the cache data based on the initial grid scale and the statistical range, including: when the statistical range is not completely covered by any grid scale, calculating according to a database to obtain statistical data in the statistical range; and merging the statistical data and the cache data to obtain a query result.
It should be understood that, when the target grid scale is the maximum-level grid scale, the statistical range is not yet completely covered by the target grid scale or no grid with finer granularity exists, the cache data whose statistical range is partially covered by the target grid scale are merged, the statistical ranges that are not hit by any grid are merged, and the database is used to calculate the statistical data in the merged statistical range. And merging the cache data and the statistical data to obtain a complete queried cache data statistical result.
As shown in fig. 5, fig. 5 is a schematic diagram of query of statistical information of vector data in this embodiment, where a rectangle 1 indicates a maximum grid scale, 2 indicates a user statistical range, 3 indicates an initial grid scale, 4 indicates a next-level grid scale of 3, and 5 indicates a next-level grid scale of 4, a target grid scale in which the user statistical range is completely hit is found by performing stepwise reduction, that is, cache data of the target grid scale that is completely hit can be obtained by query, and for a target grid that is not completely hit by any grid, for example, 2 that is not completely hit by 3, a database that is queried can calculate statistical data in the range and merge the statistical data with the cache data that is completely hit by the target grid to obtain a query result.
In this embodiment, when the statistical range is not completely covered by the initial grid scale, counting the cache data covered by the initial grid scale as first cache data; determining a target grid scale according to the initial grid scale, and obtaining second cache data based on the statistical range and the target grid scale when the statistical range is completely covered by the target grid scale; merging the first cache data and the second cache data to obtain a query result; by adopting grids of different scale levels as a cache statistical unit, when the statistical range is not completely included by the initial grid scale, the statistical grid scale is enlarged, and the hit calculation is performed step by step until the statistical range is completely covered by the target grid scale, so that the spatial range statistics of any scale can be adapted, the hit rate of cache data is improved, and the statistical query efficiency is accelerated.
As shown in fig. 5, fig. 5 is a schematic flowchart of a vector data statistical information query method according to a fourth embodiment of the present invention.
Based on the first embodiment, a fourth embodiment of the vector data statistical information query method of the present invention is provided, where before the step S20, the vector data statistical information query method of the present embodiment further includes:
step S21, spatial information of the original vector data is acquired.
It should be noted that the original vector data refers to data that is not divided and cached, the spatial information includes a spatial range and spatial reference information, and the specific location information of the original vector data can be determined by obtaining the spatial information of the original vector data, which is convenient for subsequently positioning and dividing the original vector data.
Step S22: and carrying out level division on the original vector data according to the spatial information to obtain statistical information of the vector data of each grid scale and the level of each grid scale.
In specific implementation, the level division refers to multi-scale grid division of original vector data, the original vector data is divided into a plurality of parts according to a division rule, each grid scale after division corresponds to vector data, and the vector data of each divided unit grid is calculated according to a statistical requirement for statistics. And obtaining statistical information. Further, the step S22 specifically includes: obtaining a minimum circumscribed rectangle of the original vector data based on the spatial information; obtaining grids of a target quantity and target vector data corresponding to the grids of the target quantity according to the minimum circumscribed rectangle; taking the grid scale with the granularity and proportion meeting preset requirements in the grid with the target quantity as an initial grid scale, and acquiring statistical information of vector data corresponding to the initial grid scale; and performing step-by-step reduction coding based on the initial grid scale and the statistical information of the vector data corresponding to the initial grid scale to generate the statistical information of the vector data of each grid scale and the level of each grid scale.
It should be understood that the minimum bounding rectangle of the original vector data obtained by the spatial extent and spatial reference of the original vector data includes the minimum rectangle completely containing the original vector data, and the irregular original vector data is divided into a plurality of unit data with equal area or equal distance by obtaining the minimum bounding rectangle. The target number refers to a number of grids obtained by dividing the vector data based on a quadtree. The original vector data is divided through the minimum circumscribed rectangle to obtain a plurality of grid scales and the grade of each grid scale, wherein the grids of each scale follow the quadtree relationship, and the grade can be discontinuous. Wherein the vector data in each mesh is target vector data.
It should be noted that, the grid size with the granularity and the proportion meeting the preset requirements refers to the grid size with the finest granularity and the largest scale. After the minimum external rectangle of the original vector data is divided into a plurality of grids, the grid scale with the finest granularity and the largest scale is found from the grids to be used as the initial grid scale, and statistics is carried out according to the original vector data to obtain the statistical information of the vector data corresponding to the initial grid scale. And respectively compiling step by step according to the initial grid scale and the statistical information of the corresponding vector data thereof to generate the statistical information of the vector data of each scale grid so as to obtain the scale level of each grid.
Further, in order to search for associated vector data more quickly, after performing respective reduction and compilation step by step based on the initial grid scale and statistical information of the vector data corresponding to the initial grid scale, and generating statistical information of vector data of each grid scale and a level of each grid scale, the method further includes: obtaining grids of associated vector data based on the vector data of each grid scale; acquiring the grid level of associated vector data, and establishing a parent-child relationship; and storing the statistical information of the associated vector data in a database, and establishing a spatial index based on the grid level.
It should be understood that after the levels of each grid scale and the corresponding vector data are obtained, grids associated with the vector data are screened, a parent-child relationship is established between grids of adjacent levels, so that subsequent query statistics is facilitated, a spatial index is established according to statistical information associated with the vector data and the relationship between the grid levels, and when a user needs to query, related spatial indexes can be directly queried according to the associated statistical information, so that statistical vector data are obtained.
Step S23: and storing the statistical information of the vector data of each grid scale into a database, and establishing a spatial index according to the grade of each grid scale.
In specific implementation, after a plurality of grid scales and corresponding vector data are obtained by dividing according to original vector data and spatial information thereof, the vector data of each grid scale is counted to obtain corresponding statistical information, the statistical information is stored in a database, a spatial index is established according to the scale level of each grid, and when a user needs to inquire the vector data, inquiry can be directly carried out according to the corresponding grid scale level. As shown in fig. 6, fig. 6 is a schematic overall flow chart of user query vector data in this embodiment. When a query instruction of a user is obtained, a statistical range of the user is obtained, a grid of a current level i hit in the statistical range is calculated, the maximum level of the grid scale is n, if the statistical range is completely covered by the current level i, and if i is less than n, the range of the i-level grid is shown to completely include the statistical range, and vector cache data of the current i-level grid scale are completely merged to obtain a query result. If the statistical range is completely covered by the current i-level grid scale, but i > n indicates that the statistical range at this time is larger than the grid scale range of the maximum level, vector data covered by the n-level grid of the maximum level is used as cache data, the vector data not covered by the n-level grid of the maximum level is calculated to obtain statistical data, and the cache data and the statistical data are combined to obtain a statistical result.
The embodiment obtains the spatial information of the original vector data; carrying out level division on the original vector data according to the spatial information to obtain statistical information of the vector data of each grid scale and the level of each grid scale; storing the statistical information of the vector data of each grid scale into a database, and establishing a spatial index according to the grade of each grid scale; the method comprises the steps of carrying out level division on grids which are carried out by original vector data, obtaining grids of all levels and statistical information of corresponding vector data, respectively compiling the grids step by step, storing the statistical information of the vector data of all grid levels into a database, establishing a spatial index based on grid scale levels, carrying out statistics according to a spatial statistical range when a user needs to inquire data, quickly and accurately searching the statistical data, and being short in time consumption and high in concurrency performance.
Referring to fig. 7, fig. 7 is a block diagram illustrating a first embodiment of a device for querying statistical information of vector data according to the present invention.
As shown in fig. 7, the apparatus for querying statistical information of vector data according to an embodiment of the present invention includes:
the receiving module 10 is configured to determine a statistical range according to a query instruction of a user when the query instruction is received.
And a determining module 20, configured to determine a corresponding spatial index according to the statistical range.
The determining module 20 is further configured to query a database based on the corresponding spatial index, and determine an initial grid scale.
And the query module 30 is configured to query the cache data based on the initial grid scale and the statistical range to obtain a query result.
In the embodiment, when a query instruction of a user is received, a statistical range is determined according to the query instruction; determining a corresponding spatial index according to the statistical range; querying a database based on the corresponding spatial index, and determining an initial grid scale; inquiring cache data based on the initial grid scale and the statistical range to obtain an inquiry result; the statistical range of user query is determined through a query instruction of a user, the corresponding spatial index is determined according to the statistical range, the initial grid scale is determined through the spatial index query database, the database is queried based on the initial grid scale, effective cache data are obtained, more cache data can be flexibly and effectively hit according to the size of the statistical range, and the efficiency of querying the cache data is improved.
In an embodiment, the query module 30 is further configured to use the cached data of the initial grid scale as a query result when the statistical range is completely covered by the initial grid scale.
In an embodiment, the query module 30 is further configured to count, as the first cache data, the cache data covered by the initial grid scale when the statistical range is not completely covered by the initial grid scale; determining a target grid scale according to the initial grid scale; when the statistical range is completely covered by the target grid scale, second cache data are obtained based on the statistical range and the target grid scale; and merging the first cache data and the second cache data to obtain a query result.
In an embodiment, the query module 30 is further configured to calculate statistical data in the statistical range according to a database when the statistical range is not completely covered by any grid scale; and merging the statistical data and the cache data to obtain a query result.
In an embodiment, the determining module 20 is further configured to obtain spatial information of the original vector data; carrying out level division on the original vector data according to the spatial information to obtain statistical information of the vector data of each grid scale and the level of each grid scale; and storing the statistical information of the vector data of each grid scale into a database, and establishing a spatial index according to the grade of each grid scale.
In an embodiment, the determining module 20 is further configured to obtain a minimum bounding rectangle of the original vector data based on the spatial information; obtaining grids of a target quantity and target vector data corresponding to the grids of the target quantity according to the minimum circumscribed rectangle; taking the grid scale with the granularity and proportion meeting preset requirements in the grid with the target quantity as an initial grid scale, and acquiring statistical information of vector data corresponding to the initial grid scale; and performing step-by-step reduction coding based on the initial grid scale and the statistical information of the vector data corresponding to the initial grid scale to generate the statistical information of the vector data of each grid scale and the level of each grid scale.
In an embodiment, the determining module 20 is further configured to obtain a mesh of associated vector data based on the vector data of each mesh scale; acquiring the grid level of associated vector data, and establishing a parent-child relationship; and storing the statistical information of the associated vector data in a database, and establishing a spatial index based on the grid level.
In addition, in order to achieve the above object, the present invention further provides a vector data statistics information query device, including: a memory, a processor, and a vector data statistics query program stored on the memory and executable on the processor, the vector data statistics query program configured to implement the steps of the vector data statistics query method as described above.
Since the vector data statistical information query device adopts all the technical solutions of all the embodiments, at least all the beneficial effects brought by the technical solutions of the embodiments are achieved, and are not described in detail herein.
In addition, an embodiment of the present invention further provides a storage medium, where a vector data statistics query program is stored on the storage medium, and when executed by a processor, the vector data statistics query program implements the steps of the vector data statistics query method described above.
Since the storage medium adopts all technical solutions of all the embodiments, at least all the beneficial effects brought by the technical solutions of the embodiments are achieved, and no further description is given here.
It should be understood that the above is only an example, and the technical solution of the present invention is not limited in any way, and in a specific application, a person skilled in the art may set the technical solution as needed, and the present invention is not limited in this respect.
It should be noted that the above-described work flows are only exemplary, and do not limit the scope of the present invention, and in practical applications, a person skilled in the art may select some or all of them to achieve the purpose of the solution of the embodiment according to actual needs, and the present invention is not limited herein.
In addition, the technical details that are not described in detail in this embodiment may refer to the method for querying statistical information of vector data provided in any embodiment of the present invention, and are not described herein again.
Further, it is to be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention or portions thereof that contribute to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g. Read Only Memory (ROM)/RAM, magnetic disk, optical disk), and includes several instructions for enabling a terminal device (e.g. a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A vector data statistical information query method is characterized by comprising the following steps:
when a query instruction of a user is received, determining a statistical range according to the query instruction;
determining a corresponding spatial index according to the statistical range;
querying a database based on the corresponding spatial index, and determining an initial grid scale;
and inquiring cache data based on the initial grid scale and the statistical range to obtain an inquiry result.
2. The method for querying statistical information of vector data according to claim 1, wherein said querying cache data based on the initial grid scale and the statistical range to obtain a query result comprises:
and when the statistical range is completely covered by the initial grid scale, taking the cache data of the initial grid scale as a query result.
3. The method for querying statistical information of vector data according to claim 1, wherein said querying cache data based on the initial grid scale and the statistical range to obtain a query result comprises:
when the statistical range is not completely covered by the initial grid scale, counting the cache data covered by the initial grid scale as first cache data;
determining a target grid scale according to the initial grid scale;
when the statistical range is completely covered by the target grid scale, second cache data are obtained based on the statistical range and the target grid scale;
and merging the first cache data and the second cache data to obtain a query result.
4. The method for querying statistical information of vector data according to claim 1, wherein said querying cache data based on the initial grid scale and the statistical range to obtain a query result comprises:
when the statistical range is not completely covered by any grid scale, calculating according to a database to obtain statistical data in the statistical range;
and merging the statistical data and the cache data to obtain a query result.
5. The method for querying statistical information of vector data according to claim 1, wherein before determining the corresponding spatial index according to the statistical range, the method further comprises:
acquiring spatial information of original vector data;
carrying out level division on the original vector data according to the spatial information to obtain statistical information of the vector data of each grid scale and the level of each grid scale;
and storing the statistical information of the vector data of each grid scale into a database, and establishing a spatial index according to the grade of each grid scale.
6. The method for querying statistical information of vector data according to claim 5, wherein said classifying the original vector data according to the spatial information to obtain the statistical information of the vector data of each grid dimension and the level of each grid dimension comprises:
obtaining a minimum circumscribed rectangle of the original vector data based on the spatial information;
obtaining grids of a target quantity and target vector data corresponding to the grids of the target quantity according to the minimum circumscribed rectangle;
taking the grid scale with the granularity and proportion meeting preset requirements in the grid with the target quantity as an initial grid scale, and acquiring statistical information of vector data corresponding to the initial grid scale;
and performing step-by-step reduction coding based on the initial grid scale and the statistical information of the vector data corresponding to the initial grid scale to generate the statistical information of the vector data of each grid scale and the level of each grid scale.
7. The method for querying statistical information of vector data according to claim 6, wherein said performing step-by-step compilation based on said initial grid scale and statistical information of vector data corresponding to said initial grid scale, and after generating statistical information of vector data of each grid scale and a level of each grid scale, further comprises:
obtaining grids of associated vector data based on the vector data of each grid scale;
acquiring the grid level of associated vector data, and establishing a parent-child relationship;
and storing the statistical information of the associated vector data in a database, and establishing a spatial index based on the grid level.
8. A vector data statistic information inquiry apparatus, comprising:
the receiving module is used for determining a statistical range according to a query instruction when the query instruction of a user is received;
the determining module is used for determining the corresponding spatial index according to the statistical range;
the determining module is further configured to query a database based on the corresponding spatial index, and determine an initial grid scale;
and the query module is used for querying the cache data based on the initial grid scale and the statistical range to obtain a query result.
9. A vector data statistic information inquiry apparatus, characterized by comprising: a memory, a processor, and a vector data statistics query program stored on the memory and executable on the processor, the vector data statistics query program configured to implement the vector data statistics query method of any of claims 1-7.
10. A storage medium having stored thereon a vector data statistics query program which, when executed by a processor, implements the vector data statistics query method according to any one of claims 1 to 7.
CN202111617879.0A 2021-12-27 2021-12-27 Method, device and equipment for querying statistical information of vector data and storage medium Pending CN114490748A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111617879.0A CN114490748A (en) 2021-12-27 2021-12-27 Method, device and equipment for querying statistical information of vector data and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111617879.0A CN114490748A (en) 2021-12-27 2021-12-27 Method, device and equipment for querying statistical information of vector data and storage medium

Publications (1)

Publication Number Publication Date
CN114490748A true CN114490748A (en) 2022-05-13

Family

ID=81496341

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111617879.0A Pending CN114490748A (en) 2021-12-27 2021-12-27 Method, device and equipment for querying statistical information of vector data and storage medium

Country Status (1)

Country Link
CN (1) CN114490748A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104281701A (en) * 2014-10-20 2015-01-14 北京农业信息技术研究中心 Method and system for querying distributed multi-scale spatial data
US20160110823A1 (en) * 2014-10-17 2016-04-21 Jones Lang Lasalle Ip, Inc. Computing system and method for visualizing integrated real estate data
CN111767314A (en) * 2020-06-29 2020-10-13 中国平安财产保险股份有限公司 Data caching and querying method and device, lazy caching system and storage medium
CN113010570A (en) * 2021-03-11 2021-06-22 南方电网数字电网研究院有限公司 Power grid equipment vector data query method and device, computer equipment and medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160110823A1 (en) * 2014-10-17 2016-04-21 Jones Lang Lasalle Ip, Inc. Computing system and method for visualizing integrated real estate data
CN104281701A (en) * 2014-10-20 2015-01-14 北京农业信息技术研究中心 Method and system for querying distributed multi-scale spatial data
CN111767314A (en) * 2020-06-29 2020-10-13 中国平安财产保险股份有限公司 Data caching and querying method and device, lazy caching system and storage medium
CN113010570A (en) * 2021-03-11 2021-06-22 南方电网数字电网研究院有限公司 Power grid equipment vector data query method and device, computer equipment and medium

Similar Documents

Publication Publication Date Title
CN109165215B (en) Method and device for constructing space-time index in cloud environment and electronic equipment
Pelanis et al. Indexing the past, present, and anticipated future positions of moving objects
CN108376143B (en) Novel OLAP pre-calculation system and method for generating pre-calculation result
JP6070956B2 (en) Similarity detection apparatus and directivity vicinity detection method
EP3410315B1 (en) Systems and methods for using tiled data
JP2022535533A (en) Information push method and device
CN104035938A (en) Performance continuous integration data processing method and device
CN114090838B (en) Method, system, electronic device and storage medium for visually displaying big data
CN111680063A (en) Method and device for querying data in Elasticissearch paging mode
CN113177058A (en) Geographic position information retrieval method and system based on composite condition
CN109145225B (en) Data processing method and device
CN114049463A (en) Binary tree data gridding and grid point data obtaining method and device
CN110928900B (en) Multi-table data query method, device, terminal and computer storage medium
CN110442653A (en) Method, apparatus, server and the storage medium of incremental build CUBE model
CN113806601A (en) Peripheral interest point retrieval method and storage medium
CN109213940B (en) Method, storage medium, equipment and system for realizing user position calculation under big data
CN114490748A (en) Method, device and equipment for querying statistical information of vector data and storage medium
CN117390011A (en) Report data processing method, device, computer equipment and storage medium
Hamdi et al. A pattern growth-based approach for mining spatiotemporal co-occurrence patterns
Beilschmidt et al. An efficient aggregation and overlap removal algorithm for circle maps
CN115952252A (en) Data processing method, device, electronic equipment and medium
CN114116948B (en) Geographical vector data space buffer area analysis method, device, equipment and medium
CN115048593A (en) Spatial data retrieval method, device, storage medium and equipment
CN113157212B (en) Flash storage method and device, intelligent wearable device and storage medium
CN114817775A (en) Method and device for generating spatial index

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