CN116320060A - Message conversion method and device, electronic equipment and storage medium - Google Patents

Message conversion method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116320060A
CN116320060A CN202310272507.1A CN202310272507A CN116320060A CN 116320060 A CN116320060 A CN 116320060A CN 202310272507 A CN202310272507 A CN 202310272507A CN 116320060 A CN116320060 A CN 116320060A
Authority
CN
China
Prior art keywords
message
target
initial
conversion rule
domain information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310272507.1A
Other languages
Chinese (zh)
Inventor
张文敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202310272507.1A priority Critical patent/CN116320060A/en
Publication of CN116320060A publication Critical patent/CN116320060A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion

Abstract

The embodiment of the invention discloses a message conversion method, a message conversion device, electronic equipment and a storage medium. The method comprises the following steps: acquiring an initial message and first message standard metadata, and analyzing the initial message based on the first message standard metadata to obtain initial message domain information; acquiring a message conversion rule set, and converting the initial message domain information into target message domain information based on the message conversion rule set; acquiring second message standard metadata, and assembling the target message domain information based on the second message standard metadata to obtain a target message; the first message standard metadata is obtained by analyzing a first message format description file, the message conversion rule set is obtained by analyzing a conversion rule description file, and the second message standard metadata is obtained by analyzing a second message format description file. The technical scheme of the embodiment of the invention can improve the expandability of message conversion.

Description

Message conversion method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the field of computer application, in particular to a message conversion method, a message conversion device, electronic equipment and a storage medium.
Background
Since 2020, standard migration matters for payment class messages have been initiated, such as migrating the FIN standard to the cbpr+ standard. In the message standard migration process, there is a situation that two standards coexist, and in this case, message conversion under two different standards is unavoidable.
However, the existing message conversion method is poor in expandability and is easy to solve.
Disclosure of Invention
The embodiment of the invention provides a message conversion method, a device, electronic equipment and a storage medium, so as to improve the expandability of message conversion.
According to an aspect of the present invention, there is provided a message conversion method, which may include:
acquiring an initial message and first message standard metadata, and analyzing the initial message based on the first message standard metadata to obtain initial message domain information;
acquiring a message conversion rule set, and converting the initial message domain information into target message domain information based on the message conversion rule set;
acquiring second message standard metadata, and assembling the target message domain information based on the second message standard metadata to obtain a target message;
the first message standard metadata is obtained by analyzing a first message format description file, and the first message format description file is used for describing a message format of an initial message;
The message conversion rule set is obtained by analyzing a conversion rule description document, and the conversion rule description document comprises conversion rules for converting an initial message into a target message;
the second message standard metadata is obtained by analyzing a second message format description file, and the second message format description file is used for describing the message format of the target message.
According to another aspect of the present invention, there is provided a message conversion apparatus, which may include:
the initial message domain information obtaining module is used for obtaining initial messages and first message standard metadata, and analyzing the initial messages based on the first message standard metadata to obtain initial message domain information;
the target message domain information conversion module is used for acquiring a message conversion rule set and converting the initial message domain information into target message domain information based on the message conversion rule set;
the target message obtaining module is used for obtaining second message standard metadata and assembling the target message domain information based on the second message standard metadata to obtain a target message;
the first message standard metadata is obtained by analyzing a first message format description file, and the first message format description file is used for describing a message format of an initial message;
The message conversion rule set is obtained by analyzing a conversion rule description document, and the conversion rule description document comprises conversion rules for converting an initial message into a target message;
the second message standard metadata is obtained by analyzing a second message format description file, and the second message format description file is used for describing the message format of the target message.
According to another aspect of the present invention, there is provided an electronic device, which may include:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to cause the at least one processor to implement the message conversion method provided by any embodiment of the present invention when executed.
According to another aspect of the present invention, there is provided a computer readable storage medium having stored thereon computer instructions for causing a processor to perform the method for message conversion provided by any of the embodiments of the present invention.
According to the technical scheme, the initial message and the first message standard metadata are obtained, and the initial message is analyzed based on the first message standard metadata to obtain initial message domain information; acquiring a message conversion rule set, and converting the initial message domain information into target message domain information based on the message conversion rule set; acquiring second message standard metadata, and assembling the target message domain information based on the second message standard metadata to obtain a target message; the first message standard metadata is obtained by analyzing a first message format description file, and the first message format description file is used for describing a message format of an initial message; the message conversion rule set is obtained by analyzing a conversion rule description document, and the conversion rule description document comprises conversion rules for converting an initial message into a target message; the second message standard metadata is obtained by analyzing a second message format description file, and the second message format description file is used for describing the message format of the target message. According to the technical scheme, the first message standard metadata, the message conversion rule set and the second message standard metadata which are obtained by analyzing the first message format description file, the conversion rule description file and the second message format description file are subjected to message conversion, so that the message conversion process can be updated in time under the condition that the relevant standard of the message conversion is updated or changed, and the expandability of the message conversion is improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention, nor is it intended to be used to limit the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
FIG. 1 is a flow chart of a message conversion method according to a first embodiment of the present invention;
fig. 2 is a flowchart of extracting standard metadata of a message in a message conversion method according to a first embodiment of the present invention;
FIG. 3 is a flow chart of a message conversion method according to a second embodiment of the present invention;
fig. 4 is a flowchart of a message conversion method provided in the third embodiment of the present invention;
fig. 5 is a flowchart of an alternative example of a message conversion method provided in the third embodiment of the present invention;
fig. 6 is a flowchart of a message conversion method provided in the fourth embodiment of the present invention;
fig. 7 is a block diagram of an alternative example of a message conversion method provided in the fourth embodiment of the present invention;
FIG. 8 is a flowchart of another alternative example of a message conversion method provided in the fourth embodiment of the present invention;
fig. 9 is a block diagram of a message conversion device according to a fifth embodiment of the present invention;
Fig. 10 is a schematic structural diagram of an electronic device implementing a message conversion method according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. The cases of "target", "original", etc. are similar and will not be described in detail herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a message conversion method according to a first embodiment of the present invention. The embodiment can be applied to the case of message conversion. The method can be implemented by the message conversion device provided by the embodiment of the invention, the device can be implemented by software and/or hardware, and the device can be integrated on electronic equipment, and the electronic equipment can be various user terminals or servers.
Referring to fig. 1, the method of the embodiment of the present invention specifically includes the following steps:
s110, acquiring an initial message and first message standard metadata, and analyzing the initial message based on the first message standard metadata to obtain initial message domain information, wherein the first message standard metadata is obtained by analyzing a first message format description file, and the first message format description file is used for describing a message format of the initial message.
The initial message may be understood as a message requiring message conversion, for example, a cbpr+ message or FIN message, etc. The first message standard metadata may be understood as metadata obtained by parsing a first message format description file, where the metadata is used to characterize a message structure and/or a message domain format of an initial message; the first message representation metadata may specifically include at least one of a message domain hierarchy, a message domain name, a message domain length, whether a message domain is nullable, a message domain default value, and a message domain repetition number of the initial message. The first message format description file is a file for describing the message format of the initial message; the first message format description may be a description obtained from an official website or other means; the format of the first message format description file may be, for example, a hypertext markup language (Hyper Text Markup Language, HTML) format or an extensible markup language schema (XML Schema Definition, XSD), etc.; the format of the first message format description file may also be determined by the format of the initial message, for example, in the case that the initial message is a FIN message, the format of the first message format description file may be in HTML format, and in the case that the initial message is a cbpr+ message, the format of the first message format description file may be in XSD format; in the embodiment of the present invention, the format of the first message format description file is not specifically limited.
It may be appreciated that the first message format description file includes a description of a message format of the initial message, but the first message format description file cannot be directly used for parsing and extracting initial message domain information of the initial message, so, considering that the first message format description file can describe the message format of the initial message, for example, the first message format description file may describe all elements and attributes that may occur in the initial message, a hierarchical relationship between the elements and sub-elements, an order of the elements, the number of the elements, whether the elements and the attributes are null, data types of the elements and the attributes, default values of the elements and the attributes, fixed values of the elements and the attributes, and the like, the first message format description file may be parsed and extracted to obtain first message standard metadata capable of characterizing a message structure and/or a message domain format of the initial message, and the first message standard metadata may be stored in a standardized manner, so that the first message standard metadata may be used as a basis for parsing and extracting relevant information in the initial message. In the embodiment of the invention, the first message format description file can be parsed in a script or component mode to obtain the first message standard metadata, for example, in the case that the initial message is a FIN message, the parsing of the FIN message format description file can be completed through a shell (shell) script, and the FIN message standard metadata can be obtained by extraction; and for example, under the condition that the initial message is a CBPR+ message, completing analysis of the CBPR+ message format description file through a dom4j open source component to obtain CBPR+ message standard metadata.
In the embodiment of the invention, the initial message and the first message standard metadata can be acquired, the initial message is analyzed based on the first message standard metadata, and the initial message domain information is obtained, wherein the initial message domain information can be understood as the related information of the message domain of the initial message, the initial message domain information can be an information set in the form of key value pairs, and the keys in the key value pairs can be the complete value taking paths of the message domain of the initial message.
It can be understood that, the first message standard metadata obtained by analyzing the first message format description file can be updated or changed accordingly under the condition that the first message format description file is updated or changed, so that the expandability of message conversion is improved.
S120, acquiring a message conversion rule set, and converting the initial message domain information into target message domain information based on the message conversion rule set, wherein the message conversion rule set is obtained by analyzing a conversion rule description document, and the conversion rule description document comprises a conversion rule for converting the initial message into the target message.
The message conversion rule set can be understood as a conversion rule set obtained by analyzing a conversion rule description document and comprises conversion rules for converting initial message domain information into target message domain information; the message conversion rule set can be obtained by automatically extracting, refining and analyzing the conversion rule description document. The conversion rule description document is a document including a conversion rule that describes converting an initial message into a target message; the conversion rule description document may be a description document obtained from an official website or other means, for example, a conversion rule description series document package of a SWIFT release obtained from the global banking and finance telecommunications association (Society for Worldwide Interbank Financial Telecommunication, SWIFT); the conversion rule description document may include a public function description document, a message pair conversion description document, and/or a dictionary form, among others, capable of characterizing the conversion rule; the format of the conversion rule description document may be, for example, a portable file format (portable document format, PDF) format or a spreadsheet (XLS) format or the like; in the embodiment of the invention, the format of the conversion rule description document is not particularly limited; the expression form of the conversion rule description document can be a description language adopting a uniform style similar To pseudo codes, and the feasibility can be provided for automatic extraction of a message conversion rule set, for example, the conversion rule (MT_to_MXParyAccount) of a relation party account (part account) in the conversion rule description document can be a description language adopting a uniform style similar To pseudo codes. The target message may be understood as a message obtained by converting the demand, for example, may be a cbpr+ message or a FIN message, etc. A conversion rule may be understood as a rule capable of converting an initial message into a target message.
It may be appreciated that the conversion rule description document includes a conversion rule for describing that the initial message is converted into the target message, but the conversion rule description document cannot be directly used for converting the initial message into the target message, so that the conversion rule description document may be parsed and extracted to obtain a message conversion rule set, where the message conversion rule set may convert the initial message domain information into the target message domain information, and may perform persistence preservation on the message conversion rule set, so as to use the message conversion rule set as a basis for converting the initial message domain information into the target message domain information. In the embodiment of the invention, the conversion rule description document can be analyzed in a script or component mode to obtain the message conversion rule set.
In the embodiment of the invention, a message conversion rule set can be acquired, and based on the message conversion rule set, the initial message domain information is converted into the target message domain information, wherein the target message domain information can be understood as the related information of the message domain of the target message, and the target message domain information can be an information set in the form of key value pairs.
It can be understood that the message conversion rule set obtained by analyzing the conversion rule description document can be updated or changed accordingly under the condition that the conversion rule description document is updated or changed, so that the expandability of message conversion is further improved.
S130, obtaining second message standard metadata, and assembling target message domain information based on the second message standard metadata to obtain a target message, wherein the second message standard metadata is obtained by analyzing a second message format description file, and the second message format description file is used for describing the message format of the target message.
The second message standard metadata may be understood as metadata obtained by parsing a second message format description file, where the metadata is used to characterize a message structure and/or a message domain format of a target message; the second message representation metadata may specifically include at least one of a message domain hierarchy, a message domain name, a message domain length, whether a message domain is nullable, a message domain default value, and a message domain repetition number of the target message. The second message format description file is a file for describing the message format of the target message; the second message format description may be a description obtained from an official website or other means; the format of the second message format description file may be, for example, a hypertext markup language (Hyper Text Markup Language, HTML) format or an extensible markup language schema (XML Schema Definition, XSD); the format of the second message format description file may also be determined by the format of the target message, for example, in the case that the target message is a FIN message, the format of the second message format description file may be in HTML format, and in the case that the target message is a cbpr+ message, the format of the second message format description file may be in XSD format; in the embodiment of the present invention, the format of the second message format description file is not specifically limited.
It can be understood that the second message format description file includes a description of a message format of the target message, but the second message format description file cannot be directly used for assembling the target message domain information to obtain the target message, so that the second message format description file can be parsed and extracted to obtain second message standard metadata capable of characterizing a message structure and/or a message domain format of the target message, the second message standard metadata can be used for assembling the target message domain information to obtain the target message, and the second message standard metadata can be stored in a lasting manner, so that the second message standard metadata is used as a basis for assembling the target message domain information to obtain the target message. In the embodiment of the invention, the second message format description file can be parsed in a script or component mode to obtain second message standard metadata, for example, in the case that the target message is a FIN message, the parsing of the FIN message format description file can be completed through a shell (shell) script, and the FIN message standard metadata can be obtained by extraction; and for example, if the target message is a CBPR+ message, completing analysis of the CBPR+ message format description file through the dom4j open source component to obtain CBPR+ message standard metadata.
It can be understood that the second message standard metadata obtained by analyzing the second message format description file can be updated or changed accordingly under the condition that the second message format description file is updated or changed, so that the expandability of message conversion is improved.
In the embodiment of the present invention, a plurality of different message format description files may be parsed in advance to obtain a plurality of message standard metadata and stored, for example, referring to fig. 2, FIN message format description files (HTML format) and cbpr+ message format description files (XSD format) may be respectively extracted through metadata to obtain FIN message format metadata and cbpr+ message format metadata, and FIN message format metadata is used as FIN message standard metadata, cbpr+ message format metadata is used as cbpr+ message standard metadata to obtain a plurality of message standard metadata, and a plurality of message standard metadata may be stored, and when needed, a required message standard metadata may be obtained from the obtained plurality of message standard metadata and used as the first message standard metadata or the second message standard metadata.
According to the technical scheme, the initial message and the first message standard metadata are obtained, and the initial message is analyzed based on the first message standard metadata to obtain initial message domain information; acquiring a message conversion rule set, and converting the initial message domain information into target message domain information based on the message conversion rule set; acquiring second message standard metadata, and assembling the target message domain information based on the second message standard metadata to obtain a target message; the first message standard metadata is obtained by analyzing a first message format description file, and the first message format description file is used for describing a message format of an initial message; the message conversion rule set is obtained by analyzing a conversion rule description document, and the conversion rule description document comprises conversion rules for converting an initial message into a target message; the second message standard metadata is obtained by analyzing a second message format description file, and the second message format description file is used for describing the message format of the target message. According to the technical scheme, the first message standard metadata, the message conversion rule set and the second message standard metadata which are obtained by analyzing the first message format description file, the conversion rule description file and the second message format description file are subjected to message conversion, so that the message conversion process can be updated in time under the condition that the relevant standard of the message conversion is updated or changed, and the expandability of the message conversion is improved.
Example two
Fig. 3 is a flowchart of another message conversion method provided in the second embodiment of the present invention. The present embodiment is optimized based on the above technical solutions. In this embodiment, optionally, after converting the initial message domain information into the target message domain information based on the message conversion rule set, the message conversion method further includes: obtaining lost cut-off information, wherein the lost cut-off information comprises lost and/or cut-off information in the process of converting initial message domain information into target message domain information; and displaying the lost cut-off information. Wherein, the explanation of the same or corresponding terms as the above embodiments is not repeated herein.
Referring to fig. 3, the method of this embodiment may specifically include the following steps:
s210, acquiring an initial message and first message standard metadata, and analyzing the initial message based on the first message standard metadata to obtain initial message domain information, wherein the first message standard metadata is obtained by analyzing a first message format description file, and the first message format description file is used for describing a message format of the initial message.
S220, acquiring a message conversion rule set, and converting the initial message domain information into target message domain information based on the message conversion rule set, wherein the message conversion rule set is obtained by analyzing a conversion rule description document, and the conversion rule description document comprises a conversion rule for converting the initial message into the target message.
S230, obtaining loss cut-off information, wherein the loss cut-off information comprises information lost and/or cut-off in the process of converting the initial message domain information into the target message domain information.
It can be appreciated that in the process of converting the initial domain information into the target domain information, there may be some cases of truncation and/or loss of information, and there may also be cases of meeting the condition of forcibly stopping the conversion, where the converted target domain information may be different in content from the initial domain information. In order to enable the user to know the lost and/or truncated information in the process of converting the initial message domain information into the target message domain information, the lost and/or truncated information can be recorded as the lost and truncated information in the process of converting the initial message domain information into the target message domain information based on the message conversion rule set, and the lost and truncated information can be obtained after the conversion is completed.
In the embodiment of the invention, other information, such as whether the conversion is successful or not, the number of the converted message fields and/or the number of the message conversion rules in the message conversion rule set, can be recorded in the process of converting the initial message field information into the target message field information based on the message conversion rule set, and the other information is obtained. In the embodiment of the present invention, the obtained other information may be any information in the process of converting the initial message domain information into the target message domain information, and is not particularly limited.
S240, displaying the lost truncated information.
In the embodiment of the present invention, the loss cut-off information may be displayed, for example, the loss cut-off information may be displayed on a display screen, the loss cut-off information may be displayed by voice prompt, etc., and in the embodiment of the present invention, the form of displaying the loss cut-off information is not specifically limited.
In the embodiment of the invention, other information in the process of converting the initial message domain information into the target message domain information can be displayed.
S250, obtaining second message standard metadata, and assembling the target message domain information based on the second message standard metadata to obtain the target message, wherein the second message standard metadata is obtained by analyzing a second message format description file, and the second message format description file is used for describing the message format of the target message.
In the embodiment of the invention, after the target message is obtained, the obtained target message and the missing cut-off information can be used as display information together for display.
According to the technical scheme, the lost truncated information is obtained, wherein the lost truncated information comprises lost and/or truncated information in the process of converting the initial message domain information into the target message domain information; and displaying the lost cut-off information. In the embodiment of the invention, the message conversion process can be clear and traceable by obtaining the lost cut-off information and displaying the lost cut-off information, so that a user can more comprehensively know the message conversion result after the message is converted.
Example III
Fig. 4 is a flowchart of another message conversion method provided in the third embodiment of the present invention. The present embodiment is optimized based on the above technical solutions. In this embodiment, optionally, the message conversion rule set is obtained by the following steps: acquiring 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 grammar analysis processing on the part-of-speech tagging rule information to obtain grammar set information; and generating target source codes based on the grammar set information, and packaging the target source codes to obtain a message conversion rule set. Wherein, the explanation of the same or corresponding terms as the above embodiments is not repeated herein.
Referring to fig. 4, the method of this embodiment may specifically include the following steps:
s310, acquiring a conversion rule description document, and extracting initial rule information from the conversion rule description document.
It should be noted that, considering that the transformation rule description document may have a case where the naming of the message fields is not uniform, for example, there may be a case where the naming is in various forms, or there may be a case where the spelling is wrong; or when the message domain path is expressed, the condition that a full path exists, a relative path exists, and the condition that full spelling exists and abbreviations exist exists, so that the conversion rule description document can be obtained, initial rule information is extracted from the conversion rule description document, then the initial rule information is processed through subsequent steps to obtain a message conversion rule set, the message conversion rule set is obtained by utilizing the overall consistency of the description style of the conversion rule description document, the error easily introduced when the conversion rule description document is read and understood manually is avoided, the problem of confusion expressed on the details of the conversion rule description document is solved, and the accuracy of the obtained message conversion rule set is improved.
In the embodiment of the invention, the initial rule information can be extracted from the conversion rule description document by means of components or scripts and the like, for example, the conversion rule description document can be analyzed and extracted by an open source component such as POI and the like to obtain the initial rule information, and the initial rule information is the relevant information which can characterize the conversion rule in the conversion rule description document.
After the initial rule information is extracted, the initial rule information can be stored in a lasting manner, so that the initial rule information is used as a basis for subsequent analysis and extraction to obtain a message conversion rule set.
S320, part-of-speech tagging is conducted on the initial rule information, and part-of-speech tagging rule information is obtained.
The part-of-speech tagging rule information may be understood as information obtained by performing part-of-speech tagging processing on the initial rule information.
It can be understood that, because the obtained initial rule information has a certain line text rule, the processing such as word segmentation, automatic marking and/or logic optimization can be performed on the initial rule information based on the line text rule of the initial rule information, and various word strings such as variables, constants, operators and/or method names in the initial rule information can be automatically identified, so that part-of-speech marking processing is performed on the initial rule information, and part-of-speech marking rule information is obtained.
In the embodiment of the invention, word segmentation, automatic marking, logic optimization and other treatments can be further carried out on the part-of-speech marking rule information, and the part-of-speech marking rule information is updated according to the treatment results of the treatments. The steps of performing word segmentation, automatic marking, logic optimization and the like on the part-of-speech marking rule information can be circularly executed, and part-of-speech marking rule information is updated according to the processing result of the processing until part-of-speech marking of all character strings after the initial rule information is segmented is completed. It should be noted that the above process is a multi-round iterative process, each iteration can perform logic optimization based on the information of failure of automatic marking and labeling in the last time, and then perform word segmentation and automatic marking and labeling again until all character strings after word segmentation on the initial rule information are successfully labeled.
S330, analyzing and processing the part-of-speech tagging rule information to obtain grammar set information.
In the embodiment of the invention, the part-of-speech tagging rule information can be subjected to grammar analysis processing to obtain grammar set information of related information of a grammar set capable of representing the conversion rule. The syntax set information may include: at least one of message information domain grammar, function call grammar, logic judgment grammar, logic operation grammar, mathematical operation grammar, flow control grammar, variable definition grammar, keyword definition grammar, test case definition grammar and test result definition grammar is taken. In the embodiment of the present invention, grammar information that may be included in the grammar set information is not particularly limited.
S340, generating target source codes based on grammar set information, and packaging the target source codes to obtain a message conversion rule set.
It can be understood that, because the grammar in the grammar set information is very close to the computer programming grammar, the target source code can be generated based on the grammar set information, the target source code is the source code which can be packaged to obtain the message conversion rule set, and then the target source code is packaged to obtain the message conversion rule set, for example, the rule type source code, the constant type source code and/or the unit test type source code of the JAVA language can be automatically generated based on the grammar set information as the target source code, and the target source code is packaged to obtain the Jar packet of the message conversion rule set, and the Jar packet of the obtained message conversion rule set can be used as a component for being imported and applied by the message conversion tool.
The message conversion rule set can be obtained through steps S310 to S340.
S350, acquiring an initial message and first message standard metadata, and analyzing the initial message based on the first message standard metadata to obtain initial message domain information, wherein the first message standard metadata is obtained by analyzing a first message format description file, and the first message format description file is used for describing a message format of the initial message.
S360, acquiring a message conversion rule set, and converting the initial message domain information into target message domain information based on the message conversion rule set, wherein the message conversion rule set is obtained by analyzing a conversion rule description document, and the conversion rule description document comprises a conversion rule for converting the initial message into the target message.
S370, obtaining second message standard metadata, and assembling the target message domain information based on the second message standard metadata to obtain the target message, wherein the second message standard metadata is obtained by analyzing a second message format description file, and the second message format description file is used for describing the message format of the target message.
According to the technical scheme, the message conversion rule set is obtained through the following steps: acquiring 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 grammar analysis processing on the part-of-speech tagging rule information to obtain grammar set information; and generating target source codes based on the grammar set information, and packaging the target source codes to obtain a message conversion rule set. In the embodiment of the invention, the message conversion rule set is obtained through the conversion rule description document, so that the message conversion can be realized based on the conversion rule description document which can not directly convert the initial message into the target message, and the message conversion rule set which can convert the initial message domain information into the target message domain information is obtained, thereby being convenient for realizing the message conversion based on the message conversion rule set.
An optional technical scheme, before the target source code is packaged to obtain the message conversion rule set, the message conversion method further comprises: compiling and checking the target source code; under the condition that the compiling verification is not passed, obtaining a correction result of the target source code; and updating the target source code according to the correction result.
It should be noted that, because the conversion rule description document may have problems such as spelling and description errors, correspondingly, the generated target source code may also have problems, so that the obtained message conversion rule set cannot be used normally.
Based on the above scheme, another optional technical scheme, after updating the target source code according to the correction result, the message conversion method further includes: repeatedly executing the step of compiling and checking the target source code; under the condition that compiling and checking pass, obtaining a unit test class, and carrying out logic checking on the target source code based on the unit test class; packaging the target source code to obtain a message conversion rule set, which comprises the following steps: and under the condition that the logic verification is passed, packing the target source code to obtain a message conversion rule set.
In the embodiment of the invention, after updating the target source code according to the correction result, the step of compiling and checking the target source code can be repeatedly executed until the compiling and checking pass, so as to further ensure that the message conversion rule set can be normally used.
In the embodiment of the invention, under the condition that the compiling verification is passed, a unit test class can be obtained, wherein the unit test class can be understood as a class for performing logic verification test on the minimum testable unit in the target source code, and the logic verification is performed on the target source code based on the unit test class.
It should be noted that the unit test class may be provided by the source of the acquisition conversion rule description document, for example, may be provided by the SWIFT official network; the method can also be obtained by analyzing the test cases provided by the sources of the acquired conversion rule description documents; the water can also be self-supplemented; the method can also be that under the condition that the partial conversion rule corresponds to the partial source code in the target source code, the source of the obtained conversion rule description document does not have corresponding unit test class or the partial conversion rule does not have corresponding test case in the source providing of the obtained conversion rule description document, the partial conversion rule which cannot obtain the unit test class is self-supplemented to obtain the corresponding unit test class. In the embodiment of the invention, in order to further ensure that the message conversion rule set can be normally used, the logic verification on the target source code must pass based on all unit test classes.
In the embodiment of the invention, under the condition that the logic verification is passed, the target source code is packed to obtain the message conversion rule set, so that the message conversion rule set can be further ensured to be normally used.
For better understanding of the technical solution of the embodiment of the present invention described above, an alternative example is provided herein. For example, referring to fig. 5, a SWIFT message conversion rule description PDF document, a SWIFT message conversion rule description XLS document, and an error code description XLS document provided by a SWIFT functional network may be obtained as conversion rule description documents, and conversion rule information is extracted from the conversion rule description documents to obtain basic function description corpus, public function description corpus, that is, conversion rule description corpus, as initial rule information; part-of-speech tagging processing is carried out on the initial rule information through lexical analysis, so that word sequences with tagged parts of speech, variables, constants, function names, flow control words, operators and the like are obtained to serve as part-of-speech tagging rule information; performing syntax analysis processing on the part-of-speech tagging rule information to obtain syntax set information comprising expression syntax, flow control syntax, variable/constant definition syntax, test case definition syntax and other syntaxes; generating conversion rule class source codes and dictionary constant class source codes based on grammar set information as target source codes; performing compiling test on the target source code, and updating the target source code according to the result of the compiling test; and packing the target source code to obtain a conversion rule set Jar packet as a message conversion rule set.
Example IV
Fig. 6 is a flowchart of another message conversion method provided in the fourth embodiment of the present invention. The present embodiment is optimized based on the above technical solutions. In this embodiment, optionally, converting the initial message domain information into the target message domain information based on the message conversion rule set includes: analyzing the initial message to obtain an initial message type; screening 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 domain information into target message domain information based on the target message conversion rule. Wherein, the explanation of the same or corresponding terms as the above embodiments is not repeated herein.
Referring to fig. 6, the method of this embodiment may specifically include the following steps:
s410, acquiring an initial message and first message standard metadata, and analyzing the initial message based on the first message standard metadata to obtain initial message domain information, wherein the first message standard metadata is obtained by analyzing a first message format description file, and the first message format description file is used for describing a message format of the initial message.
S420, acquiring a message conversion rule set, wherein the message conversion rule set is obtained by analyzing a conversion rule description document, and the conversion rule description document comprises a conversion rule for converting an initial message into a target message.
S430, analyzing the initial message to obtain the initial message type.
In the embodiment of the invention, the initial message can be parsed to obtain an initial message type, and the initial message type can be understood as the type of the initial message, for example, the initial message type can be a FIN format type or a cbpr+ format type, and the like.
S440, based on the initial message type, screening the initial message conversion rule in the message conversion rule set to obtain the target message conversion rule.
It will be appreciated that the conversion rule description document may include the description content of the conversion rule that converts different initial messages into different target messages, for example, the conversion rule description document may include the description content of the conversion rule that converts FIN messages into cbpr+ messages and cbpr+ messages into FIN messages, and so on, and in the embodiment of the present invention, the content included in the conversion rule description document is not specifically limited. Thus, the resulting message conversion rule set may not only include conversion rules for converting the initial message domain information into the target message domain information. In view of the above, in the embodiment of the present invention, an initial message conversion rule in a message conversion rule set may be screened based on an initial message type to obtain a target message conversion rule, where the initial message conversion rule is a conversion rule in the message conversion rule set, and the target message conversion rule is a conversion rule in the message conversion rule set capable of converting initial message domain information into target message domain information.
In the embodiment of the invention, the initial message conversion rule in the message conversion rule set can be screened based on the initial message type and the target message type, wherein the target message type is the message type of the target message, so as to obtain the target message conversion rule.
S450, converting the initial message domain information into target message domain information based on the target message conversion rule.
In the embodiment of the invention, the initial message domain information can be converted into the target message domain information based on the target message conversion rule capable of converting the initial message domain information into the target message domain information.
S460, obtaining second message standard metadata, and assembling the target message domain information based on the second message standard metadata to obtain the target message, wherein the second message standard metadata is obtained by analyzing a second message format description file, and the second message format description file is used for describing the message format of the target message.
According to the technical scheme, the initial message is analyzed, and the initial message type is obtained; screening 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 domain information into target message domain information based on the target message conversion rule. In the embodiment of the invention, the target message conversion rule can be obtained by screening from the message conversion rule set, so that the obtained target message conversion rule is applicable to converting the initial message domain information into the target message domain information.
An optional technical scheme includes that the number of target message conversion rules is at least two; converting the initial message domain information into target message domain information based on the target message conversion rule, including: acquiring the priority of each target message conversion rule in at least two target message conversion rules, and sequencing the at least two target message conversion rules based on the priority; based on the obtained sequencing result, converting the initial message domain information into target message domain information by utilizing at least two target message conversion rules one by one.
In the embodiment of the invention, under the condition that the number of the target message conversion rules is at least two, the priority of each target message conversion rule in the at least two target message conversion rules can be obtained, the priority can represent the importance degree or the execution sequence of the target message conversion rules, the priority can be obtained by analyzing the conversion rule description document and can be determined according to the conversion requirement, and in the embodiment of the invention, the source of the priority is not particularly limited; the sorting of the at least two target message conversion rules based on the priority may be, for example, sorting the at least two target message conversion rules in order of higher priority to lower priority, or sorting the at least two target message conversion rules in order of lower priority to higher priority, which is not limited herein specifically; based on the sequencing result obtained after sequencing, converting the initial message domain information into target message domain information by utilizing at least two target message conversion rules one by one.
The method includes the steps of obtaining a priority of each of at least two target message conversion rules, sorting the at least two target message conversion rules according to a sequence from low priority to high priority based on the priority, executing target message conversion rules with low priority in the at least two target message conversion rules one by one based on the obtained sorting result, converting initial message domain information into target message domain information, so as to realize an execution result of the target message conversion rules with high priority, and covering and updating the execution result of the target message conversion rules with low priority.
In the embodiment of the invention, the number of the target message conversion rules is at least two; acquiring the priority of each target message conversion rule in at least two target message conversion rules, and sequencing the at least two target message conversion rules based on the priority; based on the obtained sequencing result, at least two target message conversion rules are utilized one by one to convert the initial message domain information into target message domain information, so that the converted target message domain information can be more in accordance with the conversion standard.
For better understanding of the technical solution of the embodiment of the present invention described above, an alternative example is provided herein. For example, referring to fig. 7, the obtained message conversion rule set, FIN message standard metadata and cbpr+ message standard metadata may be loaded as components into a message conversion tool including a message parsing component, a rule calculation component, a message assembly component and a component management component, respectively. In particular, the method comprises the steps of,
The conversion rule set component obtained by the message conversion rule set, the FIN message standard metadata component obtained by the FIN message standard metadata and the cbpr+ message standard metadata component obtained by the cbpr+ message standard metadata which are loaded into the message conversion tool can be used as bottom layer components of the message conversion tool, and the component management components can be specifically used for initializing, loading and updating the conversion rule set component, the FIN message standard metadata component and the cbpr+ message standard metadata component.
The message parsing component may parse the initial message according to the FIN message standard metadata or cbpr+ message standard metadata loaded into the message conversion tool, and store each information domain content of the parsed initial message in a set in a key value pair form as initial message domain information.
The rule calculation component can convert the initial message domain information based on the message conversion rule set to obtain a message domain key value pair set of the target message as the target message domain information, and simultaneously record important prompt information such as the missing cut-off information in the rule calculation process and whether the forced stop conversion condition is met or not, so that the important prompt information is displayed later, and a user of the message conversion tool can comprehensively know the message conversion result.
The message assembly component can assemble the target message domain information based on FIN message standard metadata or CBPR+ message standard metadata loaded into the message conversion tool to obtain the target message.
For better understanding of the technical solution of the embodiment of the present invention described above, an alternative example is provided herein. For example, referring to fig. 8, an initial message and first message standard metadata are obtained, and the initial message is parsed based on the first message standard metadata to obtain initial message domain information; analyzing the initial message to obtain an initial message type; acquiring a message conversion rule set, and screening 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 target message conversion rule sets; acquiring the priority of each target message conversion rule in at least two target message conversion rules, and sequencing at least two target message conversion rules in the target message conversion rule set based on the priority; judging whether a target message conversion rule set exists a target message conversion rule which is not executed yet; if the target message conversion rule to be executed exists, judging whether the current message conversion condition hits the termination rule or not; if the termination rule is not hit, selecting a target message conversion rule to be executed from at least two target message conversion rules based on the obtained sequencing result; executing target message conversion rules to be executed on the initial message domain information, and updating the initial message domain information according to an execution result; judging whether information loss and/or truncation exists in the process of converting the initial message domain information into the target message domain information; if the information is lost and/or truncated, updating the lost truncated information according to the information loss and/or truncated condition, wherein the updated lost truncated information can comprise the reasons of the information loss and/or truncated and the names of target message conversion rules of the information loss and/or truncated condition after execution; returning to judge whether the target message conversion rule set has the target message conversion rule which is not executed yet; if the information loss and/or the truncation condition does not exist, returning to judge whether the target message conversion rule set has the target message conversion rule which is not executed yet; if the termination rule is hit, the initial message domain information is used as target message domain information; acquiring second message standard metadata, and assembling the target message domain information based on the second message standard metadata to obtain a target message; taking the target message and the lost cut-off information as conversion results; if the target message conversion rule to be executed does not exist, the initial message domain information is used as target message domain information; acquiring second message standard metadata, and assembling the target message domain information based on the second message standard metadata to obtain a target message; and taking the target message and the lost cut-off information as conversion results.
Example five
Fig. 9 is a block diagram of a message conversion device according to a fifth embodiment of the present invention, where the device is configured to execute the message conversion method according to any of the foregoing embodiments. The device and the message conversion method of each embodiment belong to the same invention conception, and the details of the embodiment of the message conversion device, which are not described in detail, can be referred to the embodiment of the message conversion method. Referring to fig. 9, the apparatus may specifically include: an initial message domain information obtaining module 510, a target message domain information converting module 520, and a target message obtaining module 530.
The initial message domain information obtaining module 510 is configured to obtain an initial message and first message standard metadata, and parse the initial message based on the first message standard metadata to obtain initial message domain information;
the target message domain information conversion module 520 is configured to obtain a message conversion rule set, and convert the initial message domain information into target message domain information based on the message conversion rule set;
a target message obtaining module 530, configured to obtain second message standard metadata, and assemble target message domain information based on the second message standard metadata to obtain a target message;
The first message standard metadata is obtained by analyzing a first message format description file, and the first message format description file is used for describing a message format of an initial message;
the message conversion rule set is obtained by analyzing a conversion rule description document, and the conversion rule description document comprises conversion rules for converting an initial message into a target message;
the second message standard metadata is obtained by analyzing a second message format description file, and the second message format description file is used for describing the message format of the target message.
Optionally, the message conversion device may further include:
the loss cut-off information obtaining module is used for obtaining loss cut-off information after converting the initial message domain information into the target message domain information based on the message conversion rule set, wherein the loss cut-off information comprises information lost and/or cut-off in the process of converting the initial message domain information into the target message domain information;
and the loss cut-off information display module is used for displaying the loss cut-off information.
Optionally, the message conversion device may further include the following module to obtain a message conversion rule set:
the initial rule information obtaining module is used for obtaining a conversion rule description document and extracting initial rule information from the conversion rule description document;
The part-of-speech tagging rule information obtaining module is used for carrying out part-of-speech tagging processing on the initial rule information to obtain part-of-speech tagging rule information;
the grammar collection information obtaining module is used for carrying out grammar analysis processing on the part-of-speech tagging rule information to obtain grammar collection information;
the message conversion rule set obtaining module is used for generating target source codes based on grammar set information and packaging the target source codes to obtain the message conversion rule set.
Based on the above scheme, optionally, the message conversion device may further include:
the target source code compiling and checking module is used for compiling and checking the target source code before packaging the target source code to obtain the message conversion rule set;
the correction result obtaining module is used for obtaining a correction result of the target source code under the condition that the compiling verification is not passed;
and the target source code updating module is used for updating the target source code according to the correction result.
Based on the above scheme, optionally, the message conversion device may further include:
the compiling and checking repeating module is used for repeatedly executing the step of compiling and checking the target source code after updating the target source code according to the correction result;
The target source code logic verification module is used for acquiring a unit test class under the condition that compiling verification passes, and carrying out logic verification on the target source code based on the unit test class;
the message conversion rule set obtaining module may include:
and the message conversion rule set obtaining unit is used for packaging the target source code under the condition that the logic verification passes, so as to obtain the message conversion rule set.
Optionally, the target domain information conversion module 520 may include:
the initial message type obtaining unit is used for analyzing the initial message to obtain the initial message type;
the target message conversion rule obtaining unit is used for screening the initial message conversion rules in the message conversion rule set based on the initial message type to obtain target message conversion rules;
the target message domain information conversion unit is used for converting the initial message domain information into target message domain information based on the target message conversion rule.
On the basis of the scheme, the number of the target message conversion rules is at least two;
the target message domain information conversion unit may include:
the target message conversion rule ordering subunit is used for acquiring the priority of each target message conversion rule in at least two target message conversion rules and ordering the at least two target message conversion rules based on the priority;
And the target message domain information conversion subunit is used for converting the initial message domain information into target message domain information by utilizing at least two target message conversion rules one by one based on the obtained sequencing result.
The message conversion device provided by the fifth embodiment of the invention obtains the initial message and the first message standard metadata through the initial message domain information obtaining module, and analyzes the initial message based on the first message standard metadata to obtain the initial message domain information; acquiring a message conversion rule set through a target message domain information conversion module, and converting initial message domain information into target message domain information based on the message conversion rule set; acquiring second message standard metadata through a target message acquisition module, and assembling target message domain information based on the second message standard metadata to acquire a target message; the first message standard metadata is obtained by analyzing a first message format description file, and the first message format description file is used for describing a message format of an initial message; the message conversion rule set is obtained by analyzing a conversion rule description document, and the conversion rule description document comprises conversion rules for converting an initial message into a target message; the second message standard metadata is obtained by analyzing a second message format description file, and the second message format description file is used for describing the message format of the target message. According to the device, the first message standard metadata, the message conversion rule set and the second message standard metadata which are obtained by analyzing the first message format description file, the conversion rule description file and the second message format description file are subjected to message conversion, so that the message conversion process can be updated in time under the condition that the relevant standard of the message conversion is updated or changed, and the expandability of the message conversion is improved.
The message conversion device provided by the embodiment of the invention can execute the message conversion method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
It should be noted that, in the embodiment of the message conversion device, each unit and module included are only divided according to the functional logic, but not limited to the above-mentioned division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present invention.
Example six
Fig. 10 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, 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 meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 10, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having 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 specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the message conversion method.
In some embodiments, the message conversion method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the message conversion method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the message conversion method in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here 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 a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. The message conversion method is characterized by comprising the following steps:
acquiring an initial message and first message standard metadata, and analyzing the initial message based on the first message standard metadata to obtain initial message domain information;
acquiring a message conversion rule set, and converting the initial message domain information into target message domain information based on the message conversion rule set;
acquiring second message standard metadata, and assembling the target message domain information based on the second message standard metadata to obtain a target message;
The first message standard metadata is obtained by analyzing a first message format description file, and the first message format description file is used for describing the message format of the initial message;
the message conversion rule set is obtained by analyzing a conversion rule description document, and the conversion rule description document comprises a conversion rule for converting the initial message into the target message;
the second message standard metadata is obtained by analyzing a second message format description file, and the second message format description file is used for describing the message format of the target message.
2. The method according to claim 1, further comprising, after said converting said initial message domain information into target message domain information based on said message conversion rule set:
obtaining lost cut-off information, wherein the lost cut-off information comprises information lost and/or cut-off in the process of converting the initial message domain information into target message domain information;
and displaying the lost truncated information.
3. The method of claim 1, wherein the set of message transformation rules is obtained by:
Acquiring the 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 grammar analysis processing on the part-of-speech tagging rule information to obtain grammar set information;
and generating a target source code based on the grammar set information, and packaging the target source code to obtain the message conversion rule set.
4. The method of claim 3, further comprising, prior to said packing said target source code to obtain said message conversion rule set:
compiling and checking the target source code;
under the condition that compiling verification is not passed, obtaining a correction result of the target source code;
and updating the target source code according to the correction result.
5. The method of claim 4, further comprising, after said updating said target source code based on said correction result:
repeatedly executing the step of compiling and checking the target source code;
under the condition that compiling verification is passed, obtaining a unit test class, and carrying out logic verification on the target source code based on the unit test class;
The step of packaging the target source code to obtain the message conversion rule set includes:
and under the condition that the logic verification is passed, packaging the target source code to obtain the message conversion rule set.
6. The method according to claim 1, wherein said converting the initial message domain information into the target message domain information based on the message conversion rule set comprises:
analyzing the initial message to obtain an initial message type;
screening 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 domain information into target message domain information based on the target message conversion rule.
7. The method of claim 6, wherein the number of target message conversion rules is at least two;
the converting the initial message domain information into the target message domain information based on the target message conversion rule includes:
acquiring the priority of each target message conversion rule in the at least two target message conversion rules, and sequencing the at least two target message conversion rules based on the priority;
And based on the obtained sequencing result, converting the initial message domain information into target message domain information by utilizing the at least two target message conversion rules one by one.
8. A message conversion device, comprising:
the system comprises an initial message domain information obtaining module, a first message domain information analyzing module and a second message domain information obtaining module, wherein the initial message domain information obtaining module is used for obtaining initial messages and first message standard metadata and analyzing the initial messages based on the first message standard metadata to obtain initial message domain information;
the target message domain information conversion module is used for acquiring a message conversion rule set and converting the initial message domain information into target message domain information based on the message conversion rule set;
the target message obtaining module is used for obtaining second message standard metadata and assembling the target message domain information based on the second message standard metadata to obtain a target message;
the first message standard metadata is obtained by analyzing a first message format description file, and the first message format description file is used for describing the message format of the initial message;
the message conversion rule set is obtained by analyzing a conversion rule description document, and the conversion rule description document comprises a conversion rule for converting the initial message into the target message;
The second message standard metadata is obtained by analyzing a second message format description file, and the second message format description file is used for describing the message format of the target message.
9. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores a computer program executable by the at least one processor to cause the at least one processor to perform the message conversion method of any of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to perform the message conversion method according to any one of claims 1-7.
CN202310272507.1A 2023-03-17 2023-03-17 Message conversion method and device, electronic equipment and storage medium Pending CN116320060A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310272507.1A CN116320060A (en) 2023-03-17 2023-03-17 Message conversion method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310272507.1A CN116320060A (en) 2023-03-17 2023-03-17 Message conversion method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116320060A true CN116320060A (en) 2023-06-23

Family

ID=86818293

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310272507.1A Pending CN116320060A (en) 2023-03-17 2023-03-17 Message conversion method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116320060A (en)

Similar Documents

Publication Publication Date Title
US10007596B2 (en) Generating test scripts through application integration
US11281862B2 (en) Significant correlation framework for command translation
CN111831384B (en) Language switching method, device, equipment and storage medium
CN116860949B (en) Question-answering processing method, device, system, computing equipment and computer storage medium
CN116028028A (en) Request function generation method, device, equipment and storage medium
CN115599386A (en) Code generation method, device, equipment and storage medium
CN116320060A (en) Message conversion method and device, electronic equipment and storage medium
US8631008B1 (en) Systems and methods for indexing electronic content that involves external interaction
CN113419740A (en) Program data stream analysis method and device, electronic device and readable storage medium
CN114528218A (en) Test program generation method, test program generation device, storage medium, and electronic device
CN112989066A (en) Data processing method and device, electronic equipment and computer readable medium
CN113407264A (en) Image-based terminal interface identification method, device, equipment and medium
CN111475403A (en) Dynamic generation method of test script and related device
CN113835893B (en) Data processing method, device, equipment, storage medium and program product
CN112445784B (en) Text structuring method, equipment and system
CN112989797B (en) Model training and text expansion methods, devices, equipment and storage medium
CN112287097B (en) Method and device for analyzing markup language text, storage medium and electronic equipment
CN114491040B (en) Information mining method and device
US20230135536A1 (en) Method and Apparatus for Processing Table
CN110737757B (en) Method and apparatus for generating information
WO2023211370A2 (en) Semantic parsing for short text
CN111596907A (en) File generation method, device, equipment and storage medium
CN113392112A (en) Data analysis method, data analysis device, electronic device, and storage medium
CN114896974A (en) Media information processing method, device, electronic equipment and storage medium
CN115934101A (en) Interface document generation method, device, medium and electronic equipment

Legal Events

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