CN107402942B - Indexing method and device - Google Patents

Indexing method and device Download PDF

Info

Publication number
CN107402942B
CN107402942B CN201610615883.6A CN201610615883A CN107402942B CN 107402942 B CN107402942 B CN 107402942B CN 201610615883 A CN201610615883 A CN 201610615883A CN 107402942 B CN107402942 B CN 107402942B
Authority
CN
China
Prior art keywords
patch
target
data
code
level
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.)
Active
Application number
CN201610615883.6A
Other languages
Chinese (zh)
Other versions
CN107402942A (en
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.)
Beidou Fuxi Zhongke Digital Hefei Co ltd
Original Assignee
Where Is Beijing Netcom Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Where Is Beijing Netcom Technology Co Ltd filed Critical Where Is Beijing Netcom Technology Co Ltd
Priority to CN201610615883.6A priority Critical patent/CN107402942B/en
Publication of CN107402942A publication Critical patent/CN107402942A/en
Application granted granted Critical
Publication of CN107402942B publication Critical patent/CN107402942B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/29Geographical information databases

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Remote Sensing (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses an indexing method and an indexing device. The method comprises the following steps: responding to a framing instruction, wherein the framing instruction is used for indicating to frame out a target area on a multi-dimensional space, and the multi-dimensional space comprises a plurality of levels of subspaces; inquiring patch codes of a target patch, wherein the target area is completely covered by the target patch, the subspace comprises a plurality of patches in a level, and each patch corresponds to one patch code; and acquiring a data set by using the patch code as an index. The invention solves the problem of low query efficiency when the spatial object is queried in the related technology.

Description

Indexing method and device
Technical Field
The invention relates to the technical field of spatial indexing, in particular to an indexing method and an indexing device.
Background
At present, in the existing various spatial index structures, grid indexes are a common regular index form, but a single-scale index mode is adopted, so that the query efficiency is low when the spatial objects with large scale difference are faced; the quad-tree index and the related mixed index thereof are another common index form, and a common linear quad-tree index structure has poor spatial continuity of coding when coding a space, and query efficiency is affected when querying a space object with a large scale difference, so that query efficiency is low when querying the space object in the related technology.
Aiming at the problem of low query efficiency when a spatial object is queried in the related art, no effective solution is provided at present.
Disclosure of Invention
The invention mainly aims to provide an indexing method and an indexing device to solve the problem of low query efficiency when a spatial object is queried in the related art.
To achieve the above object, according to one aspect of the present invention, there is provided an indexing method. The method comprises the following steps: responding to a framing instruction, wherein the framing instruction is used for indicating to frame out a target area on a multi-dimensional space, and the multi-dimensional space comprises a plurality of levels of subspaces; inquiring patch codes of a target patch, wherein the target area is completely covered by the target patch, the subspace comprises a plurality of patches in a level, and each patch corresponds to one patch code; and acquiring a data set by using the patch code as an index.
Further, the patch coding of the query target patch comprises: determining a minimum outsourcing rectangle corresponding to the target area, wherein the minimum outsourcing rectangle is a rectangle determined by the maximum value and the minimum value of the planar data generated by the target area in the abscissa direction and the maximum value and the minimum value of the planar data in the ordinate direction; acquiring a length value L, wherein the length value L is the maximum length value in the direction of the abscissa or the direction of the ordinate in the minimum wrapping rectangle; selecting a level corresponding to the minimum side length of the patch with the length larger than the length value L as a target level; judging whether a patch covering the minimum outsourcing rectangle exists in the target level; and when judging that the patch covering the minimum outsourcing rectangle exists in the target level, taking the code of the patch covering the minimum outsourcing rectangle as the patch code.
Further, after determining whether a patch covering the smallest outsourced rectangle exists in the target level, the method further comprises: determining the previous level of the target level under the condition that the patch containing the minimum outsourcing rectangle does not exist in the target level; determining a combined patch capable of covering a minimum outsourcing rectangle in a level above a target level, wherein the combined patch consists of at least one patch; and taking the code corresponding to the combined patch as the patch code of the target patch.
Further, after the coding corresponding to the combined patch is taken as the patch coding of the target patch, the method further comprises: and generating an XML file with the same name as the data file, wherein the XML file is a logic index file, and the data file is a file for storing the planar data.
Further, after determining the minimum bounding rectangle corresponding to the target area and before acquiring the length value L, the method further includes: storing the planar data into a database in a four-way division mode, wherein at least one of the following information is stored in the database: unique identification, file name, subdivision code and minimum outsourcing rectangle in the database.
Further, after obtaining the data set with the patch coding as an index, the method further comprises: judging whether the range to be inquired has intersection with the target area; determining a target numerical range corresponding to the range to be queried under the condition that intersection of the range to be queried and the target area is judged; judging whether all data in the target numerical value range are completely contained in the data range represented by the data set; and under the condition that all the data in the target numerical value range are judged not to be completely contained in the data range represented by the data set, querying the data range represented by the data set by adopting the logical index.
Further, querying the data range represented by the data set using the logical index comprises: determining a parent code corresponding to the patch code; acquiring an XML file containing each data corresponding to the parent code to obtain an XML file set; judging whether an XML file containing sub-codes of the patch codes exists in the XML file set or not; and under the condition that the XML file containing the sub-codes of the patch codes exists, inquiring whether intersection exists between the data corresponding to the XML file and the data range represented by the data set or not.
In order to achieve the above object, according to another aspect of the present invention, there is provided an index apparatus. The device includes: the response unit is used for responding to a framing instruction, wherein the framing instruction is used for indicating that a target area is framed out on a multi-dimensional space, and the multi-dimensional space comprises a plurality of levels of subspaces; the query unit is used for querying patch codes of a target patch, wherein a target area is completely covered by the target patch, a subspace comprises a plurality of patches in a level, and each patch corresponds to one patch code; and the index unit is used for acquiring the data set by taking the patch code as an index.
Further, the query unit includes: the device comprises a first determining module, a second determining module and a third determining module, wherein the first determining module is used for determining a minimum outsourcing rectangle corresponding to a target area, and the minimum outsourcing rectangle is a rectangle determined by the maximum value and the minimum value of planar data generated by the target area in the abscissa direction and the maximum value and the minimum value of the planar data in the ordinate direction; the acquisition module is used for acquiring a length value L, wherein the length value L is the maximum length value in the horizontal coordinate direction or the vertical coordinate direction in the minimum outsourcing rectangle; the selecting module is used for selecting the level corresponding to the side length of the smallest patch with the length larger than the length value L as a target level; the judging module is used for judging whether a patch covering the minimum outsourcing rectangle exists in the target level; and the second determining module is used for taking the code of the patch covering the minimum outsourcing rectangle as the patch code under the condition that the patch covering the minimum outsourcing rectangle is judged to exist in the target level.
Further, the apparatus further comprises: a first determining unit, configured to determine a previous level of a target level if it is determined that a patch including a minimum bounding rectangle does not exist in the target level; a second determining unit, configured to determine, in a level above the target level, a combined patch that can cover a minimum outsourcing rectangle, where the combined patch is composed of at least one patch; and a third determining unit, configured to use the code corresponding to the combined patch as the patch code of the target patch.
The invention adopts the following steps: responding to a framing instruction, wherein the framing instruction is used for indicating to frame out a target area on a multi-dimensional space, and the multi-dimensional space comprises a plurality of levels of subspaces; inquiring patch codes of a target patch, wherein the target area is completely covered by the target patch, the subspace comprises a plurality of patches in a level, and each patch corresponds to one patch code; and acquiring a data set by using the patch code as an index. The patch coding is multi-scale coding, namely a multi-scale coding mode adopted by the index. Through a multi-scale coding mode, the characteristic that the code of each lower-level patch is the average value of the corresponding high-level patch is realized, and the range of the codes of all sub-patches at a higher level can be directly determined according to the code of one patch, so that unified query of different scales can be realized during query; meanwhile, due to the characteristic, no other codes exist between the code and the numerical value of all the sub-codes of the code, so that the range of the regions on the numerical value of the query is continuous, and the query efficiency is higher. The problem of low query efficiency when the spatial object is queried in the related technology is solved. And further, the effect of improving the spatial continuity of the codes and further improving the query efficiency of the spatial objects is achieved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate embodiments of the invention and, together with the description, serve to explain the invention and not to limit the invention. In the drawings:
FIG. 1 is a flow diagram of an indexing method according to an embodiment of the invention;
fig. 2 is a schematic diagram illustrating a corresponding manner when N is 2 in the indexing method according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating one-dimensional correspondence in an indexing method according to an embodiment of the present invention;
fig. 4 is a diagram illustrating a corresponding result after an h-function processing when N is 3 in an indexing method according to an embodiment of the present invention; and
FIG. 5 is a schematic diagram of an indexing device according to an embodiment of the present invention.
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present invention will be described in detail below with reference to the embodiments with reference to the attached drawings.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be used. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For convenience of description, some terms or expressions referred to in the embodiments of the present application are explained below:
XML is an Extensible Markup Language (XML) abbreviation used for Markup electronic documents to have a structural Markup Language, can be used for Markup data, defines data types, and is a source Language that allows a user to define his own Markup Language. XML is a subset of the Standard Generalized Markup Language (SGML) and is well suited for Web transport. XML provides a unified way to describe and exchange structured data that is independent of the application or vendor. XML files can be opened using a general notepad or all IEs.
According to an embodiment of the present invention, an indexing method is provided.
FIG. 1 is a flow chart of an indexing method according to an embodiment of the present invention. As shown in fig. 1, the method comprises the steps of:
and step S101, responding to a framing instruction, wherein the framing instruction is used for instructing to frame out the target area on a multi-dimensional space, and the multi-dimensional space comprises a plurality of levels of subspaces.
And receiving a framing instruction which is transmitted from the outside and used for indicating to frame the target area on the multidimensional space, executing the framing instruction, and framing the target area on the multidimensional space. The multidimensional space comprises a plurality of levels of subspaces, and each subspace corresponds to a plurality of data codes. The multi-dimensional space referred to in the present invention is a two-dimensional space. Three-dimensional space is also common and is not limited herein.
Step S102, inquiring patch codes of a target patch, wherein the target area is completely covered by the target patch, a subspace comprises a plurality of patches in a level, and each patch corresponds to one patch code.
It should be noted that the target patch referred to in this application may be one patch or multiple patches, and generally, the target area is covered by multiple patches, in this application, multiple patches covering the target area are collectively referred to as a target patch, and each patch corresponds to one patch code. Therefore, the patch code of the target patch is inquired, and a plurality of patch codes are inquired.
The indexing method provided by the embodiment of the invention adopts a division mode that: the whole two-dimensional research space (defined as 0-level space) is divided into four branches, the space is equally divided into four identical subspaces, each subspace is further divided into four identical subspaces with higher levels, and recursion is carried out in the way until the specified highest level N-1 level is reached, and N levels are total. The recursively divided space set has three dimensions of horizontal dimension, vertical dimension and scale direction, and can be used as a basic framework of space index. Assuming that the whole space range is L, the space range corresponding to the 0-level index patch is L, the 1-level index patch corresponds to L/2, and the 2-level index patch corresponds to L/4 … … k-level index patch corresponds to L/(2^ k); thus there are 1 x 1 patches in the 0-level index, 2 x 2 patches in the 1-level index, and 4 x 4 patches … … in the 2-level index and 2 x k-1 patches in the k-level index.
Optionally, in the indexing method provided in the embodiment of the present invention, the searching for the patch code of the target patch includes: determining a minimum outsourcing rectangle corresponding to the target area, wherein the minimum outsourcing rectangle is a rectangle determined by the maximum value and the minimum value of the planar data generated by the target area in the abscissa direction and the maximum value and the minimum value of the planar data in the ordinate direction; acquiring a length value L, wherein the length value L is the maximum length value in the direction of the abscissa or the direction of the ordinate in the minimum wrapping rectangle; selecting a level corresponding to the minimum side length of the patch with the length larger than the length value L as a target level; judging whether a patch covering the minimum outsourcing rectangle exists in the target level; and when judging that the patch covering the minimum outsourcing rectangle exists in the target level, taking the code of the patch covering the minimum outsourcing rectangle as the patch code.
Optionally, in the indexing method provided in the embodiment of the present invention, after determining whether a target patch including a minimum bounding rectangle exists in an encoding level, the method further includes: determining the previous level of the target level under the condition that the patch containing the minimum outsourcing rectangle does not exist in the target level; determining a combined patch capable of covering a minimum outsourcing rectangle in a level above a target level, wherein the combined patch consists of at least one patch; and taking the code corresponding to the combined patch as the patch code of the target patch.
Optionally, in the indexing method provided in the embodiment of the present invention, after the coding corresponding to the combined patch is taken as the patch coding of the target patch, the method further includes: and generating an XML file with the same name as the data file, wherein the XML file is a logic index file, and the data file is a file for storing the planar data.
Optionally, in the indexing method provided in the embodiment of the present invention, after determining the minimum bounding rectangle corresponding to the target area and before acquiring the length value L, the method further includes: storing the planar data into a database in a four-way division mode, wherein at least one of the following information is stored in the database: unique identification, file name, subdivision code and minimum outsourcing rectangle in the database. The corresponding code is a subdivision code corresponding to the data range represented by the data set.
Specifically, in the indexing method provided in the embodiment of the present invention, first, a Minimum Bounding Rectangle (MBR) of the planar data generated in the target area, that is, a maximum value and a minimum value of the spatial object in the x and y directions, that is: xmin, Ymin, Xmax and Ymax, and then storing the planar data into a database according to a quartering mode, wherein the database records: 1. id, 2, file name, 3, corresponding code, 4, minimum outsourcing (judging that one planar data stores several data according to the area dominance mode, and the number can be 1, 2 and 4); the area occupation optimization strategy of the data during storage is as follows: obtaining the maximum length L of the MBR in the x direction or the y direction, namely Lm is max (abs (Xmax-Xmin), ab s (Ymax-Ymin)), then selecting the level corresponding to the maximum grid side length with the length smaller than L as a coding level, if the MBR is wholly positioned inside a single patch, selecting the code of the single patch as an index, if the MBR is not positioned inside the single patch, selecting two or four patches at a higher level to completely cover the MBR, and then encoding the points corresponding to the two or four patches as the index. Meanwhile, a same-name XML file of the planar data is generated, the XML file is a logic index file, for example, the data file of the planar data is name. The form is as follows:
Figure BDA0001063165680000061
step S103, a data set is obtained by taking the patch code as an index.
It should be noted that the data set mentioned in the present application refers to a data range corresponding to the frame selection target area. The data set is obtained by using the patch code as the index, and the level of the patch code can be determined first, where the patch code is p × 4^ n, where p% 4! When 0, n is a level. The corresponding data set for the patch code is ((p-1) × 4^ n, (p +1) × 4^ n).
It should be noted that the basic relationship involved in the indexing method provided in the embodiment of the present invention is briefly introduced as follows: numerical interval of adjacent codes on i layer: Δ Ti ═ 2 × 4^ (N-i-1), the first code on i layers: OTi ═ 4^ (N-i-1); the kth code on i layer: KTi ═ OTi + Δ Ti ═ k-1 ═ 2k + 2^ 4 (N-i-1); and (3) calculation of a hierarchy: for a code, the number of 0's in the last bit is looked at according to its corresponding binary form, and if there are 2 × i 0's, the level corresponding to the code is N-i-1, for example, 7 ═ 111)2Corresponding to the N-1 level; code 16 ═ (10000)2Corresponding to the N-3 stages, it should be noted that the number of successive 0's at the end must be an even number, and that an odd number of 0's is not possible, i.e. 8 (1000), for example2Such numbers are noncompliantAnd (4) regular. The upper and lower bound ranges corresponding to the multi-scale codes are as follows: the numerical value ranges of all the sub-codes corresponding to the code can be directly determined according to the upper and lower bound ranges, and the method can be used in query. The corresponding range of code is: (code-4^ (N-i-1), code +4^ (N-i-1)), where i is the level to which the code corresponds. Sub-coding corresponding to multi-scale coding: given a multi-scale code MTc (integer), the corresponding level is i, and the algorithm for calculating the time code ST, i '≧ i of the i' th layer contained by the multi-scale code (the multi-scale integer code satisfies the inclusion relation in the integer ordering) is shown as the following formula 1:
parent coding corresponding to multi-scale coding: given a multi-scale code MTc (integer), corresponding to level i, the algorithm for calculating the code ST of the i 'th layer contained therein, i' ≦ i (the multi-scale integer code is in integer order, satisfies the time inclusion relation) is shown in equation 2 below:
Figure BDA0001063165680000072
it should be noted that shifting is performed first and then the last bit is determined to change to zero.
And (3) coding neighborhood calculation: given a multi-scale code c (integer), the code c', c ═ c ± K Δ Ti before (after) K integer units (current level i) is calculated
And (3) an encoding mode: first, let f (x, y, n) be the correspondence of the space-filling curve in two dimensions. Parametric meaning of the function: n represents the total range of 2n x 2n covered (n is 0, 1, 2, … …); x, y denote the point in the x-th row and y-th column in this case. For example, fig. 2 and 3 show a corresponding manner when n is 2 in fig. 2. Fig. 3 shows a one-dimensional correspondence. Secondly, a full-coverage mode is adopted, the coding of the previous layer is guaranteed to be the average value of all the coding of the next layer, and the multi-layer region is coded according to a uniform format. The h function is algebraically transformed from the f function as shown in equation 3:
h(x,y,n,N)=(2*f(x,y,n)+1)*4N-n-1 equation 3
Fig. 4 shows the corresponding result of the h function processing when N is 3.
Optionally, in the indexing method provided in the embodiment of the present invention, after obtaining the data set by using patch coding as an index, the method further includes: judging whether the range to be inquired has intersection with the target area; determining a target numerical range corresponding to the range to be queried under the condition that intersection of the range to be queried and the target area is judged; judging whether all data in the target numerical value range are completely contained in the data range represented by the data set; and under the condition that all the data in the target numerical value range are judged not to be completely contained in the data range represented by the data set, querying the data range represented by the data set by adopting the logical index.
Optionally, in the indexing method provided in the embodiment of the present invention, querying the data range represented by the data set by using the logical index includes: determining a parent code corresponding to the patch code; acquiring an XML file containing each data corresponding to the parent code to obtain an XML file set; judging whether an XML file containing sub-codes of the patch codes exists in the XML file set or not; and under the condition that the XML file containing the sub-codes of the patch codes exists, inquiring whether intersection exists between the data corresponding to the XML file and the data range represented by the data set or not.
Specifically, all the subcodes { a' } corresponding to the patch code in the data set are found, and the data corresponding to the subcodes is the data completely contained in the frame-selected code. Meanwhile, if the range to be queried intersects with the target area and is not data completely contained by the target area, a logical index is required. Specifically, the method comprises the following steps: first find the parent codes of several levels of patch coding (say three levels), e.g., 20, 16, 64 for the three levels of 19. Then, finding out the XML file of each piece of data corresponding to the parent codes, inquiring whether the XML file contains the data which can contain { A' }, if so, inquiring whether the data and the frame selection range (target area) have intersection, and if so, returning the inquiry result.
Since multiple patch codes are acquired (assuming integer numbers), for example: 1. 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, and then, if the codes in the query database have corresponding parts to the above patch codes, it is only necessary to compare the parts 1< ═ code < ═ 8or 10< ═ code < ═ 15 (in two segments, the continuity is high). The method with higher continuity queries the database quickly during query, thereby improving the query efficiency.
In conclusion, the characteristic that the code of each lower-level patch is the average value of the corresponding high-level patch is realized through a multi-scale coding mode, and the range of the codes of all sub-patches of the higher level can be directly determined according to the code of one patch, so that unified query of different scales can be realized during query; meanwhile, due to the characteristic, no other codes exist between the code and the numerical value of all the sub-codes of the code, so that the range of the regions on the numerical value of the query is continuous and the efficiency is higher. For example, for the patch numbered 16 in fig. 2, the corresponding range of all sub-patches is (0, 32), and this range does not include any other patch, so when the spatial objects corresponding to the patch and all sub-patches need to be queried, it is sufficient to directly search for objects with index values between 0 and 32. The coding modes within the same layer are different, for example, the coding mode can be a Hilbert curve coding mode. It has been theoretically demonstrated that in various query modes for querying different scales, the encoding mode of the indexing method provided by the embodiment of the invention has stronger continuity, and the query efficiency can be greatly improved.
According to the indexing method provided by the embodiment of the invention, a framing instruction is responded, wherein the framing instruction is used for indicating that a target area is framed out in a multi-dimensional space, and the multi-dimensional space comprises a plurality of levels of subspaces; inquiring patch codes of a target patch, wherein the target area is completely covered by the target patch, the subspace comprises a plurality of patches in a level, and each patch corresponds to one patch code; and acquiring a data set by using the patch code as an index. The patch coding is multi-scale coding, namely a multi-scale coding mode adopted by the index. Through a multi-scale coding mode, the characteristic that the code of each lower-level patch is the average value of the corresponding high-level patch is realized, and the range of the codes of all sub-patches at a higher level can be directly determined according to the code of one patch, so that unified query of different scales can be realized during query; meanwhile, due to the characteristic, no other codes exist between the code and the numerical value of all the sub-codes of the code, so that the range of the regions on the numerical value of the query is continuous, and the query efficiency is higher. The problem of low query efficiency when the spatial object is queried in the related technology is solved. And further, the effect of improving the spatial continuity of the codes and further improving the query efficiency of the spatial objects is achieved.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
The embodiment of the present invention further provides an indexing apparatus, and it should be noted that the indexing apparatus of the embodiment of the present invention may be used to execute the indexing method provided by the embodiment of the present invention. The following describes an indexing apparatus provided in an embodiment of the present invention.
FIG. 5 is a schematic diagram of an indexing device according to an embodiment of the present invention. As shown in fig. 5, the apparatus includes: response unit 10, query unit 20, and index unit 30.
Specifically, the response unit 10 is configured to respond to a framing instruction, where the framing instruction is used to instruct to frame out the target area on a multidimensional space, and the multidimensional space includes a plurality of levels of subspaces.
The query unit 20 is configured to query patch codes of a target patch, where the target area is completely covered by the target patch, and the subspace includes multiple patches in one level, and each patch corresponds to one patch code.
And an indexing unit 30, configured to obtain the data set by using the patch code as an index.
The indexing device of the embodiment of the invention responds to a framing instruction through a response unit 10, wherein the framing instruction is used for indicating that a target area is framed out in a multi-dimensional space, and the multi-dimensional space comprises a plurality of levels of subspaces; the query unit 20 queries patch codes of a target patch, wherein a target area is completely covered by the target patch, a subspace includes a plurality of patches in a level, and each patch corresponds to one patch code; and the indexing unit 30 acquires a data set with a patch code as an index. The patch coding is multi-scale coding, namely a multi-scale coding mode adopted by the index. Through a multi-scale coding mode, the characteristic that the code of each lower-level patch is the average value of the corresponding high-level patch is realized, and the range of the codes of all sub-patches at a higher level can be directly determined according to the code of one patch, so that unified query of different scales can be realized during query; meanwhile, due to the characteristic, no other codes exist between the code and the numerical value of all the sub-codes of the code, so that the range of the regions on the numerical value of the query is continuous, and the query efficiency is higher. The problem of low query efficiency when the spatial object is queried in the related technology is solved. And further, the effect of improving the spatial continuity of the codes and further improving the query efficiency of the spatial objects is achieved.
Optionally, in the indexing apparatus provided in the embodiment of the present invention, the querying unit 20 includes: the device comprises a first determining module, a second determining module and a third determining module, wherein the first determining module is used for determining a minimum outsourcing rectangle corresponding to a target area, and the minimum outsourcing rectangle is a rectangle determined by the maximum value and the minimum value of planar data generated by the target area in the abscissa direction and the maximum value and the minimum value of the planar data in the ordinate direction; the acquisition module is used for acquiring a length value L, wherein the length value L is the maximum length value in the horizontal coordinate direction or the vertical coordinate direction in the minimum outsourcing rectangle; the selecting module is used for selecting the level corresponding to the side length of the smallest patch with the length larger than the length value L as a target level; the judging module is used for judging whether a patch covering the minimum outsourcing rectangle exists in the target level; and the second determining module is used for taking the code of the patch covering the minimum outsourcing rectangle as the patch code under the condition that the patch covering the minimum outsourcing rectangle is judged to exist in the target level.
Optionally, in the indexing apparatus provided in the embodiment of the present invention, the apparatus further includes: a first determining unit, configured to determine a previous level of a target level if it is determined that a patch including a minimum bounding rectangle does not exist in the target level; a second determining unit, configured to determine, in a level above the target level, a combined patch that can cover a minimum outsourcing rectangle, where the combined patch is composed of at least one patch; and a third determining unit, configured to use the code corresponding to the combined patch as the patch code of the target patch.
The indexing device comprises a processor and a memory, wherein the response unit 10, the query unit 20, the indexing unit 30 and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more, and the kernel parameters are adjusted to carry out indexing.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
The present application further provides an embodiment of a computer program product, which, when being executed on a data processing device, is adapted to carry out program code for initializing the following method steps: responding to a framing instruction, wherein the framing instruction is used for indicating to frame out a target area on a multi-dimensional space, and the multi-dimensional space comprises a plurality of levels of subspaces; inquiring patch codes of a target patch, wherein the target area is completely covered by the target patch, the subspace comprises a plurality of patches in a level, and each patch corresponds to one patch code; and acquiring a data set by using the patch code as an index.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
It will be apparent to those skilled in the art that the modules or steps of the present application described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and they may alternatively be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, or fabricated separately as individual integrated circuit modules, or fabricated as a single integrated circuit module from multiple modules or steps. Thus, the present application is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (9)

1. An indexing method, comprising:
responding to a framing instruction, wherein the framing instruction is used for instructing to frame out a target area on a multidimensional space, and the multidimensional space comprises a plurality of levels of subspaces;
querying a patch code of a target patch, wherein the target area is completely covered by the target patch, the subspace comprises a plurality of patches in a level, and each patch corresponds to one patch code;
acquiring a data set by taking the patch code as an index;
wherein after obtaining the data set with the patch code as an index, the method further comprises:
judging whether the range to be inquired has intersection with the target area;
determining a target numerical range corresponding to the range to be queried under the condition that the intersection of the range to be queried and the target area is judged;
judging whether all the data in the target numerical range are all contained in the data range represented by the data set;
and under the condition that all the data in the target numerical value range are judged not to be completely contained in the data range represented by the data set, querying the data range represented by the data set by adopting a logic index.
2. The method of claim 1, wherein querying the patch code for the target patch comprises:
determining a minimum outsourcing rectangle corresponding to the target area, wherein the minimum outsourcing rectangle is a rectangle determined by the maximum value and the minimum value of the planar data generated by the target area in the abscissa direction and the maximum value and the minimum value of the planar data in the ordinate direction;
acquiring a length value L, wherein the length value L is the maximum length value in the direction of the abscissa or the direction of the ordinate in the minimum outsourcing rectangle;
selecting a level corresponding to the minimum side length of the patch with the length larger than the length value L as a target level;
judging whether a patch covering the minimum outsourcing rectangle exists in the target level;
and if judging that the patch covering the minimum outsourcing rectangle exists in the target level, taking the code of the patch covering the minimum outsourcing rectangle as the patch code.
3. The method of claim 2, wherein after determining whether a patch covering the minimum outsource rectangle exists in the target level, the method further comprises:
determining a previous level of the target level when the patch containing the minimum outsourcing rectangle is judged not to exist in the target level;
determining a combined patch capable of covering the minimum outsourcing rectangle in a level above the target level, wherein the combined patch consists of at least one patch;
and taking the code corresponding to the combined patch as the patch code of the target patch.
4. The method of claim 3, wherein after the coding corresponding to the combined patch is the patch coding of the target patch, the method further comprises:
and generating an XML file with the same name as the data file, wherein the XML file is a logic index file, and the data file is a file for storing the planar data.
5. The method of claim 2, wherein after determining the minimum bounding rectangle for the target region and before obtaining the length value L, the method further comprises:
storing the planar data into a database in a four-way division mode, wherein at least one of the following information is stored in the database: unique identification, file name, subdivision code and the minimum outsourcing rectangle in the database.
6. The method of claim 1, wherein querying the data range represented by the data set using the logical index comprises:
determining a parent code corresponding to the patch code;
acquiring an XML file containing each data corresponding to the father code to obtain an XML file set;
judging whether an XML file containing the sub-codes of the patch codes exists in the XML file set or not;
and under the condition that the XML file containing the sub-codes of the patch codes exists, inquiring whether the data corresponding to the XML file and the data range represented by the data set have intersection or not.
7. An indexing device, comprising:
a response unit, configured to respond to a framing instruction, where the framing instruction is used to instruct to frame out a target area on a multidimensional space, where the multidimensional space includes a plurality of levels of subspaces;
the query unit is used for querying patch codes of a target patch, wherein the target area is completely covered by the target patch, the subspace comprises a plurality of patches in a level, and each patch corresponds to one patch code; and
the index unit is used for acquiring a data set by taking the patch code as an index;
wherein the apparatus is further configured to: after a data set is obtained by taking the patch code as an index, judging whether a range to be inquired has intersection with the target area; determining a target numerical range corresponding to the range to be queried under the condition that the intersection of the range to be queried and the target area is judged; judging whether all the data in the target numerical range are all contained in the data range represented by the data set; and under the condition that all the data in the target numerical value range are judged not to be completely contained in the data range represented by the data set, querying the data range represented by the data set by adopting a logic index.
8. The apparatus of claim 7, wherein the query unit comprises:
a first determining module, configured to determine a minimum outsourcing rectangle corresponding to the target area, where the minimum outsourcing rectangle is a rectangle determined by a maximum value and a minimum value of planar data generated by the target area in an abscissa direction and a maximum value and a minimum value of the planar data in an ordinate direction;
the acquisition module is used for acquiring a length value L, wherein the length value L is the maximum length value in the direction of the abscissa or the direction of the ordinate in the minimum outsourcing rectangle;
the selecting module is used for selecting the level corresponding to the minimum side length of the patch with the length larger than the length value L as a target level;
a judging module, configured to judge whether a patch covering the minimum outsourcing rectangle exists in the target hierarchy;
and a second determining module, configured to, when it is determined that a patch covering the minimum outsourcing rectangle exists in the target hierarchy, take an encoding of the patch covering the minimum outsourcing rectangle as the patch encoding.
9. The apparatus of claim 8, further comprising:
a first determining unit, configured to determine, when it is determined that a patch including the minimum bounding rectangle does not exist in the target hierarchy, a level immediately above the target hierarchy;
a second determining unit configured to determine, in a level immediately above the target level, a combined patch that can cover the minimum outsourcing rectangle, wherein the combined patch is composed of at least one patch;
a third determining unit, configured to use the coding corresponding to the combined patch as the patch coding of the target patch.
CN201610615883.6A 2016-07-28 2016-07-28 Indexing method and device Active CN107402942B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610615883.6A CN107402942B (en) 2016-07-28 2016-07-28 Indexing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610615883.6A CN107402942B (en) 2016-07-28 2016-07-28 Indexing method and device

Publications (2)

Publication Number Publication Date
CN107402942A CN107402942A (en) 2017-11-28
CN107402942B true CN107402942B (en) 2020-03-03

Family

ID=60389319

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610615883.6A Active CN107402942B (en) 2016-07-28 2016-07-28 Indexing method and device

Country Status (1)

Country Link
CN (1) CN107402942B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108731688A (en) * 2018-06-01 2018-11-02 北京都在哪网讯科技有限公司 Air navigation aid and device
CN112214645B (en) * 2019-07-11 2023-09-19 杭州海康威视数字技术股份有限公司 Method and device for storing track data
CN114385620A (en) * 2020-10-19 2022-04-22 腾讯科技(深圳)有限公司 Data processing method, device, equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103106284A (en) * 2013-03-01 2013-05-15 北京大学 Subdivision middleware for three-dimensional data global information correlation and information correlation method
CN103136340A (en) * 2013-02-04 2013-06-05 北京大学 Method for migrating massive spatial data in cluster fast
CN103150338A (en) * 2013-02-04 2013-06-12 北京大学 Subdivision pretreatment method and data extraction method used for image data extraction
CN103164861A (en) * 2013-03-21 2013-06-19 北京大学 Image structuring expression method based on subdivision codes
CN104182475A (en) * 2014-07-31 2014-12-03 北京大学 Location information quick search method based on mask technology and subdivision coding

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136340A (en) * 2013-02-04 2013-06-05 北京大学 Method for migrating massive spatial data in cluster fast
CN103150338A (en) * 2013-02-04 2013-06-12 北京大学 Subdivision pretreatment method and data extraction method used for image data extraction
CN103106284A (en) * 2013-03-01 2013-05-15 北京大学 Subdivision middleware for three-dimensional data global information correlation and information correlation method
CN103164861A (en) * 2013-03-21 2013-06-19 北京大学 Image structuring expression method based on subdivision codes
CN104182475A (en) * 2014-07-31 2014-12-03 北京大学 Location information quick search method based on mask technology and subdivision coding

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"地理空间大数据存储管理的地理网络地址研究";吕雪锋等;《地理与地理信息科学》;20150115;第31卷(第1期);第4页第2.2-2.3节 *
"基于地球剖分的空间信息区位标识";吕雪锋等;《高技术通讯》;20140415;第24卷(第4期);第333-346页 *

Also Published As

Publication number Publication date
CN107402942A (en) 2017-11-28

Similar Documents

Publication Publication Date Title
CN110321344B (en) Information query method and device for associated data, computer equipment and storage medium
US9268796B2 (en) Systems and methods for quantile estimation in a distributed data system
CN107402955B (en) Method and apparatus for determining index grid of geo-fence
US8055687B2 (en) System and method for determining intervals of a space filling curve in a query box
US10068033B2 (en) Graph data query method and apparatus
EP3217296A1 (en) Data query method and apparatus
US9507833B2 (en) Systems and methods for quantile determination in a distributed data system
CN107402942B (en) Indexing method and device
US10552484B2 (en) Guided data exploration
CN113254451B (en) Data index construction method and device, electronic equipment and storage medium
Roos An improved version of Chubanov's method for solving a homogeneous feasibility problem
CN109409848A (en) Node intelligent recommended method, terminal device and the storage medium of open process
CN103092992A (en) Vector data preorder quadtree coding and indexing method based on Key / Value type NoSQL (Not only SQL)
Roumelis et al. The xBR-tree: an efficient access method for points
CN116522844B (en) Circuit dividing method, circuit node voltage calculating method, terminal and storage medium
CN111125157B (en) Query data processing method and device, storage medium and processor
Petra et al. On efficient Hessian computation using the edge pushing algorithm in Julia
Reddy Muppani et al. Class-based storage-location assignment to minimise pick travel distance
CN115858709A (en) Multi-scale spatial data processing method, electronic device and storage medium
De Fréminville et al. A column generation heuristic for districting the price of a financial product
CN113468383A (en) Family relation map searching method and device, electronic equipment and storage medium
Larsen Branch and bound solution of the multidimensional assignment problem formulation of data association
CN113849498A (en) Index construction and query method
Reinecke et al. Efficient data structures for masks on 2D grids
CN106202571B (en) Digital map system for storing customer information based on two-dimensional code and use method thereof

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
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: 100000 101-3, Floor 4, Building 12, Yard 3, Fengxiu Middle Road, Haidian District, Beijing

Patentee after: Beijing Beidou Fuxi Technology Co.,Ltd.

Address before: 100012 16th Floor, Block B, China Railway Construction Plaza, Beiyuan East Road, Chaoyang District, Beijing

Patentee before: BEIJING IWHERE NETWORK TECHNOLOGY CO.,LTD.

CP03 Change of name, title or address
TR01 Transfer of patent right

Effective date of registration: 20230505

Address after: Room 805-808, 8th Floor, A1 Building, Phase 1, Zhong'an Chuanggu Science and Technology Park, No. 900 Wangjiang West Road, High tech Zone, Hefei City, Anhui Province, 230000

Patentee after: Beidou Fuxi Zhongke Digital Hefei Co.,Ltd.

Address before: 100000 101-3, Floor 4, Building 12, Yard 3, Fengxiu Middle Road, Haidian District, Beijing

Patentee before: Beijing Beidou Fuxi Technology Co.,Ltd.

TR01 Transfer of patent right