CN115599955A - XML message processing method and device - Google Patents

XML message processing method and device Download PDF

Info

Publication number
CN115599955A
CN115599955A CN202211233482.6A CN202211233482A CN115599955A CN 115599955 A CN115599955 A CN 115599955A CN 202211233482 A CN202211233482 A CN 202211233482A CN 115599955 A CN115599955 A CN 115599955A
Authority
CN
China
Prior art keywords
message
xml
field
xml message
path
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
CN202211233482.6A
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.)
Bank of China Ltd
Original Assignee
Bank of China 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 Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202211233482.6A priority Critical patent/CN115599955A/en
Publication of CN115599955A publication Critical patent/CN115599955A/en
Pending legal-status Critical Current

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
    • 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/81Indexing, e.g. XML tags; Data structures therefor; Storage structures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses an XML message processing method and device, relating to the technical field of big data, wherein the method comprises the following steps: reading an XML message stored in a database, and determining the message type and the message standard of the XML message; configuring a set of contained logic fields for each message standard of each message type of the XML message; the logical field corresponds to a leaf node of the XML message and is used for storing the information of the leaf node; the logic field is associated with the XML message through a path; after receiving the XML message, acquiring a logic field and a path of the logic field contained in the XML message according to the message type and the message standard of the XML message, searching the information of the leaf node of the XML message according to the path of the logic field, analyzing the information of the leaf node of the XML message into the corresponding logic field, and storing the XML object of the leaf node in the logic field. The invention can improve the message analysis efficiency and reduce the system complexity.

Description

XML message processing method and device
Technical Field
The invention relates to the technical field of big data, in particular to an XML message processing method and device.
Background
This section is intended to provide a background or context to the embodiments of the invention that are recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
As SWIFT and the global major local clearing message standards are gradually transitioning to ISO20022 standards, payment systems need to support various types of ISO20022 XML messages, as well as different versions and different standards of the same type of message.
At present, for the parsing of the XML message, the XML message is mainly parsed into a DOM object or an SAX object by a DOM parsing or an SAX parsing method, and then is processed by hard coding. In this way, different message formats need repeated coding, the development efficiency is low, and the system complexity is high. Or, the XML Schema is compiled into a Java class, and the XML message is operated and processed through a Java object. In this way, different standards of each message type need to be compiled into jar packets respectively, and the repeatability is high.
Disclosure of Invention
The embodiment of the invention provides an XML message processing method, which is used for realizing the unified configuration and analysis processing of XML messages, improving the processing efficiency of the XML messages and reducing the processing complexity of the XML messages, and comprises the following steps:
reading an XML message stored in a database, and determining the message type and the message standard of the XML message;
configuring a set of contained logic fields for each message standard of each message type of the XML message; the logic field corresponds to a leaf node of the XML message and is used for storing information of the leaf node; the logic field is associated with the XML message through a path; leaf nodes with the same service meaning in different message types correspond to the same logic field;
after receiving the XML message, acquiring a logic field and a path of the logic field contained in the XML message according to the message type and the message standard of the XML message, searching the information of the leaf node of the XML message according to the path of the logic field, analyzing the information of the leaf node of the XML message into the corresponding logic field, and storing the XML object of the leaf node in the logic field.
The embodiment of the present invention further provides an XML message processing apparatus, configured to implement unified configuration and parsing processing on an XML message, improve processing efficiency of the XML message, and reduce processing complexity of the XML message, where the apparatus includes:
the reading module is used for reading the XML message stored in the database and determining the message type and the message standard of the XML message;
the configuration module is used for configuring a set of contained logic fields for each message standard of each message type of the XML message; the logic field corresponds to a leaf node of the XML message and is used for storing information of the leaf node; the logic field is associated with the XML message through a path; leaf nodes with the same service meaning in different message types correspond to the same logic field;
the analysis module is used for acquiring the logic field and the path of the logic field contained in the XML message according to the message type and the message standard of the XML message after receiving the XML message, searching the information of the leaf node of the XML message according to the path of the logic field, analyzing the information of the leaf node of the XML message into the corresponding logic field, and storing the XML object of the leaf node in the logic field.
The embodiment of the invention also provides computer equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the XML message processing method when executing the computer program.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the XML message processing method is implemented.
The embodiment of the present invention further provides a computer program product, where the computer program product includes a computer program, and when the computer program is executed by a processor, the XML message processing method is implemented.
In the embodiment of the invention, the XML message stored in the database is read, and the message type and the message standard of the XML message are determined; configuring a set of contained logic fields for each message standard of each message type of the XML message; the logic field corresponds to a leaf node of the XML message and is used for storing information of the leaf node; associating the logic field with the XML message through a path; leaf nodes with the same service meaning in different message types correspond to the same logic field; after receiving the XML message, acquiring a logic field and a path of the logic field contained in the XML message according to the message type and the message standard of the XML message, searching the information of the leaf node of the XML message according to the path of the logic field, analyzing the information of the leaf node of the XML message into the corresponding logic field, and storing the XML object of the leaf node in the logic field; compared with the prior art, the method comprises the steps of configuring a set of contained logic fields according to each message standard of each message type of the XML message; after receiving the XML message, the XML message is analyzed and processed by using the logic fields contained in the XML message, so that the uniform configuration and analysis processing of the XML message can be realized, the message can be analyzed quickly and efficiently, the complexity of a system is reduced, the code repeatability is reduced, and the development efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. In the drawings:
FIG. 1 is a flow chart of a method for processing XML messages according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a process of initializing a packet type according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating an exemplary process of parsing a packet according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating a new message type configuration method according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of an XML message processing apparatus according to an embodiment of the present invention;
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention.
According to the technical scheme, the data acquisition, storage, use, processing and the like meet the relevant regulations of national laws and regulations.
The term "and/or" herein merely describes an associative relationship, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of a, B, C, and may mean including any one or more elements selected from the group consisting of a, B, and C.
In the description of the present specification, the terms "comprising," "including," "having," "containing," and the like are used in an open-ended fashion, i.e., to mean including but not limited to. Reference to the description of the terms "one embodiment," "a particular embodiment," "some embodiments," "for example," etc., means that a particular feature, structure, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. The sequence of steps involved in the embodiments is for illustrative purposes to illustrate the implementation of the present application, and the sequence of steps is not limited and can be adjusted as needed.
In order to solve the technical problems in the prior art, the invention provides an XML message processing method, which realizes the unified processing of various types of XML messages, can improve the processing efficiency of the XML messages and reduce the processing complexity of the XML messages. Fig. 1 is a flowchart of an XML message processing method in an embodiment of the present invention, and as shown in fig. 1, the method includes the following steps:
step 101: reading an XML message stored in a database, and determining the message type and the message standard of the XML message;
step 102: configuring a set of contained logic fields for each message standard of each message type of the XML message; the logic field corresponds to a leaf node of the XML message and is used for storing information of the leaf node; the logic field is associated with the XML message through a path; leaf nodes with the same service meaning in different message types correspond to the same logic field;
step 103: after receiving the XML message, acquiring a logical field and a path of the logical field contained in the XML message according to the message type and the message standard of the XML message, searching the information of the leaf node of the XML message according to the path of the logical field, analyzing the information of the leaf node of the XML message into the corresponding logical field, and storing the XML object of the leaf node in the logical field.
As can be seen from the flow shown in fig. 1, in the embodiment of the present invention, a set of included logical fields is configured for each packet standard of each packet type of an XML packet; after receiving the XML message, the XML message is analyzed and processed by using the logic field contained in the XML message, so that the uniform configuration and analysis processing of the XML message can be realized, the message can be analyzed quickly and efficiently, the system complexity is reduced, the code repeatability is reduced, and the development efficiency is improved.
In specific implementation, the XML message stored in the database can be read, and the message type and the message standard of the XML message are determined; configuring a set of contained logic fields for each message standard of each message type of the XML message; the logic field corresponds to a leaf node of the XML message and is used for storing information of the leaf node; the logic field is associated with the XML message through a path; leaf nodes with the same service meaning in different message types correspond to the same logic field. In the embodiment, a data storage mode taking the logical fields as carriers is constructed, and the XML message is converted into a set of the logical fields. For each standard of each message type, all the logical fields it contains are configured.
In an embodiment, all message types may be configured, including a namespace, a version number, and a corresponding xsd format file. And configuring a logic field contained in each message standard of each message type and a path XPath of the field in the message standard of the message type. Initializing all message types and compiling an xsd file.
In an embodiment, after reading the XML packet stored in the database, the method may further include: and (3) putting the XML message into a memory HashMap, compiling xsd files of all message types by a complieXsd method of XMLBeans, and generating a schema TypeLoader for processing and analyzing the XML message.
Fig. 2 is a diagram illustrating an example of a process of initializing a packet type in an embodiment of the present invention, and as shown in fig. 2, in this example, the process of initializing a packet type includes:
step 201: acquiring all message types from a database;
step 202: creating objects of all message types, and putting the objects into a HashMap memory;
step 203: and compiling xsd files of all message types by a composeXsd method of XMLBeans to generate a schema typeLoader for message processing and analysis.
In specific implementation, after receiving the XML message, the logic field and the path of the logic field included in the XML message are obtained according to the message type and the message standard of the XML message, the information of the leaf node of the XML message is searched according to the path of the logic field, the information of the leaf node of the XML message is analyzed to the corresponding logic field, and the XML object of the leaf node is stored in the logic field.
In an embodiment, after receiving the XML message, acquiring a logical field and a path of the logical field included in the XML according to the message type and the message standard of the XML message may include: after receiving the XML message, determining the message type and the message standard of the XML message according to the name space of the XML message; and acquiring the logic field contained in the XML and the path of the logic field from the HashMap in the memory according to the message type and the message standard of the XML message.
In an embodiment, infinispan cache may be used, loaded at system start-up. Wherein, the logic field cache: the logical field is used as the basis for message analysis and processing, is frequently used and is therefore placed in the cache. This may improve system processing efficiency. Logical field path caching: and with the message type and the message version number as key values, putting the XPath of all the logic fields into a cache, and conveniently acquiring all the fields of the current message from the cache during message analysis and processing.
Fig. 3 is an exemplary diagram of a message parsing process in an embodiment of the present invention, and as shown in fig. 3, the message parsing process in this embodiment includes:
step 301: determining the type, version and standard of the message according to the name space of the message;
step 302: acquiring a message object from the HashMap;
step 303: acquiring all logic fields and paths from a cache according to the message type and the version number;
step 304: traversing all the logic fields, and searching elements in the XML message through cursor traversal of XMLBeans and an Xpath select function according to the path Xpath;
step 305: analyzing the searched element content to a logic field, and storing an XML object of the current element node in the logic field;
step 306: and finishing the processing of all the logic fields, and converting the XML message into a logic field collection.
In an embodiment, associating the logical field with the XML packet passing path may include: the logic field is associated with the XML message through a path XPath; and subsequently searching the information of the leaf node of the XML message according to the path of the logic field, wherein the information comprises the following steps: and searching the information of the leaf node of the XML message according to the path XPath of the logic field through a cursor mode of the XMLBeans.
XMLBeans provides a method for processing XML messages through schema. Different java classes are generated by compiling schema (. Xsd). And XMLBeans binds the java class and the XML document instance. Thus, XMLBeans automatically generates java class (jar packet) for modifying access operation of XML message according to XML schema. Through the class in the jar packet, the operations of reading the content, packaging the content into an object, verifying, inquiring, adding, modifying, deleting an XML document object and the like can be completed according to the schema.
XMLBeans also provides a way to traverse an XML message, manipulate and modify it, via a cursor (XML cursor).
XMLBeans has the following characteristics:
1) And automatically generating a mapped java object structure through an XML schema based on a java object mechanism.
2) The relationship between the java objects is completely consistent with the element relationship corresponding to the XML schema.
3) XMLBeans provides a set of APIs to accomplish the manipulation and modification of mapped objects, and thus, the manipulation and modification of XML messages.
4) Accessing XMLBeans is convenient and fast.
In an embodiment, a logic field table, a logic field path table and a message type table may be stored in a database; the logic field table is used for configuring the attribute of the logic field; the logic field path table is used for configuring the path of the logic field; the message type table is used for configuring message types. For example, the logical field table configures attributes of the logical field, including field ID, field type, field data type, field parent, etc. The logical field path table configures XPath paths of all logical fields of a certain message type and version, including message type, version, field path, field tag and the like. The message type table configures all message types, including message type names, name spaces, xsd file positions, and the like.
In the embodiment, when a new message type exists, configuring the information of the message type in a message type table; if the message type has a corresponding new logical field, configuring the attribute of the new logical field in a configuration field table, and configuring the path of the new logical field in a logical field path table.
Fig. 4 is a flowchart illustrating a new packet type configuration method according to an embodiment of the present invention, where as shown in fig. 4, the new packet type configuration method in this embodiment includes:
step 401: when a system needs to support a new message type, configuring information such as a name space, xsd and the like of the message type in a message type table;
step 402: if the message type has a new logic field, configuring the message type in a logic field table;
step 403: all fields and paths of the message type are configured in the logical field path table.
As can be seen from the above embodiments, in the embodiments of the present invention, for a new packet type, the database configures the packet type table, the logical field table, and the logical field path table, and the system can support the analysis and processing of the packet type after being restarted. The system receives an XML message, acquires all logic fields and field XPath paths of the message according to the type, version and complied message standard of the message, then searches the message according to the field path, and analyzes the message content to the logic fields. And converting the XML message into a logic field collection. The logical field stores XML objects of XML message element nodes, subsequent message processing is performed through the logical field, and the operations of assignment, modification, deletion and the like of the logical field are reflected in the XML message through the XML objects.
The embodiment of the invention realizes the uniform analysis and uniform processing of the XML message based on the XMLBeans technology and the logic field storage structure. Meanwhile, the new version and the new standard of the message can be supported only by the configuration mode of the database, so that frequent code modification is avoided, and the complexity of the system is reduced.
According to the technical scheme, the data acquisition, storage, use, processing and the like meet relevant regulations of national laws and regulations.
The embodiment of the invention also provides an XML message processing device, as described in the following embodiments. Because the principle of solving the problem of the device is similar to the XML message processing method, the implementation of the device can refer to the implementation of the XML message processing method, and repeated parts are not described again.
Fig. 5 is a schematic diagram of an XML message processing apparatus according to an embodiment of the present invention, and as shown in fig. 5, the apparatus includes:
a reading module 501, configured to read an XML message stored in a database, and determine a message type and a message standard of the XML message;
a configuration module 502, configured to configure a set of included logic fields for each packet standard of each packet type of the XML packet; the logic field corresponds to a leaf node of the XML message and is used for storing information of the leaf node; the logic field is associated with the XML message through a path; leaf nodes with the same service meaning in different message types correspond to the same logic field;
the parsing module 503 is configured to, after receiving the XML message, obtain a logical field and a path of the logical field included in the XML message according to the message type and the message standard of the XML message, search information of a leaf node of the XML message according to the path of the logical field, parse the information of the leaf node of the XML message into the corresponding logical field, and store an XML object of the leaf node in the logical field.
In one embodiment, associating the logical field with the XML message transit path includes: the logic field is associated with the XML message through a path XPath;
the parsing module is specifically configured to: and searching the information of the leaf node of the XML message according to the path XPath of the logic field through a cursor mode of the XMLBeans.
In one embodiment, the configuration module is further configured to:
after reading the XML message stored in the database by the reading module, putting the XML message into a memory HashMap, compiling the xsd files of all message types by a compleXsd method of XMLBeans, and generating a schema typeLoader for processing and analyzing the XML message.
In one embodiment, the parsing module is specifically configured to:
after receiving the XML message, determining the message type and the message standard of the XML message according to the name space of the XML message;
and according to the message type and the message standard of the XML message, acquiring the logic fields and the paths of the logic fields contained in the XML message from the memory HashMap.
In one embodiment, the apparatus shown in fig. 5 further comprises:
the storage module is used for storing a logic field table, a logic field path table and a message type table in a database;
the logic field table is used for configuring the attribute of the logic field; the logic field path table is used for configuring the path of the logic field; the message type table is used for configuring message types.
In one embodiment, the storage module is further configured to:
when a new message type exists, configuring the information of the message type in a message type table; if the message type has a corresponding new logical field, configuring the attribute of the new logical field in a configuration field table, and configuring the path of the new logical field in a logical field path table.
The embodiment of the invention also provides computer equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor executes the computer program to realize the XML message processing method.
The embodiment of the invention also provides a computer readable storage medium, wherein a computer program is stored in the computer readable storage medium, and when the computer program is executed by a processor, the XML message processing method is realized.
The embodiment of the present invention further provides a computer program product, where the computer program product includes a computer program, and when the computer program is executed by a processor, the XML message processing method is implemented.
In summary, in the embodiment of the present invention, the XML message stored in the database is read, and the message type and the message standard of the XML message are determined; configuring a set of contained logic fields for each message standard of each message type of the XML message; the logic field corresponds to a leaf node of the XML message and is used for storing information of the leaf node; associating the logic field with the XML message through a path; leaf nodes with the same service meaning in different message types correspond to the same logic field; after receiving the XML message, acquiring a logic field and a path of the logic field contained in the XML message according to the message type and the message standard of the XML message, searching the information of the leaf node of the XML message according to the path of the logic field, analyzing the information of the leaf node of the XML message into the corresponding logic field, and storing the XML object of the leaf node in the logic field; compared with the prior art, the method comprises the steps of configuring a set of contained logic fields according to each message standard of each message type of the XML message; after receiving the XML message, the XML message is analyzed and processed by using the logic fields contained in the XML message, so that the uniform configuration and analysis processing of the XML message can be realized, the message can be analyzed quickly and efficiently, the complexity of a system is reduced, the code repeatability is reduced, and the development efficiency is improved.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above-mentioned embodiments are provided to further explain the objects, technical solutions and advantages of the present invention in detail, and it should be understood that the above-mentioned embodiments are only examples of the present invention and should not be used to limit the scope of the present invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (15)

1. An XML message processing method is characterized by comprising the following steps:
reading an XML message stored in a database, and determining the message type and the message standard of the XML message;
configuring a set of contained logic fields for each message standard of each message type of the XML message; the logic field corresponds to a leaf node of the XML message and is used for storing information of the leaf node; associating the logic field with the XML message through a path; leaf nodes with the same service meaning in different message types correspond to the same logic field;
after receiving the XML message, acquiring a logic field and a path of the logic field contained in the XML message according to the message type and the message standard of the XML message, searching the information of the leaf node of the XML message according to the path of the logic field, analyzing the information of the leaf node of the XML message into the corresponding logic field, and storing the XML object of the leaf node in the logic field.
2. The method of claim 1, wherein associating the logical field with the XML message transit path comprises: the logic field is associated with the XML message through a path XPath;
searching the information of the leaf node of the XML message according to the path of the logic field, wherein the information comprises the following steps: and searching the information of the leaf node of the XML message according to the path XPath of the logic field through a cursor mode of the XMLBeans.
3. The method of claim 1, wherein after reading the XML message stored in the database, further comprising:
and (3) putting the XML message into a memory HashMap, compiling xsd files of all message types by a composeXsd method of XMLBeans, and generating a schema TypeLoader for XML message processing and analysis.
4. The method according to claim 3, wherein after receiving the XML message, acquiring the logical fields and the paths of the logical fields contained in the XML message according to the message type and the message standard of the XML message comprises:
after receiving the XML message, determining the message type and the message standard of the XML message according to the namespace of the XML message;
and according to the message type and the message standard of the XML message, acquiring the logic field contained in the XML message and the path of the logic field from the HashMap in the memory.
5. The method of claim 1, further comprising:
storing a logic field table, a logic field path table and a message type table in a database;
the logic field table is used for configuring the attribute of the logic field; the logic field path table is used for configuring the path of the logic field; the message type table is used for configuring message types.
6. The method of claim 5, further comprising:
when a new message type exists, configuring the information of the message type in a message type table; if the message type has a corresponding new logical field, configuring the attribute of the new logical field in a configuration field table, and configuring the path of the new logical field in a logical field path table.
7. An XML message processing apparatus, comprising:
the reading module is used for reading the XML message stored in the database and determining the message type and the message standard of the XML message;
the configuration module is used for configuring a set of contained logic fields for each message standard of each message type of the XML message; the logic field corresponds to a leaf node of the XML message and is used for storing information of the leaf node; the logic field is associated with the XML message through a path; leaf nodes with the same service meaning in different message types correspond to the same logic field;
the analysis module is used for acquiring the logic field and the path of the logic field contained in the XML message according to the message type and the message standard of the XML message after receiving the XML message, searching the information of the leaf node of the XML message according to the path of the logic field, analyzing the information of the leaf node of the XML message into the corresponding logic field, and storing the XML object of the leaf node in the logic field.
8. The apparatus of claim 7, wherein the logical field is associated with an XML message traversing path, comprising: the logic field is associated with the XML message through a path XPath;
the parsing module is specifically configured to: and searching the information of the leaf node of the XML message according to the path XPath of the logic field through a cursor mode of the XMLBeans.
9. The apparatus of claim 7, wherein the configuration module is further to:
after reading the XML message stored in the database by the reading module, putting the XML message into a memory HashMap, compiling xsd files of all message types by a composeXsd method of XMLBeans, and generating a schema typeLoader for XML message processing and analysis.
10. The apparatus of claim 9, wherein the parsing module is specifically configured to:
after receiving the XML message, determining the message type and the message standard of the XML message according to the name space of the XML message;
and according to the message type and the message standard of the XML message, acquiring the logic field contained in the XML message and the path of the logic field from the HashMap in the memory.
11. The apparatus of claim 7, further comprising:
the storage module is used for storing a logic field table, a logic field path table and a message type table in a database;
the logic field table is used for configuring the attribute of the logic field; the logic field path table is used for configuring the path of the logic field; the message type table is used for configuring message types.
12. The apparatus of claim 11, wherein the storage module is further to:
when a new message type exists, configuring the information of the message type in a message type table; if the message type has a corresponding new logical field, configuring the attribute of the new logical field in a configuration field table, and configuring the path of the new logical field in a logical field path table.
13. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 6 when executing the computer program.
14. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the method of any one of claims 1 to 6.
15. A computer program product, characterized in that the computer program product comprises a computer program which, when being executed by a processor, carries out the method of any one of claims 1 to 6.
CN202211233482.6A 2022-10-10 2022-10-10 XML message processing method and device Pending CN115599955A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211233482.6A CN115599955A (en) 2022-10-10 2022-10-10 XML message processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211233482.6A CN115599955A (en) 2022-10-10 2022-10-10 XML message processing method and device

Publications (1)

Publication Number Publication Date
CN115599955A true CN115599955A (en) 2023-01-13

Family

ID=84846554

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211233482.6A Pending CN115599955A (en) 2022-10-10 2022-10-10 XML message processing method and device

Country Status (1)

Country Link
CN (1) CN115599955A (en)

Similar Documents

Publication Publication Date Title
US9965545B2 (en) Document order management via relaxed node indexing
Olteanu SPEX: Streamed and progressive evaluation of XPath
US7792852B2 (en) Evaluating queries against in-memory objects without serialization
US8762410B2 (en) Document level indexes for efficient processing in multiple tiers of a computer system
US20060167869A1 (en) Multi-path simultaneous Xpath evaluation over data streams
US8566343B2 (en) Searching backward to speed up query
US20030110177A1 (en) Declarative specification and engine for non-isomorphic data mapping
US8181105B2 (en) Apparatus, method, and program that performs syntax parsing on a structured document in the form of electronic data
US7930630B2 (en) Event-based parser for markup language file
JP2007510204A (en) Hardware / software partition for high performance structured data conversion
Pagán et al. Querying large models efficiently
US20060253430A1 (en) Method and apparatus for approximate projection of XML documents
JP2007528052A (en) Expression grouping and evaluation
US20080097744A1 (en) Context-free grammar
JP2009503679A (en) Lightweight application program interface (API) for extensible markup language (XML)
US7548926B2 (en) High performance navigator for parsing inputs of a message
CN112860730A (en) SQL statement processing method and device, electronic equipment and readable storage medium
US20100153430A1 (en) Method of and Apparatus for Extraction and Analysis of Macro Operations within Query Language Statement
WO2023103339A1 (en) Data conversion method and device
US9411792B2 (en) Document order management via binary tree projection
CN111488155A (en) Coloring language translation method
CN114297204A (en) Data storage and retrieval method and device for heterogeneous data source
CN115599955A (en) XML message processing method and device
CN114281842A (en) Method and device for sub-table query of database
CN113626465B (en) Database and method for realizing session-level variables in postgresql database

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