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

By using format conversion templates and receipt message templates to convert and receive receipts from initial messages, the problem of low efficiency in message conversion and transmission in existing technologies is solved, achieving more efficient data processing and easier maintenance.

CN119814894BActive Publication Date: 2026-05-29中国邮政储蓄银行股份有限公司

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
中国邮政储蓄银行股份有限公司
Filing Date
2024-12-10
Publication Date
2026-05-29

Smart Images

  • Figure CN119814894B_ABST
    Figure CN119814894B_ABST
Patent Text Reader

Abstract

The application provides a message conversion method and device, a computer readable storage medium and an electronic device. The method comprises: receiving an initial message sent by a sender, determining a class corresponding to the initial message, wherein the class comprises at least a message label; determining a format conversion template corresponding to the class, converting the initial message by using the format conversion template to obtain a converted message, wherein the format conversion template comprises at least a conversion rule of the message label; obtaining a receipt message template, generating a receipt message of the converted message by using the receipt message template, and sending the receipt message to the sender, wherein the receipt message template comprises at least a receipt rule of the message, and the receipt message is a message representing that the conversion of the initial message is completed. Through the application, 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] This application relates to the field of computer data processing technology, and more specifically, to a message conversion method, apparatus, computer-readable storage medium, and electronic device. Background Technology

[0002] The source and target systems interact via XML messages, and each target system's messages have unique characteristics. How to address the differences arising from the diversity of target system messages is a challenging problem worth considering. Previously, differentiated processing of messages from different target systems was achieved through configuration of external systems. By configuring different interfaces, tags in each XML message could be mapped to corresponding fields. The problem with this is that the actual users of these fields are the backend code. Sometimes, the differences between messages are very minor; simply because the external system's interface configuration differs, the backend code needs two completely different sets of processing logic. And most of the differences between these two sets of logic are limited to retrieving values ​​with the same meaning in different fields.

[0003] As business expands, the functional requirements of information systems become increasingly complex, and the interaction between systems is also increasing. When the source system interfaces with different target systems, the number of differentiated messages increases, leading to problems such as maintenance difficulties, low efficiency, and easy errors. Specific problems are as follows: (1) The XML message structure is complex, containing multiple elements and attributes. Human negligence or errors may occur during processing. When processing XML messages, if a template library or scheduled task is used, a large number of templates need to be collected continuously in the early stages and later maintenance, which may consume a lot of manpower and time. After configuration, it is also necessary to carefully check and verify the content of each field to ensure its accuracy and completeness. (2) The flexibility is not high, and there is no exception handling mechanism designed for special messages. When adding special messages later, the maintenance work will involve template library maintenance and changes to the backend business logic code. Extracting common message configuration information can indeed simplify some repetitive message configuration work, but for a brand new special message, it is impossible to extract information from the common configuration. For new features or field requirements, project integration still requires development to adjust incremental configuration items, which is not conducive to later maintenance. Summary of the Invention

[0004] The main objective of this application is to provide a message conversion method, apparatus, computer-readable storage medium, and electronic device to at least solve the problem of low efficiency in message conversion and transmission through interface settings in the prior art.

[0005] To achieve the above objectives, according to one aspect of this application, a message conversion method is provided, comprising: receiving an initial message sent by a sender; determining a class corresponding to the initial message, wherein the class includes at least a message tag; determining a format conversion template corresponding to the class; converting the initial message using the format conversion template to obtain a converted message, wherein the format conversion template includes at least a conversion rule for the message tag; obtaining a receipt message template; generating a receipt message for the converted message using the receipt message template; and sending the receipt message to the sender, wherein the receipt message template includes at least a receipt rule for the message; and the receipt message is a message indicating that the initial message conversion is complete.

[0006] Optionally, determining the format conversion template corresponding to the class includes: obtaining a one-to-one mapping relationship between the class and the format conversion template; and determining the format conversion template corresponding to the class based on 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 the label corresponding to the initial message, and the local message label is the label corresponding to the local message; determining 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 storing the data according to 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; and determining the receipt message template corresponding to the message tag based on the one-to-one mapping relationship between the message tag and the receipt message template.

[0009] Optionally, generating the receipt message of the converted message using the receipt message template includes: obtaining a one-to-one mapping relationship between local message tags and sender message tags; determining the sender message tag corresponding to the local message tag based on the one-to-one mapping relationship between the local message tags and sender message tags; and generating the receipt message of the converted message using the receipt message template based on the sender message tag.

[0010] Optionally, determining the class corresponding to the initial message includes: using Java reflection to encapsulate the initial message into a class corresponding to the message fields, thereby obtaining the class corresponding to the initial message, wherein the class further includes the message fields.

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

[0012] According to another aspect of this application, a message conversion apparatus is provided, comprising: a determining 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 tag; 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 includes at least a conversion rule for the message tag; and a sending unit, configured to obtain a receipt message template, generate a receipt message for the converted message using the receipt message template, and send the receipt message to the sender, wherein the receipt message template includes at least a receipt rule for the message, and the receipt message is a message indicating that the initial message conversion is complete.

[0013] According to another aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to perform any of the aforementioned message conversion methods.

[0014] According to another aspect of this 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 configured to be executed by the one or more processors, the one or more programs including methods for performing any of the aforementioned message conversion methods.

[0015] By applying the technical solution of this application, an initial message sent by the 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 initial message is converted using the format conversion template to obtain a converted message; a receipt message template is obtained, and a receipt message for the converted message is generated using the receipt message template, and the receipt message is sent to the sender. Compared with the prior art, which uses an interface to convert messages and has low transmission efficiency, this application converts the initial message using the aforementioned format conversion template and generates a receipt message using the receipt message template, avoiding the problem of using different interfaces for conversion and receipt for each message. Therefore, it can improve data conversion efficiency. Attached Figure Description

[0016] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0017] Figure 1 A hardware structure block diagram of a mobile terminal performing a message conversion method according to an embodiment of this application is shown;

[0018] Figure 2 A schematic flowchart of a message conversion method provided by an embodiment of this application is shown;

[0019] Figure 3 The illustration shows a schematic diagram of a label mapping relationship implementation method provided by an embodiment of this application;

[0020] Figure 4 A flowchart illustrating a specific message conversion method provided by an embodiment of this application is shown;

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

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

[0023] 102. Processor; 104. Memory; 106. Transmission device; 108. Input / output device. Detailed Implementation

[0024] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0025] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort 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, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0027] As described in the background section, the existing technology of converting and transmitting messages by setting up an interface suffers from low efficiency. To solve the problem of low efficiency in the process of message conversion and transmission, the embodiments of this application provide a message conversion method, apparatus, computer-readable storage medium, and electronic device.

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

[0029] The methods and embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal according to an embodiment of the message conversion method of the present invention. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0030] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the message conversion method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. The transmission device 106 is used to receive or send data via a network. Specific examples of the aforementioned networks may include wireless networks provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station 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] This embodiment provides a message conversion method that runs on a mobile terminal, computer terminal, or similar computing device. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Also, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0032] Figure 2 This is a flowchart of a message conversion method according to an embodiment of this application. For example... Figure 2 As shown, the method includes the following steps:

[0033] Step S201: Receive the initial message sent by the sender and determine the class corresponding to the initial message, wherein the class includes at least a message tag;

[0034] Specifically, the technical solution of this 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 interfaces related to mapping relationship implementation, obtaining XML messages, and sending XML message receipts; the visualization template configuration part mainly provides an interactive window for technical administrators or authorized users, primarily used to query or modify the currently configured template. This part will be described in detail below. The core idea of ​​the mapping relationship is to configure templates so that the tags in the target system's (i.e., the sender's) messages can adaptively match the tags in the template's tag library. This allows for accurate matching and processing of tags in the target system's messages, thereby achieving data interaction. By configuring different templates, the tags of each XML message are mapped to the corresponding tag library tags in the template, enabling the backend code to uniformly process data from different messages and achieve differentiated processing between different messages. The download interface is called to obtain or receive content sent by the target system (sender), and the initial message is obtained by parsing it through a SAX analyzer, after which the corresponding Bean (class) for the XML message is determined. Message tags and corresponding tag fields are both contained within the class. A SAX parser is a tool that can parse XML format messages. In practical applications, other parsers can also be used for parsing.

[0035] Step S202: Determine the 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 includes at least the conversion rules of the message tag;

[0036] Specifically, the format conversion template is matched using the FreeMaker template engine technology, matching a preset template to convert the message format and obtain the converted message. XML message acquisition is the process of 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, through parsing and conversion, transforms the tags in the message into tag values ​​in the corresponding tag library for subsequent data storage and processing. By parsing the message, the source system can extract the data from the message and map it to the corresponding tag values ​​in the tag library. This conversion process can adaptively perform according to predefined template configurations, converting the relationship between message tags and corresponding tag libraries. In this way, the backend code can directly use the tag values ​​in the corresponding tag library for data storage and processing, thus simplifying the logic of the backend code. In other words, by pre-setting the conversion rules and mapping relationships between different message formats, the format conversion can be performed directly using this mapping relationship for different message formats, eliminating the need to set different conversion interfaces for each message format, thus improving conversion efficiency.

[0037] Step S203: Obtain a receipt message template, generate a receipt message for the converted message using the receipt message template, and send the receipt message to the sender. The receipt message template includes at least the receipt rules for the message, and the receipt message is a message indicating that the initial message conversion is complete.

[0038] Specifically, after the conversion, a receipt needs to be sent to the target system, i.e., the sender, to inform them that the initial message format has been successfully converted. The receipt message is also generated using a receipt message template; the generation process is the reverse of the initial message format conversion process described above. The XML message receipt is the process of 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 this 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 the mapping relationship between it and 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. This process can easily convert business data in the source system into a standard-compliant message format for data exchange and storage with the target system.

[0039] In this embodiment, an initial message sent by the 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 initial message is converted using the format conversion template to obtain a converted message. A receipt message template is obtained, and a receipt message for the converted message is generated using the receipt message template and sent to the sender. Compared with existing technologies that use interfaces for message conversion and have low transmission efficiency, this application converts the initial message using the aforementioned format conversion template and generates a receipt message using the receipt message template. This avoids the problem of using different interfaces for conversion and receipt for each message, thus improving data conversion efficiency.

[0040] In specific implementation, step S202 above can be achieved through the following steps: Step S2021: 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; Step S2022: Determine the format conversion template corresponding to the class based on the one-to-one mapping relationship between the class and the format conversion template. This 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 FreeMaker template engine technology, message format conversion is performed by matching the preset templates (format conversion templates) corresponding to the aforementioned classes through a one-to-one mapping relationship between classes and the format conversion templates. The tag mapping relationship is implemented as follows: Figure 3 As shown, the XML message retrieves a preset template. If successful, it uses FreeMaker's tag adaptive matching to retrieve tag values. If retrieving the preset template fails, the configuration is visually modified, and FreeMaker's tag adaptive matching is used to retrieve tag values.

[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 the data according to the local message label. This method determines the label on the local system corresponding to the initial message after format conversion through the above steps, thus allowing subsequent operations to be performed according to the local label.

[0043] In the specific implementation process, after converting the format of the initial message, it is also necessary to determine the tag corresponding to the local system for the converted message. This is done by obtaining the corresponding tag value based on the mapping relationship between XML tags (initial message tags) and the local system's backend tag library fields (local message tags). Since the converted message is the message after format conversion of the initial message, the tag corresponding to the converted message can be determined. At this point, the initial message format conversion process of the target system is complete. Afterwards, data can be stored in the local system based on the local message tags.

[0044] In some optional implementations, step S203 above, obtaining the receipt message template, includes the following steps: Step S2031: 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; Step S2032: Determining the receipt message template corresponding to the message tag based on the one-to-one mapping relationship between the message tag and the receipt message template. This method generates receipt messages through the aforementioned receipt message template, thus generating corresponding receipt messages based on the template. This also avoids the problem of needing to generate and transmit receipt messages through different interfaces for messages of different formats, improving efficiency.

[0045] Specifically, the backend business code sets the tag value information for this XML message receipt transmission, that is, the message tag of the converted message mentioned above; 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, step S203 above, which uses the receipt message template to generate a receipt message for the converted message, includes the following steps: Step S2033: Obtain the one-to-one mapping relationship between local message tags and sender message tags, and determine the sender message tag corresponding to the local message tag based on the one-to-one mapping relationship between the local message tags and sender message tags; Step S2034: Use the receipt message template to generate the receipt message for the converted message based on the sender message tag. This method determines the tags related to the receipt message through the above steps, thus enabling the receipt to be issued to indicate that the message format conversion was successful.

[0047] In the specific implementation process, the above steps are the reverse steps of the format conversion steps. Based on the mapping relationship between the background tag library fields (referring to local message tags) and message tags (referring to the message tags of the initial message), the corresponding Bean object (class) is obtained. Utilizing the JAVA reflection principle, since the class contains tags, the Bean object (class) is then 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, step S201, which determines the class corresponding to the initial message, can be achieved through the following steps: encapsulating the initial message into a class corresponding to the message fields using Java reflection, thereby obtaining the class corresponding to the initial message, wherein the class further includes the message fields. This method determines the class corresponding to the message through the above steps, thus enabling the determination of the format conversion template corresponding to the initial message.

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

[0050] In some optional implementations, the method further includes the following step: Step S206: When the format conversion template corresponding to the class cannot be determined, obtain the conversion rule corresponding to the class and add the conversion rule to the format conversion template, wherein the conversion rule includes at least the conversion rule for the message tag. This method allows for flexible adjustment of the conversion template through the above steps, enabling adjustments to the conversion template according to actual conditions to adapt to different message format conversion scenarios.

[0051] Specifically, this step mainly refers to the visual template configuration section, a visual window provided to technical administrators or authorized users, primarily used to query or modify the currently configured templates. For example, if the format conversion template corresponding to the class cannot be determined, the conversion rules corresponding to the class are obtained and added to the format conversion template.

[0052] To enable those skilled in the art to better understand the technical solution of this application, the implementation process of the message conversion method of this application will be described in detail below with reference to specific embodiments.

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

[0054] Scenario 1: The steps for obtaining the XML message are as follows:

[0055] Step S1: Obtain the credentials sent by the client and parse the XML message using a SAX parser;

[0056] Step S2: Obtain the original XML message tags and the matching preset template;

[0057] Template configuration module:

[0058] Step S3: Configure the FreeMaker template engine using technology;

[0059] Step S4: Determine if the mapping relationship between the XML tag and the backend tag library field exists. If yes, proceed to step S5; otherwise, proceed to step S13.

[0060] Step S5: Obtain the mapped backend tag value through the unified interface configured in the template;

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

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

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

[0064] Step S8: Set the tag values ​​required in the receipt according to the fields in the backend tag library;

[0065] Template configuration module:

[0066] Step S9: Configure the FreeMaker template engine using technology;

[0067] Step S10: Determine if the mapping relationship between the backend tag library and XML tags exists. If yes, proceed to step S11; otherwise, proceed to step S13.

[0068] Step S11: Obtain the mapped XML tag values ​​through the unified interface configured in the template;

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

[0070] Visual template configuration module:

[0071] Step S13: Some XML tags cannot be matched with mapping relationships;

[0072] Step S14: Modify the visual template configuration interface as needed;

[0073] Step S15: Configure the template.

[0074] This application also provides a message conversion apparatus. It should be noted that the message conversion apparatus of this application can be used to execute the message conversion method provided in this application. This apparatus is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0075] The following describes the message conversion apparatus provided in the embodiments of this application.

[0076] Figure 5 This is a schematic diagram of a message conversion apparatus according to an embodiment of this application. Figure 5 As shown, the device includes:

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

[0078] Specifically, the technical solution of this 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 interfaces related to mapping relationship implementation, obtaining XML messages, and sending XML message receipts; the visualization template configuration part mainly provides an interactive window for technical administrators or authorized users, primarily used to query or modify the currently configured template. This part will be described in detail below. The core idea of ​​the mapping relationship is to configure templates so that the tags in the target system's (i.e., the sender's) messages can adaptively match the tags in the template's tag library. This allows for accurate matching and processing of tags in the target system's messages, thereby achieving data interaction. By configuring different templates, the tags of each XML message are mapped to the corresponding tag library tags in the template, enabling the backend code to uniformly process data from different messages and achieve differentiated processing between different messages. The download interface is called to obtain or receive content sent by the target system (sender), and the initial message is obtained by parsing it through a SAX analyzer, after which the corresponding Bean (class) for the XML message is determined. Message tags and corresponding tag fields are both contained within the class. A SAX parser is a tool that can parse XML format messages. In practical applications, other parsers can also be used for parsing.

[0079] The conversion unit 20 is used to determine the 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 includes at least the conversion rules of the message tag;

[0080] Specifically, the format conversion template is matched using the FreeMaker template engine technology, matching a preset template to convert the message format and obtain the converted message. XML message acquisition is the process of 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, through parsing and conversion, transforms the tags in the message into tag values ​​in the corresponding tag library for subsequent data storage and processing. By parsing the message, the source system can extract the data from the message and map it to the corresponding tag values ​​in the tag library. This conversion process can adaptively perform according to predefined template configurations, converting the relationship between message tags and corresponding tag libraries. In this way, the backend code can directly use the tag values ​​in the corresponding tag library for data storage and processing, thus simplifying the logic of the backend code. In other words, by pre-setting the conversion rules and mapping relationships between different message formats, the format conversion can be performed directly using this mapping relationship for different message formats, eliminating the need to set different conversion interfaces for each message format, thus improving conversion efficiency.

[0081] Sending unit 30 is used to obtain a receipt message template, generate a receipt message for the converted message using the receipt message template, and send the receipt message to the sender. The receipt message template includes at least the receipt rules for the message, and the receipt message is a message indicating that the initial message conversion is complete.

[0082] Specifically, after the conversion, a receipt needs to be sent to the target system, i.e., the sender, to inform them that the initial message format has been successfully converted. The receipt message is also generated using a receipt message template; the generation process is the reverse of the initial message format conversion process described above. The XML message receipt is the process of 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 this 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 the mapping relationship between it and 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. This process can easily convert business data in the source system into a standard-compliant message format for data exchange and storage with the target system.

[0083] In this embodiment, an initial message sent by the 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 initial message is converted using the format conversion template to obtain a converted message. A receipt message template is obtained, and a receipt message for the converted message is generated using the receipt message template and sent to the sender. Compared with existing technologies that use interfaces for message conversion and have low transmission efficiency, this application converts the initial message using the aforementioned format conversion template and generates a receipt message using the receipt message template. This avoids the problem of using different interfaces for conversion and receipt for each message, thus improving data conversion efficiency.

[0084] In specific implementation, the aforementioned conversion unit includes a first acquisition module and a first determination module. The first acquisition module is used to acquire a one-to-one mapping relationship between the class and the format conversion template; the first determination module is used to determine the format conversion template corresponding to the class based on the one-to-one mapping relationship between the class and the format conversion template. This 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 FreeMaker template engine technology, message format conversion is performed by matching the preset templates (format conversion templates) corresponding to the aforementioned classes through a one-to-one mapping relationship between classes and the format conversion templates. The tag mapping relationship is implemented as follows: Figure 3As shown, the XML message retrieves a preset template. If successful, it uses FreeMaker's tag adaptive matching to retrieve tag values. If retrieving the preset template fails, the configuration is visually modified, and FreeMaker's tag adaptive matching is used to retrieve tag values.

[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 based on the one-to-one mapping relationship between the initial message label and the local message label, and to store the data based on the local message label. This method determines the label on the local system corresponding to the converted initial message through the above steps, so that subsequent operations can be performed according to the local label.

[0087] In the specific implementation process, after converting the format of the initial message, it is also necessary to determine the tag corresponding to the local system for the converted message. This is done by obtaining the corresponding tag value based on the mapping relationship between XML tags (initial message tags) and the local system's backend tag library fields (local message tags). Since the converted message is the message after format conversion of the initial message, the tag corresponding to the converted message can be determined. At this point, the initial message format conversion process of the target system is complete. Afterwards, data can be stored in the local system based on the local message tags.

[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 tag of the converted message and obtain a one-to-one mapping relationship between the message tag and the receipt message template. The second determination module is used to determine the receipt message template corresponding to the message tag based on the one-to-one mapping relationship between the message tag and the receipt message template. This method generates a receipt message through the aforementioned receipt message template, which allows for the generation of a corresponding receipt message based on the template. This also avoids the problem of needing to generate and transmit receipt messages through different interfaces for messages of different formats, thus improving efficiency.

[0089] Specifically, the backend business code sets the tag value information for this XML message receipt transmission, that is, the message tag of the converted message mentioned above; 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 determining module and a generating module. The third determining module is used to obtain a one-to-one mapping relationship between local message tags and sender message tags, and determine the sender message tag corresponding to the local message tag based on the one-to-one mapping relationship. The generating module is used to generate the receipt message of the converted message based on the sender message tag using the receipt message template. This method determines the tags related to the receipt message through the above steps, thus enabling receipt confirmation to indicate successful message format conversion.

[0091] In the specific implementation process, the above steps are the reverse steps of the format conversion steps. Based on the mapping relationship between the background tag library fields (referring to local message tags) and message tags (referring to the message tags of the initial message), the corresponding Bean object (class) is obtained. Utilizing the JAVA reflection principle, since the class contains tags, the Bean object (class) is then 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 determining unit includes an encapsulation module, used to encapsulate the initial message into a class corresponding to the message fields using Java reflection, thereby obtaining the class corresponding to the initial message, wherein the class further includes the message fields. This method determines the class corresponding to the message through the above steps, thus enabling the determination of the format conversion template corresponding to the initial message.

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

[0094] In some optional implementations, the method further includes an adding unit, configured to obtain the conversion rules corresponding to the class when the format conversion template corresponding to the class cannot be determined, and add the conversion rules to the format conversion template, wherein the conversion rules at least include the conversion rules for the message tag. This method allows for flexible adjustment of the conversion template through the above steps, enabling adjustments to the conversion template according to actual conditions to adapt to different message format conversion scenarios.

[0095] Specifically, this step mainly refers to the visual template configuration section, a visual window provided to technical administrators or authorized users, primarily used to query or modify the currently configured templates. For example, if the format conversion template corresponding to the class cannot be determined, the conversion rules corresponding to the class are obtained and added to the format conversion template.

[0096] The message conversion device includes a processor and a memory. The aforementioned determining unit, conversion unit, and sending unit are all stored as program units in the memory, and the processor executes these program units stored in the memory to achieve the corresponding functions. All of the above modules are located in the same processor; alternatively, the modules may be located in different processors in any combination.

[0097] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and adjusting kernel parameters can improve message translation efficiency.

[0098] The memory may include non-permanent memory in computer-readable media, such as 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] This invention provides a computer-readable storage medium including a stored program, wherein the program, when running, controls the device where the computer-readable storage medium is located to execute the message conversion method.

[0100] Specifically, message conversion methods include:

[0101] Step S201: Receive the initial message sent by the sender and determine the class corresponding to the initial message, wherein the class includes at least a message tag;

[0102] Specifically, the technical solution of this 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 interfaces related to mapping relationship implementation, obtaining XML messages, and sending XML message receipts; the visualization template configuration part mainly provides an interactive window for technical administrators or authorized users, primarily used to query or modify the currently configured template. This part will be described in detail below. The core idea of ​​the mapping relationship is to configure templates so that the tags in the target system's (i.e., the sender's) messages can adaptively match the tags in the template's tag library. This allows for accurate matching and processing of tags in the target system's messages, thereby achieving data interaction. By configuring different templates, the tags of each XML message are mapped to the corresponding tag library tags in the template, enabling the backend code to uniformly process data from different messages and achieve differentiated processing between different messages. The download interface is called to obtain or receive content sent by the target system (sender), and the initial message is obtained by parsing it through a SAX analyzer, after which the corresponding Bean (class) for the XML message is determined. Message tags and corresponding tag fields are both contained within the class. A SAX parser is a tool that can parse XML format messages. In practical applications, other parsers can also be used for parsing.

[0103] Step S202: Determine the 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 includes at least the conversion rules of the message tag;

[0104] Specifically, the format conversion template is matched using the FreeMaker template engine technology, matching a preset template to convert the message format and obtain the converted message. XML message acquisition is the process of 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, through parsing and conversion, transforms the tags in the message into tag values ​​in the corresponding tag library for subsequent data storage and processing. By parsing the message, the source system can extract the data from the message and map it to the corresponding tag values ​​in the tag library. This conversion process can adaptively perform according to predefined template configurations, converting the relationship between message tags and corresponding tag libraries. In this way, the backend code can directly use the tag values ​​in the corresponding tag library for data storage and processing, thus simplifying the logic of the backend code. In other words, by pre-setting the conversion rules and mapping relationships between different message formats, the format conversion can be performed directly using this mapping relationship for different message formats, eliminating the need to set different conversion interfaces for each message format, thus improving conversion efficiency.

[0105] Step S203: Obtain a receipt message template, generate a receipt message for the converted message using the receipt message template, and send the receipt message to the sender. The receipt message template includes at least the receipt rules for the message, and the receipt message is a message indicating that the initial message conversion is complete.

[0106] Specifically, after the conversion, a receipt needs to be sent to the target system, i.e., the sender, to inform them that the initial message format has been successfully converted. The receipt message is also generated using a receipt message template; the generation process is the reverse of the initial message format conversion process described above. The XML message receipt is the process of 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 this 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 the mapping relationship between it and 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. This process can easily convert business data in the source system into a standard-compliant message format for data exchange and storage with the target system.

[0107] This invention provides an electronic device, including a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs at least the following steps:

[0108] Step S201: Receive the initial message sent by the sender and determine the class corresponding to the initial message, wherein the class includes at least a message tag;

[0109] Specifically, the technical solution of this 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 interfaces related to mapping relationship implementation, obtaining XML messages, and sending XML message receipts; the visualization template configuration part mainly provides an interactive window for technical administrators or authorized users, primarily used to query or modify the currently configured template. This part will be described in detail below. The core idea of ​​the mapping relationship is to configure templates so that the tags in the target system's (i.e., the sender's) messages can adaptively match the tags in the template's tag library. This allows for accurate matching and processing of tags in the target system's messages, thereby achieving data interaction. By configuring different templates, the tags of each XML message are mapped to the corresponding tag library tags in the template, enabling the backend code to uniformly process data from different messages and achieve differentiated processing between different messages. The download interface is called to obtain or receive content sent by the target system (sender), and the initial message is obtained by parsing it through a SAX analyzer, after which the corresponding Bean (class) for the XML message is determined. Message tags and corresponding tag fields are both contained within the class. A SAX parser is a tool that can parse XML format messages. In practical applications, other parsers can also be used for parsing.

[0110] Step S202: Determine the 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 includes at least the conversion rules of the message tag;

[0111] Specifically, the format conversion template is matched using the FreeMaker template engine technology, matching a preset template to convert the message format and obtain the converted message. XML message acquisition is the process of 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, through parsing and conversion, transforms the tags in the message into tag values ​​in the corresponding tag library for subsequent data storage and processing. By parsing the message, the source system can extract the data from the message and map it to the corresponding tag values ​​in the tag library. This conversion process can adaptively perform according to predefined template configurations, converting the relationship between message tags and corresponding tag libraries. In this way, the backend code can directly use the tag values ​​in the corresponding tag library for data storage and processing, thus simplifying the logic of the backend code. In other words, by pre-setting the conversion rules and mapping relationships between different message formats, the format conversion can be performed directly using this mapping relationship for different message formats, eliminating the need to set different conversion interfaces for each message format, thus improving conversion efficiency.

[0112] Step S203: Obtain a receipt message template, generate a receipt message for the converted message using the receipt message template, and send the receipt message to the sender. The receipt message template includes at least the receipt rules for the message, and the receipt message is a message indicating that the initial message conversion is complete.

[0113] Specifically, after the conversion, a receipt needs to be sent to the target system, i.e., the sender, to inform them that the initial message format has been successfully converted. The receipt message is also generated using a receipt message template; the generation process is the reverse of the initial message format conversion process described above. The XML message receipt is the process of 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 this 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 the mapping relationship between it and 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. This process can easily convert business data in the source system into a standard-compliant message format for data exchange and storage with the target system.

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

[0115] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the methods described in various embodiments of this application:

[0116] Step S201: Receive the initial message sent by the sender and determine the class corresponding to the initial message, wherein the class includes at least a message tag;

[0117] Specifically, the technical solution of this 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 interfaces related to mapping relationship implementation, obtaining XML messages, and sending XML message receipts; the visualization template configuration part mainly provides an interactive window for technical administrators or authorized users, primarily used to query or modify the currently configured template. This part will be described in detail below. The core idea of ​​the mapping relationship is to configure templates so that the tags in the target system's (i.e., the sender's) messages can adaptively match the tags in the template's tag library. This allows for accurate matching and processing of tags in the target system's messages, thereby achieving data interaction. By configuring different templates, the tags of each XML message are mapped to the corresponding tag library tags in the template, enabling the backend code to uniformly process data from different messages and achieve differentiated processing between different messages. The download interface is called to obtain or receive content sent by the target system (sender), and the initial message is obtained by parsing it through a SAX analyzer, after which the corresponding Bean (class) for the XML message is determined. Message tags and corresponding tag fields are both contained within the class. A SAX parser is a tool that can parse XML format messages. In practical applications, other parsers can also be used for parsing.

[0118] Step S202: Determine the 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 includes at least the conversion rules of the message tag;

[0119] Specifically, the format conversion template is matched using the FreeMaker template engine technology, matching a preset template to convert the message format and obtain the converted message. XML message acquisition is the process of 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, through parsing and conversion, transforms the tags in the message into tag values ​​in the corresponding tag library for subsequent data storage and processing. By parsing the message, the source system can extract the data from the message and map it to the corresponding tag values ​​in the tag library. This conversion process can adaptively perform according to predefined template configurations, converting the relationship between message tags and corresponding tag libraries. In this way, the backend code can directly use the tag values ​​in the corresponding tag library for data storage and processing, thus simplifying the logic of the backend code. In other words, by pre-setting the conversion rules and mapping relationships between different message formats, the format conversion can be performed directly using this mapping relationship for different message formats, eliminating the need to set different conversion interfaces for each message format, thus improving conversion efficiency.

[0120] Step S203: Obtain a receipt message template, generate a receipt message for the converted message using the receipt message template, and send the receipt message to the sender. The receipt message template includes at least the receipt rules for the message, and the receipt message is a message indicating that the initial message conversion is complete.

[0121] Specifically, after the conversion, a receipt needs to be sent to the target system, i.e., the sender, to inform them that the initial message format has been successfully converted. The receipt message is also generated using a receipt message template; the generation process is the reverse of the initial message format conversion process described above. The XML message receipt is the process of 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 this 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 the mapping relationship between it and 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. This process can easily convert business data in the source system into a standard-compliant message format for data exchange and storage with the target system.

[0122] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.

[0123] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0124] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0125] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0126] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function 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] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0129] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, 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 technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0130] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0131] As can be seen from the above description, the embodiments of this application achieve the following technical effects:

[0132] 1) In the message conversion method of this application, an initial message sent by the 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 initial message is converted using the format conversion template to obtain a converted message; a receipt message template is obtained, and a receipt message of the converted message is generated using the receipt message template, and the receipt message is sent to the sender. Compared with the prior art, which uses an interface to convert messages and has low transmission efficiency, this application converts the initial message using the above-mentioned format conversion template and generates a receipt message using the receipt message template, avoiding the problem of using different interfaces for conversion and receipt of each message. Therefore, it can improve data conversion efficiency.

[0133] 2) In the message conversion apparatus of this application, an initial message sent by the 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 initial message is converted using the format conversion template to obtain a converted message; a receipt message template is obtained, and a receipt message for the converted message is generated using the receipt message template, and the receipt message is sent to the sender. Compared with the prior art, which uses an interface for message conversion and has low transmission efficiency, this application converts the initial message using the aforementioned format conversion template and generates a receipt message using the receipt message template, avoiding the problem of using different interfaces for conversion and receipt for each message. Therefore, it can improve data conversion efficiency.

[0134] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A message conversion method, characterized in that, include: Receive an initial message sent by the sender, determine the class corresponding to the initial message, wherein the class includes at least a message tag; Determine the 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 includes at least the conversion rules of the message tag; Obtain a receipt message template, generate a receipt message for the converted message using the receipt message template, and send the receipt message to the sender. The receipt message template includes at least the receipt rules for the message, and the receipt message is a message indicating that the initial message conversion is complete. Determining the format conversion template corresponding to the class includes: obtaining a one-to-one mapping relationship between the class and the format conversion template; determining the format conversion template corresponding to the class based on the one-to-one mapping relationship between the class and the format conversion template, wherein the tag mapping relationship is implemented by obtaining a preset template; if obtaining the preset template is successful, tag values ​​are obtained based on FreeMaker's tag adaptive matching; if obtaining the preset template fails, the configuration is modified visually, and tag values ​​are obtained based on FreeMaker's tag adaptive matching. 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 the label corresponding to the initial message, and the local message label is the label corresponding to the local message; determining 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 storing the data according to the local message label.

2. The message conversion method according to claim 1, characterized in that, Retrieve receipt message template, including: 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; The receipt message template corresponding to the message tag is determined based on the one-to-one mapping relationship between the message tag and the receipt message template.

3. The message conversion method according to claim 1, characterized in that, The process of generating a receipt message for the conversion message using the receipt message template includes: Obtain the one-to-one mapping relationship between local message tags and sender message tags, and determine the sender message tag corresponding to the local message tag based on the one-to-one mapping relationship between the local message tags and sender message tags; The receipt message is generated from the converted message using the receipt message template and the sender message tag.

4. The message conversion method according to claim 1, characterized in that, Determining the class corresponding to the initial message includes: The initial message is encapsulated into a class corresponding to the message fields using Java reflection, thereby obtaining the class corresponding to the initial message, wherein the class also includes the message fields.

5. The message conversion method according to claim 1, characterized in that, The method further includes: If the format conversion template corresponding to the class cannot be determined, the conversion rule corresponding to the class is obtained and the conversion rule is added to the format conversion template, wherein the conversion rule includes at least the conversion rule of the message tag.

6. A message conversion device, characterized in that, include: A determining unit is configured to receive an initial message sent by a sender and determine the class corresponding to the initial message, wherein the class includes at least a message tag; A conversion unit is used to determine the format conversion template corresponding to the class, and to convert the initial message using the format conversion template to obtain a converted message, wherein the format conversion template includes at least the conversion rules of the message tag; A sending unit is configured to obtain a receipt message template, generate a receipt message for the converted message using the receipt message template, and send the receipt message to the sender. The receipt message template includes at least the receipt rules for the message, and the receipt message is a message indicating that the initial message conversion is complete. The conversion unit includes a first acquisition module and a first determination module. The first acquisition module is used to acquire a one-to-one mapping relationship between the class and the format conversion template. The first determination module is used to determine the format conversion template corresponding to the class based on the one-to-one mapping relationship between the class and the format conversion template. The tag mapping relationship is implemented by acquiring a preset template. If the preset template is successfully acquired, tag values ​​are acquired based on FreeMaker's tag adaptive matching. If the preset template is not acquired, the configuration is modified visually, and tag values ​​are acquired based on FreeMaker's tag adaptive matching. The device further includes an acquisition unit and a storage unit. The acquisition unit is used to acquire a one-to-one mapping relationship between an initial message label and a local message label after obtaining the converted message, 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 to store data according to the local message label.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device containing the computer-readable storage medium to perform the message conversion method according to any one of claims 1 to 5.

8. 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 configured to be executed by the one or more processors, the one or more programs including methods for performing the message translation method according to any one of claims 1 to 5.