Message generation method and device, equipment and storage medium

By parsing the interface document to generate the configuration file and configuring the parameters on the interface, the problem of manual XML message writing being time-consuming and error-prone is solved, and the process of efficiently generating XML messages is realized.

CN120692155APending Publication Date: 2025-09-23CHINA MERCHANTS BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510826735.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-19
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

Manually writing XML messages is time-consuming and error-prone, affecting the work efficiency of developers.

Method used

Generate a configuration file by parsing the interface document information, load the configuration file to generate a configuration interface, and the user enters parameter configuration information on the interface to generate the target XML message, including verification and construction of the XML message structure.

Benefits of technology

No need to manually write XML code, which improves developer efficiency and ensures data accuracy and integrity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120692155A_ABST
    Figure CN120692155A_ABST
Patent Text Reader

Abstract

The invention discloses a message generation method and device, equipment and a storage medium, and relates to the technical field of computers, and the method comprises the steps: obtaining interface document information; analyzing the interface document information to obtain a document analysis result; generating a configuration file according to the document analysis result; loading the configuration file to generate a configuration interface; and generating a target XML message according to the configuration file and parameter configuration information input by the user on the configuration interface. According to the method, the configuration file is generated by analyzing the content of each interface in the interface document information, then the visual interface can be generated by loading the configuration file, a user can directly configure parameters on the interface, then the target XML message is generated according to the configuration file and the parameter configuration information, developers do not need to manually write XML codes, and the development efficiency is improved. And the working efficiency of developers is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a message generation method, apparatus, device and storage medium. Background Art

[0002] In enterprise applications, web services, and system integration, XML (Extensible Markup Language) is widely used for data exchange between disparate systems. Due to its self-describing nature, platform independence, and scalability, XML has become the preferred format for data exchange. However, compared to JSON, XML's message format is more complex and its syntax is more stringent, requiring proper nesting and closing of tags, otherwise the parser may report an error. In daily development and self-testing, developers need to write XML messages, but manually writing XML messages is not only time-consuming but also error-prone, impacting developer productivity. Summary of the Invention

[0003] The main purpose of this application is to provide a message generation method, device, equipment and storage medium, aiming to improve the work efficiency of developers.

[0004] To achieve the above objectives, the present application proposes a message generation method, which includes:

[0005] Get interface document information;

[0006] Parsing the interface document information to obtain a document parsing result;

[0007] Generate a configuration file based on the document parsing result;

[0008] Loading the configuration file to generate a configuration interface;

[0009] A target XML message is generated according to the configuration file and the parameter configuration information input by the user on the configuration interface.

[0010] In one embodiment, the loading of the configuration file to generate a configuration interface includes:

[0011] Receiving an interface selection request initiated by a user on a preset user interface, wherein the interface selection request includes an interface identifier;

[0012] Extracting interface information, input parameter information, and output parameter information corresponding to the interface identifier from the configuration file;

[0013] The configuration interface is generated according to the interface information, the input parameter information, and the output parameter information.

[0014] In one embodiment, generating a target XML message according to the configuration file and parameter configuration information input by the user on the configuration interface includes:

[0015] Obtaining parameter configuration information entered by the user on the configuration interface;

[0016] Verifying the parameter configuration information according to the attribute tags of each field in the input parameter information;

[0017] If the verification is successful, the target XML message is generated according to the parameter configuration information, the interface information, the input parameter information and the output parameter information.

[0018] In one embodiment, generating the target XML message according to the parameter configuration information, the interface information, the input parameter information, and the output parameter information includes:

[0019] Creating a plurality of element nodes according to the interface information, the input parameter information and the output parameter information;

[0020] Generate a message structure according to each element node;

[0021] The parameter value of each field in the parameter configuration information is written into the element node of the message structure respectively to obtain the target XML message.

[0022] In one embodiment, after generating the target XML message according to the configuration file and the parameter configuration information input by the user on the configuration interface, the method further includes:

[0023] Determine a root node of a message structure in the target XML message, wherein the root node is a node associated with a start identifier among the element nodes;

[0024] Taking the root node as the starting point, traverse and parse each element node in the target XML message to obtain a message parsing result;

[0025] The message parsing result is displayed on the configuration interface.

[0026] In one embodiment, verifying the parameter configuration information according to the attribute tags of each field in the input parameter information includes:

[0027] According to the attribute tag of each field in the input parameter information, the data type, field length, field format of each field in the parameter configuration information and / or the dependency relationship between each field are verified.

[0028] In one embodiment, after generating the configuration interface according to the interface information, the input parameter information, and the output parameter information, the method further includes:

[0029] In response to a user's parameter modification request, displaying the input fields in the parameter modification request and their associated attribute labels on the configuration interface;

[0030] updating the configuration file according to the modified input fields and their associated attribute tags;

[0031] and / or,

[0032] In response to a user's parameter addition request, the input fields and their associated attribute labels in the parameter addition request are newly displayed on the configuration interface;

[0033] Add the newly added input fields and their associated property tags to the configuration file.

[0034] In addition, to achieve the above-mentioned purpose, the present application also proposes a message generating device, which includes:

[0035] Acquisition module, used to obtain interface document information;

[0036] A parsing module, configured to parse the interface document information and obtain a document parsing result;

[0037] A first generating module, configured to generate a configuration file according to the document parsing result;

[0038] A second generating module is used to load the configuration file to generate a configuration interface;

[0039] The third generating module is used to generate a target XML message according to the configuration file and the parameter configuration information input by the user on the configuration interface.

[0040] In addition, to achieve the above-mentioned purpose, the present application also proposes an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the message generation method described above.

[0041] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the message generation method described above are implemented.

[0042] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the steps of the message generation method described above.

[0043] The present application provides a message generation method, apparatus, device, and storage medium. The message generation method includes obtaining interface document information; parsing the interface document information to obtain document parsing results; generating a configuration file based on the document parsing results; loading the configuration file to generate a configuration interface; and generating a target XML message based on the configuration file and parameter configuration information entered by the user on the configuration interface. The present application parses the content of each interface in the interface document information to generate a configuration file, and then loads the configuration file to generate a visual interface. The user can directly configure parameters on the configuration interface, and then generate a target XML message based on the configuration file and the user-configured parameter configuration information. Developers do not need to manually write XML code, thereby improving their work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0046] Figure 1 A flowchart of the first embodiment of the method for generating a message in this application is provided;

[0047] Figure 2 An example diagram of interface document information provided in one embodiment of the present application;

[0048] Figure 3 A schematic diagram of the configuration interface provided in one embodiment of the present application;

[0049] Figure 4 A flowchart of the second embodiment of the method for generating a message in this application is provided;

[0050] Figure 5 A flowchart of the third embodiment of the method for generating a message in this application is provided;

[0051] Figure 6 A flowchart of the fourth embodiment of the message generation method of this application is provided;

[0052] Figure 7 A flowchart of the fifth embodiment of the method for generating a message of the present application is provided;

[0053] Figure 8 This is a schematic diagram of the module structure of the message generating device according to an embodiment of the present application;

[0054] Figure 9 Schematic diagram of the device structure of the hardware operating environment involved in the message generation method in the embodiment of the present application.

[0055] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0056] It should be understood that the specific embodiments described herein are merely used to explain the technical solutions of the present application and are not intended to limit the present application.

[0057] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0058] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, mobile phone, etc., or an electronic device capable of implementing the above functions, a big data service platform, a message generation system, etc. The following uses the message generation system as an example to illustrate this embodiment and the following embodiments.

[0059] Based on this, the embodiment of the present application provides a message generation method, referring to Figure 1 , Figure 1 A flowchart illustrating the first embodiment of the message generation method of this application.

[0060] In this embodiment, the message generation method includes steps S11 to S15:

[0061] Step S11, obtaining interface document information;

[0062] It should be noted that the interface document information includes detailed information of at least one interface, including interface information corresponding to the interface (for example, interface name, version number and interface description, etc.), input objects, attribute labels corresponding to the input objects (for example, each field name, data format, whether it is required, field description, etc.), output objects and attribute labels corresponding to the output objects (for example, output format and return code, etc.). In one embodiment, reference may be made to Figure 2 , Figure 2This is an example diagram of interface document information provided in one embodiment of the present application. To help users write interface documents more efficiently, a document template can be provided. Users can fill in specific parameter information based on the structure and prompts of the document template. Users can upload the interface document information to the system, or users can determine the storage address of the interface document information on the system. The system can then read the interface document information based on the storage address during runtime.

[0063] Step S12, parsing the interface document information to obtain a document parsing result;

[0064] It should be noted that the document parsing results include detailed information of each interface. For example, the document parsing results include interface information such as interface name, interface description and version number, as well as parameter information such as field name, data type, whether it is required, whether it is a unique value and default value, as well as parameter information such as return field, data format and return code.

[0065] In this embodiment, according to the document format of the interface document information, different parsing methods are adopted to parse the content of each interface in the interface document information. For example, if the interface document information is a word file, the content of the interface document information is parsed by methods such as text extraction and regular expressions. If the interface document information is a JSON format or YAML format file, the interface document information is parsed using parsing tools such as SwaggerParser (Java) and openapi-core (Python). By parsing the content of each interface in the interface document information, information such as the interface name and interface description of each interface is extracted, as well as parameter information such as the field name, data type, whether it is required, and the default value of each interface, and parameter information such as the return field, data format, and return code of each interface is extracted, thereby obtaining the document parsing result.

[0066] Step S13, generating a configuration file based on the document parsing result;

[0067] It should be noted that the configuration file includes information such as interface information, input parameter information, and output parameter information for each interface. The interface information includes information such as the interface name and interface description; the input parameter information includes information such as the field name, data type, whether it is required, and the default value; and the output parameter information includes information such as the return field, data format, and return code. Specifically, the data in the document parsing results is encapsulated into a structured data format, for example, using a dictionary or list to achieve data structuring, and then the structured data is saved in a file to obtain the configuration file.

[0068] Step S14, loading the configuration file to generate a configuration interface;

[0069] It should be noted that, referring to Figure 3 , Figure 3 A distribution diagram of the configuration interface provided for one embodiment of the present application. In one embodiment, the configuration interface includes the following areas: an interface information display area, an input parameter configuration area, and an output parameter display area. Basic information such as the interface name, interface description, and interface identification are displayed in the interface information display area, and a brief description of the interface function can be provided to help users understand the role of the interface. The form fields of the input parameters are dynamically displayed in the input parameter configuration area. Optionally, each input parameter field displays the corresponding field name, data type, whether it is required, and other information. Input prompts or default values ​​can be provided to help users fill in the parameters correctly. The name, data type, description, and other information of the output parameters are displayed in the output parameter display area. The output parameters are used to display the return results after the interface call, and the user can view the structure of the return field here.

[0070] In this embodiment, the system can load the interface information, input parameter information and output parameter information in the configuration file during operation to generate a configuration interface. Optionally, information such as the interface name and interface description in the interface information, the field name and data type of each field in the input parameter information, and information such as the return field, data format and return code in the output parameter information are displayed in the relevant area on the visual interface to obtain the configuration interface. In other embodiments, the system provides a user interface through which the user can select the interface to be viewed or configured. When the user's interface selection request is received, the interface information, input parameter information and output parameter information corresponding to the selected interface identifier are extracted from the configuration file. The interface information, input parameter information and output parameter information are then loaded into the relevant area of ​​the visual interface to obtain the configuration interface, so that the user can directly input parameter information on the configuration interface.

[0071] Step S13: Generate a target XML message according to the configuration file and the parameter configuration information input by the user on the configuration interface.

[0072] In this embodiment, after a user enters corresponding parameters on the configuration interface, the system captures the parameter configuration information entered by the user and then creates a message structure based on information such as the interface information, input parameter information, and output parameter information in the configuration file. For example, the element nodes in the message structure include a root node and child nodes. Optionally, the root node is created based on the interface information, and corresponding child nodes are created based on the input parameter information and output parameter information. Furthermore, the nodes in the message structure are populated based on the parameter values ​​of each field in the parameter configuration information to obtain the target XML message. In other embodiments, to ensure data accuracy, after obtaining the parameter configuration information entered by the user, each field in the parameter configuration information is verified, for example, to verify the field length range, data type, field format, and dependencies between fields. Furthermore, if verification is successful, the target XML message is generated based on information such as the interface information, input parameter information, and output parameter information in the parameter configuration information configuration file. If verification fails, a prompt message is generated to prompt the user to re-enter the data.

[0073] This embodiment parses the content of each interface in the interface document information to generate a configuration file based on the content of each interface, and then loads the configuration file to generate a visual interface. The user can directly configure parameters on the configuration interface, and then generate the target XML message based on the configuration file and the parameter configuration information configured by the user. Developers do not need to manually write XML code, thereby improving the work efficiency of developers.

[0074] In one possible embodiment, referring to Figure 4 , Figure 4 This is a flow chart of the second embodiment of the message generation method of this application. Loading the configuration file to generate a configuration interface includes:

[0075] Step S21: receiving an interface selection request initiated by a user on a preset user interface, wherein the interface selection request includes an interface identifier;

[0076] It should be noted that the interface selection request includes an interface identifier, wherein the interface identifier may be an interface name, an interface code ID, etc. Figure 3 , Figure 3 This is a schematic diagram of the configuration interface provided in one embodiment of the present application. A clear interface classification is provided on the preset user interface. Users can directly click on a drop-down box to select an interface. The drop-down box includes the interface names of all available interfaces. Users can scroll through the drop-down box to browse and select the interface to be configured, helping users quickly locate the interface to be configured. In other embodiments, users can also enter keywords to search for interface names.

[0077] Step S22, extracting interface information, input parameter information, and output parameter information corresponding to the interface identifier from the configuration file;

[0078] In this embodiment, the configuration file records relevant information of multiple interfaces. When an interface selection request initiated by a user on a preset user interface is received, the interface selection request is parsed to obtain an interface identifier, wherein the interface identifier is an identifier used to uniquely identify the interface. Furthermore, the interface information, input parameter information, and output parameter information corresponding to the interface identifier are extracted from the configuration file.

[0079] Step S23: generating the configuration interface according to the interface information, the input parameter information, and the output parameter information.

[0080] In this embodiment, the interface information, input parameter information and output parameter information are loaded onto the visual interface to obtain the configuration interface. For example, at the top or prominent position of the interface, the system displays the basic information of the interface, including the interface name, description, version, etc., to help the user confirm whether the correct interface is selected. In the middle of the interface or the parameter area, the system dynamically displays the input parameter information in the form of a table or list, for example, displaying the field name, data type, whether it is required, whether it is unique and the default value of each parameter, etc., to facilitate user viewing and parameter filling. At the bottom of the interface or the output area, the system displays the output parameter information, for example, displaying information such as the return field, data format, return code and description, etc., through which the user can understand the data content that can be obtained after the interface call is successful.

[0081] This embodiment receives an interface selection request initiated by a user on a preset user interface, and then extracts the various parameter information associated with the interface identifier in the configuration file based on the interface identifier in the interface selection request, and then loads the various parameter information associated with the interface identifier into the visual interface to obtain the configuration interface. Subsequently, the user can directly enter parameters on the configuration interface to generate the target XML message. The user does not need to manually write XML code, thereby improving the work efficiency of developers.

[0082] In one possible embodiment, referring to Figure 5 , Figure 5 This is a flow chart of the third embodiment of the message generation method of this application. According to the parameter configuration information entered by the user on the configuration interface, a target XML message is generated, including:

[0083] Step S31, obtaining parameter configuration information input by the user on the configuration interface;

[0084] Specifically, the user enters the required parameters on the configuration interface. Optionally, a dedicated input box or selection box is provided for each parameter that requires input, and the user can enter specific parameter values ​​in these fields. Once the user completes the parameter input and submits the configuration interface, the system captures all parameter values ​​entered by the user and organizes them into parameter configuration information.

[0085] Step S32: verifying the parameter configuration information according to the attribute tags of each field in the input parameter information;

[0086] It should be noted that the attribute tag of a field includes attributes such as the field format, field length range, dependency, whether the field is unique, data type, and whether it is a required field.

[0087] In order to ensure the accuracy and completeness of the data, the parameter configuration information input by the user needs to be verified. In one embodiment, the field length of each field in the parameter configuration information is verified based on the field length range of each field in the input parameter information, that is, the field length of each field in the parameter configuration information is compared with the field length range of the corresponding field in the input parameter information to check whether the field length corresponding to the parameter value of each field in the parameter configuration information meets the field length range defined in the input parameter information. If the field length corresponding to the parameter value of each field is within the specified field length range, it proves that the field length verification is successful. If it is not within the specified field length range, it proves that the field length verification fails. For example, if the field "user name" is defined as a length between 5 and 20 characters, the value entered by the user must meet this length range.

[0088] In one embodiment, the field format of each field in the parameter configuration information is verified based on the field format of each field in the input parameter information. That is, the field format of each field in the parameter configuration information is compared with the field format of the corresponding field in the input parameter information to check whether the field value in the parameter configuration information meets the format requirements defined in the input parameter information, such as date format, email format, number format, etc. If the field format of each field in the parameter configuration information meets the field format of the corresponding field in the input parameter information, the field format verification is successful. If it does not meet the specified field format, the field format verification fails.

[0089] In another embodiment, the dependency relationships between the fields in the parameter configuration information are checked based on the dependency relationships between the fields in the input parameter information to check whether the values ​​of certain fields in the parameter configuration information are dependent on the values ​​of other fields. For example, certain fields may only be required to exist or have specific values ​​if another field meets specific conditions.

[0090] In addition, in other embodiments, the required fields in the parameter configuration information are verified based on the attribute tags of each field in the input parameter information to ensure that the user has entered values ​​for all required fields. For example, if the parameter "password" is a required field, the user needs to enter a value and it cannot be empty.

[0091] In another embodiment, the fields in the parameter configuration information that specify unique values ​​may also be verified to ensure that the values ​​of certain parameters are unique, for example, a user name or email address is unique in the system and cannot be repeated.

[0092] In other embodiments, verification rules are customized according to specific needs. For example, a verification function can be defined to check whether the value entered by the user meets specific business logic, and a verification function can be defined to check whether the password entered by the user meets the complexity requirements (such as containing at least one uppercase letter, one lowercase letter and one number).

[0093] In addition, if the verification is successful, step S33 is executed. If the verification fails, a prompt message is generated to prompt the user to re-enter the corresponding parameters.

[0094] Step S33: If the verification is successful, the target XML message is generated according to the parameter configuration information, the interface information, the input parameter information and the output parameter information.

[0095] It should be noted that XML messages are a hierarchical data format consisting of a root node, child nodes, and attributes. The root node is the top-level node of the entire message structure and can be used to create the basic structure of the XML message based on the collected information. In this embodiment, if verification is successful, it proves that the parameters entered by the user meet the field requirements. Furthermore, based on the interface information, input parameter information, and output parameter information, several element nodes are constructed. An element node includes a root node and child nodes. For example, a root node is created based on the interface information, and corresponding child nodes are created based on each field in the input parameter information and each field in the output parameter information. Furthermore, the element node corresponding to each field in the parameter configuration information is determined. Optionally, a mapping relationship is established between each field in the parameter configuration information and the element node of the message structure. Based on this mapping relationship, the element node corresponding to each field in the parameter configuration information can be determined. Furthermore, the parameter value of each field in the parameter configuration information is written into the corresponding element node. For example, the parameter value is used as the text content of the node, thereby constructing the target XML message.

[0096] This embodiment obtains the parameter configuration information entered by the user on the configuration interface and then verifies the parameter configuration information to ensure the accuracy and completeness of the parameter input. After successful verification, the message structure is constructed based on the interface information, input parameter information, and output parameter information. The parameter values ​​of each field in the parameter configuration information are then filled into each element node in the message structure to generate the target XML message. This eliminates the need for users to manually write XML code, which can improve developer work efficiency.

[0097] In one possible embodiment, referring to Figure 6 , Figure 6 A flowchart of the fourth embodiment of the message generation method of the present application is provided. Generating the target XML message according to the parameter configuration information, the interface information, the input parameter information, and the output parameter information includes:

[0098] Step S41, creating several element nodes according to the interface information, the input parameter information and the output parameter information;

[0099] It should be noted that in an XML message, an element node is the basic unit that constitutes the message structure, similar to a node in a tree structure. An element node includes a root node and child nodes. Interface information generally includes information such as the interface name, version number, and interface description. The root node of the XML message can be created based on the interface information. In addition, the input parameter information describes the data that needs to be provided when the interface is called, such as the parameter name, type, and whether it is required. Related child nodes are created based on the various fields in the input parameter information. In addition, the output parameter information describes the data returned after the interface call is completed, such as the name, type, and structure of the return value. Related child nodes can be created based on the various fields in the output parameter information.

[0100] Specifically, the interface information, input parameter information, and output parameter information are parsed to extract information such as the name, version number, and description of the interface, as well as detailed information of each field in the input parameter information, such as the name, type, and whether it is required, and detailed information of each field in the output parameter information, such as the name, return code, and structure of the return value. Further, a root node of the XML message is created based on the interface information, and the root node includes attributes such as the name and version number of the interface. In addition, a child node is created for each field in the input parameter information, and attributes (such as name, type, etc.) are added to each node. In addition, a child node is created for each field in the output parameter information, and attributes (such as name, type, etc.) are added to each node.

[0101] Step S42, generating a message structure according to each element node;

[0102] In this embodiment, the root node and the child nodes are combined according to a logical relationship. For example, the root node is used as the top node of the XML message, and the input parameters and output parameters are used as child nodes of the root node to construct a message structure.

[0103] Step S43: writing the parameter value of each field in the parameter configuration information into the element node of the message structure to obtain the target XML message.

[0104] Specifically, the parameter value for each field is extracted from the parameter configuration information input by the user. Then, based on the parameter name or other identifier, the element node corresponding to each field is determined in the message structure. In other embodiments, a mapping relationship between each element node in the message structure and each field in the parameter configuration information can be pre-established, and based on this mapping relationship, the element node corresponding to each field in the message structure is determined. Furthermore, the parameter value for each field is written as the text content of the node into the corresponding element node, thereby obtaining the target XML message.

[0105] This embodiment creates corresponding element nodes based on the interface information, input parameter information and output parameter information of the configuration file, and then generates a message structure based on each element node. Furthermore, the parameter values ​​of each field in the parameter configuration information are written into the corresponding element nodes to obtain the target XML message. Users do not need to manually write XML code during the entire process, thereby improving the work efficiency of developers.

[0106] In one possible embodiment, referring to Figure 7 , Figure 7 This is a flowchart of Embodiment 5 of the message generation method of this application. After generating the target XML message based on the parameter configuration information entered by the user on the configuration interface, the method further includes:

[0107] Step S51, determining the root node of the message structure in the target XML message;

[0108] It should be noted that in the message structure corresponding to an XML message, the root node is the node associated with a start marker among the element nodes. For example, the root node has a specific attribute (such as start="true") to identify it as a start node. In this embodiment, the target XML message is parsed to query and obtain the node associated with the start marker, and this node is used as the root node in the target XML message.

[0109] Step S52, starting from the root node, traversing and parsing each element node in the target XML message to obtain a message parsing result;

[0110] Step S53: Display the message parsing result on the configuration interface.

[0111] In this embodiment, starting from the root node, each element node in the XML message is recursively parsed. Optionally, information such as the name, attributes, and text content of each node can be extracted to obtain the message parsing results. Furthermore, the message parsing results are dynamically displayed on the configuration interface for user viewing and operation. In other embodiments, the configuration interface also provides operation functions, allowing users to further process or modify the message parsing results, thereby improving the efficiency of user operations on XML data.

[0112] This embodiment determines the root node of the message structure in the target XML message, and then recursively parses each element node in the target XML message with the root node as the starting point, and then dynamically displays the message parsing results on the configuration interface. The user can intuitively view the hierarchical structure and specific content of the XML message, thereby realizing the visualization of XML message parsing.

[0113] In a feasible implementation manner, after generating the configuration interface according to the interface information, the input parameter information, and the output parameter information, the method further includes:

[0114] Step S61, in response to a user's parameter modification request, displaying the input fields and their associated attribute labels in the parameter modification request on the configuration interface;

[0115] Step S62, updating the configuration file according to the modified input field and its associated attribute tag; and / or,

[0116] Step S63, in response to the user's parameter addition request, the input fields and their associated attribute labels in the parameter addition request are newly displayed on the configuration interface;

[0117] Step S64: Add the newly added input field and its associated attribute tag to the configuration file.

[0118] In this embodiment, the configuration interface provides editable input boxes for each field and its attribute label in the input parameter information. When a user's parameter modification request is received, the user's modified input fields and attribute labels in the parameter modification request are retrieved. After the user clicks the "Save Changes" button, the corresponding content in the configuration file is updated based on the modified input fields and attribute labels.

[0119] In addition, an input box is provided on the configuration interface for the user to enter a new field name and attribute label. When a user's parameter addition request is received, information such as the newly added input field and its associated attribute label is obtained, and the newly added input field and its associated attribute label are displayed on the configuration interface. The newly added input field and its associated attribute label are then added to the configuration file.

[0120] This embodiment can efficiently complete parameter modification and addition operations by modifying or adding field information on the configuration interface, while ensuring real-time updating of the configuration file.

[0121] It should be noted that the examples in the figure are only used to understand the present application and do not constitute a limitation on the message generation method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0122] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0123] This application also provides a message generating device, please refer to Figure 8 , the message generating device includes:

[0124] Acquisition module 71, used to obtain interface document information;

[0125] The parsing module 72 is used to parse the interface document information to obtain a document parsing result;

[0126] A first generating module 73 is used to generate a configuration file according to the document parsing result;

[0127] The second generating module 74 is used to load the configuration file to generate a configuration interface;

[0128] The third generating module 75 is configured to generate a target XML message according to the configuration file and the parameter configuration information input by the user on the configuration interface.

[0129] The second generating module 74 is further configured to:

[0130] A receiving unit, configured to receive an interface selection request initiated by a user on a preset user interface, wherein the interface selection request includes an interface identifier;

[0131] An extraction unit, configured to extract interface information, input parameter information, and output parameter information corresponding to the interface identifier from the configuration file;

[0132] The first generating unit is configured to generate the configuration interface according to the interface information, the input parameter information, and the output parameter information.

[0133] The third generating module 75 is further configured to:

[0134] An acquisition unit, configured to acquire parameter configuration information input by a user on the configuration interface;

[0135] A verification unit, configured to verify the parameter configuration information according to the attribute tags of each field in the input parameter information;

[0136] The second generating unit is configured to generate the target XML message according to the parameter configuration information, the interface information, the input parameter information and the output parameter information if the verification is successful.

[0137] The third generating unit 75 is further configured to:

[0138] A creation subunit, configured to create a plurality of element nodes according to the interface information, the input parameter information, and the output parameter information;

[0139] A generating subunit, configured to generate a message structure according to each of the element nodes;

[0140] The writing subunit is used to write the parameter value of each field in the parameter configuration information into the element node of the message structure to obtain the target XML message.

[0141] The message generating device further includes:

[0142] A determination module, configured to determine a root node of a message structure in the target XML message, wherein the root node is a node associated with a start identifier among the element nodes;

[0143] A traversal module is used to traverse and parse each element node in the target XML message starting from the root node to obtain a message parsing result;

[0144] The display module is used to traverse and parse each element node in the target XML message starting from the root node to obtain a message parsing result.

[0145] The verification unit is further configured to:

[0146] According to the attribute tag of each field in the input parameter information, the data type, field length, field format of each field in the parameter configuration information and / or the dependency relationship between each field are verified.

[0147] The message generating device further includes:

[0148] a modification module, configured to display, on the configuration interface, the input fields and associated attribute labels in the parameter modification request in response to a user's parameter modification request;

[0149] An updating module, configured to update the configuration file according to the modified input fields and their associated attribute tags;

[0150] and / or,

[0151] A new adding module, configured to respond to a user's parameter adding request and display the input fields and their associated attribute labels in the parameter adding request on the configuration interface;

[0152] The adding module is used to add a newly added input field and its associated attribute tags to the configuration file.

[0153] The message generation device provided in this application, utilizing the message generation method of the aforementioned embodiment, can resolve the technical problem that manually writing XML messages consumes a significant amount of time, impacting developer productivity. Compared to the prior art, the message generation device provided in this application achieves the same beneficial effects as the message generation method provided in the aforementioned embodiment. Other technical features of the message generation device are the same as those disclosed in the aforementioned embodiment and are not further detailed here.

[0154] The present application provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the message generation method in the above-mentioned embodiment one.

[0155] Reference below Figure 9 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic devices in the embodiments of the present application may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 9 The electronic device shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.

[0156] like Figure 9As shown, the electronic device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes based on programs stored in a read-only memory 1002 or programs loaded from a storage device 1003 into a random access memory 1004. The random access memory 1004 also stores various programs and data required for the operation of the electronic device. The processing device 1001, the read-only memory 1002, and the random access memory 1004 are connected to each other via a bus 1005. An input / output interface 1006 is also connected to the bus. Typically, the following systems may be connected to the input / output interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape or a hard disk; and a communication device 1009. The communication device 1009 may allow the electronic device to communicate with other devices wirelessly or wired to exchange data. Although the figures show electronic devices with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have instead.

[0157] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device 1003, or installed from a read-only memory 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are performed.

[0158] The electronic device provided in this application, utilizing the message generation method of the aforementioned embodiment, can resolve the technical issue of manually writing XML messages, which consumes a significant amount of time and affects developer productivity. Compared to the prior art, the electronic device provided in this application achieves the same beneficial effects as the message generation method provided in the aforementioned embodiment. Other technical features of this electronic device are the same as those disclosed in the aforementioned embodiment and are not further elaborated upon here.

[0159] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0160] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

[0161] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, a computer program) stored thereon, and the computer-readable program instructions are used to execute the message generation method in the above embodiment.

[0162] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0163] The computer-readable storage medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0164] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by an electronic device, the electronic device:

[0165] Get interface document information;

[0166] Parsing the interface document information to obtain a document parsing result;

[0167] Generate a configuration file based on the document parsing result;

[0168] Loading the configuration file to generate a configuration interface;

[0169] A target XML message is generated according to the configuration file and the parameter configuration information input by the user on the configuration interface.

[0170] Computer program code for performing the operations of the present application may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0171] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.

[0172] The modules described in the embodiments of the present application may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.

[0173] The computer-readable storage medium provided in this application stores computer-readable program instructions (i.e., a computer program) for executing the above-described message generation method. This computer-readable storage medium can address the technical issue of manually writing XML messages, which consumes a significant amount of time and affects developer productivity. Compared to the prior art, the beneficial effects of the computer-readable storage medium provided in this application are similar to those of the message generation method provided in the above-described embodiments and are not further elaborated here.

[0174] An embodiment of the present application provides a computer program product, including a computer program, which implements the steps of the above-mentioned message generation method when executed by a processor.

[0175] The computer program product provided in this application can solve the technical problems in the background technology. Compared with the prior art, the beneficial effects of the computer program product provided in the embodiment of this application are the same as the beneficial effects of the message generation method provided in the above embodiment, which will not be repeated here.

[0176] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.

[0177] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0178] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as mentioned above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, controlled terminal, or network device, etc.) to execute the method of each embodiment of the present application.

[0179] The above are only preferred embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A message generation method, characterized in that: include: Get interface document information; Parsing the interface document information to obtain a document parsing result; Generate a configuration file based on the document parsing result; Loading the configuration file to generate a configuration interface; A target XML message is generated according to the configuration file and the parameter configuration information input by the user on the configuration interface.

2. The message generation method according to claim 1, wherein: The step of loading the configuration file to generate a configuration interface includes: Receiving an interface selection request initiated by a user on a preset user interface, wherein the interface selection request includes an interface identifier; Extracting interface information, input parameter information, and output parameter information corresponding to the interface identifier from the configuration file; The configuration interface is generated according to the interface information, the input parameter information, and the output parameter information.

3. The message generation method according to claim 2, wherein: Generating a target XML message according to the configuration file and the parameter configuration information input by the user on the configuration interface includes: Obtaining parameter configuration information entered by the user on the configuration interface; Verifying the parameter configuration information according to the attribute tags of each field in the input parameter information; If the verification is successful, the target XML message is generated according to the parameter configuration information, the interface information, the input parameter information and the output parameter information.

4. The message generation method according to claim 3, wherein: The generating the target XML message according to the parameter configuration information, the interface information, the input parameter information and the output parameter information includes: Creating a plurality of element nodes according to the interface information, the input parameter information and the output parameter information; Generate a message structure according to each element node; The parameter value of each field in the parameter configuration information is written into the element node of the message structure respectively to obtain the target XML message.

5. The message generation method according to claim 4, wherein: After generating the target XML message according to the configuration file and the parameter configuration information input by the user on the configuration interface, the method further includes: Determine a root node of a message structure in the target XML message, wherein the root node is a node associated with a start identifier among the element nodes; Taking the root node as the starting point, traverse and parse each element node in the target XML message to obtain a message parsing result; The message parsing result is displayed on the configuration interface.

6. The message generation method according to claim 3, wherein: The verifying the parameter configuration information according to the attribute tags of each field in the input parameter information includes: According to the attribute tag of each field in the input parameter information, the data type, field length, field format of each field in the parameter configuration information and / or the dependency relationship between each field are verified.

7. The message generation method according to claim 2, wherein: After generating the configuration interface according to the interface information, the input parameter information, and the output parameter information, the method further includes: In response to a user's parameter modification request, displaying the input fields in the parameter modification request and their associated attribute labels on the configuration interface; updating the configuration file according to the modified input fields and their associated attribute tags; and / or, In response to a user's parameter addition request, the input fields and their associated attribute labels in the parameter addition request are newly displayed on the configuration interface; Add the newly added input fields and their associated property tags to the configuration file.

8. A message generating device, characterized in that: include: Acquisition module, used to obtain interface document information; A parsing module, configured to parse the interface document information and obtain a document parsing result; A first generating module, configured to generate a configuration file according to the document parsing result; A second generating module is used to load the configuration file to generate a configuration interface; The third generating module is used to generate a target XML message according to the configuration file and the parameter configuration information input by the user on the configuration interface.

9. An electronic device, characterized in that: The electronic device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the message generation method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the message generation method according to any one of claims 1 to 7 are implemented.