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

By acquiring and parsing message standard metadata and conversion rule sets, the problem of poor scalability of message conversion methods is solved, enabling flexible conversion and efficient updates under different standards.

CN116320060BActive Publication Date: 2026-02-17AGRICULTURAL BANK OF CHINA
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310272507.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-17
Publication Date
2026-02-17
Estimated Expiration
2043-03-17

AI Technical Summary

Technical Problem

Existing message conversion methods have poor scalability and cannot effectively meet the conversion needs between different standards.

Method used

By acquiring the initial message standard metadata and conversion rule set, parsing and assembling the target message field information, and using the first and second message standard metadata for format parsing and conversion rule description, flexible conversion of message format can be achieved.

Benefits of technology

It improves the scalability of message conversion, enabling timely updates to the conversion process in the event of different standard updates or changes, ensuring the accuracy and efficiency of the conversion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116320060B_ABST
    Figure CN116320060B_ABST
Patent Text Reader

Abstract

This invention discloses a message conversion method, apparatus, electronic device, and storage medium. The method includes: acquiring an initial message and first message standard metadata, and parsing the initial message based on the first message standard metadata to obtain initial message field information; acquiring a message conversion rule set, and converting the initial message field information into target message field information based on the message conversion rule set; acquiring second message standard metadata, and assembling the target message field information based on the second message standard metadata to obtain a target message; wherein the first message standard metadata is obtained by parsing a first message format specification file, the message conversion rule set is obtained by parsing a conversion rule description document, and the second message standard metadata is obtained by parsing a second message format specification file. The technical solution of this invention can improve the scalability of message conversion.
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] Since 2020, the migration of payment message standards has been initiated, such as migrating the FIN standard to the CBPR+ standard. During this migration, situations inevitably arise where two standards coexist, making message conversion between the two different standards unavoidable.

[0003] However, existing message conversion methods have poor scalability and need to be addressed. Summary of the Invention

[0004] This invention provides a message conversion method, apparatus, electronic device, and storage medium to improve the scalability of message conversion.

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

[0006] Obtain the initial message and the first message standard metadata, and parse the initial message based on the first message standard metadata to obtain the initial message field information;

[0007] Obtain the message conversion rule set, and based on the message conversion rule set, convert the initial message field information into the target message field information;

[0008] Obtain the second message standard metadata, and assemble the target message field information based on the second message standard metadata to obtain the target message;

[0009] Among them, the first message standard metadata is obtained by parsing the first message format specification file, which is used to describe the message format of the initial message;

[0010] Among them, the message conversion rule set is obtained by parsing the conversion rule description document, which includes conversion rules for converting the initial message into the target message;

[0011] The second message standard metadata is obtained by parsing the second message format specification file, which is used to describe the message format of the target message.

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

[0013] The initial message field information acquisition module is used to obtain the initial message and the first message standard metadata, and parse the initial message based on the first message standard metadata to obtain the initial message field information;

[0014] The target message field information conversion module is used to obtain the message conversion rule set and convert the initial message field information into the target message field information based on the message conversion rule set.

[0015] The target message acquisition module is used to obtain the second message standard metadata and, based on the second message standard metadata, assemble the target message field information to obtain the target message;

[0016] Among them, the first message standard metadata is obtained by parsing the first message format specification file, which is used to describe the message format of the initial message;

[0017] Among them, the message conversion rule set is obtained by parsing the conversion rule description document, which includes conversion rules for converting the initial message into the target message;

[0018] The second message standard metadata is obtained by parsing the second message format specification file, which is used to describe the message format of the target message.

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

[0020] At least one processor; and

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

[0022] 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.

[0023] 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.

[0024] The technical solution of this invention involves obtaining an initial message and first message standard metadata, parsing the initial message based on the first message standard metadata to obtain initial message field information; obtaining a message conversion rule set, converting the initial message field information into target message field information based on the message conversion rule set; obtaining second message standard metadata, assembling the target message field information based on the second message standard metadata to obtain a target message; wherein, the first message standard metadata is obtained by parsing a first message format specification file, which describes the message format of the initial message; wherein, the message conversion rule set is obtained by parsing a conversion rule description document, which includes conversion rules for converting the initial message into the target message; wherein, the second message standard metadata is obtained by parsing a second message format specification file, which describes the message format of the target message. The technical solution of this invention converts messages by parsing the first message format specification file, the conversion rule description file, and the second message format specification file to obtain the first message standard metadata, the message conversion rule set, and the second message standard metadata. This allows for timely updates to the message conversion process when the relevant standards for message conversion are updated or changed, thereby improving the scalability of message conversion.

[0025] 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

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

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

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

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

[0030] Figure 5 This is a flowchart of an optional example of a message conversion method provided in Embodiment 3 of the present invention;

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

[0032] Figure 7 This is a structural diagram of an optional example of a message conversion method provided in Embodiment 4 of the present invention;

[0033] Figure 8 This is a flowchart of another optional example of a message conversion method provided in Embodiment 4 of the present invention;

[0034] Figure 9 This is a structural block diagram of the message conversion device provided in Embodiment 5 of the present invention;

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

[0036] 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.

[0037] 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.

[0038] Example 1

[0039] Figure 1 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.

[0040] See Figure 1 The method of this invention specifically includes the following steps:

[0041] S110. Obtain the initial message and the first message standard metadata, and parse the initial message based on the first message standard metadata to obtain the initial message field information. The first message standard metadata is obtained by parsing the first message format specification file, which is used to describe the message format of the initial message.

[0042] The initial message can be understood as the message that requires message transformation, such as a CBPR+ message or a FIN message. The first message standard metadata can be understood as the metadata obtained by parsing the first message format specification file, used to characterize the message structure and / or message field format of the initial message; the first message characterizing metadata may specifically include at least one of the following: message field hierarchy, message field name, message field length, whether the message field is nullable, message field default value, and message field repetition count. The first message format specification document is a document used to describe the message format of the initial message. The first message format specification document can be a specification document obtained from an official website or other means. The format of the first message format specification document can be, for example, Hyper Text Markup Language (HTML) format or Extensible Markup Language Schema Definition (XSD) format. The format of the first message format specification document can also be determined by the format of the initial message. For example, if the initial message is a FIN message, the format of the first message format specification document can be HTML format; if the initial message is a CBPR+ message, the format of the first message format specification document can be XSD format. In this embodiment of the invention, the format of the first message format specification document is not specifically limited.

[0043] It is understandable that the first message format specification file includes a description of the message format of the initial message. However, the first message format specification file cannot be directly used to parse and extract the initial message field information of the initial message. Therefore, considering that the first message format specification file can describe the message format of the initial message, such as all elements and attributes that can appear in the initial message, the hierarchical relationship between elements and sub-elements, the order of elements, the number of elements, whether elements and attributes are empty, the data type of elements and attributes, and the default and fixed values ​​of elements and attributes, the first message format specification file can be parsed and extracted to obtain the first message standard metadata that can characterize the message structure and / or message field format of the initial message. This first message standard metadata can be used to parse and extract the initial message field information of the initial message. The first message standard metadata can be persistently saved so as to serve as the basis for the analysis and extraction of relevant information in the initial message. In this embodiment of the invention, the first message format specification file can be parsed to obtain the first message standard metadata through scripts or components. For example, if the initial message is a FIN message, the FIN message format specification file can be parsed using a shell script to extract the FIN message standard metadata. As another example, if the initial message is a CBPR+ message, the dom4j open-source component can be used to parse the CBPR+ message format specification file to obtain the CBPR+ message standard metadata.

[0044] In this embodiment of the invention, an initial message and first message standard metadata can be obtained, and the initial message can be parsed based on the first message standard metadata to obtain initial message field information. The initial message field information can be understood as information related to the message field of the initial message. The initial message field information can be a set of information in the form of key-value pairs, and the key in the key-value pair can be the complete value path of the message field of the initial message.

[0045] Understandably, the first message standard metadata obtained by parsing the first message format specification file can be updated or changed accordingly when the first message format specification file is updated or changed, thus improving the scalability of message conversion.

[0046] S120. Obtain the message conversion rule set, and based on the message conversion rule set, convert the initial message field information into the target message field information. The message conversion rule set is obtained by parsing the conversion rule description document, which includes conversion rules for converting the initial message into the target message.

[0047] The message conversion rule set can be understood as a set of conversion rules obtained by parsing the conversion rule description document, including the conversion rules for converting initial message field information into target message field information; the message conversion rule set can be obtained by automatically extracting, refining and parsing the conversion rule description document. A transformation rule description document is a document that includes transformation rules for converting an initial message into a target message. This document can be obtained from an official website or other sources, such as a series of transformation rule description documents published by SWIFT (Society for Worldwide Interbank Financial Telecommunication). It can include public function description documents, message pair transformation description documents, and / or dictionary tables, etc., documents that characterize the transformation rules. The format of the transformation rule description document can be, for example, a portable document format (PDF) or a spreadsheet (Microsoft Excel, XLS). In this embodiment of the invention, the format of the transformation rule description document is not specifically limited. The presentation of the transformation rule description document can be a unified style of description language similar to pseudocode, which provides feasibility for the automatic extraction of message transformation rule sets. For example, the transformation rule (MT_To_MXPartyAccount) for a party account in the transformation rule description document can be a unified style of description language similar to pseudocode. The target message can be understood as the message obtained through the required transformation, such as a CBPR+ message or a FIN message, etc. Transformation rules can be understood as the rules that can transform the initial message into the target message.

[0048] It is understood that the conversion rule description document includes conversion rules that describe how to convert an initial message into a target message. However, the conversion rule description document cannot be directly used to convert the initial message into the target message. Therefore, the conversion rule description document can be parsed and extracted to obtain a message conversion rule set. This message conversion rule set can convert the initial message field information into the target message field information, and the message conversion rule set can be persistently saved as the basis for converting the initial message field information into the target message field information. In this embodiment of the invention, the message conversion rule set can be obtained by parsing the conversion rule description document through scripts or components.

[0049] In this embodiment of the invention, a message conversion rule set can be obtained, and based on the message conversion rule set, the initial message field information can be converted into target message field information. The target message field information can be understood as information related to the message field of the target message. The target message field information can be a set of information existing in the form of key-value pairs.

[0050] Understandably, the message conversion rule set obtained by parsing the conversion rule description document can be updated or changed accordingly when the conversion rule description document is updated or changed, thus further improving the scalability of message conversion.

[0051] S130. Obtain the second message standard metadata and assemble the target message field information based on the second message standard metadata to obtain the target message. The second message standard metadata is obtained by parsing the second message format specification file, which is used to describe the message format of the target message.

[0052] The second message standard metadata can be understood as metadata obtained by parsing the second message format specification file, used to characterize the message structure and / or message field format of the target message. Specifically, the second message characterization metadata may include at least one of the following: message field hierarchy, message field name, message field length, whether a message field is nullable, message field default value, and message field repetition count. The second message format specification file is a file used to describe the message format of the target message. The second message format specification file may be a specification file obtained from an official website or other means. The format of the second message format specification file may be, for example, Hyper Text Markup Language (HTML) or Extensible Markup Language Schema Definition (XSD). The format of the second message format specification file may also be determined by the format of the target message. For example, if the target message is a FIN message, the format of the second message format specification file may be HTML; if the target message is a CBPR+ message, the format of the second message format specification file may be XSD. In this embodiment of the invention, the format of the second message format specification file is not specifically limited.

[0053] It is understood that the second message format specification file includes a description of the message format of the target message. However, the second message format specification file cannot be directly used to assemble the target message field information to obtain the target message. Therefore, the second message format specification file can be parsed and extracted to obtain second message standard metadata that can characterize the message structure and / or message field format of the target message. This second message standard metadata can be used to assemble the target message field information to obtain the target message. The second message standard metadata can be persistently saved to serve as the basis for assembling the target message field information to obtain the target message. In this embodiment of the invention, the second message format specification file can be parsed to obtain the second message standard metadata through scripts or components. For example, when the target message is a FIN message, a shell script can be used to parse the FIN message format specification file and extract the FIN message standard metadata; as another example, when the target message is a CBPR+ message, the dom4j open-source component can be used to parse the CBPR+ message format specification file and obtain the CBPR+ message standard metadata.

[0054] Understandably, the second message standard metadata obtained by parsing the second message format specification file can be updated or changed accordingly when the second message format specification file is updated or changed, thus improving the scalability of message conversion.

[0055] In this embodiment of the invention, various message format specification files can be parsed in advance to obtain and store multiple message standard metadata. For example, see [link to relevant documentation]. Figure 2 The FIN message format specification file (HTML format) and the CBPR+ message format specification file (XSD format) can be extracted using metadata to obtain FIN message format metadata and CBPR+ message format metadata. The FIN message format metadata is used as the FIN message standard metadata, and the CBPR+ message format metadata is used as the CBPR+ message standard metadata, resulting in multiple message standard metadata. These multiple message standard metadata are stored, and when needed, the required message standard metadata can be obtained from the multiple obtained message standard metadata and used as the first message standard metadata or the second message standard metadata.

[0056] The technical solution of this invention involves obtaining an initial message and first message standard metadata, parsing the initial message based on the first message standard metadata to obtain initial message field information; obtaining a message conversion rule set, converting the initial message field information into target message field information based on the message conversion rule set; obtaining second message standard metadata, assembling the target message field information based on the second message standard metadata to obtain a target message; wherein, the first message standard metadata is obtained by parsing a first message format specification file, which describes the message format of the initial message; wherein, the message conversion rule set is obtained by parsing a conversion rule description document, which includes conversion rules for converting the initial message into the target message; wherein, the second message standard metadata is obtained by parsing a second message format specification file, which describes the message format of the target message. The technical solution of this invention converts messages by parsing the first message format specification file, the conversion rule description file, and the second message format specification file to obtain the first message standard metadata, the message conversion rule set, and the second message standard metadata. This allows for timely updates to the message conversion process when the relevant standards for message conversion are updated or changed, thereby improving the scalability of message conversion.

[0057] Example 2

[0058] Figure 3 This is a flowchart of another message conversion method provided in Embodiment 2 of the present invention. This embodiment is based on and optimized from the above-described technical solutions. Optionally, in this embodiment, after converting the initial message field information into the target message field information based on the message conversion rule set, the message conversion method further includes: obtaining loss truncation information, wherein the loss truncation information includes information lost and / or truncated during the conversion of the initial message field information into the target message field information; and displaying the loss truncation information. The explanations of terms that are the same as or corresponding to those in the above embodiments are not repeated here.

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

[0060] S210. Obtain the initial message and the first message standard metadata, and parse the initial message based on the first message standard metadata to obtain the initial message field information. The first message standard metadata is obtained by parsing the first message format specification file, which is used to describe the message format of the initial message.

[0061] S220. Obtain the message conversion rule set, and based on the message conversion rule set, convert the initial message field information into the target message field information. The message conversion rule set is obtained by parsing the conversion rule description document, which includes conversion rules for converting the initial message into the target message.

[0062] S230. Obtain lost / truncated information, wherein the lost / truncated information includes information lost and / or truncated during the process of converting the initial message field information into the target message field information.

[0063] It is understandable that during the conversion of initial message field information to target message field information, some information may be truncated and / or lost, and there may also be situations where the conversion is forcibly stopped. In these cases, the converted target message field information may differ in content from the initial message field information. To enable users to understand the information lost and / or truncated during the conversion of initial message field information to target message field information, the lost and / or truncated information can be recorded as lost / truncated information during the conversion process based on the message conversion rule set. This lost / truncated information is obtained after the conversion is complete.

[0064] In this embodiment of the invention, during the process of converting initial message field information into target message field information based on the message conversion rule set, other information may also be recorded, such as whether the conversion was successful, the number of converted message fields, and / or the number of message conversion rules in the message conversion rule set executed, and the aforementioned other information may be obtained. In this embodiment of the invention, the other information obtained may be any information obtained during the process of converting initial message field information into target message field information, without specific limitations.

[0065] S240, Display missing / truncation information.

[0066] In this embodiment of the invention, the lost truncation information can be displayed, for example, by displaying the lost truncation information on a display screen, or by providing a voice prompt about the lost truncation information, etc. In this embodiment of the invention, there is no specific limitation on the form of displaying the lost truncation information.

[0067] In this embodiment of the invention, other information may also be shown in the process of converting the initial message field information into the target message field information.

[0068] S250. Obtain the second message standard metadata and assemble the target message field information based on the second message standard metadata to obtain the target message. The second message standard metadata is obtained by parsing the second message format specification file, which is used to describe the message format of the target message.

[0069] In this embodiment of the invention, after obtaining the target message, the obtained target message and the loss / truncation information can be displayed together as display information.

[0070] The technical solution of this invention provides lost / truncated information, which includes information lost and / or truncated during the conversion of initial message field information into target message field information; and displays the lost / truncated information. In this invention, by obtaining and displaying the lost / truncated information, the message conversion process becomes clear and traceable, allowing users to gain a more comprehensive understanding of the message conversion results after conversion.

[0071] Example 3

[0072] Figure 4 This is a flowchart of another message conversion method provided in Embodiment 3 of the present invention. This embodiment is based on and optimized from the above-mentioned technical solutions. In this embodiment, optionally, the message conversion rule set is obtained through the following steps: obtaining a conversion rule description document and extracting initial rule information from the conversion rule description document; performing part-of-speech tagging on the initial rule information to obtain part-of-speech tagging rule information; performing syntactic analysis on the part-of-speech tagging rule information to obtain grammar set information; generating target source code based on the grammar set information and packaging the target source code to obtain the message conversion rule set. The explanations of terms that are the same as or corresponding to those in the above embodiments are not repeated here.

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

[0074] S310. Obtain the transformation rule description document and extract the initial rule information from the transformation rule description document.

[0075] It is important to note that, considering the potential inconsistencies in message field naming within the conversion rule description document (e.g., multiple naming formats, spelling errors, etc.), and the possibility of using both full and relative paths, as well as both full spellings and abbreviations, a more efficient approach is to obtain the initial rule information from the conversion rule description document. This initial rule information is then processed in subsequent steps to obtain the message conversion rule set. This approach leverages the overall consistency of the description style within the conversion rule description document, avoiding errors easily introduced by manual reading and understanding of the document. Furthermore, it addresses the issue of inconsistent details in the document, thereby improving the accuracy of the resulting message conversion rule set.

[0076] In this embodiment of the invention, initial rule information can be extracted from the transformation rule description document. This extraction can be achieved through components or scripts, such as using open-source components like POI to parse and extract the initial rule information from the transformation rule description document. This initial rule information is the relevant information that can characterize the transformation rules in the transformation rule description document.

[0077] After extracting the initial rule information, it can be persistently saved to serve as the basis for subsequent analysis and extraction of message transformation rule sets.

[0078] S320. Perform part-of-speech tagging on the initial rule information to obtain part-of-speech tagging rule information.

[0079] Among them, part-of-speech tagging rule information can be understood as the information obtained after processing the initial rule information with part-of-speech tagging.

[0080] It is understandable that, since the initial rule information has certain textual patterns, it can be processed by word segmentation, automatic tagging and / or logical optimization based on these patterns. This can automatically identify various word strings such as variables, constants, operators and / or method names in the initial rule information, thereby enabling part-of-speech tagging of the initial rule information and obtaining part-of-speech tagging rule information.

[0081] In this embodiment of the invention, the part-of-speech tagging rule information can be further processed by word segmentation, automatic tagging, and / or logical optimization, and the part-of-speech tagging rule information can be updated according to the processing results. The steps of further processing the part-of-speech tagging rule information by word segmentation, automatic tagging, and / or logical optimization, and updating the part-of-speech tagging rule information according to the processing results, can be repeated until part-of-speech tagging is completed for all strings after word segmentation of the initial rule information. It should be noted that the above process is a multi-round iterative process. Each iteration can perform logical optimization based on the information of previous automatic tagging failures, and then re-perform word segmentation and automatic tagging until all strings after word segmentation of the initial rule information are successfully tagged.

[0082] S330. Perform syntactic analysis on the part-of-speech tagging rule information to obtain syntactic set information.

[0083] In this embodiment of the invention, part-of-speech tagging rule information can be subjected to syntactic analysis to obtain syntactic set information that represents the syntactic set of transformation rules. This syntactic set information may include at least one of the following: message information field retrieval syntactics, message information field setting syntactics, function call syntactics, logical judgment syntactics, logical operation syntactics, mathematical operation syntactics, flow control syntactics, variable definition syntactics, keyword definition syntactics, test case definition syntactics, and test result definition syntactics. In this embodiment of the invention, no specific limitation is made on the syntactic information that may be included in the syntactic set information.

[0084] S340. Generate the target source code based on the syntax set information, and package the target source code to obtain the message conversion rule set.

[0085] Understandably, since the syntax in the syntax set information is very close to the syntax of computer programming, target source code can be generated based on the syntax set information. This target source code is the source code that can be packaged to obtain the message conversion rule set. Then, the target source code is packaged to obtain the message conversion rule set. For example, the target source code can be the Java language rule class source code, constant class source code, and / or unit test class source code automatically generated based on the syntax set information. The target source code is then packaged to obtain the message conversion rule set JAR file. The obtained message conversion rule set JAR file can be used as a component for message conversion tools to import and use.

[0086] The message conversion rule set can be obtained through steps S310 to S340.

[0087] S350. Obtain the initial message and the first message standard metadata, and parse the initial message based on the first message standard metadata to obtain the initial message field information. The first message standard metadata is obtained by parsing the first message format specification file, which is used to describe the message format of the initial message.

[0088] S360. Obtain the message conversion rule set. Based on the message conversion rule set, convert the initial message field information into the target message field information. The message conversion rule set is obtained by parsing the conversion rule description document, which includes conversion rules for converting the initial message into the target message.

[0089] S370. Obtain the second message standard metadata and assemble the target message field information based on the second message standard metadata to obtain the target message. The second message standard metadata is obtained by parsing the second message format specification file, which is used to describe the message format of the target message.

[0090] The technical solution of this invention provides that the message conversion rule set is obtained through the following steps: obtaining a conversion rule description document and extracting initial rule information from the document; performing part-of-speech tagging on the initial rule information to obtain part-of-speech tagging rule information; performing syntactic analysis on the tagging rule information to obtain grammar set information; generating target source code based on the grammar set information and packaging the source code to obtain the message conversion rule set. In this invention, obtaining the message conversion rule set through the conversion rule description document allows for the conversion of initial message field information into target message field information from a document that cannot directly convert the initial message into the target message, thus facilitating message conversion based on the rule set.

[0091] An optional technical solution, before packaging the target source code to obtain the message conversion rule set, the message conversion method further includes: compiling and verifying the target source code; if the compilation and verification fails, obtaining the correction result of the target source code; and updating the target source code based on the correction result.

[0092] It is important to note that the conversion rule description document may contain spelling and description errors, which may also lead to problems with the generated target source code, rendering the resulting message conversion rule set unusable. To address this issue, the target source code can be compiled and verified before packaging to obtain the message conversion rule set. If the compilation and verification fail, the target source code can be checked and corrected automatically or manually to obtain the corrected result. This corrected result is the final version of the target source code. Updating the target source code based on the corrected result can resolve the issue of the message conversion rule set not functioning correctly.

[0093] Based on the above solution, another optional technical solution, after updating the target source code according to the correction results, further includes: repeatedly executing the step of compiling and verifying the target source code; if the compilation and verification pass, obtaining the unit test class, and performing logical verification on the target source code based on the unit test class; and packaging the target source code to obtain a message conversion rule set, including: if the logical verification passes, packaging the target source code to obtain a message conversion rule set.

[0094] In this embodiment of the invention, after updating the target source code based on the correction result, the step of compiling and verifying the target source code can be repeated until the compilation and verification pass, so as to further ensure that the message conversion rule set can be used normally.

[0095] In this embodiment of the invention, if the compilation verification passes, a unit test class can be obtained. This unit test class can be understood as a class that performs logical verification tests on the smallest testable unit in the target source code. Based on the unit test class, the target source code is logically verified.

[0096] It is important to note that unit test classes can be provided by the source of the conversion rule description document, such as the SWIFT website; they can also be obtained by parsing the test cases provided by the source of the conversion rule description document; they can be supplemented by the user; or they can be supplemented by the user when there are no corresponding unit test classes for some conversion rules in the target source code, or when there are no corresponding test cases for some conversion rules in the source of the conversion rule description document. In this embodiment of the invention, to further ensure that the message conversion rule set can be used normally, the logical verification of the target source code based on all unit test classes must pass.

[0097] In this embodiment of the invention, if the logical verification passes, the target source code is packaged to obtain a message conversion rule set, which can further ensure that the message conversion rule set can be used normally.

[0098] To better understand the technical solutions of the above embodiments of the present invention, an optional example is provided herein. For example, see [link to example]. Figure 5 The process involves obtaining PDF, XLS, and error code description documents of SWIFT message transformation rules from the SWIFT website as transformation rule description documents. From these documents, basic function description corpora and common function description corpora (i.e., transformation rule description corpora) are extracted as initial rule information. Lexical analysis is then used to perform part-of-speech tagging on the initial rule information, resulting in a sequence of tagged words, variables, constants, function names, flow control words, and operators, etc., as part-of-speech tagging rule information. Syntactic analysis is then performed on the part-of-speech tagging rule information to obtain a grammar set including expression syntax, flow control syntax, variable / constant definition syntax, and test case definition syntax. Based on this grammar set information, transformation rule class source code and dictionary constant class source code are generated as target source code. The target source code is then compiled and tested, and updated based on the compilation and test results. Finally, the target source code is packaged into a transformation rule set JAR file, which serves as the message transformation rule set.

[0099] Example 4

[0100] Figure 6This is a flowchart of another message conversion method provided in Embodiment 4 of the present invention. This embodiment is an optimization based on the above-described technical solutions. In this embodiment, optionally, converting initial message field information into target message field information based on a message conversion rule set includes: parsing the initial message to obtain the initial message type; filtering the initial message conversion rules in the message conversion rule set based on the initial message type to obtain target message conversion rules; and converting the initial message field information into target message field information based on the target message conversion rules. The explanations of terms that are the same as or corresponding to those in the above embodiments are not repeated here.

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

[0102] S410. Obtain the initial message and the first message standard metadata, and parse the initial message based on the first message standard metadata to obtain the initial message field information. The first message standard metadata is obtained by parsing the first message format specification file, which is used to describe the message format of the initial message.

[0103] S420. Obtain the message conversion rule set, wherein the message conversion rule set is obtained by parsing the conversion rule description document, and the conversion rule description document includes conversion rules for converting the initial message into the target message.

[0104] S430. Parse the initial message to obtain the initial message type.

[0105] In this embodiment of the invention, the initial message can be parsed to obtain the initial message type. The initial message type can be understood as the type of the initial message, such as the FIN format type or the CBPR+ format type, etc.

[0106] S440. Based on the initial message type, filter the initial message conversion rules in the message conversion rule set to obtain the target message conversion rule.

[0107] It is understood that the conversion rule description document may include descriptions of conversion rules for converting different initial messages into different target messages. For example, the conversion rule description document may include descriptions of conversion rules for converting FIN messages into CBPR+ messages and CBPR+ messages into FIN messages, etc. In this embodiment of the invention, the content included in the conversion rule description document is not specifically limited. Therefore, the resulting message conversion rule set may not only include conversion rules for converting initial message field information into target message field information. Considering the above, in this embodiment of the invention, the initial message conversion rules in the message conversion rule set can be filtered based on the initial message type to obtain target message conversion rules. These initial message conversion rules are the conversion rules in the message conversion rule set, and these target message conversion rules are the conversion rules in the message conversion rule set that can convert initial message field information into target message field information.

[0108] In this embodiment of the invention, the target message conversion rule can also be obtained by filtering the initial message conversion rule in the message conversion rule set based on the initial message type and the target message type, where the target message type is the message type of the target message.

[0109] S450. Based on the target message conversion rules, convert the initial message field information into the target message field information.

[0110] In this embodiment of the invention, the initial message field information can be converted into the target message field information based on the target message conversion rule that can convert the initial message field information into the target message field information.

[0111] S460. Obtain the second message standard metadata and assemble the target message field information based on the second message standard metadata to obtain the target message. The second message standard metadata is obtained by parsing the second message format specification file, which is used to describe the message format of the target message.

[0112] The technical solution of this invention involves parsing an initial message to obtain an initial message type; based on the initial message type, filtering the initial message conversion rules in the message conversion rule set to obtain target message conversion rules; and based on the target message conversion rules, converting the initial message field information into target message field information. In this invention, target message conversion rules can be obtained by filtering from the message conversion rule set, so that the obtained target message conversion rules are applicable to converting the initial message field information into target message field information.

[0113] An optional technical solution includes at least two target message conversion rules; converting initial message field information into target message field information based on the target message conversion rules, including: obtaining the priority of each of the at least two target message conversion rules, and sorting the at least two target message conversion rules based on the priority; and converting the initial message field information into target message field information one by one using the at least two target message conversion rules based on the obtained sorting result.

[0114] In this embodiment of the invention, when there are at least two target packet conversion rules, the priority of each of the at least two target packet conversion rules can be obtained. This priority can characterize the importance or execution order of the target packet conversion rules. The priority can be obtained by parsing the conversion rule description document, or it can be determined according to the conversion requirements. In this embodiment of the invention, the source of the priority is not specifically limited. Based on the priority, the at least two target packet conversion rules are sorted. For example, the at least two target packet conversion rules can be sorted in order of priority from high to low, or in order of priority from low to high. There is no specific limitation here. Based on the sorting result, the initial packet field information is converted into target packet field information one by one using the at least two target packet conversion rules.

[0115] For example, one could obtain the priority of each of the at least two target message conversion rules, and based on the priority, sort the at least two target message conversion rules in ascending order of priority. Based on the sorting result, execute the target message conversion rule with lower priority among the at least two target message conversion rules one by one, and convert the initial message field information into target message field information, so as to overwrite and update the execution result of the target message conversion rule with higher priority with the execution result of the target message conversion rule with lower priority.

[0116] In this embodiment of the invention, the number of target message conversion rules is at least two; the priority of each of the at least two target message conversion rules is obtained, and the at least two target message conversion rules are sorted based on the priority; based on the obtained sorting result, the initial message field information is converted into target message field information one by one using the at least two target message conversion rules, so that the converted target message field information is more in line with the conversion standard.

[0117] To better understand the technical solutions of the above embodiments of the present invention, an optional example is provided herein. For example, see [link to example]. Figure 7The obtained message conversion rule set, along with FIN message standard metadata and CBPR+ message standard metadata, can be loaded as components into a message conversion tool that includes a message parsing component, a rule calculation component, a message assembly component, and a component management component. Specifically,

[0118] The conversion rule set component obtained from the message conversion rule set, the FIN message standard metadata component obtained from the FIN message standard metadata, and the CBPR+ message standard metadata component obtained from the CBPR+ message standard metadata can be loaded into the message conversion tool as the underlying components of the message conversion tool. They can be managed through the component management component, which can specifically manage the initial loading and updating of the conversion rule set component, the FIN message standard metadata component, and the CBPR+ message standard metadata component.

[0119] The message parsing component can parse the initial message based on the FIN message standard metadata or CBPR+ message standard metadata loaded into the message conversion tool. The content of each information field of the parsed initial message is stored in a set as key-value pairs as the initial message field information.

[0120] The rule calculation component can transform the initial message field information based on the message conversion rule set to obtain the set of message field key-value pairs of the target message as the target message field information. At the same time, it records the loss and truncation information during the rule calculation process and important prompts such as whether the forced stop conversion condition is met, so that the above important prompts can be displayed later, so that users of the message conversion tool can fully understand the message conversion results.

[0121] The message assembly component can assemble the target message from the target message field information based on the FIN message standard metadata or CBPR+ message standard metadata loaded into the message conversion tool.

[0122] To better understand the technical solutions of the above embodiments of the present invention, an optional example is provided herein. For example, see [link to example]. Figure 8The process involves: acquiring the initial message and first message standard metadata; parsing the initial message based on the first message standard metadata to obtain initial message field information; parsing the initial message to obtain the initial message type; acquiring a message conversion rule set; filtering the initial message conversion rules in the message conversion rule set based on the initial message type to obtain at least two target message conversion rules as the target message conversion rule set; acquiring the priority of each target message conversion rule in the at least two target message conversion rules; sorting the at least two target message conversion rules in the target message conversion rule set based on the priority; determining whether there are any unexecuted target message conversion rules in the target message conversion rule set; if there are unexecuted target message conversion rules, determining whether the current message conversion status hits the termination rule; if not, selecting target message conversion rules to be executed from the at least two target message conversion rules based on the obtained sorting result; executing the unexecuted target message conversion rules on the initial message field information and updating the initial message field information according to the execution result; and determining whether there are any issues during the process of converting the initial message field information into target message field information. In the event of information loss and / or truncation; if information loss and / or truncation exist, update the loss and truncation information accordingly. The updated loss and truncation information may include the reason for the information loss and / or truncation, and the name of the target message conversion rule that resulted in information loss and / or truncation after execution; return to determine if there are any unexecuted target message conversion rules in the target message conversion rule set; if no information loss and / or truncation exists, return to determine if there are any unexecuted target message conversion rules in the target message conversion rule set. If a termination rule is hit, the initial message field information is used as the target message field information; the second message standard metadata is obtained, and the target message field information is assembled based on the second message standard metadata to obtain the target message; the target message and the loss / truncation information are used as the conversion result; if there is no target message conversion rule to be executed, the initial message field information is used as the target message field information; the second message standard metadata is obtained, and the target message field information is assembled based on the second message standard metadata to obtain the target message; the target message and the loss / truncation information are used as the conversion result.

[0123] Example 5

[0124] Figure 9 This is a structural block diagram of the message conversion apparatus provided in Embodiment 5 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 9The device may specifically include: an initial message field information acquisition module 510, a target message field information conversion module 520, and a target message acquisition module 530.

[0125] The initial message field information acquisition module 510 is used to acquire the initial message and the first message standard metadata, and parse the initial message based on the first message standard metadata to obtain the initial message field information.

[0126] The target message field information conversion module 520 is used to obtain a message conversion rule set and convert the initial message field information into the target message field information based on the message conversion rule set.

[0127] The target message acquisition module 530 is used to obtain the second message standard metadata and assemble the target message field information based on the second message standard metadata to obtain the target message;

[0128] Among them, the first message standard metadata is obtained by parsing the first message format specification file, which is used to describe the message format of the initial message;

[0129] Among them, the message conversion rule set is obtained by parsing the conversion rule description document, which includes conversion rules for converting the initial message into the target message;

[0130] The second message standard metadata is obtained by parsing the second message format specification file, which is used to describe the message format of the target message.

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

[0132] The module for obtaining lost and truncated information is used to obtain lost and truncated information after converting the initial message field information into the target message field information based on the message conversion rule set. The lost and truncated information includes information lost and / or truncated during the conversion of the initial message field information into the target message field information.

[0133] The module for displaying lost / truncated information is used to display lost / truncated information.

[0134] Optionally, the message conversion device may also include the following modules to obtain the message conversion rule set:

[0135] The initial rule information acquisition module is used to obtain the transformation rule description document and extract the initial rule information from the transformation rule description document.

[0136] The part-of-speech tagging rule information acquisition module is used to perform part-of-speech tagging processing on the initial rule information to obtain part-of-speech tagging rule information;

[0137] The grammar set information acquisition module is used to perform grammatical analysis on the part-of-speech tagging rule information to obtain grammar set information.

[0138] The message conversion rule set acquisition module is used to generate target source code based on syntax set information and package the target source code to obtain the message conversion rule set.

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

[0140] The target source code compilation and verification module is used to compile and verify the target source code before packaging it to obtain the message conversion rule set.

[0141] The correction result module is used to obtain the correction result of the target source code when the compilation verification fails;

[0142] The target source code update module is used to update the target source code based on the correction results.

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

[0144] The compilation and verification repetition module is used to repeatedly execute the compilation and verification steps of the target source code after updating the target source code based on the correction results.

[0145] The target source code logic verification module is used to obtain the unit test class after the compilation verification passes, and to perform logic verification on the target source code based on the unit test class.

[0146] The message conversion rule set acquisition module may include:

[0147] The message conversion rule set is obtained by packaging the target source code after the logical verification passes, thus obtaining the message conversion rule set.

[0148] Optionally, the target message field information conversion module 520 may include:

[0149] The initial message type acquisition unit is used to parse the initial message and obtain the initial message type;

[0150] The target message conversion rule obtaining unit is used to filter the initial message conversion rules in the message conversion rule set based on the initial message type to obtain the target message conversion rule;

[0151] The target message field information conversion unit is used to convert the initial message field information into the target message field information based on the target message conversion rules.

[0152] Based on the above scheme, optionally, the number of target message transformation rules is at least two;

[0153] The target message field information conversion unit may include:

[0154] The target message conversion rule sorting subunit is used to obtain the priority of each of the at least two target message conversion rules, and sort the at least two target message conversion rules based on the priority.

[0155] The target message field information conversion subunit is used to convert the initial message field information into target message field information by using at least two target message conversion rules, based on the obtained sorting results.

[0156] The message conversion apparatus provided in Embodiment 5 of the present invention obtains an initial message and first message standard metadata through an initial message field information acquisition module, and parses the initial message based on the first message standard metadata to obtain initial message field information; obtains a message conversion rule set through a target message field information conversion module, and converts the initial message field information into target message field information based on the message conversion rule set; obtains a second message standard metadata through a target message acquisition module, and assembles the target message field information based on the second message standard metadata to obtain a target message; wherein, the first message standard metadata is obtained by parsing a first message format specification file, which describes the message format of the initial message; wherein, the message conversion rule set is obtained by parsing a conversion rule description document, which includes conversion rules for converting the initial message into the target message; wherein, the second message standard metadata is obtained by parsing a second message format specification document, which describes the message format of the target message. The aforementioned device performs message conversion by parsing the first message format specification file, the conversion rule description file, and the second message format specification file to obtain the first message standard metadata, the message conversion rule set, and the second message standard metadata. This allows for timely updates to the message conversion process when the relevant standards for message conversion are updated or changed, thereby improving the scalability of message conversion.

[0157] 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.

[0158] 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.

[0159] Example 6

[0160] Figure 10 A 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.

[0161] like Figure 10 As shown, 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 program stored in the ROM 12 or loaded into the RAM 13 from storage unit 18. 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.

[0162] 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.

[0163] 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.

[0164] 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).

[0165] 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.

[0166] 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.

[0167] 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.

[0168] 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).

[0169] 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.

[0170] 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.

[0171] 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.

[0172] 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 by, include: Obtain the initial message and the first message standard metadata, and parse the initial message based on the first message standard metadata to obtain the initial message field information; Obtain a message conversion rule set, and based on the message conversion rule set, convert the initial message field information into target message field information; Obtain the second message standard metadata, and assemble the target message field information based on the second message standard metadata to obtain the target message; The first message standard metadata is obtained by parsing the first message format specification file, which is used to describe the message format of the initial message. The first message standard metadata includes at least one of the following: message field level, message field name, message field length, whether the message field is empty, message field default value, and message field repetition count. The message conversion rule set is obtained by parsing a conversion rule description document, which includes conversion rules for converting the initial message into the target message. The second message standard metadata is obtained by parsing the second message format specification file, which describes the message format of the target message. The second message standard metadata includes at least one of the following: message field level, message field name, message field length, whether the message field is empty, message field default value, and message field repetition count. The message conversion rule set is obtained through the following steps: Obtain the transformation rule description document and extract the initial rule information from the transformation rule description document; The initial rule information is subjected to part-of-speech tagging to obtain part-of-speech tagging rule information; The part-of-speech tagging rule information is subjected to syntactic analysis to obtain grammar set information; The target source code is generated based on the syntax set information, and the target source code is packaged to obtain the message conversion rule set.

2. The method of claim 1, wherein, After converting the initial message field information into the target message field information based on the message conversion rule set, the method further includes: Obtain lost and truncated information, wherein the lost and truncated information includes information lost and / or truncated during the process of converting the initial message field information into the target message field information; Display the lost / truncated information.

3. The method of claim 1, wherein, Before packaging the target source code to obtain the message conversion rule set, the method further includes: The target source code is compiled and verified; If the compilation verification fails, the corrected result of the target source code is obtained; Based on the correction results, the target source code is updated.

4. The method of claim 3, wherein, After updating the target source code based on the correction result, the method further includes: Repeat the steps of compiling and verifying the target source code; If the compilation verification passes, obtain the unit test class, and perform logical verification on the target source code based on the unit test class; The process of packaging the target source code to obtain the message conversion rule set includes: If the logical verification passes, the target source code is packaged to obtain the message conversion rule set.

5. The method of claim 1, wherein, The step of converting the initial message field information into the target message field information based on the message conversion rule set includes: The initial message is parsed to obtain the initial message type; Based on the initial message type, the initial message conversion rules in the message conversion rule set are filtered to obtain the target message conversion rules; Based on the target message conversion rule, the initial message field information is converted into the target message field information.

6. The method of claim 5, wherein, The number of target message conversion rules is at least two; The step of converting the initial message field information into target message field information based on the target message conversion rule includes: Obtain the priority of each of the at least two target packet conversion rules, and sort the at least two target packet conversion rules based on the priority; Based on the obtained sorting results, the initial message field information is converted into target message field information by using the at least two target message conversion rules one by one.

7. A message conversion device, characterized in that, include: The initial message field information acquisition module is used to acquire the initial message and the first message standard metadata, and parse the initial message based on the first message standard metadata to obtain the initial message field information; The target message field information conversion module is used to obtain a message conversion rule set and convert the initial message field information into target message field information based on the message conversion rule set. The target message acquisition module is used to obtain the second message standard metadata and, based on the second message standard metadata, assemble the target message field information to obtain the target message; The first message standard metadata is obtained by parsing the first message format specification file, which is used to describe the message format of the initial message. The first message standard metadata includes at least one of the following: message field level, message field name, message field length, whether the message field is empty, message field default value, and message field repetition count. The message conversion rule set is obtained by parsing a conversion rule description document, which includes conversion rules for converting the initial message into the target message. The second message standard metadata is obtained by parsing the second message format specification file, which describes the message format of the target message. The second message standard metadata includes at least one of the following: message field level, message field name, message field length, whether the message field is empty, message field default value, and message field repetition count. The message conversion device further includes: The initial rule information acquisition module is used to obtain the transformation rule description document and extract the initial rule information from the transformation rule description document; The part-of-speech tagging rule information acquisition module is used to perform part-of-speech tagging processing on the initial rule information to obtain part-of-speech tagging rule information; The grammar set information acquisition module is used to perform grammatical analysis on the part-of-speech tagging rule information to obtain grammar set information; The message conversion rule set acquisition module is used to generate target source code based on the syntax set information, and package the target source code to obtain the message conversion rule set.

8. 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-6.

9. 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-6.

Citation Information

Patent Citations

  • Method and system for converting communication messages

    CN103428184A

  • Structured message self-adaptive conversion method and device

    CN109889553A

  • File storage conversion processing method and device, electronic equipment and storage medium

    CN113407488A

  • Message conversion method and device, equipment and medium

    CN114070886A