CN105138524A - Method and apparatus for creating document node path index and server - Google Patents

Method and apparatus for creating document node path index and server Download PDF

Info

Publication number
CN105138524A
CN105138524A CN201410240776.0A CN201410240776A CN105138524A CN 105138524 A CN105138524 A CN 105138524A CN 201410240776 A CN201410240776 A CN 201410240776A CN 105138524 A CN105138524 A CN 105138524A
Authority
CN
China
Prior art keywords
node
path
document
indexing
section point
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201410240776.0A
Other languages
Chinese (zh)
Inventor
彭川
李�浩
王博
邓光超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Peking University Founder Information Industry Group Co Ltd
Original Assignee
Peking University Founder Information Industry Group 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 Peking University Founder Information Industry Group Co Ltd filed Critical Peking University Founder Information Industry Group Co Ltd
Priority to CN201410240776.0A priority Critical patent/CN105138524A/en
Publication of CN105138524A publication Critical patent/CN105138524A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

The invention provides a method and apparatus for creating a document node path index and a server. The method comprises: obtaining a to-be-processed document, wherein the document comprises a first node identifier required to establish a path index and a first node path identifier used for establishing the path index of a node corresponding to the first node identifier; and according to the obtained first node identifier and first node path identifier, creating the path index of the node corresponding to the first node identifier. According to the method and apparatus for creating the document node path index and the server, it is not required that the path index is created for the node in each path of the document of an XMLDBMS, so that the storage space of the XMLDBMS is saved.

Description

A kind of method, device and server creating document node path indexing
Technical field
The present invention relates to database field, particularly relate to a kind of method, device and the server that create document node path indexing.
Background technology
XML data base management system (XMLDBMS) is in recent years fast-developing a kind of novel data base management system (DBMS) (DBMS), and it stores and the data of retrieval are XML document.As document database, certain node in the Query XML document that user can be a large amount of under certain paths is gone forward side by side line operate.Conveniently user's inquiry, needs the path indexing all creating arbitrary node on every paths in XML document.
The deficiencies in the prior art part is: all need to the every paths in XML document the path indexing creating each node, can cause great waste to the storage space of XMLDBMS.
Summary of the invention
For overcoming above-mentioned defect, the invention provides a kind of method, device and the server that create document node path indexing.
First aspect, the embodiment of the present invention provides a kind of method creating document node path indexing, and described method comprises:
Obtain pending document, wherein, described document comprises the first node mark needing to set up path indexing and the first node ID of trace route path identifying the path indexing of corresponding node for setting up described first node;
According to the described first node mark got and described first node ID of trace route path, create the path indexing of described first node mark corresponding node.
Preferably, described document also comprises document identification, and described method also comprises:
Store described document identification and the corresponding node path index for inquiring about.
Preferably, described method also comprises:
Obtain the update request of document path indexing, wherein, described update request comprises the Section Point mark of built vertical path indexing in document corresponding to document identification, described document identification and the Section Point ID of trace route path for the path indexing that upgrades described Section Point mark corresponding node;
According to the described Section Point mark got and described Section Point ID of trace route path, create the path indexing of described Section Point mark corresponding node.
Preferably, described method also comprises:
Delete the node path index corresponding to described document identification.
Second aspect, the embodiment of the present invention provides a kind of device creating document node path indexing, and described device comprises:
First acquisition module, for obtaining pending document, wherein, described document comprises the first node mark needing to set up path indexing and the first node ID of trace route path identifying the path indexing of corresponding node for setting up described first node;
First processing module, for according to the described first node mark got and described first node ID of trace route path, creates the path indexing of described first node mark corresponding node.
Preferably, described document also comprises document identification, and described device also comprises:
Memory module, for storing described document identification and the corresponding node path index for inquiring about.
Preferably, described device also comprises:
Second acquisition module, for obtaining the update request of document path indexing, wherein, described update request comprises the Section Point mark of built vertical path indexing in document corresponding to document identification, described document identification and the Section Point ID of trace route path for the path indexing that upgrades described Section Point mark corresponding node;
Second processing module, for according to the described Section Point mark got and described Section Point ID of trace route path, creates the path indexing of described Section Point mark corresponding node.
Preferably, described device also comprises:
Removing module, for deleting the node path index corresponding to described document identification.
The third aspect, the embodiment of the present invention provides a kind of server, and described server comprises the device of above-mentioned establishment document node path indexing.
The method of the establishment document node path indexing that the embodiment of the present invention provides, device and server, need to set up the first node mark of path indexing by obtaining pending document and identify the first node ID of trace route path of the path indexing of corresponding node for setting up described first node, and the path indexing of node corresponding to described first node mark is set up according to first node ID of trace route path, without the need to every paths of the document at XMLDBMS all to Make Path index to node, save the storage space of XMLDBMS.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 represents the process flow diagram of the method creating document node path indexing.
Fig. 2 represents the schematic diagram of the device creating document node path indexing.
Embodiment
For making the object of the embodiment of the present invention, technical scheme and advantage clearly, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
As shown in Figure 1, described method comprises a kind of process flow diagram creating the method for document node path indexing:
Step 100. obtains pending document, and wherein, described document comprises the first node mark needing to set up path indexing and the first node ID of trace route path identifying the path indexing of corresponding node for setting up described first node;
Step 101., according to the described first node mark got and described first node ID of trace route path, creates the path indexing of described first node mark corresponding node.
By description above, set up the path indexing of node corresponding to described first node mark according to first node ID of trace route path, without the need to every paths of the document at XMLDBMS all to Make Path index to node.
The method of the establishment document node path indexing that the present embodiment provides can be used for user in digital library and retrieves books, the place that the user that also can be used for website retrieves information.
Such as, have 3 nodes in certain XML document, respectively with a, b, c mark, wherein, a is father's node of b, and b is father's node of c, and corresponding node path is a, a/b, a/b/c respectively.According to the mode of existing establishment XML document node path index, on these three node paths of a, a/b, a/b/c, all index can be established.And present way is user's specified path, index is set up in the path of specifying, such as user specifies on the a/b of path and sets up index, and that creates index on a/b path, and a, a/b/c do not create; Compared with the mode of existing establishment XML document node path index, save the storage space of the XMLDBMS of 66%.And, according to user-defined node path, its node path index is set up to the node element met in XML document on user-defined path, more meets the demand of user.
In existing establishment XML document node path Index process, owing to being the path indexing all needing to create each node to the every paths in XML document, so the path indexing of each node need not be stored, also just any operation can not be carried out to the searching route of established document.
In the present embodiment, described document also comprises document identification, and described method also comprises:
Store described document identification and the corresponding node path index for inquiring about.
By aforesaid operations, store document identification and corresponding node path index, so that the follow-up searching route to document of user operates, improve the Experience Degree of user.
Existing establishment XML document node path index is owing to being the path indexing all needing to create each node to the every paths in XML document, so application dumb, and can not set up index according to the demand of user, cause defect very slow when loading document.
In the present embodiment, described method also comprises:
Obtain the update request of document path indexing, wherein, described update request comprises the Section Point mark of built vertical path indexing in document corresponding to document identification, described document identification and the Section Point ID of trace route path for the path indexing that upgrades described Section Point mark corresponding node;
According to the described Section Point mark got and described Section Point ID of trace route path, create the path indexing of described Section Point mark corresponding node.
Further, described method also comprises:
Delete the node path index corresponding to described document identification.
Pass through aforesaid operations, according to user-defined node path, its node path index is set up to the node met in XML document on user-defined path, renewal rewards theory can be carried out to the path indexing of document flexibly, more meet the demand of user, the speed loading document can be accelerated; And, user does not set up index to the node element of certain paths in XML document when interpolation document, and in the operation of user below, create such demand, at this moment user can by order this paths dynamically in XML document increasing, revising, delete its node path index.Compare former way, have more dirigibility and dynamic.
To be embodiment be further described the method creating document node path indexing by following.
The another embodiment creating the method for document node path indexing comprises the steps:
Step 1, interpolation XML document, and when interpolation document, specify in the path indexing which node path in this XML document being set up node, one or more node path can be specified.If not specified node path, namely represent and do not need the node element in this XML document sets up node path, acquiescence is not specified node path;
Step 2, analyzing XML file, obtain the node element of an XML document;
Step 3, verify that whether the node path of this node element is the path needing to set up node path index that user specifies when adding document.If so, then on this node element, the flag needing to set up this node path index is set to TRUE, otherwise, be set to FALSE;
Step 4, by storage engines, this node is stored on disk, when depositing, judges whether the node path index that will create this node element according to the value the need of the flag setting up node path index on this node element.
Further, be further described according to the method for implementation to the establishment document node path indexing that the present embodiment describes of the establishment of the node path index of an XML document, deletion, renewal, reconstruction four kinds operation below:
1. create
Time in a newly-increased XML document to XMLDBMS, according to document node and the node element data of common mode storing X ML document.After the order of interpolation XML document, specify a parameter, and specify to need to set up index on which node path of the document by user.Default value on the node path of the document added, does not set up index.If user specifies the parameter that needs to set up index and give the path values needing the index adding node path, then at XMLDBMS when parse documents, often parse a node element, when then the node element parsed being inserted in node table, whether storage engines will set up the path indexing of node on this record to tell at this moment to a mark.Meanwhile, the node path concordance list in the metadata table of system road adds corresponding record.
When user adds document with the default value whether setting up the path indexing of node time, user does not set up the path indexing of corresponding node in the document added in other words.Then, in user's inquiry afterwards, there is the demand needing to set up path indexing in the document added, for this situation, we still can add the index on the node path of specifying dynamically, by sweeping each node element in node storage list, find the node element needing to set up node path index, the zone bit whether setting up node path index is set, and then inserts in node table.And do not need the node element setting up node path concordance list, directly insert node storage list.Same, need the node path concordance list in the metadata table of system road to add corresponding record.
2. delete
When deleting the index of the node path of document, user specifies to delete which document, the node path on which paths.First XMLDBMS can carry out query node path indexing table according to the path of the given document id of user and node.Check it is whether the user of the document path of specifying has node path index.If no, then can user one feedback be given.If had, then can remove node table according to the path that user is given, by all node elements that node path search index goes out under this path, then reinserting in node table, telling that when inserting storage engines does not set up its node path index on this record.
Meanwhile, the system table of Maintenance Point path indexing also will do corresponding renewal rewards theory.
3. rebuild
When node table has renewal rewards theory, when inserting or delete a node element, at this moment need to rebuild the index on node path.Concrete operations are each nodes swept in node table, inquire about in node path concordance list again and set up index the need of on the path of this node element, if needed, tell that storage engines needs the node element under this path is set up its path indexing, if do not needed, then directly this node element is inserted in node table.
By the description of above-mentioned two embodiments, the method of the establishment document node path indexing that the application provides, need to set up the first node mark of path indexing by obtaining pending document and identify the first node ID of trace route path of the path indexing of corresponding node for setting up described first node, and the path indexing of node corresponding to described first node mark is set up according to first node ID of trace route path, without the need to every paths of the document at XMLDBMS all to Make Path index to node, save the storage space of XMLDBMS.
As shown in Figure 2, described device comprises a kind of structural drawing creating the device of document node path indexing:
First acquisition module 10, for obtaining pending document, wherein, described document comprises the first node mark needing to set up path indexing and the first node ID of trace route path identifying the path indexing of corresponding node for setting up described first node;
First processing module 20, for according to the described first node mark got and described first node ID of trace route path, creates the path indexing of described first node mark corresponding node.
Further, described document also comprises document identification, and described device also comprises:
Memory module, for storing described document identification and the corresponding node path index for inquiring about.
Further, described device also comprises:
Second acquisition module, for obtaining the update request of document path indexing, wherein, described update request comprises the Section Point mark of built vertical path indexing in document corresponding to document identification, described document identification and the Section Point ID of trace route path for the path indexing that upgrades described Section Point mark corresponding node;
Second processing module, for according to the described Section Point mark got and described Section Point ID of trace route path, creates the path indexing of described Section Point mark corresponding node.
Further, described device also comprises:
Removing module, for deleting the node path index corresponding to described document identification.
Also propose a kind of server in this enforcement, described server comprises the device of above-mentioned establishment document node path indexing.
The device of establishment document node path indexing provided in the present embodiment and the function of server and treatment scheme, see the flow process of the embodiment of the method for the establishment document node path indexing provided above, can repeat no more herein.
By the description of above-described embodiment, the device of the establishment document node path indexing that the application provides and server, need to set up the first node mark of path indexing by obtaining pending document and identify the first node ID of trace route path of the path indexing of corresponding node for setting up described first node, and the path indexing of node corresponding to described first node mark is set up according to first node ID of trace route path, without the need to every paths of the document at XMLDBMS all to Make Path index to node, save the storage space of XMLDBMS.
One of ordinary skill in the art will appreciate that: all or part of step realizing said method embodiment can have been come by the hardware that programmed instruction is relevant.Aforesaid program can be stored in a computer read/write memory medium.This program, when performing, performs the step comprising above-mentioned each embodiment of the method; And aforesaid storage medium comprises: ROM, RAM, magnetic disc or CD etc. various can be program code stored medium.
Last it is noted that above each embodiment is only in order to illustrate technical scheme of the present invention, be not intended to limit; Although with reference to foregoing embodiments to invention has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein some or all of technical characteristic; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the scope of various embodiments of the present invention technical scheme.

Claims (9)

1. create a method for document node path indexing, it is characterized in that, described method comprises:
Obtain pending document, wherein, described document comprises the first node mark needing to set up path indexing and the first node ID of trace route path identifying the path indexing of corresponding node for setting up described first node;
According to the described first node mark got and described first node ID of trace route path, create the path indexing of described first node mark corresponding node.
2. the method for establishment document node path indexing according to claim 1, it is characterized in that, described document also comprises document identification, and described method also comprises:
Store described document identification and the corresponding node path index for inquiring about.
3. the method for establishment document node path indexing according to claim 2, it is characterized in that, described method also comprises:
Obtain the update request of document path indexing, wherein, described update request comprises the Section Point mark of built vertical path indexing in document corresponding to document identification, described document identification and the Section Point ID of trace route path for the path indexing that upgrades described Section Point mark corresponding node;
According to the described Section Point mark got and described Section Point ID of trace route path, create the path indexing of described Section Point mark corresponding node.
4. the method for establishment document node path indexing according to claim 3, it is characterized in that, described method also comprises:
Delete the node path index corresponding to described document identification.
5. create a device for document node path indexing, it is characterized in that, described device comprises:
First acquisition module, for obtaining pending document, wherein, described document comprises the first node mark needing to set up path indexing and the first node ID of trace route path identifying the path indexing of corresponding node for setting up described first node;
First processing module, for according to the described first node mark got and described first node ID of trace route path, creates the path indexing of described first node mark corresponding node.
6. the device of establishment document node path indexing according to claim 5, it is characterized in that, described document also comprises document identification, and described device also comprises:
Memory module, for storing described document identification and the corresponding node path index for inquiring about.
7. the device of establishment document node path indexing according to claim 6, it is characterized in that, described device also comprises:
Second acquisition module, for obtaining the update request of document path indexing, wherein, described update request comprises the Section Point mark of built vertical path indexing in document corresponding to document identification, described document identification and the Section Point ID of trace route path for the path indexing that upgrades described Section Point mark corresponding node;
Second processing module, for according to the described Section Point mark got and described Section Point ID of trace route path, creates the path indexing of described Section Point mark corresponding node.
8. the device of establishment document node path indexing according to claim 7, it is characterized in that, described device also comprises:
Removing module, for deleting the node path index corresponding to described document identification.
9. a server, is characterized in that, described server comprises the device of the establishment document node path indexing described in claim 5-8.
CN201410240776.0A 2014-05-30 2014-05-30 Method and apparatus for creating document node path index and server Pending CN105138524A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410240776.0A CN105138524A (en) 2014-05-30 2014-05-30 Method and apparatus for creating document node path index and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410240776.0A CN105138524A (en) 2014-05-30 2014-05-30 Method and apparatus for creating document node path index and server

Publications (1)

Publication Number Publication Date
CN105138524A true CN105138524A (en) 2015-12-09

Family

ID=54723875

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410240776.0A Pending CN105138524A (en) 2014-05-30 2014-05-30 Method and apparatus for creating document node path index and server

Country Status (1)

Country Link
CN (1) CN105138524A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107783776A (en) * 2016-08-26 2018-03-09 阿里巴巴集团控股有限公司 The processing method and processing device of firmware upgrade bag, electronic equipment
WO2018176174A1 (en) * 2017-04-01 2018-10-04 福建福昕软件开发股份有限公司 Method for feeding back interconnected document

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101661481A (en) * 2008-08-29 2010-03-03 国际商业机器公司 XML data storing method, method and device thereof for executing XML query
CN101887458A (en) * 2010-07-06 2010-11-17 江苏大学 Path coding-based XML document index method
CN102768674A (en) * 2012-06-12 2012-11-07 上海方正数字出版技术有限公司 XML (Extensive markup language) data storage method based on route structure

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101661481A (en) * 2008-08-29 2010-03-03 国际商业机器公司 XML data storing method, method and device thereof for executing XML query
CN101887458A (en) * 2010-07-06 2010-11-17 江苏大学 Path coding-based XML document index method
CN102768674A (en) * 2012-06-12 2012-11-07 上海方正数字出版技术有限公司 XML (Extensive markup language) data storage method based on route structure

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107783776A (en) * 2016-08-26 2018-03-09 阿里巴巴集团控股有限公司 The processing method and processing device of firmware upgrade bag, electronic equipment
CN107783776B (en) * 2016-08-26 2021-10-15 斑马智行网络(香港)有限公司 Processing method and device of firmware upgrade package and electronic equipment
WO2018176174A1 (en) * 2017-04-01 2018-10-04 福建福昕软件开发股份有限公司 Method for feeding back interconnected document

Similar Documents

Publication Publication Date Title
CN104794123A (en) Method and device for establishing NoSQL database index for semi-structured data
CN105069033A (en) Method and device for creating database table model
CN108614837B (en) File storage and retrieval method and device
CN105868421A (en) Data management method and data management device
CN102725755A (en) Method and system of file access
CN105205053A (en) Method and system for analyzing database incremental logs
CN104715039A (en) Column-based storage and research method and equipment based on hard disk and internal storage
CN108470040B (en) Method and device for warehousing unstructured data
CN105808538A (en) Method and device for generating mobile report form
CN105760184A (en) Method and device for loading component
CN109739828B (en) Data processing method and device and computer readable storage medium
CN106649412B (en) Data processing method and equipment
CN104615594A (en) Data updating method and device
CN105447172A (en) Data processing method and system under Hadoop platform
CN104424219A (en) Method and equipment of managing data documents
CN111726249B (en) Configuration file processing method and device of network equipment
CN105677805A (en) Data storing and reading method and device using protobuf
US10769105B2 (en) Modifying Lucene index file
CN104699815A (en) Data processing method and system
CN102360359A (en) Data management device and data management method
CN104408128A (en) Read optimization method for asynchronously updating indexes based on B+ tree
CN105138524A (en) Method and apparatus for creating document node path index and server
CN103678041A (en) Incremental backup method and system
CN111176901B (en) HDFS deleted file recovery method, terminal device and storage medium
CN102955808A (en) Data acquisition method and distributed file system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20151209

WD01 Invention patent application deemed withdrawn after publication