CN113157975A - Extensible markup language parsing system and method - Google Patents

Extensible markup language parsing system and method Download PDF

Info

Publication number
CN113157975A
CN113157975A CN202110454721.XA CN202110454721A CN113157975A CN 113157975 A CN113157975 A CN 113157975A CN 202110454721 A CN202110454721 A CN 202110454721A CN 113157975 A CN113157975 A CN 113157975A
Authority
CN
China
Prior art keywords
parsing
analysis
rule
content
analyzed
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
CN202110454721.XA
Other languages
Chinese (zh)
Other versions
CN113157975B (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.)
China Telecom Group Trade Union Shanghai Committee
Original Assignee
China Telecom Group Trade Union Shanghai Committee
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 China Telecom Group Trade Union Shanghai Committee filed Critical China Telecom Group Trade Union Shanghai Committee
Priority to CN202110454721.XA priority Critical patent/CN113157975B/en
Publication of CN113157975A publication Critical patent/CN113157975A/en
Application granted granted Critical
Publication of CN113157975B publication Critical patent/CN113157975B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/80Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
    • G06F16/84Mapping; Conversion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/16Time-division multiplex systems in which the time allocation to individual channels within a transmission cycle is variable, e.g. to accommodate varying complexity of signals, to vary number of channels transmitted
    • H04J3/1605Fixed allocated frame structures
    • H04J3/1652Optical Transport Network [OTN]

Abstract

The invention provides an extensible markup language parsing system and method, comprising: at least one preset analysis rule set; acquiring basic information of at least one network element management system connected with an adaptation layer and a storage path of an associated analysis rule set in advance; receiving a document which is sent by a network element management system and adopts an extensible markup language and acquiring basic information of the network element management system; obtaining a corresponding storage path according to the basic information matching and loading a corresponding analysis rule set; and reading the elements to be analyzed in the document in sequence, matching the analysis rules in a centralized manner by the analysis rules according to the obtained current path information of the elements to be analyzed for each element to be analyzed, and executing the corresponding rule content to analyze the elements to be analyzed to obtain the analysis content when the corresponding analysis rules are matched. The method has the advantages that the message difference and the network management interface version difference of each network element management system can be adapted through a set of analysis and configuration rules, and the operation and maintenance cost is greatly reduced.

Description

Extensible markup language parsing system and method
Technical Field
The present invention relates to the field of communications technologies, and in particular, to an extensible markup language parsing system and method.
Background
In the past, an optical transmission network adopts a multi-manufacturer hybrid network, an Operation Support System (OSS) on an upper layer of each operator lacks an effective end-to-end Management and control capability for the network, and the Management and control of the network basically depends on an EMS network Management System (Element Management System) of each manufacturer. Under the large background of cloud network convergence, manufacturers require an interface defined in a Web Service form development standard according to 'interface specification of network management acquisition control layer of China telecommunication transmission professional', and provide data foundation and capability guarantee for an operator upper OSS system to realize unified management and a business end-to-end model of a network under a multi-manufacturer mixed networking scene. However, the difference in the understanding of the manufacturers to the specifications causes the difference between the implementation of the specifications and the entry and exit of the interfaces of the manufacturers, and the iterative update of the specifications also causes the incompatibility of the network management software interface versions of the manufacturers.
For Java programming Language, data binding technologies such as Aegis, JAXB, SDO, XMLBeans and the like can be used, and specification description files such as XSD, WSDL and the like are used to generate Java codes, and XML is mapped to object attributes, but the data binding technologies can only bind XML (Extensible Markup Language) elements and object attributes one to one, and cannot process the binding of multiple irregular XML and object attributes, upper layer applications still need to adapt to the difference between different manufacturers and different network management versions, and if XSD or WSDL is not specified or version iterations are not compatible, multiple Java codes of different versions need to be generated. For deployed services, multiple versions of clients are required to be compatible with the server, thereby bringing difficulties in development and deployment of upper-layer application systems.
Disclosure of Invention
To solve the problems in the prior art, the present invention provides an xml parsing system configured in an adaptation layer of an optical transmission network, including:
the system comprises a first storage module, a second storage module and a third storage module, wherein the first storage module is used for storing at least one preset analysis rule set, the analysis rule set comprises a plurality of analysis rules, and each analysis rule comprises path information and corresponding rule content;
a second storage module, configured to store pre-acquired basic information of at least one network element management system connected to the adaptation layer, and a storage path of the parsing rule set of the network element management system corresponding to adaptation associated with the basic information;
the analysis module is respectively connected with the first storage module and the second storage module, and comprises:
a receiving unit, configured to receive a document in an extensible markup language sent by the network element management system, and obtain the basic information of the network element management system that sent the document;
the loading unit is connected with the receiving unit and used for obtaining the corresponding storage path according to the basic information matching and loading the corresponding analysis rule set from the first storage module according to the storage path;
and the analysis unit is respectively connected with the receiving unit and the loading unit and is used for sequentially reading the elements to be analyzed in the document, matching the analysis rules in the analysis rule set according to the obtained current path information of the elements to be analyzed for each element to be analyzed, and executing the corresponding rule content to analyze the elements to be analyzed to obtain the analysis content when the corresponding analysis rules are matched.
Preferably, the parsing rule set is configured to include:
a placeholder portion configured to store a placeholder for each of the parsing rules;
a prefix portion configured to store a common prefix of each of the parsing rules;
a rule content portion configured to store remaining content of each of the parsing rules excluding the placeholder and the universal prefix.
Preferably, the remaining content includes the node path from which the common prefix is removed and the rule content;
then, for each parsing rule, the parsing unit obtains the generic prefix and the node path without the generic prefix in the remaining content from the parsing rule set, and processes the node path to obtain the path information, so as to match the path information with the current path information.
Preferably, the rule content comprises a tag position mark and a parsing action, wherein the tag position mark comprises a starting tag position, a text tag position and an ending tag position;
the parsing unit includes:
the reading subunit is configured to, when the corresponding parsing rule is matched, read a declaration head at the start tag position in the rule content to obtain a data structure of the element to be parsed;
the first analysis subunit is connected with the reading subunit and is used for reading the text value of the element to be analyzed according to the text label position when the data structure is a hash table structure, and then processing the text value according to the analysis action associated with the end label position to obtain the analysis content of the element to be analyzed;
and the second analysis subunit is connected with the reading subunit and is used for reading the text value of the element to be analyzed according to the text label position when the data structure is a linked list structure, and then assigning the text value to an object field configured in advance in the rule content in a manner of splicing separators according to the analysis action associated with the end label position to serve as the analysis content.
Preferably, when the data structure is the hash table structure, the parsing action includes assigning the text value as the label to the object field according to a mapping relationship between the label and the object field defined in advance in the declaration header, or
Assigning the text value as the label and the key value of the data structure to the object field according to the mapping relation, or
Assigning the text value and the key value as the label to the object field according to the mapping relation, and when a history value exists in the object field, adding the text value and the key value after the history value, or
Converting the text value into a JSON character string and then assigning the JSON character string to the object field, or splicing the text values to form a character string and then assigning the character string to the object field, or
And assigning the text value to a preset field which is configured in advance in the rule content.
Preferably, the adaptation layer establishes a connection with the network element management system through an access address of the network element management system, and the receiving unit obtains the basic information of the network element management system that sends the document through the access address.
Preferably, the basic information includes a vendor identifier and a software version of the element management system.
Preferably, the parsing rule set is stored in the first storage module according to a hierarchical directory structure, where the hierarchical directory structure uses the manufacturer identifier as a first-layer directory and the software version as a second-layer directory.
The invention also provides an extensible markup language parsing method, which is applied to the extensible markup language parsing system, wherein at least one parsing rule set is pre-configured in the extensible markup language parsing system, the parsing rule set comprises a plurality of parsing rules, and each parsing rule comprises path information and corresponding rule content;
the extensible markup language parsing system is also configured with at least one pre-acquired basic information of the network element management system connected with the adaptation layer and a storage path of the parsing rule set of the network element management system corresponding to adaptation associated with the basic information;
the method for parsing the extensible markup language comprises the following steps:
step S1, the xml parsing system receives a document in xml sent by the element management system, and obtains the basic information of the element management system that sent the document;
step S2, the XML parsing system matches the basic information to obtain the corresponding storage path, and loads the corresponding parsing rule set according to the storage path;
step S3, the extensible markup language parsing system reads the elements to be parsed in the document in sequence as the current elements to be parsed;
step S4, for each current element to be parsed, the xml parsing system performs matching of the parsing rules in the parsing rule set according to the obtained current path information of the current element to be parsed, and whether the corresponding parsing rules are matched is determined:
if not, go to step S5;
if so, executing the corresponding rule content to analyze the current element to be analyzed to obtain an analysis content;
step S5, the xml parsing system determines whether all the elements to be parsed in the document are parsed:
if yes, quitting;
if not, taking the next element to be analyzed as the current element to be analyzed, and then returning to the step S4.
Preferably, the rule content comprises a tag position mark and a parsing action, wherein the tag position mark comprises a starting tag position, a text tag position and an ending tag position;
in step S4, the executing the parsing process of parsing the current element to be parsed by the corresponding rule content includes:
the extensible markup language parsing system reads a declaration head of the starting label position in the rule content to obtain a data structure of the element to be parsed;
when the data structure is a hash table structure, reading a text value of the element to be analyzed according to the text label position, and then processing the text value according to the analysis action associated with the end label position to obtain the analysis content of the element to be analyzed;
and when the data structure is a linked list structure, reading the text value of the element to be analyzed according to the text label position, and then assigning the text value to an object field configured in advance in the rule content in a separator splicing mode according to the analysis action associated with the end label position to serve as the analysis content.
The technical scheme has the following advantages or beneficial effects:
1) by configuring various analysis rules, the XML element content is mapped to the object field, so that various irregular XML structures are mapped to the same object structure, and the technical problem that the conventional data binding technology cannot handle the binding of various irregular XML and object attributes is solved;
2) the message difference and the network management interface version difference of each network element management system can be adapted through a set of analysis configuration rules, and only one set of adaptation layer software system needs to be deployed, so that the operation and maintenance cost is greatly reduced.
Drawings
FIG. 1 is a schematic diagram of an XML parsing system according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an XML parsing method according to a preferred embodiment of the present invention.
Detailed Description
The invention is described in detail below with reference to the figures and specific embodiments. The present invention is not limited to the embodiment, and other embodiments may be included in the scope of the present invention as long as the gist of the present invention is satisfied.
In a preferred embodiment of the present invention, based on the above problems in the prior art, there is provided an xml parsing system configured in an adaptation layer of an optical transmission network, as shown in fig. 1, including:
the first storage module 1 is used for storing at least one preset analysis rule set, wherein the analysis rule set comprises a plurality of analysis rules, and each analysis rule comprises path information and corresponding rule content;
the second storage module 2 is used for storing the basic information of at least one network element management system connected with the adaptation layer, which is acquired in advance, and a storage path of an analysis rule set of the network element management system corresponding to adaptation associated with the basic information;
analyze module 3, connect first storage module 1 and second storage module 2 respectively, analyze module 3 includes:
a receiving unit 31, configured to receive a document sent by a network element management system and using an extensible markup language, and obtain basic information of the network element management system that sends the document;
the loading unit 32 is connected to the receiving unit 31, and is configured to obtain a corresponding storage path according to the basic information matching, and load a corresponding parsing rule set from the first storage module according to the storage path;
the parsing unit 33 is connected to the receiving unit 31 and the loading unit 32, and configured to sequentially read the elements to be parsed in the document, perform, for each element to be parsed, matching parsing rules from a parsing rule set according to the obtained current path information of the element to be parsed, and execute corresponding rule contents to parse the element to be parsed to obtain parsing contents when the corresponding parsing rules are matched.
Specifically, in this embodiment, the parsing rule for parsing and adapting the XML document is preconfigured in each network element management system, and when the corresponding network element management system sends the XML document, the corresponding parsing rule can be loaded correspondingly for parsing to obtain the corresponding parsing content for the upper layer application to process and use, the message difference and the network management interface version difference of each network element management system can be adapted through one set of parsing and configuring rules, and only one set of parsing and configuring rules needs to be deployed in the adaptation layer software system, so that the operation and maintenance cost is greatly reduced.
Further specifically, different parsing rules may be needed for parsing by different element management systems, so that an adaptive parsing rule set needs to be matched first before parsing an XML document, which is a document using an extensible markup language and sent by an element management system, and the XML document is parsed according to each parsing rule in the parsing rule set. In this embodiment, by acquiring basic information of each network element management system accessed by the adaptation layer in advance, the basic information is bound and stored with a preconfigured parsing rule set, so as to provide support for subsequently matching the adapted parsing rule set.
Further, after the corresponding parsing rule set is obtained through matching, file content in the XML document may be read, one element in the XML document is read each time to serve as a current element to be parsed, a node path of the current element to be parsed is obtained at an initial mark position as current path information for the current element to be parsed, and then comparison is performed according to the current path information and path information corresponding to each parsing rule in the parsing rule set. Preferably, since not all the contents in the XML document are valid contents or required contents, when the parsing rule is configured, the parsing rule may not be configured for the invalid contents or the required contents, and when the path information is compared, there is a possibility that some elements may not match the path information, and the parsing rule of the element is not configured in the parsing rule set, and the element is considered to be the invalid contents or the required contents, in this case, the next element is directly skipped, and if the path information is matched, the corresponding parsing rule is obtained, and the element is analyzed according to the parsing rule while the element is considered to be the valid contents or the required contents, and the parsing efficiency is effectively improved by selectively parsing while the valid contents or the required contents are obtained, the parsing process of unnecessary content is omitted. And repeatedly executing the analysis process for each element to be analyzed in the XML document until the XML document is completely read, and then providing the analysis content for the upper application to be processed and used according to the requirement, so that the upper operation support system can realize the end-to-end management and control of the network.
In a preferred embodiment of the present invention, the parsing rule set is configured to include:
a placeholder portion configured to store a placeholder for each parsing rule;
a prefix portion configured to store a common prefix of each parsing rule;
and the rule content part is configured to store the residual content of each resolution rule after the placeholders and the universal prefixes are removed.
Specifically, in the embodiment, the placeholder and the universal prefix of the parsing rule are uniformly stored, so that the configuration is facilitated, and the writing and configuration operation is simplified.
In a preferred embodiment of the present invention, the remaining content includes a node path from which the common prefix is removed and rule content;
for each parsing rule, the parsing unit 33 obtains the generic prefix and the node path without the generic prefix in the remaining content from the parsing rule set, and processes the node path to obtain the path information, so as to match the path information with the current path information.
In a preferred embodiment of the present invention, the rule content includes a tag location label and a parsing action, the tag location label includes a start tag location, a text tag location, and an end tag location;
the parsing unit 33 includes:
the reading subunit 331, configured to, when the corresponding parsing rule is matched, read a declaration head at a start tag position in the rule content to obtain a data structure of the element to be parsed;
the first parsing subunit 332, connected to the reading subunit 331, configured to, when the data structure is a hash table structure, read a text value of the element to be parsed according to the text tag position, and then process the text value according to a parsing action associated with the end tag position to obtain a parsing content of the element to be parsed;
the second parsing subunit 333 is connected to the reading subunit 332, and configured to, when the data structure is a linked list structure, read a text value of an element to be parsed according to a text tag position, and then assign the text value to an object field configured in advance in the rule content in a manner of concatenating delimiters according to a parsing action associated with an end tag position as parsing content.
In a preferred embodiment of the present invention, when the data structure is a hash table structure, the parsing action includes assigning a text value as a label to the object field according to a mapping relation between the label and the object field defined in advance in the declaration header, or
Assigning the text value as the label and the key value of the data structure to the object field according to the mapping relation, or
Assigning the text value and the key value as the label to the object field according to the mapping relation, and when a history value exists in the object field, adding the text value and the key value to the history value, or
Converting the text value into JSON character string and assigning to object field, or
Splicing the text values to form a character string and then assigning the character string to an object field, or
And assigning the text value to a preset field which is configured in advance in the rule content.
Specifically, in this embodiment, the parsing action may be implemented by a corresponding action function, where assigning a text value serving as a label to an object field according to a mapping relationship between the label and the object field defined in advance in a declaration header may be implemented by a mapping function; assigning the text value as the label and the key value of the data structure to the object field according to the mapping relation can be realized through a mappingWithKey function; assigning the text value and the key value as the label to the object field according to the mapping relation, and when a historical value exists in the object field, adding the text value and the key value to the historical value and then realizing the function of mappingappendinwithkey; the text value is converted into a JSON character string and then assigned to the object field, and the assignment can be realized through a JSON function; splicing the text values to form a character string and then assigning the character string to the object field can be realized through an appngwithkey function; assigning the text value to a preset field pre-configured in the rule content can be realized through a map function.
In a preferred embodiment of the present invention, the adaptation layer establishes a connection with the network element management system through the access address of the network element management system, and the receiving unit obtains the basic information of the network element management system that sends the document through the access address.
In a preferred embodiment of the invention, the basic information comprises a vendor identification and a software version of the element management system.
In a preferred embodiment of the present invention, the set of parsing rules is stored in the first storage module according to a hierarchical directory structure, where the hierarchical directory structure uses the manufacturer identifier as a first-level directory and the software version as a second-level directory.
Specifically, in this embodiment, the manufacturer identifier includes hua is and zhongxing as an example, where the first-layer directory is hua is and zhongxing, the second-layer directory includes version 1 and version 2, if the network element management system that sends the XML document is the manufacturer and is version 2, the storage path of the corresponding parsing rule set is hua is and hua is corresponding version 2, and the parsing unit may locate the parsing rule set according to the storage path, and further parse the XML document according to the parsing rule set.
The invention also provides an extensible markup language parsing method, which is applied to the extensible markup language parsing system, wherein at least one parsing rule set is pre-configured in the extensible markup language parsing system, the parsing rule set comprises a plurality of parsing rules, and each parsing rule comprises path information and corresponding rule content;
the extensible markup language parsing system is also configured with at least one piece of basic information of the network element management system connected with the adaptation layer, which is acquired in advance, and a storage path of a parsing rule set of the network element management system corresponding to adaptation associated with the basic information;
as shown in fig. 2, the method for parsing xml includes:
step S1, the extensible markup language parsing system receives the document which is sent by the network element management system and adopts extensible markup language, and obtains the basic information of the network element management system which sends the document;
step S2, the extensible markup language parsing system matches the basic information to obtain a corresponding storage path, and loads a corresponding parsing rule set according to the storage path;
step S3, the extensible markup language parsing system reads the elements to be parsed in the document in sequence as the current elements to be parsed;
step S4, aiming at each current element to be analyzed, the extensible markup language analysis system matches the analysis rules in the analysis rule set according to the obtained current path information of the current element to be analyzed, and whether the corresponding analysis rules are matched is judged:
if not, go to step S5;
if so, executing corresponding rule content to analyze the current element to be analyzed to obtain analysis content;
step S5, the XML parsing system determines whether all the elements to be parsed in the document are parsed:
if yes, quitting;
if not, the next element to be resolved is taken as the current element to be resolved, and then the process returns to step S4.
In a preferred embodiment of the present invention, the rule content includes a tag location label and a parsing action, the tag location label includes a start tag location, a text tag location, and an end tag location;
in step S4, the process of executing the corresponding rule content to parse the current element to be parsed includes:
reading a declaration head of a starting label position in the rule content by the extensible markup language parsing system to obtain a data structure of an element to be parsed;
when the data structure is a hash table structure, reading a text value of the element to be analyzed according to the position of a text label, and then processing the text value according to an analysis action associated with the position of an end label to obtain analysis content of the element to be analyzed;
and when the data structure is a linked list structure, reading the text value of the element to be analyzed according to the position of the text label, and then assigning the text value to a pre-configured object field in the rule content in a manner of splicing separators according to the analysis action associated with the position of the ending label to be used as analysis content.
While the invention has been described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention.

Claims (10)

1. An XML parsing system configured at an adaptation layer of an optical transport network, comprising:
the system comprises a first storage module, a second storage module and a third storage module, wherein the first storage module is used for storing at least one preset analysis rule set, the analysis rule set comprises a plurality of analysis rules, and each analysis rule comprises path information and corresponding rule content;
a second storage module, configured to store pre-acquired basic information of at least one network element management system connected to the adaptation layer, and a storage path of the parsing rule set of the network element management system corresponding to adaptation associated with the basic information;
the analysis module is respectively connected with the first storage module and the second storage module, and comprises:
a receiving unit, configured to receive a document in an extensible markup language sent by the network element management system, and obtain the basic information of the network element management system that sent the document;
the loading unit is connected with the receiving unit and used for obtaining the corresponding storage path according to the basic information matching and loading the corresponding analysis rule set from the first storage module according to the storage path;
and the analysis unit is respectively connected with the receiving unit and the loading unit and is used for sequentially reading the elements to be analyzed in the document, matching the analysis rules in the analysis rule set according to the obtained current path information of the elements to be analyzed for each element to be analyzed, and executing the corresponding rule content to analyze the elements to be analyzed to obtain the analysis content when the corresponding analysis rules are matched.
2. The extensible markup language parsing system according to claim 1 wherein said parsing rule set is configured to comprise:
a placeholder portion configured to store a placeholder for each of the parsing rules;
a prefix portion configured to store a common prefix of each of the parsing rules;
a rule content portion configured to store remaining content of each of the parsing rules excluding the placeholder and the universal prefix.
3. The XML parsing system of claim 2, wherein the remaining content includes a node path from which the common prefix is removed and the rule content;
then, for each parsing rule, the parsing unit obtains the generic prefix and the node path without the generic prefix in the remaining content from the parsing rule set, and processes the node path to obtain the path information, so as to match the path information with the current path information.
4. The XML parsing system of claim 1, wherein the rule content comprises a tag location label comprising a start tag location, a text tag location, and an end tag location, and a parsing action;
the parsing unit includes:
the reading subunit is configured to, when the corresponding parsing rule is matched, read a declaration head at the start tag position in the rule content to obtain a data structure of the element to be parsed;
the first analysis subunit is connected with the reading subunit and is used for reading the text value of the element to be analyzed according to the text label position when the data structure is a hash table structure, and then processing the text value according to the analysis action associated with the end label position to obtain the analysis content of the element to be analyzed;
and the second analysis subunit is connected with the reading subunit and is used for reading the text value of the element to be analyzed according to the text label position when the data structure is a linked list structure, and then assigning the text value to an object field configured in advance in the rule content in a manner of splicing separators according to the analysis action associated with the end label position to serve as the analysis content.
5. The XML parsing system of claim 4, wherein when the data structure is the hash table structure, the parsing action comprises assigning the text value as the label to the object field according to a predefined mapping relationship between the label and the object field in the declaration header, or
Assigning the text value as the label and the key value of the data structure to the object field according to the mapping relation, or
Assigning the text value and the key value as the label to the object field according to the mapping relation, and when a history value exists in the object field, adding the text value and the key value after the history value, or
Converting the text value into JSON character string and assigning to the object field, or
Splicing the text values to form a character string and then assigning the character string to the object field, or
And assigning the text value to a preset field which is configured in advance in the rule content.
6. The xml parsing system of claim 1, wherein the adaptation layer establishes a connection with the element management system through an access address of the element management system, and the receiving unit obtains the basic information of the element management system that sent the document through the access address.
7. The XML parsing system of claim 6, wherein said basic information comprises vendor identification and software version of said element management system.
8. The XML parsing system of claim 7, wherein said parsing rule set is stored in said first storage module according to a hierarchical directory structure, said hierarchical directory structure having said vendor identification as a first level directory and said software version as said second level directory.
9. An extensible markup language parsing method applied to the extensible markup language parsing system according to any one of claims 1 to 8, wherein at least one parsing rule set is preconfigured in the extensible markup language parsing system, the parsing rule set includes a plurality of parsing rules, and each parsing rule includes path information and corresponding rule content;
the extensible markup language parsing system is also configured with at least one pre-acquired basic information of the network element management system connected with the adaptation layer and a storage path of the parsing rule set of the network element management system corresponding to adaptation associated with the basic information;
the method for parsing the extensible markup language comprises the following steps:
step S1, the xml parsing system receives a document in xml sent by the element management system, and obtains the basic information of the element management system that sent the document;
step S2, the XML parsing system matches the basic information to obtain the corresponding storage path, and loads the corresponding parsing rule set according to the storage path;
step S3, the extensible markup language parsing system reads the elements to be parsed in the document in sequence as the current elements to be parsed;
step S4, for each current element to be parsed, the xml parsing system performs matching of the parsing rules in the parsing rule set according to the obtained current path information of the current element to be parsed, and whether the corresponding parsing rules are matched is determined:
if not, go to step S5;
if so, executing the corresponding rule content to analyze the current element to be analyzed to obtain an analysis content;
step S5, the xml parsing system determines whether all the elements to be parsed in the document are parsed:
if yes, quitting;
if not, taking the next element to be analyzed as the current element to be analyzed, and then returning to the step S4.
10. The XML parsing method of claim 9, wherein said rule content comprises tag location tags including a start tag location, a text tag location, and an end tag location, and parsing action;
in step S4, the executing the parsing process of parsing the current element to be parsed by the corresponding rule content includes:
the extensible markup language parsing system reads a declaration head of the starting label position in the rule content to obtain a data structure of the element to be parsed;
when the data structure is a hash table structure, reading a text value of the element to be analyzed according to the text label position, and then processing the text value according to the analysis action associated with the end label position to obtain the analysis content of the element to be analyzed;
and when the data structure is a linked list structure, reading the text value of the element to be analyzed according to the text label position, and then assigning the text value to an object field configured in advance in the rule content in a separator splicing mode according to the analysis action associated with the end label position to serve as the analysis content.
CN202110454721.XA 2021-04-26 2021-04-26 Extensible markup language parsing system and method Active CN113157975B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110454721.XA CN113157975B (en) 2021-04-26 2021-04-26 Extensible markup language parsing system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110454721.XA CN113157975B (en) 2021-04-26 2021-04-26 Extensible markup language parsing system and method

Publications (2)

Publication Number Publication Date
CN113157975A true CN113157975A (en) 2021-07-23
CN113157975B CN113157975B (en) 2022-12-13

Family

ID=76870970

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110454721.XA Active CN113157975B (en) 2021-04-26 2021-04-26 Extensible markup language parsing system and method

Country Status (1)

Country Link
CN (1) CN113157975B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113687832A (en) * 2021-10-27 2021-11-23 上海捷勃特机器人有限公司 Robot program storage and compiling method
CN116610679A (en) * 2023-07-17 2023-08-18 金锐同创(北京)科技股份有限公司 json data analysis method, json data analysis device, computer equipment and computer medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101055578A (en) * 2006-04-12 2007-10-17 龙搜(北京)科技有限公司 File content dredger based on rule
US20100042973A1 (en) * 2008-08-12 2010-02-18 Sun Microsystems, Inc. Method for analyzing an xacml policy
CN111104557A (en) * 2019-11-22 2020-05-05 黄琴 Heterogeneous document processing system and method based on standard document markup language specification

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101055578A (en) * 2006-04-12 2007-10-17 龙搜(北京)科技有限公司 File content dredger based on rule
US20100042973A1 (en) * 2008-08-12 2010-02-18 Sun Microsystems, Inc. Method for analyzing an xacml policy
CN111104557A (en) * 2019-11-22 2020-05-05 黄琴 Heterogeneous document processing system and method based on standard document markup language specification

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113687832A (en) * 2021-10-27 2021-11-23 上海捷勃特机器人有限公司 Robot program storage and compiling method
CN113687832B (en) * 2021-10-27 2022-03-04 上海捷勃特机器人有限公司 Robot program storage and compiling method
CN116610679A (en) * 2023-07-17 2023-08-18 金锐同创(北京)科技股份有限公司 json data analysis method, json data analysis device, computer equipment and computer medium
CN116610679B (en) * 2023-07-17 2023-10-17 金锐同创(北京)科技股份有限公司 json data analysis method, json data analysis device, computer equipment and computer medium

Also Published As

Publication number Publication date
CN113157975B (en) 2022-12-13

Similar Documents

Publication Publication Date Title
CN102185900B (en) Application service platform system and method for developing application services
US8458467B2 (en) Method and apparatus for adaptive application message payload content transformation in a network infrastructure element
US7526769B2 (en) Message translation and parsing of data structures in a distributed component architecture
CN113157975B (en) Extensible markup language parsing system and method
US8219664B2 (en) Defining nodes in device management system
CN102447585B (en) Method and device for converting network configuration protocol response message into command line
CN102413022B (en) Application debugging method and system
KR101495341B1 (en) Method and System for assigning IDs to software compoents
CN109670081B (en) Method and device for processing service request
EP1563408A1 (en) Method and device for defining objects allowing to establish a device management tree for mobile communication devices
CN105554169B (en) OID configuration and analysis method, ORS client, OID node and database thereof
CN107632875B (en) E-commerce interface integration method, system, computer equipment and readable storage medium
CN113014406B (en) Equipment deployment method, device, server and storage medium
CN1716960B (en) Methods and devices for generating XML expressed management transactions that include an XPATH expression
CN112988409A (en) Interface calling method and device, computer equipment and storage medium
EP1709548B1 (en) Defining nodes in device management system
CN108804711A (en) A kind of method, apparatus and computer readable storage medium of data processing
CN108737347B (en) Data communication method, device and equipment
CA2559642A1 (en) Devices, systems and methods for network device conversion
EP2134032A1 (en) Method, system and device for managing customer premises equipment
CN111338685A (en) Common component configuration method, device, equipment and storage medium
CN202077062U (en) Application service platform system
US20040015780A1 (en) Position-independent access to data elements in an electronic document
CN111708828A (en) Tagged data management method, device, equipment and computer readable storage medium
CN117319186A (en) Automatic network policy opening system and method for container group

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant