CN101520801A - Method for storing space geometric objects to database - Google Patents

Method for storing space geometric objects to database Download PDF

Info

Publication number
CN101520801A
CN101520801A CN200910076928A CN200910076928A CN101520801A CN 101520801 A CN101520801 A CN 101520801A CN 200910076928 A CN200910076928 A CN 200910076928A CN 200910076928 A CN200910076928 A CN 200910076928A CN 101520801 A CN101520801 A CN 101520801A
Authority
CN
China
Prior art keywords
row
space
value
geometric
spatial
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.)
Granted
Application number
CN200910076928A
Other languages
Chinese (zh)
Other versions
CN101520801B (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.)
Institute of Software of CAS
National University of Defense Technology
Institute of Geographic Sciences and Natural Resources of CAS
Original Assignee
Institute of Software of CAS
National University of Defense Technology
Institute of Geographic Sciences and Natural Resources of CAS
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 Institute of Software of CAS, National University of Defense Technology, Institute of Geographic Sciences and Natural Resources of CAS filed Critical Institute of Software of CAS
Priority to CN2009100769287A priority Critical patent/CN101520801B/en
Publication of CN101520801A publication Critical patent/CN101520801A/en
Application granted granted Critical
Publication of CN101520801B publication Critical patent/CN101520801B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to a method for storing space geometric objects to a database. The method comprises the following steps: creating a database space table containing geometric columns; receiving space geometric object embodiments in an information mode, extracting space geometric eigenvalues and initialing in-row indicators of the geometric columns; calculating and assigning a space order code to each space geometric object; writing the in-row indicators of the geometric columns along with other in-row data; adopting a blocking and aggregation index method of the geometric objects to write the out-row data of the geometric columns; and creating or refreshing a space index. A corresponding reading method comprises the following steps: confirming the reading types of geometric object values according to the operation types of a current space and the storage types of the geometric objects; reading the in-row data of the space geometric object embodiments appointed by the geometric columns; and reading the out-row data if necessary. The method improves the response efficiency for reading the data of the geometric objects and further minimizes the I/O access of the out-row data of the geometric columns.

Description

A kind of database space geometric object access method
Technical field
The invention belongs to the message area that database and Geographic Information System are intersected, particularly a kind of space geometry object access method that in kernel of DBMS, realizes.
Background technology
The efficient organization and management of magnanimity geographical spatial data is Geographic Information System of future generation (GIS) platform gordian technique to be solved." relevant database+Spatial Data Engine " and " EXPANDING DISPLAY AREA relevant database " is two kinds of mainstream technologys that current industrial circle adopts.The former is the technical system that classical GIS field is adopted, its core be utilize Spatial Data Engine (middleware) efficiently come the organization space data in relevant database storage and call (hereinafter to be referred as " depositing pattern "); The latter is the technical system that IT database manufacturer is adopted, its core is to increase spatial data type, spatial index and space S QL language (hereinafter to be referred as " built-in pattern ") at data base management system (DBMS) (DBMS) kernel, thereby the formation spatial data base management system (spatialDBMS, SDBMS).
Built-in pattern is owing to management and the ADABAS with spatial data combines together, and spatial data is pressed the object access, can operate and handle in the implementation space in the database kernel, and unified SQL interface is provided, and has become the development in future direction.But since built-in pattern directly with the binding of database kernel, realize that difficulty is bigger, compare the comparatively ripe pattern of depositing, built-in pattern still remains raising in performance aspect the operation of massive spatial data and the analysis.
The spatial data type is as a kind of abstraction interface of SDBMS expression and operating space geometric object, and its bottom layer realization mechanism directly influences data access efficiency.Because space geometry object and body all have big object (large object, LOB) feature, so conventional SDBMS generally directly continues to use existing LOB architecture, and attract the access space geometric object by Spatial Cable, as representative SDBMS platform PostgreSQL/PostGIS, MySQL Spatial Extensions, Ingres SpatialLibrary etc.Wherein, spatial index is mainly used in quickly positioning target space geometry object, and the own access of hitting object data then realizes by LOB mechanism.The design original intention of LOB mechanism is mainly used in access non-structured " string " type data, as big Value Data such as multimedia data stream, Word document, generally comprises binary large object type (BLOB type) and the big object type of text (as the CLOB type).The data volume of an object can be up to the GB level because LOB itemizes, so general combination storage of supporting the row interior (inline) or the row outer (out-of-line) of LOB column data, be a positioning pointer only storing the directed outwards value in the LOB row row, and actual LOB value is stored in the outer page of row or the operating system file.
Since the design original intention of LOB mechanism at be common unstructured data, do not consider the space destructuring feature that the space geometry object is had and the singularity of data manipulation thereof, so its data organization and access framework are not suitable for the space geometry object.This mainly shows following two aspects:
(1) the space geometry object has the space geometry feature.Though it is the minimum outsourcing rectangle of space geometry object, area, girth etc. do not belong to space geometry object itself, significant for routine operations such as spatial index establishment, spatial relationship judgement, spatial statisticses.LOB mechanism is owing to generally only store the positioning pointer of pointing to real LOB value in master meter is capable, after so above eigenwert often needs to read the interior positioning pointer of row, further being worth back calculating in real time outward by access line obtains, even and prestore relevant geometrical characteristic in the outer value of being expert at, but often also can have the outer second-level access expense of row.
(2) the space geometry object has the spatial relationship feature.Be different from common big object, the operation of space geometry object generally has whole access (rather than the local access of single object, SubString operation as CLOB string) and the characteristics of spatial neighbor object while access (as the inquiry of windowing of routine), so have the space clustering storage and the unified requirements for access of geometric object value, and common LOB mechanism is not supported the space ordering of LOB value, and the unordered storage in the space between the object often brings extra I/O expense.
More than analyze as can be known, adopt conventional LOB mechanism access space geometric object to have unnecessary I/O expense, and I/O is the sensitive parameter (especially at the big Value Data of access) that influences database performance, so press at the spatial data feature, design data access method targetedly, with inquiry and the analysis efficiency that improves massive spatial data under the built-in pattern.
Summary of the invention
The technical problem to be solved in the present invention is: at based on the not high problem of conventional LOB mechanism access space geometric object I/O response efficiency, a kind of database space geometric object access method is proposed, space geometry feature and spatial relationship feature according to the space geometry object deposit the space geometry object value in, the unnecessary outer visit process of row when reducing data read as far as possible, and in the time must getting involved the outer visit of row, realize how improving and go the I/O efficient of outer data access.
The technical solution adopted for the present invention to solve the technical problems: a kind ofly deposit the method for space geometry object value in, it is characterized in that: comprise following steps to database:
(1) creates the database space table that comprises how much row;
The geometric properties of the space geometry object that will store according to the database space table is corresponding geometric data type with the column data type definition of how much row, as point, line, surface etc., and creates necessary index accessory structure simultaneously.
(2) the space geometry object instance of reception message mode extracts the capable internal indicator that space geometry eigenwert and initialization are listed as for how much, comprises following steps:
1. SDBMS receives the space geometry object value that modes such as Structured Query Language (SQL), programmatic access interface send, and it is pending to be converted to SDBMS internal logic expression structure from message format.
2. from the space geometry object instance, extract and conventional space querying and the closely-related geometrical characteristic set A of analysis operation (A 1, A 2..., A n) (n 〉=0), can comprise but be not limited only to minimum outsourcing rectangle, area, the girth of space geometry object.
3. initialization positioning pointer P, and associating geometrical characteristic set A, { A, P} can be referred to as how much and be listed as the row internal indicator materialization Storage Item in the row of how much row of formation.Wherein, positioning pointer P is mainly used in the canned data after the serializing of description geometric object, can comprise following subitem: and PLen, OBID, OBLen, flags}, wherein, PLen is the length overall of positioning pointer structure; OBID is used for unique identification space geometry object instance; OBLen is the length of geometric object serializing value; Flags is a storage mark, is used to identify as in the row of serializing value or the row external memory, information such as whether compress.
(3) calculate and be each space geometry object tax space order code, comprise following steps:
1. obtain area of space scope and four fens degree of depth n (n 〉=1) of current spatial table, choose a kind of space filling curve algorithm area of space scope under this table is carried out the graticule mesh coding, make each grid have unique code value M Ij(i representative row number, j representative row number).Wherein, the space filling curve algorithm can adopt but be not limited only to following method: Hilbert curve, Z overture line, Gray code, Morton coding etc.
2. according to the spatial distribution characteristic of space geometry object, to calculate the grid coding that obtains based on space filling curve and further be converted to object coding, thereby make the corresponding space ordering of each geometric object to be deposited code value (spatial sortingcode, SSC), be used for the follow-up blocking and aggregation index of setting up geometric object.
The method that grid coding further is converted to object coding is: for the point-like object, if it falls in some grids, and its space order code grid coding for this reason then; If it drops on the sideline of graticule mesh, appoint then that to get one be the grid coding on limit with this sideline.For wire, planar object, the overlapping relation of the quick budgetary estimate of minimum outsourcing rectangular characteristic value by object itself and graticule mesh, if minimum outsourcing rectangle falls in a certain grid fully, the space order code of object grid coding for this reason then, if it has occupied a plurality of grids, then get shared grid number at most, close on the grid coding of tree bottom most, and mending 0 thereafter, behind formation and the leaf node figure place same-code, with its space order code as this object.
(4) write capable internal indicator and the interior data of other row that geometry is listed as, comprise following steps:
1. the space geometry object further is converted to the serializing storage organization from the logical expression structure, forms the serializing value of physical store.The serializing value is the logical expression structure to be made data simplify, compress (if necessary), and carries out the result of fluidization treatment, and is relevant with specific implementation.
2. the serializing value of judging current geometric object adopts in the row that is listed as for how much or the row external memory.Space geometry feature according to threshold value and space geometry object in the row of how much given row, decision current sequence value adopts in the row or the row external memory, if promptly the current sequence value is less than or equal to threshold value in the given row, or corresponding spatial point type, then go stored; When the serializing value greater than given row in during threshold value, then this value is shifted out spatial table, and adopts the outer page of the given blocking and aggregation index organization method writing line of step (5).
3. according to the length of geometric object serializing value, the OBLen in the newline internal indicator more, and according in the row or row external memory, information such as whether compress fill in the flags sign, unite serializing value in the row (when adopting the row stored) at last and write the spatial table page in the lump.
(5) adopt the blocking and aggregation indexing means of geometric object to write the outer data of row that geometry is listed as, comprise following steps:
If 1. the row of current spatial table is worth storage organization outward and does not create, then create and be used to organize and outer secondary table value, related with the space master meter of storage line.As creating, then directly entered for following the 2. step.
2. the serializing value of current geometric object is decomposed into n (n 〉=1) data sub-block, the data sub-block size can not surpass the database page size, thereby to be convenient to sub-block identification be the part of database routine tuple.A tuple in the corresponding secondary table of each sub-piece, can comprise following attribute OBID, BLKID, SCC, BLKLen, flag, BLK}, wherein, OBID is used for the space geometry object instance that the unique identification current sub-block is belonged to; BLKID is the sequence number of current sub-block in the serializing value; SCC is the space order code (refer step (3)) of space geometry object instance under the current sub-block; BLKLen is the length of storage data in the current sub-block; Whether flag is a block mark, compress as blocks of data etc.; BLK is the sub-piece content of current data.
3. circulation writes each height piece and records secondary table, and organize as the gathering key of secondary table and store based on the SCC attribute of sub-piece, thereby form blocking and aggregation index organization table, realize of the mapping of the spatial neighbor of partitioned organization between object inside and the object to the physics gathering, the sub-piece SCC value that promptly belongs to same spatial object is identical, assemble the page (being the contiguous storages of these page physics) so write automatically, and the sub-piece SCC value of spatial neighbor object is contiguous, so write the gathering page equally automatically.
(6) establishment or renewal spatial index.
According to the minimum outsourcing rectangle of one of eigenwert in the geometric object row, create or the renewal spatial index, need not the extra access row and be worth outward.
Technical scheme of the present invention also comprises and a kind ofly reads the method for space geometry object value to database, it is characterized in that: comprise following steps:
(a), determine the type that reads of geometric object value according to the storage class of current spatial operation type and geometric object serializing value;
Read type and be divided into following three kinds:
Only visit in the row.For the spatial operation that only need obtain geometrical characteristic, as common spatial index create or upgrade operation, based on the arithmetic operation of area or girth etc., or required geometric object value is row during stored, reads value in the row of how much row designated space geometric object examples, and no longer access line is worth outward.
Postpone the outer visit of row.For needs capable in geometrical characteristic make the spatial operation of budgetary estimate, as spatial relationship decision operation such as common Intersects, Touches, Overlaps, then read the interior geometrical characteristic of row of how much row designated space geometric object examples earlier and do budgetary estimate, judge whether it satisfies the logical calculated demand:, then evade the outer value of access line and improve reading efficiency as satisfying; As not satisfying, then again according to outer value of positioning pointer P access line in the row and the whole object of instantiation.
Parallel outer visit in the row.Value in the row of how much row is read in the whole geometry object of operation need directly obtain to(for) geometric object editor, download etc., and the length of object own surpasses threshold value in the row earlier, is worth outward according to the further access line of positioning pointer P again.
(b) read value in the row of how much row designated space geometric object examples;
The read operation of which kind of type no matter, all must the row of how much row of visit in value, if but only be read as in the row visit or postpone the outer visit of row type, then directly return capable internal indicator and serializing value (in threshold value).
(c) if necessary, the row that reads how much row designated space geometric object examples again is worth outward;
Budgetary estimate does not satisfy the demands for the outer visit of delay row one-level, or execution is when visiting type outside walking abreast in the row, get the positioning pointer P of current how much column indicators, according to its OBID value of storing, find outer all of mating of row to assemble sub-piece, read this a little, and merge in order, thereby the whole serializing value that restores object is returned according to the BLKID attribute of sub-piece.
The advantage that the present invention is compared with prior art had is: one aspect of the present invention is at the importance of geometrical characteristic in logical operation of space geometry object, carried out the rapid extraction of geometrical characteristic in the stage that deposits in of geometric object, and be cached to by materialization in the row of how much row, realized the two-stage access process that traditional LOB mechanism is not available, the row of space geometry object interior and row is outer, thereby evade the unnecessary outer visit process of row in spatial index generation, the spatial relationship query script as far as possible, from improving the response efficiency of data read in logic; On the other hand, the characteristics that generally have whole access of single geometric object and the access simultaneously of spatial neighbor geometric object at spatial operation, the sub-piece that has carried out the serializing value outside how much row are gone in the ablation process of value decomposes and assembles ordering, realized of the gathering access of single geometric object, thereby further realized minimizing of how much row outer value I/O visits of row to a plurality of spatial neighbor geometric object piecemeal values.Hierarchical test result based on 1GB~20GB shows that the more traditional LOB access mechanism of this method space querying efficient on average improves about 25%~30%.
Description of drawings
Fig. 1 is the process flow diagram that database deposits the space geometry object value in;
Fig. 2 is the process flow diagram that database reads the space geometry object value;
Fig. 3 is spatial table institutional framework scheme (schema) synoptic diagram;
Fig. 4 is in the spatial table row and the outer institutional framework synoptic diagram of row;
Fig. 5 is that the space order code generates synoptic diagram;
Fig. 6 is the space querying result schematic diagram.
Embodiment
In conjunction with the inventive method, provide following examples: to spatial table T gHow much row (supposition row geom by name) deposit 4 geometric object G in 1={ POINT (1 2) }, G 2={ POLYGON (0 0.9,1.3 0.9,1.3 2,0 2) }, G 3={ LINESTRING (1.5 1,2.5 1,2.32.3) }, G 4={ POLYGON (2.8 1,3.6 1,3.6 1.8,2.8 1.8) }, and be that example reads with the typical space relational query, so that whole data access flow process to be described.
What the present invention proposed deposits the method for space geometry object value in to database, and its flow process comprises following steps as shown in Figure 1:
(1) creates the spatial table T that comprises how much row g
Establishment comprises the spatial table T of how much row gThe time, make up its accessory structure and incidence relation simultaneously, formative tissue organization plan: Schema g={ T b, T s, I Bs, R Bs, as shown in Figure 3.Wherein:
1. T b={ C 1, C 2..., C n, C g(n 〉=0), for comprising the master meter list structure of how much row, C iRepresent non-how much row, C gHow much row of expression, and hypothesis row geom by name.The field type of how much row is generally the defined geometric data type of database, as the given ST_Geometry type system of reference ISO SQL/MM-Spatial standard.In this example, suppose that row geom is the ST_Geometry type, can store dissimilar geometric datas such as point, line, surface.
2. I BsExpression is based upon T bTable C gThe space R tree index that lists is used for quickly positioning target geometric object record.
3. T s={ C i, C s, C h, C 1, C f, C v, be storage T bTable C gThe secondary table list structure example of the outer value of row row, a sub-piece record of its each tuple storage geometric object serializing value.Wherein: C iUnique identification for geometric object under the sub-piece; C sFor the sequence number of the sub-piece of current data in the whole sequence value, can unite C iSet up the unique index required serializing value of retrieval fast; C hBe the space order code of geometric object under the sub-piece, may be defined as solid long word symbol type; C 1The physical length of representing sub-blocks of data; C fThe expression state data memory; C vThe data value of representing sub-piece may be defined as the elongated byte type of designated length, in present embodiment, supposes that block length is 60 bytes (actual realize suggestion use bigger numerical to improve performances), and then type definition can be Varbyte (60).T sEach first group record master meter in a data sub-block in the particular space geometric object, both have identical C iValue.
4. I CsExpression is based upon T sTable C hThe B tree that lists assembles index, and shown in arrow among Fig. 3, the contiguous object map of index is to the contiguous sub-piece record of physics.
5. R BsExpression master meter T bWith secondary table T sCorresponding relation, can demarcate by naming rule or metadata.
(2) the space geometry object instance of reception message mode extracts space geometry eigenwert and initialization row internal indicator; Comprise following steps in conjunction with the embodiments:
1. with G 2Be inserted as example (other in like manner), suppose to carry out following SQL statement: " INSERT INTO Tg (geom) VALUES (' POLYGON (0 0.9,1.3 0.9,1.3 2,02) ') ", then SDBMS at first needs G 2From Message-text form ' POLYGON (0 0.9,1.3 0.9,1.3 2,02) ', resolve and be converted to internal representations structure g={P; Null; 1; (0,0.9) (1.3,0.9) (1.3,2) (0,2) }.Wherein g has adopted the Polygon structure type, and pseudodefinition is: Struct Polygon{type, srid, nrings, pointarray}, wherein, type writes down geometric type, srid writes down coordinate system, the number of nrings record polygon ring, and pointarray is the two-dimensional array of point set.
2. extract and conventional space querying and the closely-related geometric properties value set of analysis operation among the expression structure g internally, comprising: the minimum outsourcing rectangle A that calculates g m={ (0,0.9) (1.3,2) }, wherein (0,0.9) and (1.3,2) is respectively two of minimum outsourcing rectangle to angular coordinate; Girth A 1=4.8; Area A a=1.46.
3. initialization row internal indicator P={P a, P p, as shown in Figure 4, wherein: P a={ A m, A 1, A a, write down above geometric properties value set; P p={ P 1, P i, P t, P f, the record positioning pointer.Still be example with g, positioning pointer P pIn: P 1=16, expression positioning pointer length overall is 16 bytes; P i=21, expression G 2Unique identifier be 21; P t=0, i.e. G 2Not serializing as yet can't be determined data length overall after the serializing temporarily; P f=0, expression be the storage relevant information because this moment, storage mode was determined, represent with 0 equally.
(3) calculate and be each space geometry object tax space order code; Comprise following steps in conjunction with the embodiments:
1. to the regional extent H at g place eFour fens depth H are made in={ (0,0), (4,4) } d={ graticule mesh of 4} is divided, and adopts the Hilbert space filling curve that graticule mesh is encoded simultaneously, as shown in Figure 5.H eBe divided into 16 grids,, form 16 three grades of grid GT according to Hilbert space filling curve order 1, GT 2..., GT 16, 4 secondary grid GS 1, GS 2, GS 3, GS 4With 1 one-level grid GF 1GT wherein 1, GT 2, GT 3, GT 4Form secondary grid GS 1, i.e. GS 1={ GT 1, GT 2, GT 3, GT 4, GS in like manner 2={ GT 5, GT 6, GT 7, GT 8, GS 3={ GT 9, GT 10, GT 11, GT 12, GS 4={ GT 13, GT 14, GT 15, GT 16; GS 1, GS 2, GS 3, GS 4Form one-level grid F 1
2. calculate and to obtain g and three grades of grid T 1, T 2, T 3, T 4, secondary grid S 1With one-level grid F 1Intersect, g does not fall into any one three grades of grid fully, but has fallen into secondary grid S fully 1In, therefore with S 1Grid numbering as the space order code of g, because S 1Be the secondary grid, therefore need to mend 0, i.e. H={0100}.
(4) write capable internal indicator and the interior data of other row that geometry is listed as; Comprise following steps in conjunction with the embodiments:
1. g further is converted to serializing storage organization G s, as adopting the GeoSerl structure type, pseudodefinition is: StructGeoSerl{int size, unsigned char *Glob}, wherein, size is a glob serializing byte stream length overall, supposes for G 2Be 85 bytes; Glob is the byte stream first address, and the concrete form of byte stream is relevant with realization, and as adopting the WKB form of open space information association (OGC) standard, data are compressible etc., no longer launch.
2. threshold value is got K=50 byte (reality is generally greater than this value) in the row of hypothesis row geom, because g does not belong to the spatial point type, and therefore length adopt row external memory strategy greater than threshold k after the serializing.
3. upgrade positioning pointer P pMiddle P t=85, the data total length is 85 bytes after the expression serializing; Upgrade positioning pointer P pMiddle P f=2, the row external memory is adopted in expression; Indicator is carried out writing the master meter page as row stored item after the serializing.
(5) adopt the outer data of geometric object blocking and aggregation index organization method writing line; Comprise following steps in conjunction with the embodiments:
1. the secondary table T that is associated with master meter sCreate, directly be transferred to for the 2. step.
2. as shown in Figure 4, going outer data is stored into secondary table T sIn.Because definition of T in the step (1) sSub-block length be 60 bytes, and the serializing form G of g sIts length P tGreater than 60, so G sNeed be divided into a plurality of sub-pieces and store, be about to G sBe decomposed into length and be respectively two G of 60 and 25 S1And G S2, make up data sub-block store recording R respectively 1={ P i, N 1, H g, L 1, f 1, G S1And R 2={ P i, N 2, H g, L 2, f 2, G S2, wherein: P iThe=21st, G 2Unique identifier; N 1=1 and N 2=2 represent that respectively two sub-blocks of data are at G sIn sequence number be respectively 1 and 2; H g=0100 expression G 2The space order code; L 1=60 and L 2=25 expressions two sub-blocks of data physical lengths difference 60 and 25; f 1=1 and f 2=1 expression two sub-blocks of data do not compress; G S1And G S2Represent G respectively sThe serializing value.
3. with R 1And R 2With space ordering code value H gBe written to secondary table T for assembling key assignments sIn.
(6) upgrade spatial index;
According to the geometric object outsourcing frame A that calculates acquisition mValue is upgraded spatial index I Bs
In like manner deposit space geometry object G in 1, G 3And G 4
In conjunction with above embodiment, what further specify that the present invention proposes reads the method for space geometry object value to spatial database, and its flow process as shown in Figure 2.Suppose to carry out following SQL statement inquiry and read the space geometry object: " selectst_overlap (geometry; ' POLYGON (1.5 0.5,3 0.5,3 2) ') from Tg where geom mbrintersect (' RECT (0 0; 4 4) ') ", and note polygon G p={ (1.5,0.5) (3,0.5) (3,2) }, inquiry rectangle G r={ (0,0) (4,4) }.Resolve this query requests, this is that a typical space relation is judged inquiry, requires to judge at G rAll geometric objects and G in the spatial dimension pWhether there is the overlap relation, comprises following steps:
(a) by spatial index localizing objects geometric object;
At first carry out predicate operational character mbrintersect (outsourcing rectangle intersection), promptly by the space R tree index I that has set up Bs, filter out outsourcing rectangle and G rAll geometric objects that intersect, from Fig. 6 as seen, 4 geometric objects in the present embodiment will all be hit, and concern the candidate who judges as next step overlap.
(b), determine the type that reads of space geometry object value according to the storage class of current spatial operation type and geometric object serializing value;
For G 1, owing to be the spatial point type, its data are in all storage is expert at, and only need conduct interviews to data in the row and obtain geometric object and make spatial relationship and judge and get final product, belong to the interior access type of row.
For G with capable external memory 2, G 3And G 4, because the overlap analysis operation can carry out budgetary estimate based on the outsourcing rectangle in the row earlier, if necessary, remake accurate comparison, postpone the outer visit of row type so belong to.
(c) read value in the row of how much row designated space geometric object examples;
For G 1, directly read value in the row, and and G pMake the spatial relationship of overlap and judge, draw FALSE and return.
For G 2, at first, obtain G by reading eigenwert in the row 2Minimum outsourcing rectangle G 2m={ (0,0.9) (1.3,2) }, judgement can be learnt G fast 2mAnd G pThe spatial relationship that does not have overlap draws FALSE and returns, and no longer needs access line to be worth outward.
For G 3, at first, obtain G by reading eigenwert in the row 3Minimum outsourcing rectangle G 3m={ (1.5,1) (2.3,3) }, judgement can be learnt G fast 3mAnd G pTherefore the spatial relationship that has overlap need further be obtained the outer value of row and do accurately to judge.
For G 4, the same G of process 3, need further obtain the outer value of row and do accurately to judge.
(d) if necessary, the row that reads how much row designated space geometric object examples again is worth outward;
As shown in Figure 6, because G 3And G 4Be the spatial neighbor object, so in typical case, each data sub-block of the outer value of its row is in the gathering store status, promptly is gathered in the same page in this example.Like this, according to the object unique identification P in the positioning pointer i, can navigate to the outer page of row at sub-piece place fast by the unique index of being set up on the secondary table, and in the present embodiment, can be with reading of a secondary table page only taken place G 3And G 4The outer value of row read internal memory, and further the physical length L by sub-piece sequence number N and every reads out each piecemeal value G sDo to merge in order, form complete serializing value.At last, by the accurate comparison of overlap, the equal return true of result.
Analyze above example as seen, under conventional LOB mechanism, above query manipulation needs the outer data of access line 4 times, be that each read operation all needs correspondence to read the outer data of complete row, could judge the overlap relation of geometric object, simultaneously, though 4 geometric object spatial neighbors that read, but because the outer data of row do not adopt the blocking and aggregation memory mechanism, so the serializing value often is distributed in the different pages and is in disordered state (shown in Fig. 6 dotted arrow), thereby cause I/O number of the outer page of row to increase; And in this example, by distinguishing visit and the outer visit of delay row in the row, at first avoided the outer data access process of unnecessary row twice by reading the interior eigenwert of row, simultaneously, further store by the blocking and aggregation of the outer value of row, twice outer visit of row corresponded to 1 page I/O (shown in Fig. 6 solid arrow), thereby further improved the reading efficiency of data.The spatial relationship inquiry hierarchical test that carries out based on the data volume of 1GB~20GB shows that the more traditional LOB access mechanism of this method efficient on average improves about 25%~30%.

Claims (10)

1, a kind ofly deposit the method for space geometry object value in to database, it is characterized in that: this method comprises following steps:
(1) creates the database space table that comprises how much row;
(2) the space geometry object instance of reception message mode extracts the capable internal indicator that space geometry eigenwert and initialization are listed as for how much;
(3) calculate and be each space geometry object tax space order code;
(4) write capable internal indicator and the interior data of other row that geometry is listed as;
(5) adopt the blocking and aggregation indexing means of geometric object to write the outer data of row that geometry is listed as;
(6) establishment or renewal spatial index.
2, a kind of method that deposits the space geometry object value to database in as claimed in claim 1, it is characterized in that: the space geometry eigenwert of extracting in the described step (2), can comprise but be not limited only to minimum outsourcing rectangle, area, the girth of space geometry object, and associating positioning pointer P, constitute the interior materialization Storage Item of row that geometry is listed as.
3, as claimed in claim 1ly a kind ofly deposit the method for space geometry object value in to database, it is characterized in that: described step (3) is calculated and is composed the method for space order code for each space geometry object, comprises following steps:
(3.1) obtain area of space scope and four fens degree of depth of current spatial table, choose a kind of space filling curve algorithm area of space scope under this table is carried out the graticule mesh coding, make each grid have unique code value;
(3.2) according to the spatial distribution characteristic of space geometry object, to calculate the grid coding that obtains based on space filling curve and further be converted to object coding, thereby make the corresponding space ordering of each geometric object example to be deposited code value, be used for the follow-up blocking and aggregation index of setting up geometric object.
4, calculating as claimed in claim 3 and be the method that each space geometry object is composed the space order code, it is characterized in that: the method that in the described step (3.2) grid coding further is converted to object coding is: for the point-like object, if it falls in some grids, its space order code grid coding for this reason then; If it drops on the sideline of graticule mesh, appoint then that to get one be the grid coding on limit with this sideline; For wire and planar object, the overlapping relation of the quick budgetary estimate of minimum outsourcing rectangular characteristic value by object itself and graticule mesh, if minimum outsourcing rectangle falls in a certain grid fully, the space order code of object grid coding for this reason then is if it has occupied n grid, wherein n〉1, then get shared grid number at most, close on most the tree bottom grid coding, and mending 0 thereafter, behind formation and the leaf node figure place same-code, with its space order code as this object.
5, a kind of method that deposits the space geometry object value to database in as claimed in claim 1, it is characterized in that: in the described step (4), judge that according to threshold value and space geometry feature in the row of given how much row the serializing value of geometric object adopts in the row or the row external memory, if promptly the current sequence value is less than or equal to threshold value in the given row, or corresponding spatial point type, then go stored; When the serializing value greater than given row in during threshold value, then the serializing value is shifted out spatial table.
6, as claimed in claim 1ly a kind ofly deposit the method for space geometry object value in to database, it is characterized in that: described step (5) adopts the blocking and aggregation indexing means of geometric object to write the outer data of row of how much row, comprises following steps:
(6.1) if the row of current spatial table is worth storage organization outward not to be created, then establishment is used to organize and outer secondary table value, related with the space master meter of storage line; As creating, then directly enter following (6.2) step;
(6.2) the serializing value of current space geometry object instance is decomposed into m data sub-block, m 〉=1 wherein, each sub-block identification given space order code attribute in requirement 1 step (3) of having the right less than database page size;
(6.3) circulation writes each height piece and records secondary table, and organize as the gathering key of secondary table and store based on the space order code attribute of sub-piece, thereby form blocking and aggregation index organization table, realize of the mapping of the spatial neighbor of partitioned organization between object inside and the object to the physics gathering.
7, a kind of method that deposits the space geometry object value to database in as claimed in claim 1, it is characterized in that: described step (6) is according to the minimum outsourcing rectangle value of one of eigenwert in the geometric object row, create or the renewal spatial index, need not the extra access row and be worth outward.
8, a kind ofly read the method for space geometry object value to database, it is characterized in that: this method comprises following steps:
(a), determine the type that reads of geometric object value according to the storage class of spatial operation type and geometric object serializing value;
(b) read value in the row of how much row designated space geometric object examples;
(c) if necessary, the row that reads this geometric object example again is worth outward.
9, as claimed in claim 8ly a kind ofly read the method for space geometry object value to database, it is characterized in that: described step (a) has according to the type that reads of the storage class decision space geometric object example of spatial operation type and geometric object serializing value:
Only visit in the row: for the spatial operation that only need obtain geometrical characteristic, or required geometric object value is during for the row stored, reads value in the row of how much row designated space geometric object examples, and no longer access line is worth outward;
Postpone the outer visit of row: for needs capable in geometrical characteristic make the spatial operation of budgetary estimate, can adopt and postpone the outer visit of row, promptly read how much interior geometrical characteristics of row row earlier and do budgetary estimate, judge whether it satisfies the logical calculated demand:, then evade the outer value of access line and improve reading efficiency as satisfying; As not satisfying, then again according to outer value of positioning pointer P access line in the row and the whole object of instantiation.
Parallel outer visit in the row: the operation of directly obtaining the whole geometry object for needs, and the length of object own surpasses threshold value in the row, read value in the row of how much row earlier, be worth outward according to the further access line of positioning pointer P again.
10, a kind of method that reads the space geometry object value to database as claimed in claim 8, it is characterized in that: the methods that described step (c) reads the capable outer values of how much row designated space geometric object examples are: according to the positioning pointer P of current how much row row internal indicators find go mate in the outer secondary table all assemble sub-piece, read this a little, and the antithetical phrase piece merges in order, thereby the whole serializing value that restores object is returned.
CN2009100769287A 2009-01-14 2009-01-14 Method for storing space geometric objects to database Expired - Fee Related CN101520801B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009100769287A CN101520801B (en) 2009-01-14 2009-01-14 Method for storing space geometric objects to database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009100769287A CN101520801B (en) 2009-01-14 2009-01-14 Method for storing space geometric objects to database

Publications (2)

Publication Number Publication Date
CN101520801A true CN101520801A (en) 2009-09-02
CN101520801B CN101520801B (en) 2011-03-23

Family

ID=41081390

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009100769287A Expired - Fee Related CN101520801B (en) 2009-01-14 2009-01-14 Method for storing space geometric objects to database

Country Status (1)

Country Link
CN (1) CN101520801B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101882147A (en) * 2010-05-12 2010-11-10 北京航空航天大学 Curve data storage device and method
CN106156302A (en) * 2016-06-30 2016-11-23 上海达梦数据库有限公司 A kind of processing method and processing device of big field data
CN106796589A (en) * 2014-05-30 2017-05-31 湖北第二师范学院 The indexing means and system of spatial data object
CN108009265A (en) * 2017-12-15 2018-05-08 中国公路工程咨询集团有限公司 A kind of space data index method under cloud computing environment
CN108090150A (en) * 2017-12-11 2018-05-29 厦门亿力吉奥信息科技有限公司 GIS spatial objects storage method and its system
CN110019204A (en) * 2017-10-27 2019-07-16 航天信息股份有限公司 Method and apparatus are indexed inside split towards HDFS
CN111538735A (en) * 2020-07-08 2020-08-14 武大吉奥信息技术有限公司 Space data coding and querying method based on any database and electronic equipment
CN112347118A (en) * 2021-01-08 2021-02-09 阿里云计算有限公司 Data storage, query and generation method, database engine and storage medium
CN113342917A (en) * 2021-06-29 2021-09-03 维沃移动通信有限公司 Spatial position searching method and device, electronic equipment and storage medium

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101882147A (en) * 2010-05-12 2010-11-10 北京航空航天大学 Curve data storage device and method
CN101882147B (en) * 2010-05-12 2012-07-25 北京航空航天大学 Curve data storage device and method
CN106796589A (en) * 2014-05-30 2017-05-31 湖北第二师范学院 The indexing means and system of spatial data object
CN106796589B (en) * 2014-05-30 2021-01-15 湖北第二师范学院 Indexing method and system for spatial data object
CN106156302A (en) * 2016-06-30 2016-11-23 上海达梦数据库有限公司 A kind of processing method and processing device of big field data
CN106156302B (en) * 2016-06-30 2019-09-03 上海达梦数据库有限公司 A kind of processing method and processing device of big field data
CN110019204A (en) * 2017-10-27 2019-07-16 航天信息股份有限公司 Method and apparatus are indexed inside split towards HDFS
CN108090150A (en) * 2017-12-11 2018-05-29 厦门亿力吉奥信息科技有限公司 GIS spatial objects storage method and its system
CN108009265B (en) * 2017-12-15 2020-06-16 中国公路工程咨询集团有限公司 Spatial data indexing method in cloud computing environment
CN108009265A (en) * 2017-12-15 2018-05-08 中国公路工程咨询集团有限公司 A kind of space data index method under cloud computing environment
CN111538735A (en) * 2020-07-08 2020-08-14 武大吉奥信息技术有限公司 Space data coding and querying method based on any database and electronic equipment
CN112347118A (en) * 2021-01-08 2021-02-09 阿里云计算有限公司 Data storage, query and generation method, database engine and storage medium
CN113342917A (en) * 2021-06-29 2021-09-03 维沃移动通信有限公司 Spatial position searching method and device, electronic equipment and storage medium
CN113342917B (en) * 2021-06-29 2023-06-06 维沃移动通信有限公司 Spatial position searching method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN101520801B (en) 2011-03-23

Similar Documents

Publication Publication Date Title
CN101520801B (en) Method for storing space geometric objects to database
JP6032467B2 (en) Spatio-temporal data management system, spatio-temporal data management method, and program thereof
CN107402958B (en) Method for creating and accessing GKF three-dimensional spatial database
WO2020252799A1 (en) Parallel data access method and system for massive remote-sensing images
CN107423422B (en) Spatial data distributed storage and search method and system based on grid
CN113434623B (en) Fusion method based on multi-source heterogeneous space planning data
CN108536692B (en) Execution plan generation method and device and database server
US20210254995A1 (en) Methods, apparatuses, systems, and storage media for storing and loading visual localization maps
US8176053B2 (en) Query system for a hybrid voxel and feature database
CN112559481A (en) Data storage method and device based on distributed system and relational database
CN104685498A (en) Hardware implementation of the aggregation/group by operation: hash-table method
CN103970902A (en) Method and system for reliable and instant retrieval on situation of large quantities of data
CN101763416A (en) Method for accessing spatial grid object of database
US11995059B2 (en) Database index and database query processing method, apparatus, and device
CN104160398A (en) Structured large object (lob) data
CN104462351A (en) Data query model and method for MapReduce pattern
Min et al. A system framework for map air update navigation service
CN109815240A (en) For managing method, apparatus, equipment and the storage medium of index
CN109388659A (en) Date storage method, device and computer readable storage medium
CN115391307A (en) Database optimization method and device, electronic equipment and computer-readable storage medium
CN101266607A (en) High dimension data index method based on maximum clearance space mappings
Li et al. A Survey of Multi-Dimensional Indexes: Past and Future Trends
CN117608476A (en) Vector data block storage method and device, electronic equipment and medium
CN109213760A (en) The storage of high load business and search method of non-relation data storage
CN103810114A (en) Method and device for distributing storage space

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20110323

Termination date: 20180114