A message conversion method and device, electronic equipment and storage medium

By parsing the structure document of the initial message and determining the node path, a tree structure data is constructed, which solves the problems of low efficiency and poor compatibility of existing message conversion methods and achieves efficient and compatible message conversion.

CN116226456BActive Publication Date: 2026-06-23AGRICULTURAL BANK OF CHINA

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
AGRICULTURAL BANK OF CHINA
Filing Date
2023-03-07
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing message conversion methods are inefficient and have poor compatibility.

Method used

By obtaining the structure document of the initial message, parsing it to obtain structured configuration data, determining the relative paths of nodes on the absolute paths of nodes, and constructing a tree structure based on the target configuration data, the initial message is transformed into the target message.

Benefits of technology

It improves message conversion efficiency, ensures a clear hierarchical structure of the converted tree structure, and enhances compatibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116226456B_ABST
    Figure CN116226456B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a message conversion method and device, electronic equipment and a storage medium. The method comprises: obtaining a structure document of an initial message, and parsing the structure document to obtain structured configuration data, wherein the structured configuration data comprises at least one node absolute path; for each node absolute path in the at least one node absolute path, determining a node relative path corresponding to each absolute node on the node absolute path according to the structured configuration data, and determining target configuration data according to each node relative path; constructing tree structure data based on the target configuration data, and determining a target message based on the tree structure data to convert the initial message into the target message. The technical solution of the embodiments of the present application improves the message conversion efficiency and compatibility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer applications, and in particular to a message conversion method, apparatus, electronic device and storage medium. Background Technology

[0002] During project development, it is often necessary to convert International Organization for Standardization (ISO) messages in Extensible Markup Language (XML) format.

[0003] However, the current message conversion methods are inefficient and have poor compatibility, which need to be addressed. Summary of the Invention

[0004] This invention provides a message conversion method, apparatus, electronic device, and storage medium, which improves message conversion efficiency and compatibility.

[0005] According to one aspect of the present invention, a message conversion method is provided, which may include:

[0006] Obtain the structure document of the initial message and parse the structure document to obtain structured configuration data, wherein the structured configuration data includes at least one absolute path of a node;

[0007] For each absolute path of at least one node, based on the structured configuration data, determine the relative path of each absolute node on the absolute path, and determine the target configuration data based on the relative paths of each node.

[0008] A tree-structured data structure is constructed based on the target configuration data, and the target message is determined based on the tree-structured data to convert the initial message into the target message.

[0009] According to another aspect of the present invention, a message conversion apparatus is provided, which may include:

[0010] The structured configuration data acquisition module is used to obtain the structure document of the initial message and parse the structure document to obtain structured configuration data, wherein the structured configuration data includes at least one absolute path of a node;

[0011] The target configuration data determination module is used to determine the relative path of each absolute node on the absolute path of at least one node, based on the structured configuration data, and determine the target configuration data based on the relative paths of each node.

[0012] The target message determination module is used to construct a tree structure data based on the target configuration data, and determine the target message based on the tree structure data, so as to convert the initial message into the target message.

[0013] According to another aspect of the present invention, an electronic device is provided, which may include:

[0014] At least one processor; and

[0015] A memory that is communicatively connected to at least one processor; wherein,

[0016] The memory stores a computer program that can be executed by at least one processor, such that when the at least one processor executes the program, it implements the message conversion method provided in any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided having computer instructions stored thereon for causing a processor to execute and implement the message conversion method provided in any embodiment of the present invention.

[0018] The technical solution of this invention involves obtaining the structure document of an initial message and parsing it to obtain structured configuration data. The structured configuration data includes at least one absolute node path. For each absolute node path, based on the structured configuration data, a relative path corresponding to each absolute node on that path is determined, and target configuration data is determined based on these relative paths. A tree structure is constructed based on the target configuration data, and the target message is determined based on this tree structure data, thereby converting the initial message into the target message. This technical solution improves message conversion efficiency by parsing the structure document of the initial message and thereby determining the target message. It also ensures a clear hierarchical structure in the resulting tree structure, improving the compatibility of the message conversion.

[0019] It should be understood that the description in this section is not intended to identify key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0020] Figure 1 This is a diagram illustrating the effect of mapping an XML-structured ISO message into a tree structure, as provided by the present invention.

[0021] Figure 2 This is a flowchart of a message conversion method provided in Embodiment 1 of the present invention;

[0022] Figure 3This is a flowchart of determining structured configuration data provided in Embodiment 1 of the present invention;

[0023] Figure 4 This is a flowchart of a message conversion method provided in Embodiment 2 of the present invention;

[0024] Figure 5 This is a flowchart of determining a list of tree-structured objects provided in Embodiment 2 of the present invention;

[0025] Figure 6 This is a flowchart of a message conversion method provided in Embodiment 3 of the present invention;

[0026] Figure 7 This is an example diagram of a Chinese and English name storage table provided in Embodiment 3 of the present invention;

[0027] Figure 8 This is a structural block diagram of the message conversion device provided in Embodiment 4 of the present invention;

[0028] Figure 9 This is a schematic diagram of the structure of an electronic device that implements the message conversion method of this invention. Detailed Implementation

[0029] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0030] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. The same applies to "target," "original," etc., and will not be repeated here. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0031] Before introducing the embodiments of the present invention, the application scenarios of the embodiments of the present invention will be described by way of example. During project development, ISO messages can be mapped into a tree structure for display; for example, see [link to relevant documentation]. Figure 1 This achieves the effect of mapping an XML-structured ISO message into a tree structure. However, existing message conversion schemes suffer from low conversion efficiency and poor compatibility. Therefore, this invention provides the following message conversion method to solve the problems in the prior art.

[0032] Example 1

[0033] Figure 2 This is a flowchart of a message conversion method provided in Embodiment 1 of the present invention. This embodiment is applicable to message conversion scenarios. The method can be executed by the message conversion device provided in this embodiment of the invention. This device can be implemented in software and / or hardware and can be integrated into an electronic device, which can be various user terminals or servers.

[0034] See Figure 2 The method of this invention specifically includes the following steps:

[0035] S110. Obtain the structure document of the initial message and parse the structure document to obtain structured configuration data, wherein the structured configuration data includes at least one absolute path of a node.

[0036] The initial message can be understood as the message that transforms the requirement into the target message. For example, the initial message could be an ISO message with an XML structure. The target message can be understood as the message obtained by transforming the initial message, such as a JavaScript Object Notation (JSON) message. The structure document can be understood as a document that formally describes the initial message. For example, a structure document could be an XML Schema document referenced by each ISO message. The Schema document describes the specific types of elements and attributes in the ISO message with the referenced XML structure. The Schema document can also define and validate the specific content format of the message. Therefore, parsing the Schema document yields structured configuration data.

[0037] In this embodiment of the invention, a structure document of the initial message can be obtained and parsed to obtain structured configuration data. This structured configuration data can be understood as data that describes the initial message. For example, the structured configuration data may include at least one absolute node path, a regular expression, and metadata such as the positions of loop nodes obtained after parsing the structure document and the data types of leaf nodes obtained after parsing the structure document. In this embodiment of the invention, there are no specific limitations on the data that the structured configuration data may include. The absolute node path can be understood as an absolute path based on the root node obtained after parsing the structure document.

[0038] For example, see Figure 3 It can obtain the schema document of the initial message and parse the schema document; starting from the root node obtained by parsing the schema document, it traverses back through each child node obtained by parsing the schema document to obtain at least one absolute path of a node. For example, the absolute path of a node can be / Document / FIToFICstmrCdtTrf / CdtTrfTxIrnf / CdtrAgt / FinInstnID / PstlAder / AdrLine. It then parses the schema document to obtain the regular expression, the position of the loop node, and the data type of the leaf node. The above at least one absolute path of a node, the regular expression, the position of the loop node, and the data type of the leaf node are used as structured configuration data.

[0039] S120. For each absolute path of at least one node, determine the relative path of each absolute node on the absolute path of the node according to the structured configuration data, and determine the target configuration data according to the relative path of each node.

[0040] In this context, an absolute node can be understood as a node on an absolute path. A relative path can be understood as a relative path based on the location of the referenced absolute node. Target configuration data can be understood as configuration data capable of constructing a tree-like data structure.

[0041] In this embodiment of the invention, for each absolute path of at least one node, the relative path of each absolute node on the absolute path can be determined according to the structured configuration data, and the target configuration data can be determined according to each relative path. For example, each relative path can be converted into a flat storage method for storage and used as the target configuration data, or each relative path can be directly used as the target configuration data.

[0042] In this embodiment of the invention, for each absolute path of at least one node, the relative path of each absolute node on the absolute path is determined according to the structured configuration data. There may be cases where the same relative path of the same node appears repeatedly. In such cases, only one of the same relative paths of the same node can be retained, and the other repeated relative paths of the same node can be deleted. Then, the target configuration data is determined according to the relative paths of the nodes that do not have repeated relative paths of the same node, thereby improving the processing speed of subsequent steps.

[0043] S130. Construct a tree structure data based on the target configuration data, and determine the target message based on the tree structure data, so as to convert the initial message into the target message.

[0044] Among them, tree structure data can be understood as data that can represent the tree structure relationship between nodes obtained after parsing the initial message. Based on the tree structure data, the initial message can be converted into the target message.

[0045] In this embodiment of the invention, a tree-structured data is constructed based on the target configuration data, and the target message is determined based on the tree-structured data to convert the initial message into the target message. It should be noted that the tree-structured data may include an object corresponding to the target message, and the target message can be determined based on the object corresponding to the target message. For example, if the target message is a JSON message, the tree-structured data may include a JSON object used to determine the JSON message.

[0046] The technical solution of this invention involves obtaining the structure document of an initial message and parsing it to obtain structured configuration data. The structured configuration data includes at least one absolute node path. For each absolute node path, based on the structured configuration data, a relative path corresponding to each absolute node on that path is determined, and target configuration data is determined based on these relative paths. A tree structure is constructed based on the target configuration data, and the target message is determined based on this tree structure data, thereby converting the initial message into the target message. This technical solution improves message conversion efficiency by parsing the structure document of the initial message and thereby determining the target message. It also ensures a clear hierarchical structure in the resulting tree structure, improving the compatibility of the message conversion.

[0047] An optional technical solution involves determining the relative path of each absolute node on the absolute path of a node based on structured configuration data, including: determining the parent-child relationship between every two absolute nodes on the absolute path of a node based on the structured configuration data; and determining the relative path of each absolute node on the absolute path of a node based on the parent-child relationship.

[0048] In this context, the parent-child relationship can be understood as whether two absolute nodes are directly related as parent and child nodes or not.

[0049] In this embodiment of the invention, the parent-child relationship between every two absolute nodes on the absolute path can be determined based on structured configuration data. For example, if there are three nodes A, B, and C on the absolute path, the parent-child relationship between every two absolute nodes can be determined as follows: node A is the parent of node B, node B is the parent of node C, node C is the child of node B, node B is the child of node A, and node A and node C are not in a parent-child relationship. Based on the parent-child relationship, the relative path corresponding to each absolute node on the absolute path can be determined. The above scheme can efficiently determine the relative path corresponding to each absolute node.

[0050] An optional technical solution further includes, before determining the target configuration data based on the relative paths of each node: if there are cyclic nodes that appear repeatedly in the relative paths of each node, adding different count numbers to at least one cyclic node in the relative paths of each node; and updating the relative paths of each node based on the added counts.

[0051] In this context, a relative node can be understood as a node on a path relative to another node. A counter label can be understood as a number used to distinguish recurring nodes.

[0052] In this embodiment of the invention, the existence of a cyclic node can be determined based on the position of the cyclic node in the structured configuration data, or by finding cyclically occurring nodes among the relative nodes. If a cyclic node exists, a different count can be added to at least one cyclic node on each node's relative path. For example, for a cyclic node D that appears three times, counts can be added to the three occurrences of cyclic node D to obtain cyclic node D_1, cyclic node D_2, and cyclic node D_3. Based on the increments obtained by adding different counts to at least one cyclic node on each node's relative path, the relative paths of each node are updated to distinguish cyclic nodes, thereby facilitating the subsequent construction of the tree structure data.

[0053] Example 2

[0054] Figure 4 This is a flowchart of another message conversion method provided in Embodiment 2 of the present invention. This embodiment is based on the above-mentioned technical solutions and optimized. In this embodiment, optionally, the node value document of the initial message is obtained, wherein the node value document includes the node value of each absolute node on each node absolute path; for each node relative path represented by the target configuration data, each leaf node in at least one leaf node on the node relative path is determined, and it is determined whether the node value of the leaf node is empty according to the node value document; if the node value of the leaf node is not empty, the tree object is generated by traversing from the leaf node to the root node on the node relative path, and the node values ​​of the tree nodes in the tree object are filled according to the node value document; the tree object after filling is deduplicated and added to the tree structure object list, and the tree structure data is constructed according to the tree structure object list. The explanations of the same or corresponding terms as those in the above embodiments are not repeated here.

[0055] See Figure 4 The method in this embodiment may specifically include the following steps:

[0056] S210. Obtain the structure document of the initial message and parse the structure document to obtain structured configuration data, wherein the structured configuration data includes at least one absolute path of a node.

[0057] S220. For each absolute path of at least one node, determine the relative path of each absolute node on the absolute path of the node according to the structured configuration data, and determine the target configuration data according to the relative path of each node.

[0058] S230. Obtain the node value document of the initial message, wherein the node value document includes the node value of each absolute node on the absolute path of each node.

[0059] In this context, a node value document can be understood as a document that includes the correspondence between the node number or position coordinates of each absolute node on each node's absolute path and its corresponding node value; it can also be understood as a document that represents the positional correspondence between each absolute node on each node's absolute path and its corresponding node value. For example, a node value document could include the correspondence between the node number or position coordinates of each absolute node on each node's absolute path and the location of its corresponding node value stored in the database. A node value can be understood as the value of an absolute node; if the absolute node is a text node, the node value is the text content; if the absolute node is an attribute node, the node value is the attribute value. The type of the node value is determined by the type of the absolute node.

[0060] In this embodiment of the invention, the node value document can be obtained after parsing the initial message, or it can be the node value document carried by the initial message directly obtained. In this embodiment, the method for obtaining the node value document of the initial message is not specifically limited. When it is necessary to obtain the node value of an absolute node, the node value corresponding to the absolute node can be obtained by querying the node value document using the absolute node's number or location coordinates; alternatively, the storage location of the node value corresponding to the absolute node in the database can be obtained by querying the node value document using the absolute node's number or location coordinates, and the node value corresponding to the absolute node can be obtained by querying the database using that storage location.

[0061] S240. For each node relative path represented by the target configuration data, determine each leaf node in at least one leaf node on the node relative path, and determine whether the node value of the leaf node is empty based on the node value document.

[0062] In this embodiment of the invention, for each relative path of a node in the target configuration data representation, each leaf node in at least one leaf node on the relative path of the node can be determined, and the node value of the leaf node can be determined according to the node value document. For example, the node value of the leaf node can be queried from the node value document, and the node value of the leaf node can be determined according to the query result.

[0063] S250. If the node value of a leaf node is not empty, traverse from the leaf node to the root node on the relative path of the node to generate a tree object, and fill the node values ​​of the tree nodes in the tree object according to the node value document.

[0064] In this embodiment of the invention, when the node value of the leaf node is not empty, the tree object is generated by traversing from the leaf node in reverse order according to the parent-child relationship to the root node on the relative path of the node. The tree object is the object corresponding to the target message, such as a JSON object. The node values ​​of the tree nodes in the tree object are filled according to the node value document.

[0065] It is important to note that filling the node values ​​of tree nodes in a tree object according to the node value document can be done in two ways: either after generating the tree object, the node values ​​of each node in the tree object are determined according to the node value document and then the node values ​​of each node are filled; or, during the process of traversing from the leaf nodes in reverse order to the root node on the relative path of the nodes, the node value of each node is determined according to the node value document and then the node value of that node is filled.

[0066] In this embodiment of the invention, the node values ​​of the tree nodes in the tree object can also be filled according to the node value document and the preset filling rules. The preset filling rules are determined by user requirements. For example, the preset filling rules can be rules that specify the format or attributes of the node values ​​to be filled, which are not specifically limited here.

[0067] S260. After deduplication of the tree object after filling, add it to the list of tree structure objects, construct tree structure data based on the list of tree structure objects, and determine the target message based on the tree structure data, so as to convert the initial message into the target message.

[0068] The tree structure object list can be understood as a list of tree objects that can be used to construct tree structure data.

[0069] In this embodiment of the invention, the tree object after filling can be deduplicated to prevent redundancy of duplicate tree objects. Then, the deduplicated tree object after filling is added to the tree structure object list, and tree structure data is constructed based on the tree structure object list. The target message is then determined based on the tree structure data to convert the initial message into the target message.

[0070] For example, see Figure 5 The process involves: retrieving the node value document of the initial message; traversing the relative paths of the nodes representing the target configuration data; for each leaf node in at least one leaf node on the currently traversed relative path, determining whether the node value of the leaf node is empty based on the node value document; if the node value of the leaf node is empty, continuing to traverse the next relative path of the currently traversed relative path; if the node value of the leaf node is not empty, traversing from the leaf node to the root node on the relative path to generate a tree object JstreeModel; and filling the tree nodes in the tree object JstreeModel with node values ​​according to the parent-child relationship between every two tree nodes based on the node value document and preset filling rules; deduplicating the filled tree object JstreeModel and adding it to the list of tree structure objects; continuing to traverse the next relative path of the currently traversed relative path until the traversal is complete. The tree object JstreeModel can be an object capable of determining the JSON message, and the determined JSON message can be displayed using the Jstree component.

[0071] The technical solution of this invention involves obtaining a node value document for the initial message, wherein the node value document includes the node value of each absolute node on each absolute path of the node; for each relative path of the node represented by the target configuration data, determining each leaf node among at least one leaf node on the relative path of the node, and determining whether the node value of the leaf node is empty according to the node value document; if the node value of the leaf node is not empty, traversing from the leaf node to the root node on the relative path of the node to generate a tree object, and filling the node values ​​of the tree nodes in the tree object according to the node value document; after deduplication of the filled tree object, adding it to a list of tree structure objects, and constructing tree structure data according to the list of tree structure objects. In this invention embodiment, the compatibility of message conversion is further improved by generating tree objects with high compatibility.

[0072] Example 3

[0073] Figure 6 This is a flowchart of another message conversion method provided in Embodiment 3 of the present invention. This embodiment is an optimization based on the above-described technical solutions. In this embodiment, optionally, after determining the target message based on the tree structure data, the message conversion method further includes: displaying the tree structure represented by the tree structure data based on the target message. The explanations of terms that are the same as or corresponding to those in the above embodiments will not be repeated here.

[0074] See Figure 6 The method in this embodiment may specifically include the following steps:

[0075] S310. Obtain the structure document of the initial message and parse the structure document to obtain structured configuration data, wherein the structured configuration data includes at least one absolute path of a node.

[0076] S320. For each absolute path of at least one node, determine the relative path of each absolute node on the absolute path of the node according to the structured configuration data, and determine the target configuration data according to the relative path of each node.

[0077] S330. Construct a tree-structured data based on the target configuration data, and determine the target message based on the tree-structured data, so as to convert the initial message into the target message.

[0078] S340. Display the tree structure represented by the tree structure data based on the target message.

[0079] Among them, a tree structure is a data structure in which there is a one-to-many tree relationship between nodes.

[0080] In this embodiment of the invention, after determining the target message based on the tree structure data, the tree structure represented by the tree structure data can also be displayed based on the target message to intuitively see the hierarchical structure of the tree structure. For example, when the target message is a JSON message, the Jstree component can be used on the front end to display the tree structure message. JsTree is a jQuery plugin that provides an interactive tree and is distributed under the MIT License. JsTree is easily extensible, definable, and configurable, supporting HyperText Markup Language (HTML) and JSON data sources, as well as asynchronous JavaScript and XML (AJAX) loading.

[0081] In this embodiment of the invention, the tree structure represented by the tree structure data can also be displayed based on the target message and structured configuration data to achieve a better display effect.

[0082] In this embodiment of the invention, after parsing the structured document to obtain structured configuration data, language parsing can be performed on the determining nodes in the absolute paths of at least one node in the structured configuration data to obtain language parsing results. When displaying the tree structure represented by the tree structure data based on the target message, in response to a language selection instruction indicating the language of the selected tree structure to be displayed, the tree structure is displayed according to the selected language and the language parsing results. For example, language parsing can be performed on the determining nodes in the absolute paths of at least one node in the structured configuration data to obtain language parsing results. These language parsing results can be a table of Chinese and English names corresponding to each absolute node. This table can include the correspondence between the descriptions of the English related information and the descriptions of the Chinese related information corresponding to each absolute node. See [link to relevant documentation]. Figure 7 For example, the English and Chinese name storage table can include the English description of the absolute node AdrLine (AddressLine) and the Chinese description of the unstructured address. When displaying the tree structure represented by the tree structure data based on the target message, in response to the language selection instruction, the unstructured address of the relevant information of the tree node AdrLine in the tree structure can be displayed according to the selected Chinese language and the English and Chinese name storage table.

[0083] The technical solution of this invention, after determining the target message based on tree structure data, displays the tree structure represented by the tree structure data based on the target message. This invention improves the compatibility of displaying tree structure message data.

[0084] An optional technical solution, after displaying the tree structure represented by the tree structure data based on the target message, further includes: generating node hierarchy relationship configuration data based on the target configuration data and the tree structure data; the method further includes: using the displayed tree structure as the display result; responding to a node addition instruction applied to the display result, determining the selected node to be added in the tree structure represented by the display result, and determining whether the selected node is a leaf node in the tree structure according to the node hierarchy relationship configuration data; if the selected node is not a leaf node, determining the child nodes of the selected node according to the node hierarchy relationship configuration data, and adding the child nodes to the display result.

[0085] The node-adding command can be understood as an instruction to add a selected node to the tree structure represented by the displayed results. For example, a node-adding command might be generated when a user clicks on a selected node in the displayed results. A selected node can be understood as a node in the tree structure represented by the displayed results that is to be added for selection.

[0086] In this embodiment of the invention, node hierarchy configuration data can be generated based on target configuration data and tree structure data. This hierarchy configuration data may include at least one of the following: the level of each tree node in the tree structure, the child nodes corresponding to the tree node, whether the tree node is a cycle node, and whether the tree node is a leaf node. Here, a tree node can be understood as a node in a tree structure.

[0087] In this embodiment of the invention, the displayed tree structure can be used as the display result, which can be understood as the result displayed on the front end. In response to a node addition command applied to the display result, the system can determine the node to be added in the tree structure represented by the display result, and determine whether the selected node is a leaf node in the tree structure based on the node hierarchy configuration data. If the selected node is not a leaf node, it indicates that a child node can be added to the selected node. The child nodes of the selected node are determined based on the node hierarchy configuration data, and the child nodes are added to the display result.

[0088] For example, in response to a node addition instruction generated after a user clicks on a selected node in the display results with the mouse, the selected node to be added is determined, and whether the selected node is a leaf node in the tree structure is determined according to the node hierarchy configuration data; if the selected node is not a leaf node, at least one selectable child node that the selected node can support is determined according to the node hierarchy configuration data, and at least one selectable child node is displayed using a cascading drop-down list; the user can select one of the at least one selectable child nodes in the cascading drop-down list and add the selected child node to the display results to modify the display results.

[0089] In this embodiment of the invention, after the nodes are added, in response to a submission instruction indicating the submission of the added nodes (e.g., an instruction generated after the user clicks "submit case"), the tree structure data is updated and displayed after being concatenated with the selected child nodes or the node values ​​of the selected nodes, based on the aforementioned selection of added child nodes or addition / modification of node values. Simultaneously, structured configuration data, target configuration data, node hierarchy configuration data, relative paths of selected child nodes or added / modified node values, and other related data can also be updated. The initial message is then updated after parsing the updated tree structure data and / or the aforementioned related data based on parsing rules. These parsing rules are rules that enable the updating of the initial message after parsing the updated tree structure data and / or the aforementioned related data; the specific content of these parsing rules is not specifically limited in this embodiment of the invention.

[0090] Based on the above solution, an optional technical solution, after adding the child node to the display result, further includes: updating the child node to the selected node, and repeatedly executing the step of determining whether the selected node is a leaf node in the tree structure based on the node hierarchy configuration data; if the selected node is a leaf node, displaying a node value input box for the selected node, so as to add or modify the node value of the selected node through the node value input box.

[0091] The node value input box can be understood as an input box used to enter the node value of the selected node.

[0092] In this embodiment of the invention, if the selected node is not a leaf node, the child nodes of the selected node can be determined according to the node hierarchy configuration data, and the child nodes can be added to the display result. Then, the child nodes are updated to the selected node, and the step of determining whether the selected node is a leaf node in the tree structure according to the node hierarchy configuration data is repeated. If the selected node is not a leaf node, the child nodes of the selected node can be determined according to the node hierarchy configuration data, and the child nodes can be added to the display result. This process is repeated until the selected node added to the display result is a leaf node.

[0093] In this embodiment of the invention, when the selected node is a leaf node, the relative path of the selected node can also be determined, and it can be determined whether there is a relative path of the same node as the relative path of the selected node in the relative paths of each node represented by the target configuration data. If there is, the selected node is deleted to ensure the uniqueness of the leaf node.

[0094] In this embodiment of the invention, if the selected node is a leaf node, it means that no new child node can be added to the selected node. Instead, a node value input box is displayed for the selected node, so that the node value of the selected node can be added or modified through the node value input box, thereby further modifying the display result.

[0095] Based on the above solution, an optional technical solution, after displaying the tree structure data, further includes: using the displayed tree structure data as the display result; responding to the node information display instruction acting on the display result, determining the node information of the display node to be displayed in the tree structure represented by the display result; and displaying the node information.

[0096] Among them, the display node can be understood as the new tree node that corresponds to the display requirements in the tree structure data.

[0097] In this embodiment of the invention, the displayed tree structure data may be used as the display result; in response to a node information display instruction acting on the display result to indicate the display of node information, the node information of the display node to be displayed in the tree structure represented by the display result is determined; the node information is displayed to realize the display of relevant information of the display node. The node information may include at least one of the following: the absolute path of the display node, the relative path of the display node, the parent node and / or child node of the display node, the level of the display node in the tree structure data, whether the display node is a cycle node, and whether the display node is a leaf node.

[0098] Example 4

[0099] Figure 8 This is a structural block diagram of the message conversion apparatus provided in Embodiment 4 of the present invention. This apparatus is used to execute the message conversion method provided in any of the above embodiments. This apparatus and the message conversion methods of the above embodiments belong to the same inventive concept. Details not described in detail in the embodiments of the message conversion apparatus can be found in the embodiments of the above message conversion methods. See also... Figure 8 The device may specifically include: a structured configuration data acquisition module 410, a target configuration data determination module 420, and a target message determination module 430.

[0100] The structured configuration data acquisition module 410 is used to obtain the structure document of the initial message and parse the structure document to obtain structured configuration data, wherein the structured configuration data includes at least one absolute path of a node.

[0101] The target configuration data determination module 420 is used to determine the relative path of each absolute node on the absolute path of at least one node, based on the structured configuration data, and to determine the target configuration data based on the relative paths of each node.

[0102] The target message determination module 430 is used to construct a tree structure data based on the target configuration data and determine the target message based on the tree structure data, so as to convert the initial message into the target message.

[0103] Optionally, the target configuration data determination module 420 may include:

[0104] The parent-child relationship determination unit is used to determine the parent-child relationship between every two absolute nodes on the absolute path of a node based on the structured configuration data.

[0105] The node relative path determination unit is used to determine the node relative path corresponding to each absolute node on the absolute path of the node based on the parent-child relationship.

[0106] Optionally, the message conversion device may also include:

[0107] The counting number addition module is used to add different counting numbers to at least one cyclic node on the relative path of each node before determining the target configuration data based on the relative path of each node, in the case where there are cyclic nodes that appear repeatedly in the relative path of each node.

[0108] The node relative path update module is used to update the relative paths of each node based on the obtained increase results.

[0109] Optionally, the target message determination module 430 may include:

[0110] The node value document acquisition unit is used to acquire the node value document of the initial message, wherein the node value document includes the node value of each absolute node on the absolute path of each node;

[0111] The node value determination unit is used to determine each leaf node in at least one leaf node on the relative path of the target configuration data representation for each node relative path, and to determine whether the node value of the leaf node is empty based on the node value document.

[0112] The node value filling unit is used to generate a tree object by traversing from the leaf node to the root node on the relative path of the node when the node value of the leaf node is not empty, and to fill the node values ​​of the tree nodes in the tree object according to the node value document.

[0113] The tree structure data construction unit is used to add deduplicated tree objects after filling to the tree structure object list, and construct tree structure data based on the tree structure object list.

[0114] Based on the above scheme, the message conversion device may optionally include:

[0115] The tree structure data display module is used to display the tree structure represented by the tree structure data based on the target message after the target message is determined based on the tree structure data.

[0116] Based on the above scheme, the message conversion device may optionally include:

[0117] The node hierarchy configuration data generation module is used to generate node hierarchy configuration data based on the target configuration data and the tree structure data after displaying the tree structure represented by the tree structure data based on the target message.

[0118] The message conversion device may further include:

[0119] The first display result is used as a module to display the tree structure data as the display result;

[0120] The leaf node determination module is used to respond to the node addition command applied to the display result, determine the selection node to be added in the tree structure represented by the display result, and determine whether the selection node is a leaf node in the tree structure based on the node hierarchy configuration data.

[0121] The child node addition module is used to determine the child nodes of the selected node based on the node hierarchy configuration data when the selected node is not a leaf node, and then add the child nodes to the display results.

[0122] Based on the above scheme, the message conversion device may optionally include:

[0123] The Select Node Update module is used to update the child nodes to selected nodes after adding them to the display results, and repeats the step of determining whether the selected node is a leaf node in the tree structure based on the node hierarchy configuration data.

[0124] The node value input box display module is used to display a node value input box for the selected node when the selected node is a leaf node, so that the node value of the selected node can be added or modified through the node value input box.

[0125] The message conversion apparatus provided in Embodiment 4 of this invention obtains the structure document of the initial message through a structured configuration data acquisition module, parses the structure document to obtain structured configuration data, wherein the structured configuration data includes at least one absolute path of a node; a target configuration data determination module determines the relative path of each absolute node on each absolute path of the at least one absolute path of a node based on the structured configuration data, and determines the target configuration data based on each relative path of a node; a target message determination module constructs a tree structure data based on the target configuration data, and determines the target message based on the tree structure data, thereby converting the initial message into a target message. This apparatus, by parsing the structure document of the initial message and thereby determining the target message, improves the message conversion efficiency and also makes the resulting tree structure hierarchical structure clear, improving the compatibility of message conversion.

[0126] The message conversion device provided in the embodiments of the present invention can execute the message conversion method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method execution.

[0127] It is worth noting that in the embodiments of the above message conversion device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.

[0128] Example 5

[0129] Figure 9A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0130] As shown in the figure, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer programs stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0131] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0132] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as message translation methods.

[0133] In some embodiments, the message translation method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the message translation method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the message translation method by any other suitable means (e.g., by means of firmware).

[0134] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0135] Computer programs used to implement the methods of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs can be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0136] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0137] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0138] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0139] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0140] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0141] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A message conversion method, characterized in that, include: Obtain the structure document of the initial message and parse the structure document to obtain structured configuration data. The structure document is a document used to formally describe the initial message. The structured configuration data includes at least one absolute path of a node. The structured configuration data also includes regular expressions, the positions of loop nodes obtained after parsing the structure document, and the data types of leaf nodes obtained after parsing the structure document. For each absolute path in the at least one absolute path, based on the structured configuration data, determine the relative path of each absolute node on the absolute path, and determine the target configuration data based on each relative path. A tree structure data is constructed based on the target configuration data, and the target message is determined based on the tree structure data, so as to convert the initial message into the target message; After determining the target message based on the tree structure data, the process also includes: The tree structure represented by the tree structure data is displayed based on the target message; After displaying the tree structure represented by the tree structure data based on the target message, the method further includes: Node hierarchy relationship configuration data is generated based on the target configuration data and the tree structure data; The method further includes: The tree structure shown will be used as the display result; In response to a node addition instruction acting on the display result, a selection node to be added in the tree structure represented by the display result is determined, and whether the selection node is a leaf node in the tree structure is determined according to the node hierarchy configuration data. If the selected node is not a leaf node, the child nodes of the selected node are determined according to the node hierarchy configuration data, and the child nodes are added to the display result. The added child nodes are concatenated with the tree structure to update the tree structure data, and the updated tree structure data is parsed based on the parsing rules to update the initial message.

2. The method according to claim 1, characterized in that, The step of determining the relative path of each absolute node on the absolute path of the nodes based on the structured configuration data includes: Based on the structured configuration data, determine the parent-child relationship between every two absolute nodes on the absolute path of the node; Based on the parent-child relationship, determine the relative path of each node corresponding to the absolute node on the absolute path of the node.

3. The method according to claim 1, characterized in that, Before determining the target configuration data based on the relative paths of each node, the method further includes: If there are cyclic nodes that appear repeatedly in the relative nodes on the relative paths of each node, add different count numbers to at least one cyclic node on the relative paths of each node. Update the relative paths of each node based on the obtained increase results.

4. The method according to claim 1, characterized in that, The construction of the tree-structured data based on the target configuration data includes: Obtain the node value document of the initial message, wherein the node value document includes the node value of each absolute node on each absolute path of the node; For each node relative path represented by the target configuration data, determine each leaf node among at least one leaf node on the node relative path, and determine whether the node value of the leaf node is empty based on the node value document; If the node value of the leaf node is not empty, traverse from the leaf node to the root node on the relative path of the node to generate a tree object, and fill the node values ​​of the tree nodes in the tree object according to the node value document. After deduplication of the tree objects that have been filled, they are added to the list of tree structure objects, and tree structure data is constructed based on the list of tree structure objects.

5. The method according to claim 1, characterized in that, After adding the child node to the display result, the process further includes: Update the child node to the selected node, and repeat the step of determining whether the selected node is a leaf node in the tree structure based on the node hierarchy configuration data; When the selected node is a leaf node, a node value input box is displayed for the selected node, so that the node value of the selected node can be added or modified through the node value input box.

6. A message conversion device, characterized in that, include: The structured configuration data acquisition module is used to obtain the structure document of the initial message and parse the structure document to obtain structured configuration data. The structure document is a document used to formally describe the initial message. The structured configuration data includes at least one absolute path of a node. The structured configuration data also includes regular expressions, the positions of loop nodes obtained after parsing the structure document, and the data types of leaf nodes obtained after parsing the structure document. The target configuration data determination module is used to determine the relative path of each absolute node on the absolute path of the node for each absolute path of the at least one node, based on the structured configuration data, and to determine the target configuration data based on each relative path of the node. The target message determination module is used to construct a tree structure data based on the target configuration data, and determine the target message based on the tree structure data, so as to convert the initial message into the target message; The message conversion device further includes: The tree structure data display module is used to display the tree structure represented by the tree structure data based on the target message after the target message is determined based on the tree structure data; The message conversion device further includes: The node hierarchy configuration data generation module is used to generate node hierarchy configuration data based on the target configuration data and the tree structure data after displaying the tree structure represented by the tree structure data based on the target message. The message conversion device further includes: The first display result is used as a module to display the tree structure as the display result; The leaf node determination module is used to respond to the node addition instruction acting on the display result, determine the selection node to be added in the tree structure represented by the display result, and determine whether the selection node is a leaf node in the tree structure according to the node hierarchy configuration data. The child node adding module is used to determine the child nodes of the selected node according to the node hierarchy configuration data when the selected node is not a leaf node, and add the child nodes to the display result. The added child nodes are concatenated with the tree structure to update the tree structure data, and the updated tree structure data is parsed based on the parsing rules to update the initial message.

7. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to cause the at least one processor to perform the message conversion method as described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the message conversion method as described in any one of claims 1-5.