CN103064859A - Fast extensive makeup language (XML) analytic method based on variable memory pre-application and HASH - Google Patents
Fast extensive makeup language (XML) analytic method based on variable memory pre-application and HASH Download PDFInfo
- Publication number
- CN103064859A CN103064859A CN2011103240766A CN201110324076A CN103064859A CN 103064859 A CN103064859 A CN 103064859A CN 2011103240766 A CN2011103240766 A CN 2011103240766A CN 201110324076 A CN201110324076 A CN 201110324076A CN 103064859 A CN103064859 A CN 103064859A
- Authority
- CN
- China
- Prior art keywords
- node
- xml
- hash
- attribute
- document
- 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
Links
Images
Abstract
The invention discloses a fast extensive makeup language (XML) analytic method based on an variable memory pre-application and HASH. The fast XML analytic method comprises the steps of reading an XML document to Xml Content and generating a Xml Root Node of the Document, carrying out grammatical analysis to the Xml Content, analyzing the XML document, carrying out processing on different branches when the grammatical analysis indicates the classification of an analytical part, entering an iterative algorithm when the analysis result is a Node, storing a piece of Attribute information, carrying out relationship interlinkage of brother Attribute, carrying out interlinkage of a Node-Attribute relationship, and carrying out searching of any element node of the XML document. Through a variable pre-application memory algorithm, analytical speed of the XML is improved, so that an XML document can be located rapidly through the arrangement of a Hash index switch.
Description
Technical field
The present invention relates to a kind of analytic method, particularly relate to a kind of quick XML analytic method based on variable internal memory preliminery application and HASH.
Background technology
XML (Extensible Markup Language, extend markup language) but be that a cover uses the rigorous data of description language that simply formats of rule, be widely used for the form as interaction data between cross-platform, in XML document, label carries out nested tissue by the order of agreement, and document must meet the syntax gauge of XML.
, occurred immediately for the analytic technique of XML document, it is the process that the XML data is converted to hierarchical format from its serializing string format that XML resolves for this reason.Existing XML analytical tool has been realized the parsing storage of XML document, and to the read method of any label of XML document.Such as TinyXml, be that an XML that increases income that uses C Plus Plus to write resolves the storehouse, can in Windows or Linux, compile use, disclose one and overlapped the system and method for resolving and obtaining XML document information.
Wherein, described system principle is as follows: by the analyzing XML file, document decomposition is become the various elements of XML, and utilize ordinal relation and nested relation of inclusion between these elements of the tree-like representation of firstchild-nextsibling tree multi-fork, in internal memory, generate the DOM model, i.e. DOM Document Object Model, then, by the access to the DOM model, reach the purpose of obtaining XML document information.
TinyXml has mainly defined with lower class according to the various elements of XML: TiXmlBase: the public base class of whole TinyXML model; The base type of node elements in the TiXmlNode:DOM tree; TiXmlDocument: corresponding to an object of XML document integral body; TiXmlDeclaration: the object of corresponding XML statement part; TiXmlComment: the comment section in the corresponding XML document; TiXmlElement: corresponding to the common element object in the XML document, common element can have attribute, corresponding to TiXmlAttribute; TiXmlText: corresponding to the text message object in the element in the XML document.By above class, just can be by the whole DOM model of XML file generated.
There is following defective in existing XML analytic technique: at analyzing XML file, when generating the various element of DOM model, need it is carried out the dynamic assignment internal memory for each element.
This implementation method, especially when XML document larger, perhaps utilize when message is comparatively frequent between the system that XML document carries out, because frequently the slow defective of resolution file that causes of dynamic assigning memory just can expose.
On the other hand, existing XML analytic technique, when generating the DOM model tree, used the method that each node in the tree is preserved the pointer of its father node, the front and back brotgher of node, first and last child nodes of preserving, but, if when there is a large amount of different node element in XML document, read a certain node element information, can only be by traveling through from the beginning to the end the method for dom tree, rather than travel through fast with certain strategy.
Summary of the invention
Technical matters to be solved by this invention provides a kind of quick XML analytic method based on variable internal memory preliminery application and HASH, and it has improved the speed that XML resolves; Solved simultaneously in the audit memory tree and can only by the problem of full traversal, can locate fast by the Hash index so that use.
The present invention solves above-mentioned technical matters by following technical proposals: a kind of quick XML analytic method based on variable internal memory preliminery application and HASH, it is characterized in that, and this analytic method may further comprise the steps:
Step 1: read XML document to Xml Content, and generate the Xml Root Node node of Document;
Step 2: Xml Content is carried out grammatical analysis, analyzing XML file; The classification of part is resolved in the grammatical analysis indication, carries out the processing of different branches;
Step 3: if analysis result is Node, then can enter iterative algorithm, from preliminery application internal memory Static Node List, take out first node by Xml Free Node Linklist, deposit Node information, and carry out the link of father and son Node relation; Connection for the Node of brotherhood is processed, and uses the chained list mode related, if Hash index switch open is called key assignments according to its Node name simultaneously and uses Hash to link;
Step 4: if analysis result is Node subordinate's Attribute, then pass through Xml Free Attribute Linklist from preliminery application internal memory Static Attribute List, take out first node, deposit Attribute information, carry out the relational links of fraternal Attribute, and carry out the link of Node-Attribute relation;
Step 5: after the iterative algorithm by step 3, step 4, whole XML document has been mapped as the Document internal memory tree, on this basis, can carry out the inquiry of the arbitrary element node of XML document; If Hash index switch open is by the Hash indexed search; If Hash index switch cuts out, by Document tree traversal search.
Positive progressive effect of the present invention is: the present invention has improved the speed that XML resolves; Solved simultaneously in the audit memory tree and can only by the problem of full traversal, can locate fast by the Hash index so that use; When need are resolved new XML document, the internal memory tree of old XML document is not carried out internal memory discharge, but adopt the simple high efficiency method that empties the use state, so that the XML resolver possesses reusability.
Description of drawings
Fig. 1 is the process flow diagram that the present invention is based on the quick XML analytic method of variable internal memory preliminery application and HASH.
Embodiment
Provide preferred embodiment of the present invention below in conjunction with accompanying drawing, to describe technical scheme of the present invention in detail.
As shown in Figure 1, the quick XML analytic method that the present invention is based on variable internal memory preliminery application and HASH may further comprise the steps:
Step 1: read XML document to Xml Content, and generate the Xml Root Node node of Document.Each Xml Node node is made of following element: the name value information of Node node; The head and the tail child node; The brotgher of node; The front and back node that is used for url management; Attribute linked-list; And the Hash chained list that is used for fast query;
Step 2: Xml Content is carried out grammatical analysis, analyzing XML file; The classification of part is resolved in the grammatical analysis indication, carries out the processing of different branches;
Step 3: if analysis result is Node, then can enter iterative algorithm, by Xml Free Node Linklist from preliminery application internal memory Static Node List, (Xml Free Node Linklist is oriented to empty all preliminery application internal memories of sign and finishes using to take out first node, then dynamically apply for internal memory), deposit Node information, and carry out the link of father and son Node relation.Connection for the Node of brotherhood is processed, and uses the chained list mode related, if Hash index switch open is called key assignments according to its Node name simultaneously and uses Hash to link;
Step 4: if analysis result is Node subordinate's Attribute, then pass through Xml Free Attribute Linklist from preliminery application internal memory Static Attribute List, (Xml Free Attribute Linklist is oriented to empty all preliminery application internal memories of sign and finishes using to take out first node, then dynamically apply for internal memory), deposit Attribute information, carry out the relational links of fraternal Attribute, and carry out the link of Node-Attribute relation;
Step 5: after the iterative algorithm by step 3, step 4, whole XML document has been mapped as the Document internal memory tree, on this basis, can carry out the inquiry of the arbitrary element node of XML document.If Hash index switch open is by the Hash indexed search; If Hash index switch cuts out, by Document tree traversal search.
So far, parsing and Query XML document flow process finish.XML analytic method among the present invention can be resolved continuously to different XML document after initialization, in the dispose procedure to expired XML document, adopts the mode that empties the use state, and then resolves and inquire about next XML document with same flow process.
Although more than described the specific embodiment of the present invention, it will be understood by those of skill in the art that these only illustrate, under the prerequisite that does not deviate from principle of the present invention and essence, can make various changes or modifications to these embodiments.Therefore, protection scope of the present invention is limited by appended claims.
Claims (2)
1. the quick XML analytic method based on variable internal memory preliminery application and HASH is characterized in that, this analytic method may further comprise the steps:
Step 1: read XML document to Xml Content, and generate the Xml Root Node node of Document;
Step 2: Xml Content is carried out grammatical analysis, analyzing XML file; The classification of part is resolved in the grammatical analysis indication, carries out the processing of different branches;
Step 3: if analysis result is Node, then can enter iterative algorithm, from preliminery application internal memory Static Node List, take out first node by Xml Free Node Linklist, deposit Node information, and carry out the link of father and son Node relation; Connection for the Node of brotherhood is processed, and uses the chained list mode related, if Hash index switch open is called key assignments according to its Node name simultaneously and uses Hash to link;
Step 4: if analysis result is Node subordinate's Attribute, then pass through Xml Free Attribute Linklist from preliminery application internal memory Static Attribute List, take out first node, deposit Attribute information, carry out the relational links of fraternal Attribute, and carry out the link of Node-Attribute relation;
Step 5: after the iterative algorithm by step 3, step 4, whole XML document has been mapped as the Document internal memory tree, on this basis, can carry out the inquiry of the arbitrary element node of XML document; If Hash index switch open is by the Hash indexed search; If Hash index switch cuts out, by Document tree traversal search.
2. the quick XML analytic method based on variable internal memory preliminery application and HASH as claimed in claim 1, it is characterized in that, the preliminery application internal memory that described quick XML analytic method based on variable internal memory preliminery application and HASH is provided with Static Node List and two variable-size of Static Attribute List is used for depositing nodal information, possess Hash index switch, described each Xml Node node is made of following element: the name value information of Node node; The head and the tail child node; The brotgher of node; The front and back node that is used for url management; Attribute linked-list; And the Hash chained list that is used for fast query.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2011103240766A CN103064859A (en) | 2011-10-21 | 2011-10-21 | Fast extensive makeup language (XML) analytic method based on variable memory pre-application and HASH |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2011103240766A CN103064859A (en) | 2011-10-21 | 2011-10-21 | Fast extensive makeup language (XML) analytic method based on variable memory pre-application and HASH |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103064859A true CN103064859A (en) | 2013-04-24 |
Family
ID=48107489
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2011103240766A Pending CN103064859A (en) | 2011-10-21 | 2011-10-21 | Fast extensive makeup language (XML) analytic method based on variable memory pre-application and HASH |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103064859A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104951565A (en) * | 2015-07-10 | 2015-09-30 | 上海斐讯数据通信技术有限公司 | XML configuration maintenance method and system based on memory database |
CN107038148A (en) * | 2017-04-25 | 2017-08-11 | 大象慧云信息技术有限公司 | The analytic method and resolver of XML document |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040221229A1 (en) * | 2003-04-29 | 2004-11-04 | Hewlett-Packard Development Company, L.P. | Data structures related to documents, and querying such data structures |
US20080270345A1 (en) * | 2007-04-27 | 2008-10-30 | Jeff Barlow | System and method for using indexes to parse static XML documents |
CN101996252A (en) * | 2010-11-17 | 2011-03-30 | 浙江省电力试验研究院 | Expression method of indexing information for node element in XML (Extensive Makeup Language) file |
CN102033954A (en) * | 2010-12-24 | 2011-04-27 | 东北大学 | Full text retrieval inquiry index method for extensible markup language document in relational database |
-
2011
- 2011-10-21 CN CN2011103240766A patent/CN103064859A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040221229A1 (en) * | 2003-04-29 | 2004-11-04 | Hewlett-Packard Development Company, L.P. | Data structures related to documents, and querying such data structures |
US20080270345A1 (en) * | 2007-04-27 | 2008-10-30 | Jeff Barlow | System and method for using indexes to parse static XML documents |
CN101996252A (en) * | 2010-11-17 | 2011-03-30 | 浙江省电力试验研究院 | Expression method of indexing information for node element in XML (Extensive Makeup Language) file |
CN102033954A (en) * | 2010-12-24 | 2011-04-27 | 东北大学 | Full text retrieval inquiry index method for extensible markup language document in relational database |
Non-Patent Citations (1)
Title |
---|
张运嵩: "一种快速的非提取式XML解析器的设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104951565A (en) * | 2015-07-10 | 2015-09-30 | 上海斐讯数据通信技术有限公司 | XML configuration maintenance method and system based on memory database |
CN104951565B (en) * | 2015-07-10 | 2018-07-24 | 上海斐讯数据通信技术有限公司 | XM (extensible messaging client) L (extensible markup language) configuration maintenance method and system based on memory database |
CN107038148A (en) * | 2017-04-25 | 2017-08-11 | 大象慧云信息技术有限公司 | The analytic method and resolver of XML document |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Sevilla Ruiz et al. | Inferring versioned schemas from NoSQL databases and its applications | |
CN107491561B (en) | Ontology-based urban traffic heterogeneous data integration system and method | |
US7487174B2 (en) | Method for storing text annotations with associated type information in a structured data store | |
US20140074764A1 (en) | Simplifying a graph of correlation rules while preserving semantic coverage | |
CN106682147A (en) | Mass data based query method and device | |
Comyn-Wattiau et al. | Model driven reverse engineering of NoSQL property graph databases: The case of Neo4j | |
CN111078702B (en) | SQL sentence classification management and unified query method and device | |
CN112219199A (en) | Efficient use of TRIE data structures in databases | |
JP5152877B2 (en) | Document data storage method and apparatus in document base system | |
CN103123650B (en) | A kind of XML data storehouse full-text index method mapped based on integer | |
CN104035754A (en) | XML (Extensible Markup Language)-based custom code generation method and generator | |
JP7105982B2 (en) | Structured record retrieval | |
CN102982095B (en) | A kind of body automatic creation system based on thesaurus and method thereof | |
CN102810114A (en) | Personal computer resource management system based on body | |
Ramesh et al. | Data modelling for discrete time series data using Cassandra and MongoDB | |
CN105335366A (en) | SQL statement processing method and apparatus and server | |
US8745097B2 (en) | Efficient XML/XSD to owl converter | |
CN114218472A (en) | Intelligent search system based on knowledge graph | |
CN104462095B (en) | A kind of extracting method and device of query statement common portion | |
CN101916260A (en) | Method for establishing semantic mapping between disaster body and relational database | |
US10387493B2 (en) | Methods for converting an XML artifact into a topic map instance and devices thereof | |
CN111475534B (en) | Data query method and related equipment | |
CN103064859A (en) | Fast extensive makeup language (XML) analytic method based on variable memory pre-application and HASH | |
CN103902651A (en) | Cloud code query method and device based on MongoDB | |
Hsu et al. | UCIS-X: an updatable compact indexing scheme for efficient extensible markup language document updating and query evaluation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20130424 |