Message conversion method and device, computer readable storage medium and electronic equipment

By using format conversion templates and receipt packet templates in the message conversion method, the problem of low packet conversion and transmission efficiency in the prior art is solved, and more efficient data conversion and better system maintenance are achieved.

CN119814894AActive Publication Date: 2025-04-11中国邮政储蓄银行股份有限公司
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202411812689.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-04-11
Estimated Expiration
2044-12-10

AI Technical Summary

Technical Problem

In the prior art, the conversion and transmission efficiency of packets is low through setting interfaces, resulting in problems such as difficulty in maintenance, low efficiency and error-prone problems.

Method used

Provide a message conversion method, including receiving the initial message, determining its corresponding class, and converting the message according to the class format conversion template, generating conversion messages and receipt messages, avoiding each message from using a different interface for conversion and receipt.

Benefits of technology

Through the use of format conversion templates and receipt message templates, data conversion efficiency is improved, maintenance difficulty and error rate are reduced, and system flexibility and maintainability are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814894A_ABST
    Figure CN119814894A_ABST
Patent Text Reader

Abstract

The invention provides a message conversion method and device, a computer readable storage medium and electronic equipment. The method comprises the steps that an initial message sent by a sender is received, a class corresponding to the initial message is determined, and the class at least comprises a message label; a format conversion template corresponding to the class is determined, the format conversion template is adopted to convert the initial message to obtain a converted message, and the format conversion template at least comprises a conversion rule of the message label; a receipt message template is obtained, a receipt message of the converted message is generated through the receipt message template, the receipt message is sent to the sender, the receipt message template at least comprises a receipt rule of the message, and the receipt message is a message representing that conversion of the initial message is completed. According to the invention, the conversion and transmission efficiency of the message is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of computer data processing, and in particular to a message conversion method, device, computer-readable storage medium and electronic device. Background Art

[0002] The source system and the target system interact with each other through XML messages. The messages of different target systems have their own unique characteristics. How to solve the difference problem caused by the diversity of target system messages is a difficult problem worth thinking about. In the past, the way to differentiate the processing of different target system messages was to configure them through the external system. By configuring different interfaces, the label of each XML message can be mapped to the corresponding domain. The problem is that the actual user of the domain is the background code. Sometimes, the difference between the messages is very small. Just because the interfaces configured by the external system are different, the background code needs two completely different sets of processing logic, and most of the differences in these two sets of logic are limited to taking the same meaning in different domains.

[0003] As the business expands, the functional requirements for information systems become more and more complex, and the interactions between systems are also increasing. When the source system connects to different target system interfaces, the number of differentiated messages increases, facing maintenance difficulties, low efficiency, and easy errors. The specific problems are as follows: (1) The XML message structure is complex and contains multiple elements and attributes. Human negligence, omissions, or errors may occur during the processing. When processing XML messages, if a template library or scheduled tasks are used, both the initial work and the subsequent maintenance require continuous collection of a large number of templates, which may consume a lot of manpower and time costs. After the configuration is completed, the content of each field needs to be carefully checked and verified to ensure its accuracy and completeness. (2) The flexibility is not high. There is no exception handling mechanism designed for special messages. When adding special messages in the future. Maintenance work will involve template library maintenance and background business logic code changes. Extracting common message configuration information can indeed simplify some repetitive message configuration work, but for a new special message, information cannot be extracted from the common configuration. In response to new features or field requirements, project docking still needs to adjust incremental configuration items through development, which is not conducive to later maintenance. Summary of the invention

[0004] The main purpose of the present application is to provide a message conversion method, device, computer-readable storage medium and electronic device to at least solve the problem of low efficiency in message conversion and transmission by setting an interface in the prior art.

[0005] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a message conversion method is provided, including: receiving an initial message sent by a sender, determining a class corresponding to the initial message, wherein the class at least includes a message label; determining a format conversion template corresponding to the class, using the format conversion template to convert the initial message to obtain a converted message, wherein the format conversion template at least includes a conversion rule for the message label; obtaining a receipt message template, using the receipt message template to generate a receipt message for the converted message, and sending the receipt message to the sender, wherein the receipt message template at least includes a message receipt rule, and the receipt message is a message indicating that the conversion of the initial message is completed.

[0006] Optionally, determining the format conversion template corresponding to the class includes: acquiring a one-to-one mapping relationship between the class and the format conversion template; and determining the format conversion template corresponding to the class according to the one-to-one mapping relationship between the class and the format conversion template.

[0007] Optionally, after obtaining the converted message, the method further includes: obtaining a one-to-one mapping relationship between an initial message label and a local message label, wherein the initial message label represents a label corresponding to the initial message, and the local message label is a label corresponding to the local message; determining a local message label corresponding to the converted message based on the one-to-one mapping relationship between the initial message label and the local message label, and storing data based on the local message label.

[0008] Optionally, obtaining the receipt message template includes: extracting the message tag of the converted message, and obtaining a one-to-one mapping relationship between the message tag and the receipt message template; determining the receipt message template corresponding to the message tag according to the one-to-one mapping relationship between the message tag and the receipt message template.

[0009] Optionally, the receipt message template is used to generate the receipt message of the converted message, including: obtaining a one-to-one mapping relationship between a local message tag and a sender message tag, and determining a sender message tag corresponding to the local message tag according to the one-to-one mapping relationship between the local message tag and the sender message tag; and using the receipt message template to generate the receipt message of the converted message according to the sender message tag.

[0010] Optionally, determining the class corresponding to the initial message includes: utilizing a Java reflection mechanism to encapsulate the initial message into a class corresponding to a message field, to obtain the class corresponding to the initial message, wherein the class also includes the message field.

[0011] Optionally, the method further includes: when the format conversion template corresponding to the class cannot be determined, obtaining conversion rules corresponding to the class, and adding the conversion rules to the format conversion template, wherein the conversion rules at least include conversion rules for the message label.

[0012] According to another aspect of the present application, a message conversion device is provided, including: a determination unit, used to receive an initial message sent by a sender, and determine a class corresponding to the initial message, wherein the class at least includes a message label; a conversion unit, used to determine a format conversion template corresponding to the class, and use the format conversion template to convert the initial message to obtain a converted message, wherein the format conversion template at least includes a conversion rule for the message label; a sending unit, used to obtain a receipt message template, use the receipt message template to generate a receipt message of the converted message, and send the receipt message to the sender, wherein the receipt message template at least includes a message receipt rule, and the receipt message is a message indicating that the conversion of the initial message is completed.

[0013] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the message conversion methods.

[0014] According to another aspect of the present application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include means for executing any one of the message conversion methods.

[0015] By applying the technical solution of the present application, an initial message sent by a sender is received, and the class corresponding to the initial message is determined; a format conversion template corresponding to the class is determined, and the format conversion template is used to convert the initial message to obtain a converted message; a receipt message template is obtained, and a receipt message template is used to generate a receipt message of the converted message, and the receipt message is sent to the sender. Compared with the method in the prior art that converts and transmits messages by setting interfaces, which has low efficiency, the present application converts the initial message by using the above-mentioned format conversion template, and generates a receipt message by using the receipt message template, thereby avoiding the problem that each message uses different interfaces for conversion and receipt, and thus can improve data conversion efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0017] Figure 1 A hardware structure block diagram of a mobile terminal for executing a message conversion method provided in an embodiment of the present application is shown;

[0018] Figure 2 A schematic diagram of a flow chart of a message conversion method provided in an embodiment of the present application is shown;

[0019] Figure 3 A schematic diagram of a label mapping relationship implementation method provided by an embodiment of the present application is shown;

[0020] Figure 4 A flow chart of a specific message conversion method provided by an embodiment of the present application is shown;

[0021] Figure 5 A structural block diagram of a message conversion device provided in an embodiment of the present application is shown.

[0022] The above drawings include the following reference numerals:

[0023] 102, processor; 104, memory; 106, transmission device; 108, input and output devices. DETAILED DESCRIPTION

[0024] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0027] As introduced in the background technology, the prior art converts and transmits messages by setting up interfaces, which has the problem of low efficiency. In order to solve the problem of low efficiency in the message conversion and transmission process, the embodiments of the present application provide a message conversion method, device, computer-readable storage medium and electronic device.

[0028] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0029] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a message conversion method according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0030] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the message conversion method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The transmission device 106 is used to receive or send data via a network. The above-mentioned specific examples of the network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0031] In this embodiment, a message conversion method running on a mobile terminal, a computer terminal or a similar computing device is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0032] Figure 2 1 is a flow chart of a message conversion method according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:

[0033] Step S201, receiving an initial message sent by a sender, and determining a class corresponding to the initial message, wherein the class at least includes a message label;

[0034] Specifically, the technical solution of the present application includes the following two main parts: a conversion template configuration part and a visualization template configuration part. The conversion template configuration part is mainly used to encapsulate the mapping relationship implementation, obtain XML messages, send XML message receipts and other related interfaces; the visualization template configuration part mainly provides a window that can interact with the user, and provides a visualization window for the technical administrator or the authorized user, which is mainly used to query or modify the currently configured template, which will be described in detail below. Among them, the core idea of ​​the mapping relationship is to configure the template so that the tags in the target system (i.e., the sender) message can adaptively match the tag library tags in the template. In this way, the tags in the target system message can be accurately matched and processed, thereby achieving the purpose of data interaction. By configuring different templates, the tags of each XML message are mapped to the tag library tags corresponding to the template, so that the background code can uniformly process the data of different messages and realize differentiated processing between different messages. Call the download interface to obtain or receive the content sent by the target system (sender), and parse the initial message through the SAX analyzer, and then determine the Bean (class) corresponding to the XML message. The message tag and the corresponding tag field are both included in the class. The SAX parser is a tool that can parse XML format messages. In actual applications, other parsers can also be used for parsing.

[0035] Step S202, determining a format conversion template corresponding to the class, and converting the initial message using the format conversion template to obtain a converted message, wherein the format conversion template at least includes a conversion rule for the message label;

[0036] Specifically, the format conversion template is matched based on the FreeMaker template engine technology, and the preset template is matched to convert the message format to obtain the converted message. XML message acquisition is a process based on the target system initiating a message to the source system (this system, i.e., the receiving system). In this process, the source system receives the XML message sent by the target system, and converts the label in the message into the label value in the corresponding tag library through parsing and conversion, so as to facilitate subsequent data storage and processing. By parsing the message, the source system can extract the data in the message and map it to the corresponding tag library label value. This conversion process can be adaptively performed according to the predefined template configuration, and the relationship between the message label and the corresponding tag library is converted. In this way, the background code can directly use the tag value in the corresponding tag library for data storage and processing, thereby simplifying the logic of the background code. In other words, by presetting the conversion rules and mapping relationships between different message formats, the mapping relationship can be directly used for messages of different formats to perform format conversion, and there is no need to set different conversion interfaces for messages of each format, thereby improving conversion efficiency.

[0037] Step S203, obtaining a receipt message template, using the receipt message template to generate a receipt message of the converted message, and sending the receipt message to the sender, wherein the receipt message template at least includes a receipt rule of the message, and the receipt message is a message indicating that the conversion of the initial message is completed.

[0038] Specifically, after the conversion, a receipt needs to be sent to the target system, that is, the sender, to inform the sender that the format of the initial message has been successfully converted. The receipt message is also generated using a receipt message template, and the generation process of the receipt message is the reverse process of the format conversion process of the above-mentioned initial message. The XML message receipt is a process based on the source system initiating a message to the target system. In this process, the source system can obtain business data from the corresponding tag library and convert these data into XML messages through the mapping relationship of the template configuration module. The template configuration module defines the structure and content of the XML message and provides a mapping relationship with the tag library. By configuring the template, the source system can convert the business data in the tag library into various elements and attributes of the message according to pre-set rules and mapping relationships. Such a processing process can easily convert the business data in the source system into a standard message format for data exchange and storage with the target system.

[0039] Through this embodiment, the initial message sent by the sender is received, and the class corresponding to the initial message is determined; the format conversion template corresponding to the class is determined, and the format conversion template is used to convert the initial message to obtain a converted message; the receipt message template is obtained, and the receipt message template is used to generate a receipt message of the converted message, and the receipt message is sent to the sender. Compared with the method in the prior art that converts and transmits messages by setting interfaces, which has low efficiency, the present application converts the initial message by the above-mentioned format conversion template, and generates a receipt message by the receipt message template, which avoids the problem that each message uses different interfaces for conversion and receipt, and thus can improve data conversion efficiency.

[0040] In a specific implementation process, the above step S202 can be implemented by the following steps: Step S2021: determining the format conversion template corresponding to the class, including: obtaining a one-to-one mapping relationship between the class and the format conversion template; Step S2022: determining the format conversion template corresponding to the class according to the one-to-one mapping relationship between the class and the format conversion template. The method determines the format conversion template corresponding to the class through the above steps to perform format conversion on the initial message.

[0041] Specifically, based on the FreeMaker template engine technology, the message format conversion is performed by matching the preset template (format conversion template) corresponding to the above class through the one-to-one mapping relationship between the class and the format conversion template. Figure 3 As shown, the XML message obtains the preset template. If successful, the label value is obtained based on FreeMaker's label adaptive matching. If the preset template fails to be obtained, the configuration is visually modified to obtain the label value based on FreeMaker's label adaptive matching.

[0042] In some optional implementations, after obtaining the converted message, the method further includes the following steps: Step S204: Obtain a one-to-one mapping relationship between the initial message label and the local message label, wherein the initial message label represents the label corresponding to the initial message, and the local message label is the label corresponding to the local message; Step S205: Determine the local message label corresponding to the converted message based on the one-to-one mapping relationship between the initial message label and the local message label, and store data based on the local message label. The method determines the label on the local system corresponding to the initial message after the conversion format through the above steps, so that subsequent operations can be performed according to the local label.

[0043] In the specific implementation process, after the format of the initial message is converted, it is also necessary to determine the local system label corresponding to the message after the format conversion, that is, according to the mapping relationship between the XML label (initial message label) and the background label library field (local message label) of the local system, the corresponding label value is obtained. Since the converted message is the message after the format conversion of the initial message, the label corresponding to the converted message can be determined, and the initial message format conversion process of the target system is completed. Afterwards, data can be stored in the local system according to the local message label.

[0044] In some optional implementations, the above step S203 obtains the receipt message template, including the following steps: step S2031: extract the message tag of the converted message, and obtain the one-to-one mapping relationship between the message tag and the receipt message template; step S2032: determine the receipt message template corresponding to the message tag according to the one-to-one mapping relationship between the message tag and the receipt message template. The method generates a receipt message through the above receipt message template, so that the corresponding receipt message can be generated according to the template, and the problem that messages of different formats need to generate and transmit receipt messages through different interfaces can also be avoided, thereby improving efficiency.

[0045] Specifically, the background business code sets the tag value information sent in this XML message receipt, that is, the message tag of the above-mentioned conversion message; based on the FreeMaker template engine technology, the corresponding receipt message template is obtained based on the one-to-one mapping relationship between the message tag and the receipt message template.

[0046] In some optional implementations, the above step S203 uses the receipt message template to generate the receipt message of the converted message, including the following steps: Step S2033: obtain a one-to-one mapping relationship between the local message tag and the sender message tag, and determine the sender message tag corresponding to the local message tag according to the one-to-one mapping relationship between the local message tag and the sender message tag; Step S2034: use the receipt message template to generate the receipt message of the converted message according to the sender message tag. The method determines the tag related to the receipt message through the above steps, so that a receipt can be issued to inform that the message format conversion is successful.

[0047] In the specific implementation process, the above steps are the reverse steps of the format conversion steps. According to the mapping relationship between the background tag library field (referring to the local message tag) and the message tag (referring to the message tag of the initial message), the corresponding Bean object (class) is obtained; using the JAVA reflection principle, since the class contains the tag, the Bean object (class) is converted into the corresponding message tag value, a message receipt is generated, and the interface is called to send the receipt message to the sender.

[0048] In some optional implementations, the above step S201 determines the class corresponding to the initial message, which can be implemented by the following steps: using the Java reflection mechanism to encapsulate the initial message into a class corresponding to the message field, and obtain the class corresponding to the initial message, wherein the class also includes the message field. The method determines the class corresponding to the message through the above steps, so that the format conversion template corresponding to the initial message can be determined.

[0049] In the specific implementation process, as mentioned above, the initial message is obtained by parsing with the SAX analyzer; then the obtained XML initial message is encapsulated into a corresponding Bean (class) by using the Java reflection principle.

[0050] In some optional implementations, the method further includes the following steps: Step S206: in the case where the format conversion template corresponding to the class cannot be determined, the conversion rules corresponding to the class are obtained, and the conversion rules are added to the format conversion template, wherein the conversion rules at least include the conversion rules of the message label. The method can flexibly adjust the conversion template through the above steps, so that the conversion template can be adjusted according to actual conditions to adapt to different message format conversion scenarios.

[0051] Specifically, this step mainly refers to the visualization template configuration part, which provides a visualization window for technical administrators or authorized users, and is mainly used to query or modify the currently configured template. For example: if the format conversion template corresponding to the class cannot be determined, the conversion rules corresponding to the class are obtained, and the conversion rules are added to the format conversion template.

[0052] In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the implementation process of the message conversion method of the present application will be described in detail below in conjunction with specific embodiments.

[0053] This embodiment relates to a specific message conversion method, such as Figure 4 As shown, the following steps are included:

[0054] Scenario 1: The steps to obtain the XML message are as follows:

[0055] Step S1: Get the certificate sent by the client and parse the XML message through the SAX analyzer;

[0056] Step S2: Obtain the original XML message tag and match the preset template;

[0057] Template configuration module:

[0058] Step S3: Use FreeMaker template engine configuration technology;

[0059] Step S4: Determine whether a mapping relationship between the XML tag and the background tag library field exists. If yes, execute step S5; if no, execute step S13;

[0060] Step S5: Obtain the background label value obtained after mapping through the unified interface configured by the template;

[0061] Step S6: XML message acquisition processing is completed.

[0062] Scenario 2: The steps for generating an XML message are as follows:

[0063] Step S7: the background business code matches the preset template;

[0064] Step S8: Set the tag value required in the receipt according to the background tag library field;

[0065] Template configuration module:

[0066] Step S9: Use FreeMaker template engine configuration technology;

[0067] Step S10: Determine whether a mapping relationship between the background tag library and the XML tag exists. If yes, execute step S11; if no, execute step S13;

[0068] Step S11: obtaining the XML tag value obtained after mapping through the unified interface configured by the template;

[0069] Step S12: The XML message receipt is generated successfully.

[0070] Visual template configuration module:

[0071] Step S13: There are some XML tags that cannot be matched to the mapping relationship;

[0072] Step S14: Modify the visualization template configuration interface by yourself;

[0073] Step S15: Configure the template.

[0074] The present application embodiment also provides a message conversion device. It should be noted that the message conversion device of the present application embodiment can be used to execute the message conversion method provided by the present application embodiment. The device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions have been made without further details. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.

[0075] The following is an introduction to the message conversion device provided in an embodiment of the present application.

[0076] Figure 5 Schematic diagram of a message conversion device according to an embodiment of the present application. Figure 5 As shown, the device comprises:

[0077] The determining unit 10 is configured to receive an initial message sent by a sender and determine a class corresponding to the initial message, wherein the class includes at least a message label;

[0078] Specifically, the technical solution of the present application includes the following two main parts: a conversion template configuration part and a visualization template configuration part. The conversion template configuration part is mainly used to encapsulate the mapping relationship implementation, obtain XML messages, send XML message receipts and other related interfaces; the visualization template configuration part mainly provides a window that can interact with the user, and provides a visualization window for the technical administrator or the authorized user, which is mainly used to query or modify the currently configured template, which will be described in detail below. Among them, the core idea of ​​the mapping relationship is to configure the template so that the tags in the target system (i.e., the sender) message can adaptively match the tag library tags in the template. In this way, the tags in the target system message can be accurately matched and processed, thereby achieving the purpose of data interaction. By configuring different templates, the tags of each XML message are mapped to the tag library tags corresponding to the template, so that the background code can uniformly process the data of different messages and realize differentiated processing between different messages. Call the download interface to obtain or receive the content sent by the target system (sender), and parse the initial message through the SAX analyzer, and then determine the Bean (class) corresponding to the XML message. The message tag and the corresponding tag field are both included in the class. The SAX parser is a tool that can parse XML format messages. In actual applications, other parsers can also be used for parsing.

[0079] A conversion unit 20, configured to determine a format conversion template corresponding to the class, and convert the initial message using the format conversion template to obtain a converted message, wherein the format conversion template at least includes a conversion rule for the message label;

[0080] Specifically, the format conversion template is matched based on the FreeMaker template engine technology, and the preset template is matched to convert the message format to obtain the converted message. XML message acquisition is a process based on the target system initiating a message to the source system (this system, i.e., the receiving system). In this process, the source system receives the XML message sent by the target system, and converts the label in the message into the label value in the corresponding tag library through parsing and conversion, so as to facilitate subsequent data storage and processing. By parsing the message, the source system can extract the data in the message and map it to the corresponding tag library label value. This conversion process can be adaptively performed according to the predefined template configuration, and the relationship between the message label and the corresponding tag library is converted. In this way, the background code can directly use the tag value in the corresponding tag library for data storage and processing, thereby simplifying the logic of the background code. In other words, by presetting the conversion rules and mapping relationships between different message formats, the mapping relationship can be directly used for messages of different formats to perform format conversion, and there is no need to set different conversion interfaces for messages of each format, thereby improving conversion efficiency.

[0081] The sending unit 30 is used to obtain a receipt message template, use the receipt message template to generate a receipt message of the converted message, and send the receipt message to the sender, wherein the receipt message template at least includes a receipt rule of the message, and the receipt message is a message that indicates that the conversion of the initial message is completed.

[0082] Specifically, after the conversion, a receipt needs to be sent to the target system, that is, the sender, to inform the sender that the format of the initial message has been successfully converted. The receipt message is also generated using a receipt message template, and the generation process of the receipt message is the reverse process of the format conversion process of the above-mentioned initial message. The XML message receipt is a process based on the source system initiating a message to the target system. In this process, the source system can obtain business data from the corresponding tag library and convert these data into XML messages through the mapping relationship of the template configuration module. The template configuration module defines the structure and content of the XML message and provides a mapping relationship with the tag library. By configuring the template, the source system can convert the business data in the tag library into various elements and attributes of the message according to pre-set rules and mapping relationships. Such a processing process can easily convert the business data in the source system into a standard message format for data exchange and storage with the target system.

[0083] Through this embodiment, the initial message sent by the sender is received, and the class corresponding to the initial message is determined; the format conversion template corresponding to the class is determined, and the format conversion template is used to convert the initial message to obtain a converted message; the receipt message template is obtained, and the receipt message template is used to generate a receipt message of the converted message, and the receipt message is sent to the sender. Compared with the method in the prior art that converts and transmits messages by setting interfaces, which has low efficiency, the present application converts the initial message by the above-mentioned format conversion template, and generates a receipt message by the receipt message template, which avoids the problem that each message uses different interfaces for conversion and receipt, and thus can improve data conversion efficiency.

[0084] In a specific implementation process, the conversion unit includes a first acquisition module and a first determination module, wherein the first acquisition module is used to acquire a one-to-one mapping relationship between the class and the format conversion template; and the first determination module is used to determine the format conversion template corresponding to the class according to the one-to-one mapping relationship between the class and the format conversion template. The method determines the format conversion template corresponding to the class through the above steps to perform format conversion on the initial message.

[0085] Specifically, based on the FreeMaker template engine technology, the message format conversion is performed by matching the preset template (format conversion template) corresponding to the above class through the one-to-one mapping relationship between the class and the format conversion template. Figure 3As shown, the XML message obtains the preset template. If successful, the label value is obtained based on FreeMaker's label adaptive matching. If the preset template fails to be obtained, the configuration is visually modified to obtain the label value based on FreeMaker's label adaptive matching.

[0086] In some optional implementations, after obtaining the converted message, the method further includes an acquisition unit and a storage unit, the acquisition unit is used to acquire a one-to-one mapping relationship between the initial message label and the local message label, wherein the initial message label represents the label corresponding to the initial message, and the local message label is the label corresponding to the local message; the storage unit is used to determine the local message label corresponding to the converted message according to the one-to-one mapping relationship between the initial message label and the local message label, and store data according to the local message label. The method determines the label on the local system corresponding to the initial message after the conversion format through the above steps, so that subsequent operations can be performed according to the local label.

[0087] In the specific implementation process, after the format of the initial message is converted, it is also necessary to determine the local system label corresponding to the message after the format conversion, that is, according to the mapping relationship between the XML label (initial message label) and the background label library field (local message label) of the local system, the corresponding label value is obtained. Since the converted message is the message after the format conversion of the initial message, the label corresponding to the converted message can be determined, and the initial message format conversion process of the target system is completed. Afterwards, data can be stored in the local system according to the local message label.

[0088] In some optional implementations, the sending unit includes a second acquisition module and a second determination module, the second acquisition module is used to extract the message label of the converted message, and obtain the one-to-one mapping relationship between the message label and the receipt message template; the second determination module is used to determine the receipt message template corresponding to the message label according to the one-to-one mapping relationship between the message label and the receipt message template. The method generates a receipt message through the above-mentioned receipt message template, so that the corresponding receipt message can be generated according to the template, and the problem that messages of different formats need to generate and transmit receipt messages through different interfaces can also be avoided, thereby improving efficiency.

[0089] Specifically, the background business code sets the tag value information sent in this XML message receipt, that is, the message tag of the above-mentioned conversion message; based on the FreeMaker template engine technology, the corresponding receipt message template is obtained based on the one-to-one mapping relationship between the message tag and the receipt message template.

[0090] In some optional implementations, the sending unit includes a third determination module and a generation module, the third determination module is used to obtain a one-to-one mapping relationship between a local message label and a sender message label, and determine the sender message label corresponding to the local message label according to the one-to-one mapping relationship between the local message label and the sender message label; the generation module is used to use the receipt message template to generate the receipt message of the converted message according to the sender message label. The method determines the label related to the receipt message through the above steps, so that a receipt can be issued to inform that the message format conversion is successful.

[0091] In the specific implementation process, the above steps are the reverse steps of the format conversion steps. According to the mapping relationship between the background tag library field (referring to the local message tag) and the message tag (referring to the message tag of the initial message), the corresponding Bean object (class) is obtained; using the JAVA reflection principle, since the class contains the tag, the Bean object (class) is converted into the corresponding message tag value, a message receipt is generated, and the interface is called to send the receipt message to the sender.

[0092] In some optional implementations, the determination unit includes an encapsulation module, which is used to encapsulate the initial message into a class corresponding to the message field using a Java reflection mechanism to obtain a class corresponding to the initial message, wherein the class also includes the message field. The method determines the class corresponding to the message through the above steps, so that the format conversion template corresponding to the initial message can be determined.

[0093] In the specific implementation process, as mentioned above, the initial message is obtained by parsing with the SAX analyzer; then the obtained XML initial message is encapsulated into a corresponding Bean (class) by using the Java reflection principle.

[0094] In some optional implementations, the method further includes an adding unit for obtaining a conversion rule corresponding to the class when the format conversion template corresponding to the class cannot be determined, and adding the conversion rule to the format conversion template, wherein the conversion rule at least includes a conversion rule for the message label. The method can flexibly adjust the conversion template through the above steps, so that the conversion template can be adjusted according to actual conditions to adapt to different message format conversion scenarios.

[0095] Specifically, this step mainly refers to the visualization template configuration part, which provides a visualization window for technical administrators or authorized users, and is mainly used to query or modify the currently configured template. For example: if the format conversion template corresponding to the class cannot be determined, the conversion rules corresponding to the class are obtained, and the conversion rules are added to the format conversion template.

[0096] The message conversion device includes a processor and a memory, and the above-mentioned determination unit, conversion unit and sending unit are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize the corresponding functions. The above-mentioned modules are all located in the same processor; or, the above-mentioned modules are located in different processors in any combination.

[0097] The processor includes a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the conversion efficiency of the message can be improved by adjusting the kernel parameters.

[0098] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0099] An embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the message conversion method.

[0100] Specifically, the message conversion method includes:

[0101] Step S201, receiving an initial message sent by a sender, and determining a class corresponding to the initial message, wherein the class at least includes a message label;

[0102] Specifically, the technical solution of the present application includes the following two main parts: a conversion template configuration part and a visualization template configuration part. The conversion template configuration part is mainly used to encapsulate the mapping relationship implementation, obtain XML messages, send XML message receipts and other related interfaces; the visualization template configuration part mainly provides a window that can interact with the user, and provides a visualization window for the technical administrator or the authorized user, which is mainly used to query or modify the currently configured template, which will be described in detail below. Among them, the core idea of ​​the mapping relationship is to configure the template so that the tags in the target system (i.e., the sender) message can adaptively match the tag library tags in the template. In this way, the tags in the target system message can be accurately matched and processed, thereby achieving the purpose of data interaction. By configuring different templates, the tags of each XML message are mapped to the tag library tags corresponding to the template, so that the background code can uniformly process the data of different messages and realize differentiated processing between different messages. Call the download interface to obtain or receive the content sent by the target system (sender), and parse the initial message through the SAX analyzer, and then determine the Bean (class) corresponding to the XML message. The message tag and the corresponding tag field are both included in the class. The SAX parser is a tool that can parse XML format messages. In actual applications, other parsers can also be used for parsing.

[0103] Step S202, determining a format conversion template corresponding to the class, and converting the initial message using the format conversion template to obtain a converted message, wherein the format conversion template at least includes a conversion rule for the message label;

[0104] Specifically, the format conversion template is matched based on the FreeMaker template engine technology, and the preset template is matched to convert the message format to obtain the converted message. XML message acquisition is a process based on the target system initiating a message to the source system (this system, i.e., the receiving system). In this process, the source system receives the XML message sent by the target system, and converts the label in the message into the label value in the corresponding tag library through parsing and conversion, so as to facilitate subsequent data storage and processing. By parsing the message, the source system can extract the data in the message and map it to the corresponding tag library label value. This conversion process can be adaptively performed according to the predefined template configuration, and the relationship between the message label and the corresponding tag library is converted. In this way, the background code can directly use the tag value in the corresponding tag library for data storage and processing, thereby simplifying the logic of the background code. In other words, by presetting the conversion rules and mapping relationships between different message formats, the mapping relationship can be directly used for messages of different formats to perform format conversion, and there is no need to set different conversion interfaces for messages of each format, thereby improving conversion efficiency.

[0105] Step S203, obtaining a receipt message template, using the receipt message template to generate a receipt message of the converted message, and sending the receipt message to the sender, wherein the receipt message template at least includes a receipt rule of the message, and the receipt message is a message indicating that the conversion of the initial message is completed.

[0106] Specifically, after the conversion, a receipt needs to be sent to the target system, that is, the sender, to inform the sender that the format of the initial message has been successfully converted. The receipt message is also generated using a receipt message template, and the generation process of the receipt message is the reverse process of the format conversion process of the above-mentioned initial message. The XML message receipt is a process based on the source system initiating a message to the target system. In this process, the source system can obtain business data from the corresponding tag library and convert these data into XML messages through the mapping relationship of the template configuration module. The template configuration module defines the structure and content of the XML message and provides a mapping relationship with the tag library. By configuring the template, the source system can convert the business data in the tag library into various elements and attributes of the message according to pre-set rules and mapping relationships. Such a processing process can easily convert the business data in the source system into a standard message format for data exchange and storage with the target system.

[0107] An embodiment of the present invention provides an electronic device, including a processor, a memory, and a program stored in the memory and executable on the processor, wherein when the processor executes the program, at least the following steps are implemented:

[0108] Step S201, receiving an initial message sent by a sender, and determining a class corresponding to the initial message, wherein the class at least includes a message label;

[0109] Specifically, the technical solution of the present application includes the following two main parts: a conversion template configuration part and a visualization template configuration part. The conversion template configuration part is mainly used to encapsulate the mapping relationship implementation, obtain XML messages, send XML message receipts and other related interfaces; the visualization template configuration part mainly provides a window that can interact with the user, and provides a visualization window for the technical administrator or the authorized user, which is mainly used to query or modify the currently configured template, which will be described in detail below. Among them, the core idea of ​​the mapping relationship is to configure the template so that the tags in the target system (i.e., the sender) message can adaptively match the tag library tags in the template. In this way, the tags in the target system message can be accurately matched and processed, thereby achieving the purpose of data interaction. By configuring different templates, the tags of each XML message are mapped to the tag library tags corresponding to the template, so that the background code can uniformly process the data of different messages and realize differentiated processing between different messages. Call the download interface to obtain or receive the content sent by the target system (sender), and parse the initial message through the SAX analyzer, and then determine the Bean (class) corresponding to the XML message. The message tag and the corresponding tag field are both included in the class. The SAX parser is a tool that can parse XML format messages. In actual applications, other parsers can also be used for parsing.

[0110] Step S202, determining a format conversion template corresponding to the class, and converting the initial message using the format conversion template to obtain a converted message, wherein the format conversion template at least includes a conversion rule for the message label;

[0111] Specifically, the format conversion template is matched based on the FreeMaker template engine technology, and the preset template is matched to convert the message format to obtain the converted message. XML message acquisition is a process based on the target system initiating a message to the source system (this system, i.e., the receiving system). In this process, the source system receives the XML message sent by the target system, and converts the label in the message into the label value in the corresponding tag library through parsing and conversion, so as to facilitate subsequent data storage and processing. By parsing the message, the source system can extract the data in the message and map it to the corresponding tag library label value. This conversion process can be adaptively performed according to the predefined template configuration, and the relationship between the message label and the corresponding tag library is converted. In this way, the background code can directly use the tag value in the corresponding tag library for data storage and processing, thereby simplifying the logic of the background code. In other words, by presetting the conversion rules and mapping relationships between different message formats, the mapping relationship can be directly used for messages of different formats to perform format conversion, and there is no need to set different conversion interfaces for messages of each format, thereby improving conversion efficiency.

[0112] Step S203, obtaining a receipt message template, using the receipt message template to generate a receipt message of the converted message, and sending the receipt message to the sender, wherein the receipt message template at least includes a receipt rule of the message, and the receipt message is a message indicating that the conversion of the initial message is completed.

[0113] Specifically, after the conversion, a receipt needs to be sent to the target system, that is, the sender, to inform the sender that the format of the initial message has been successfully converted. The receipt message is also generated using a receipt message template, and the generation process of the receipt message is the reverse process of the format conversion process of the above-mentioned initial message. The XML message receipt is a process based on the source system initiating a message to the target system. In this process, the source system can obtain business data from the corresponding tag library and convert these data into XML messages through the mapping relationship of the template configuration module. The template configuration module defines the structure and content of the XML message and provides a mapping relationship with the tag library. By configuring the template, the source system can convert the business data in the tag library into various elements and attributes of the message according to pre-set rules and mapping relationships. Such a processing process can easily convert the business data in the source system into a standard message format for data exchange and storage with the target system.

[0114] The devices in this article can be servers, PCs, PADs, mobile phones, etc.

[0115] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the method described in each embodiment of the present application:

[0116] Step S201, receiving an initial message sent by a sender, and determining a class corresponding to the initial message, wherein the class at least includes a message label;

[0117] Specifically, the technical solution of the present application includes the following two main parts: a conversion template configuration part and a visualization template configuration part. The conversion template configuration part is mainly used to encapsulate the mapping relationship implementation, obtain XML messages, send XML message receipts and other related interfaces; the visualization template configuration part mainly provides a window that can interact with the user, and provides a visualization window for the technical administrator or the authorized user, which is mainly used to query or modify the currently configured template, which will be described in detail below. Among them, the core idea of ​​the mapping relationship is to configure the template so that the tags in the target system (i.e., the sender) message can adaptively match the tag library tags in the template. In this way, the tags in the target system message can be accurately matched and processed, thereby achieving the purpose of data interaction. By configuring different templates, the tags of each XML message are mapped to the tag library tags corresponding to the template, so that the background code can uniformly process the data of different messages and realize differentiated processing between different messages. Call the download interface to obtain or receive the content sent by the target system (sender), and parse the initial message through the SAX analyzer, and then determine the Bean (class) corresponding to the XML message. The message tag and the corresponding tag field are both included in the class. The SAX parser is a tool that can parse XML format messages. In actual applications, other parsers can also be used for parsing.

[0118] Step S202, determining a format conversion template corresponding to the class, and converting the initial message using the format conversion template to obtain a converted message, wherein the format conversion template at least includes a conversion rule for the message label;

[0119] Specifically, the format conversion template is matched based on the FreeMaker template engine technology, and the preset template is matched to convert the message format to obtain the converted message. XML message acquisition is a process based on the target system initiating a message to the source system (this system, i.e., the receiving system). In this process, the source system receives the XML message sent by the target system, and converts the label in the message into the label value in the corresponding tag library through parsing and conversion, so as to facilitate subsequent data storage and processing. By parsing the message, the source system can extract the data in the message and map it to the corresponding tag library label value. This conversion process can be adaptively performed according to the predefined template configuration, and the relationship between the message label and the corresponding tag library is converted. In this way, the background code can directly use the tag value in the corresponding tag library for data storage and processing, thereby simplifying the logic of the background code. In other words, by presetting the conversion rules and mapping relationships between different message formats, the mapping relationship can be directly used for messages of different formats to perform format conversion, and there is no need to set different conversion interfaces for messages of each format, thereby improving conversion efficiency.

[0120] Step S203, obtaining a receipt message template, using the receipt message template to generate a receipt message of the converted message, and sending the receipt message to the sender, wherein the receipt message template at least includes a receipt rule of the message, and the receipt message is a message indicating that the conversion of the initial message is completed.

[0121] Specifically, after the conversion, a receipt needs to be sent to the target system, that is, the sender, to inform the sender that the format of the initial message has been successfully converted. The receipt message is also generated using a receipt message template, and the generation process of the receipt message is the reverse process of the format conversion process of the above-mentioned initial message. The XML message receipt is a process based on the source system initiating a message to the target system. In this process, the source system can obtain business data from the corresponding tag library and convert these data into XML messages through the mapping relationship of the template configuration module. The template configuration module defines the structure and content of the XML message and provides a mapping relationship with the tag library. By configuring the template, the source system can convert the business data in the tag library into various elements and attributes of the message according to pre-set rules and mapping relationships. Such a processing process can easily convert the business data in the source system into a standard message format for data exchange and storage with the target system.

[0122] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0123] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0124] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0125] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0126] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0127] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0128] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0129] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0130] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0131] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:

[0132] 1) In the message conversion method of the present application, an initial message sent by a sender is received, and a class corresponding to the initial message is determined; a format conversion template corresponding to the class is determined, and the format conversion template is used to convert the initial message to obtain a converted message; a receipt message template is obtained, and a receipt message template is used to generate a receipt message of the converted message, and the receipt message is sent to the sender. Compared with the method in the prior art that converts and transmits messages by setting interfaces, which has low efficiency, the present application converts the initial message by using the above-mentioned format conversion template, and generates a receipt message by using the receipt message template, thereby avoiding the problem that each message uses different interfaces for conversion and receipt, and thus can improve data conversion efficiency.

[0133] 2) In the message conversion device of the present application, the initial message sent by the sender is received, and the class corresponding to the initial message is determined; the format conversion template corresponding to the class is determined, and the format conversion template is used to convert the initial message to obtain a converted message; a receipt message template is obtained, and a receipt message template is used to generate a receipt message of the converted message, and the receipt message is sent to the sender. Compared with the method in the prior art that converts and transmits messages by setting interfaces, which has low efficiency, the present application converts the initial message by using the above-mentioned format conversion template, and generates a receipt message by using the receipt message template, thereby avoiding the problem that each message uses different interfaces for conversion and receipt, and thus can improve data conversion efficiency.

[0134] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A message conversion method, characterized in that: include: Receiving an initial message sent by a sender, and determining a class corresponding to the initial message, wherein the class includes at least a message label; Determine a format conversion template corresponding to the class, and convert the initial message using the format conversion template to obtain a converted message, wherein the format conversion template at least includes a conversion rule for the message label; Obtain a receipt message template, use the receipt message template to generate a receipt message of the converted message, and send the receipt message to the sender, wherein the receipt message template at least includes a receipt rule for the message, and the receipt message is a message that indicates that the conversion of the initial message is completed.

2. The message conversion method according to claim 1, characterized in that: Determine the format conversion template corresponding to the class, including: Obtaining a one-to-one mapping relationship between the class and the format conversion template; The format conversion template corresponding to the class is determined according to a one-to-one mapping relationship between the class and the format conversion template.

3. The message conversion method according to claim 1, characterized in that: After obtaining the conversion message, the method further includes: Obtain a one-to-one mapping relationship between an initial message label and a local message label, wherein the initial message label represents a label corresponding to the initial message, and the local message label is a label corresponding to the local message; The local message label corresponding to the converted message is determined according to the one-to-one mapping relationship between the initial message label and the local message label, and data is stored according to the local message label.

4. The message conversion method according to claim 1, characterized in that: Get the receipt message template, including: Extracting a message tag of the converted message, and obtaining a one-to-one mapping relationship between the message tag and the receipt message template; The receipt message template corresponding to the message tag is determined according to a one-to-one mapping relationship between the message tag and the receipt message template.

5. The message conversion method according to claim 1, characterized in that: The receipt message template is used to generate a receipt message of the converted message, including: Obtain a one-to-one mapping relationship between a local message label and a sender message label, and determine a sender message label corresponding to the local message label according to the one-to-one mapping relationship between the local message label and the sender message label; The receipt message template is used to generate the receipt message of the converted message according to the sender message label.

6. The message conversion method according to claim 1, characterized in that: Determining a class corresponding to the initial message includes: The initial message is encapsulated into a class corresponding to the message field by using a Java reflection mechanism, so as to obtain a class corresponding to the initial message, wherein the class also includes the message field.

7. The message conversion method according to claim 1, characterized in that: The method further comprises: In the case where the format conversion template corresponding to the class cannot be determined, the conversion rules corresponding to the class are obtained, and the conversion rules are added to the format conversion template, wherein the conversion rules at least include the conversion rules of the message label.

8. A message conversion device, characterized in that: include: A determination unit, configured to receive an initial message sent by a sender, and determine a class corresponding to the initial message, wherein the class includes at least a message label; A conversion unit, configured to determine a format conversion template corresponding to the class, and convert the initial message using the format conversion template to obtain a converted message, wherein the format conversion template at least includes a conversion rule for the message label; A sending unit is used to obtain a receipt message template, use the receipt message template to generate a receipt message of the converted message, and send the receipt message to the sender, wherein the receipt message template at least includes a receipt rule of the message, and the receipt message is a message that indicates that the conversion of the initial message is completed.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the message conversion method according to any one of claims 1 to 7.

10. An electronic device, characterized in that: include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include a method for executing the message conversion method described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Business object and xml message mutual conversion method and system

    CN105138613A

  • Network element equipment accessing method based on automatic template configuration

    CN108418704A

  • Security management platform access management receiving method, security management platform access management sending method and security management platform access management system

    CN111258778A

  • Message conversion method and device, computer readable storage medium and processor

    CN113132371A

  • Financial message conversion method and system based on FreeMarker template engine

    CN113992765A