Interface message processing method, device, equipment, medium and computer program product
By establishing field mapping relationships and configuration information between internal interfaces and external message styles, a message conversion tool is generated, which solves the problem of resource consumption of interface docking among systems, and realizes an efficient and simplified interface docking process.
Patent Information
- Application Number
- CN202410176186.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-08
- Publication Date
- 2025-08-12
AI Technical Summary
When connecting interfaces between systems, they need to connect with multiple interfaces separately, which consumes a lot of time and human resources.
By determining the internal fields of the internal interface and preset external message styles, establishing field mapping relationships and configuration information, generating message conversion tools, and realizing unified conversion of internal interface messages into external message styles.
Unified docking with external systems can be achieved without modifying the internal interface, reducing labor and time costs, ensuring the normal operation of the internal interface, and simplifying the configuration process through the visual interface.
Smart Images

Figure CN120475072A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information processing technology, and in particular to an interface message processing method, apparatus, device, medium and computer program product. Background Art
[0002] When systems connect to each other through interfaces, they typically need to transmit data using the same interface message format. When a system provides services through multiple interfaces, the interconnected systems must connect to each interface using a different message format, consuming significant time and resources. Summary of the Invention
[0003] Based on this, it is necessary to provide an interface message processing method, apparatus, computer equipment, storage medium and computer program product to address the above technical problems.
[0004] In a first aspect, the present application provides an interface message processing method. The method comprises:
[0005] Determining an internal field corresponding to the internal interface according to an internal message pattern of the internal interface;
[0006] Determine the external fields according to the preset external message style;
[0007] In response to a configuration operation, determining a field mapping relationship between an internal field corresponding to the internal interface and the external field, and determining field configuration information of the external field;
[0008] Configuring a message conversion tool corresponding to the internal interface according to the field mapping relationship and the field configuration information;
[0009] In response to the release of the internal interface, the message conversion tool corresponding to the internal interface is loaded to convert the message sent by the internal interface from the internal message style to the external message style, and to convert the message used to call the internal interface from the external message style to the internal message style.
[0010] In one embodiment, the configuration operation includes a first mapping configuration operation and a second mapping configuration operation, and the method further includes: determining a preset mapping relationship between the internal field and the external field based on the field identifiers of the internal field and the external field; displaying the preset mapping relationship; determining the field mapping relationship between the internal field corresponding to the internal interface and the external field in response to the configuration operation, including: configuring the preset mapping relationship as a field mapping relationship between the internal field corresponding to the internal interface and the external field in response to the first mapping configuration operation; adjusting the preset mapping relationship in response to the second mapping configuration operation, and configuring the adjusted preset mapping relationship as a field mapping relationship between the internal field corresponding to the internal interface and the external field.
[0011] In one embodiment, the configuration operation includes a first field configuration operation and a second field configuration operation. In response to the configuration operation, the field configuration information of the external field is determined, including: determining the internal field corresponding to the external field based on the field mapping relationship between the internal field corresponding to the internal interface and the external field; displaying the preset field configuration information of the external field based on the field configuration information of the internal field corresponding to the external field; in response to the first field configuration operation, configuring the preset field configuration information as the field configuration information of the external field; in response to the second field configuration operation, adjusting the preset field configuration information, and configuring the adjusted preset field configuration information as the field configuration information of the external field.
[0012] In one of the embodiments, the message conversion tool corresponding to the internal interface is configured according to the field mapping relationship corresponding to the internal interface and the field configuration information of the external field, including: generating an object class code corresponding to the external message style according to the field configuration information of the external field; configuring the message conversion tool corresponding to the internal interface according to the field mapping relationship corresponding to the internal interface and the object class code.
[0013] In one embodiment, the method further includes: in response to a mapping adjustment operation, updating the field mapping relationship corresponding to the internal interface; in response to a configuration adjustment operation, updating the field configuration information of the external field; updating the message conversion tool corresponding to the internal interface according to the updated field mapping relationship corresponding to the internal interface, and / or the updated field configuration information of the external field; and in response to a loading operation, loading the updated message conversion tool corresponding to the internal interface.
[0014] In one embodiment, the method further includes: displaying various versions of the message conversion tool corresponding to the internal interface according to the update record of the message conversion tool corresponding to the internal interface; and loading the target version of the message conversion tool in response to a version loading operation.
[0015] In a second aspect, the present application further provides an interface message processing device. The device comprises:
[0016] An internal field determination module, configured to determine an internal field corresponding to the internal interface according to an internal message pattern of the internal interface;
[0017] An external field determination module, used to determine the external field according to a preset external message style;
[0018] a configuration determination module, configured to determine, in response to a configuration operation, a field mapping relationship between an internal field corresponding to the internal interface and the external field, and to determine field configuration information of the external field;
[0019] A conversion configuration module, configured to configure a message conversion tool corresponding to the internal interface according to the field mapping relationship and the field configuration information;
[0020] A loading module is used to load the message conversion tool corresponding to the internal interface in response to the release of the internal interface, so as to convert the message sent by the internal interface from the internal message style to the external message style, and to convert the message used to call the internal interface from the external message style to the internal message style.
[0021] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are performed:
[0022] According to the internal message style of the internal interface, the internal field corresponding to the internal interface is determined; according to the preset external message style, the external field is determined; in response to the configuration operation, the field mapping relationship between the internal field corresponding to the internal interface and the external field is determined, and the field configuration information of the external field is determined; according to the field mapping relationship and the field configuration information, the message conversion tool corresponding to the internal interface is configured; in response to the release of the internal interface, the message conversion tool corresponding to the internal interface is loaded to convert the message sent by the internal interface from the internal message style to the external message style, and to convert the message used to call the internal interface from the external message style to the internal message style.
[0023] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:
[0024] According to the internal message style of the internal interface, the internal field corresponding to the internal interface is determined; according to the preset external message style, the external field is determined; in response to the configuration operation, the field mapping relationship between the internal field corresponding to the internal interface and the external field is determined, and the field configuration information of the external field is determined; according to the field mapping relationship and the field configuration information, the message conversion tool corresponding to the internal interface is configured; in response to the release of the internal interface, the message conversion tool corresponding to the internal interface is loaded to convert the message sent by the internal interface from the internal message style to the external message style, and to convert the message used to call the internal interface from the external message style to the internal message style.
[0025] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the following steps:
[0026] According to the internal message style of the internal interface, the internal field corresponding to the internal interface is determined; according to the preset external message style, the external field is determined; in response to the configuration operation, the field mapping relationship between the internal field corresponding to the internal interface and the external field is determined, and the field configuration information of the external field is determined; according to the field mapping relationship and the field configuration information, the message conversion tool corresponding to the internal interface is configured; in response to the release of the internal interface, the message conversion tool corresponding to the internal interface is loaded to convert the message sent by the internal interface from the internal message style to the external message style, and to convert the message used to call the internal interface from the external message style to the internal message style.
[0027] The above-mentioned interface message processing method, device, computer equipment, storage medium and computer program product, according to the internal message style of the internal interface and the preset external message style, according to the mapping relationship between the internal field corresponding to the internal interface and the external field and the field configuration information of the external field, configure the message conversion tool corresponding to the internal interface, and load its corresponding message conversion tool in real time when the internal interface is released, so that the messages of each internal interface already released in the system can be uniformly converted into the preset external message style, so that it can be connected to the external system through a unified docking method without modifying the developed internal interface, without the need for the external system to dock with different internal interfaces respectively, effectively reducing labor costs and time costs. Moreover, the present application can also convert the received interface call message into the internal message style corresponding to the corresponding internal interface, so as to ensure that the internal interface works normally in the original way without increasing the complexity of the system. Moreover, the present application can also enable the user to complete the relevant configuration of the message conversion through the interactive operation between the visual interface and the visual interface without having to write code by themselves, which can effectively reduce the complexity of the configuration process and improve the configuration efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 1 is a flow chart of a method for processing interface messages in one embodiment;
[0029] Figure 2 A schematic diagram of a process for determining a field mapping relationship in one embodiment;
[0030] Figure 3 A schematic diagram showing a preset mapping relationship in an embodiment;
[0031] Figure 4 A schematic diagram of a process for determining field configuration information in one embodiment;
[0032] FIG5 (a) is a schematic diagram showing preset field configuration information in one embodiment;
[0033] FIG5( b ) is a schematic diagram showing field configuration prompt information in one embodiment;
[0034] Figure 6 A schematic diagram of a process for updating a message conversion tool in one embodiment;
[0035] Figure 7 Schematic diagram showing various versions of the message conversion tool in one embodiment;
[0036] Figure 8 is a structural block diagram of an interface message processing device in one embodiment;
[0037] Figure 9FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0039] In one embodiment, Figure 1 As shown, a method for processing interface messages is provided. This embodiment uses the method applied to a terminal as an example for illustration. It is understandable that the method can also be applied to a server, or to a system including a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0040] Step S101: Determine an internal field corresponding to the internal interface according to the internal message style of the internal interface.
[0041] Specifically, the internal interface can be an interface provided by the system that can be called to implement system functions or obtain data in the system. In this step, the message format of the request message and response message of the internal interface can be obtained to obtain the internal message format of the interface. Then, based on the fields included in the internal message format, the internal fields corresponding to the internal interface can be determined.
[0042] The system may have multiple internal interfaces. In this step, the internal message style of each internal interface may be obtained respectively, and the internal fields corresponding to each internal interface may be determined respectively.
[0043] Step S102: Determine the external field according to the preset external message style.
[0044] In order to connect the system with an external system, an external message format for connecting with the external system can be pre-set, wherein the external message format can include multiple external fields.
[0045] For example, in steps S101 and S102, sample messages conforming to an internal message format and an external message format may be obtained, respectively. Then, based on the fields included in the sample messages, an internal field list and an external field list may be generated, respectively. The sample messages may be in JSON (JavaScript Object Notation) format or XML (Extensible Markup Language) format.
[0046] Illustratively, in some implementations, the message conversion configuration information may be displayed based on internal fields and external fields.
[0047] Based on the internal fields and external fields obtained in the above process, the message conversion configuration information can be displayed through a visual interface. The message conversion configuration information may include, but is not limited to, field identifiers of internal fields, field identifiers of external fields, prompt information guiding the user to perform configuration operations, etc. In addition, in some embodiments, the message conversion configuration information may also include preset mapping relationships between internal fields and external fields, preset field configuration information for external fields, etc.
[0048] Among them, when the system has multiple internal interfaces, the visual interface can display the message conversion configuration information corresponding to different internal interfaces respectively.
[0049] Step S103 : In response to the configuration operation, determining the field mapping relationship between the internal field corresponding to the internal interface and the external field, and determining the field configuration information of the external field.
[0050] Specifically, users can interact with the visual interface by clicking, pressing, dragging, etc. to configure field mapping relationships and field configuration information. The field configuration information for external fields may include field types, field validation rules, etc.
[0051] For example, the visualization interface can display field identifiers for internal fields and field identifiers for external fields. Based on a user's click operation, the field identifiers of a pair of internal and external fields selected by the user can be determined, and a field mapping relationship between the selected internal and external fields can be established. For example, the visualization interface can also display a list of optional configuration information for the external field. Based on a user's check operation, the field configuration information for the external field can be determined.
[0052] For example, the user can switch to display the message conversion configuration information corresponding to different internal interfaces in the visual interface and perform configuration operations on each internal interface respectively. According to the user's configuration operations, the mapping relationship between the internal fields and external fields corresponding to different internal interfaces can be determined respectively.
[0053] Step S104: configuring a message conversion tool corresponding to the internal interface according to the field mapping relationship and the field configuration information.
[0054] In this step, the message conversion tool may be configured according to the field mapping relationship corresponding to the internal interface and the field configuration information of the external field to obtain the message conversion tool corresponding to the internal interface.
[0055] Exemplarily, the message conversion tool can be a conversion tool based on an object mapping framework such as Dozer, which can copy data from one object to another according to a configuration file. In this step, a configuration file for the object mapping framework can be generated based on the field mapping relationship corresponding to the internal interface and the field configuration information for the external field. The object mapping framework can then be configured using this configuration file to obtain a message conversion tool corresponding to the internal interface.
[0056] It is understandable that when the system has multiple internal interfaces, a corresponding message conversion tool can be configured for each internal interface.
[0057] Step S105 : In response to the release of the internal interface, a message conversion tool corresponding to the internal interface is loaded.
[0058] Specifically, if the internal interface is unpublished, this step can involve, for example, subscribing to messages from the system's interface publishing service. Once the internal interface is published, the corresponding message conversion tool can be loaded. Subscription can be performed using, for example, Redis (Remote Dictionary Server).
[0059] Among them, the loaded message conversion tool can subsequently convert the message sent by the internal interface from the internal message style to the external message style, and convert the message received by the system for calling the internal interface from the external message style to the internal message style. Thus, by loading the message conversion tool corresponding to each internal interface, the messages generated by the different internal interfaces of the system can be converted into external messages of a unified style, and the external system can be efficiently connected to the system based on the external message style. In addition, the messages received from the external system can also be converted into the corresponding internal message styles according to the internal interface it calls, so that the called internal interface can obtain the message of the corresponding style.
[0060] The above-mentioned interface message processing method determines the internal field corresponding to the internal interface according to the internal message style of the internal interface, determines the external field according to the preset external message style, and then determines the field mapping relationship between the internal field corresponding to the internal interface and the external field in response to the configuration operation, and determines the field configuration information of the external field, and then configures the message conversion tool corresponding to the internal interface according to the field mapping relationship corresponding to the internal interface and the field configuration information of the external field, and loads the message conversion tool corresponding to the internal interface in response to the release of the internal interface, wherein the loaded message conversion tool can convert the message sent by the internal interface from the internal message style to the external message style, and convert the message used to call the internal interface from the external message style to the internal message style. In this solution, according to the internal message style of the internal interface and the pre-set external message style, according to the mapping relationship between the internal field corresponding to the internal interface and the external field and the field configuration information of the external field, the message conversion tool corresponding to the internal interface is configured, and the corresponding message conversion tool is loaded in real time when the internal interface is released, which can uniformly convert the messages of each internal interface already released in the system into the preset external message style, so that it can be connected to the external system through a unified docking method without modifying the developed internal interface, without the need for the external system to dock with different internal interfaces respectively, effectively reducing labor costs and time costs. Moreover, this solution can also convert the received interface call message into the internal message style corresponding to the corresponding internal interface, so as to ensure that the internal interface works normally in the original way without increasing the complexity of the system. Moreover, this solution can also enable users to complete the relevant configuration of message conversion through interactive operations between the visual interface without having to write code themselves, which can effectively reduce the complexity of the configuration process and improve configuration efficiency.
[0061] In one embodiment, the configuration operation includes a first mapping configuration operation and a second mapping configuration operation, such as Figure 2 As shown, the above method also includes:
[0062] Step S201: determining a preset mapping relationship between the internal field and the external field according to the field identifiers of the internal field and the external field.
[0063] Step S202: displaying the preset mapping relationship.
[0064] Specifically, in this embodiment, a preset mapping relationship between internal fields and external fields may be determined first, and the preset mapping relationship may be displayed through a visual interface.
[0065] For example, in step S201, the external field corresponding to each internal field can be determined based on the similarity between the field identifiers of the internal field and the external field, thereby forming a preset mapping relationship between the internal field and the external field. The similarity value can be calculated based on the meaning of the field identifier or the similarity of the constituent characters. If the similarity value between the field identifiers of a pair of internal fields and external fields is high, a preset mapping relationship can be established between the pair of internal fields and external fields.
[0066] Then, in step S202, the preset mapping relationship between the internal fields and the external fields can be displayed through a visual interface. Figure 3 As shown, the visual interface can display the field identifiers of the internal fields of the request message corresponding to the internal interface 1, as well as the field identifiers of the external fields. The field identifiers can be sorted from top to bottom, and there is a preset mapping relationship between the internal fields and external fields with the same arrangement order. For example, Figure 3 In the visual interface shown, the field identifiers of internal fields can be sorted in the order of Field A1, Field A2, Field A3, ... Field An, and the field identifiers of external fields can be sorted in the order of Field B1, Field B2, Field B3, ... Field Bn, with Field A1 and Field B1 being arranged in the same order. Based on this, it can be determined that, for example, Field A1 and Field B1 have a preset mapping relationship, and Field A2 and Field B2 have a preset mapping relationship.
[0067] In the above step S103, in response to the configuration operation, determining the field mapping relationship between the internal field corresponding to the internal interface and the external field includes:
[0068] Step S203: In response to the first mapping configuration operation, the preset mapping relationship is configured as a field mapping relationship between the internal field corresponding to the internal interface and the external field.
[0069] Specifically, the user may perform a first mapping configuration operation on the visual interface, such as clicking a confirmation button. Based on the user's first mapping configuration operation, the preset mapping relationship displayed on the visual interface may be determined to be the mapping relationship confirmed by the user, and then, the preset mapping relationship may be configured as a field mapping relationship between the internal field and the external field corresponding to the internal interface.
[0070] Step S204 : In response to the second mapping configuration operation, the preset mapping relationship is adjusted, and the adjusted preset mapping relationship is configured as a field mapping relationship between the internal field corresponding to the internal interface and the external field.
[0071] Specifically, the user may further perform a second mapping configuration operation in the visual interface, such as a check, drag, etc. Based on the user's second mapping configuration operation, the mapping relationship between the internal field and the external field modified by the user based on the preset mapping relationship may be determined, and then the preset mapping relationship may be adjusted accordingly, and the adjusted preset mapping relationship may be configured as the field mapping relationship between the internal field and the external field corresponding to the internal interface.
[0072] In other embodiments, the second mapping configuration operation performed by the user may also be to cancel all preset mapping relationships and manually establish a mapping relationship between each internal field and an external field. Based on this, the adjustment of the preset mapping relationship may be to delete the original preset mapping relationship and use the mapping relationship manually established by the user as the adjusted preset mapping relationship.
[0073] In this embodiment, based on the field identifiers of internal and external fields, a preset mapping relationship between internal and external fields is first determined and displayed, providing a preliminary reference for field mapping configuration, eliminating the need for users to establish mapping relationships from scratch and effectively improving field mapping configuration efficiency. Furthermore, based on the user's mapping configuration operations, the field mapping relationship between the internal and external fields of the final application is determined, allowing users to personalize the mapping relationship and increase configuration flexibility.
[0074] In one embodiment, Figure 4 As shown, the configuration operation includes a first field configuration operation and a second field configuration operation. In step S103, in response to the configuration operation, field configuration information of the external field is determined, including:
[0075] Step S401 : determining the internal field corresponding to the external field according to the field mapping relationship between the internal field corresponding to the internal interface and the external field.
[0076] Step S402: Displaying preset field configuration information of the external field according to the field configuration information of the internal field corresponding to the external field.
[0077] Specifically, in order to facilitate the user to configure the field configuration information of the external field, this embodiment may first determine the preset field configuration information of the external field and then display it through a visual interface.
[0078] In step S401, one or more internal fields corresponding to each external field can be determined based on the field mapping relationship between the internal fields of the one or more internal interfaces and the external fields. Then, in step S402, field configuration information of the internal field corresponding to the external field can be obtained, and then, based on the obtained one or more field configuration information, preset field configuration information of the external field can be determined and displayed to the user through a visual interface.
[0079] For example, as shown in Figure 5(a), the visualization interface can display the field identifier, optional field types, and optional field attributes corresponding to each type of the external field. Figure 5(a) shows that the preset field configuration information for the external field with the field identifier "Field 1" is Type 1 and Attribute 2.
[0080] Step S403: In response to the first field configuration operation, the preset field configuration information is configured as field configuration information for the external field.
[0081] Specifically, the user can perform a first field configuration operation on the visual interface, such as clicking a confirmation button. Based on the user's first field configuration operation, the preset field configuration information for the external field displayed on the visual interface can be determined to be the field configuration information confirmed by the user. Based on this, it can be preconfigured as the field configuration information for the external field.
[0082] Step S404: In response to the second field configuration operation, the preset field configuration information is adjusted, and the adjusted preset field configuration information is configured as the field configuration information for the external field.
[0083] Specifically, the user can also perform a second field configuration operation on the visual interface, which can be a click, input, etc. Based on the user's second field configuration operation, the preset field configuration information of the external field can be modified and adjusted. For example, the preset field configuration information of the external field with the field identifier "Field 1" can be adjusted to type 1 and attribute 3. Then, the adjusted preset field configuration information is configured as the field configuration information of the external field.
[0084] In some embodiments, the second field configuration operation performed by the user may also include a configuration operation for the field verification rules. Among them, according to the user's operation such as long pressing or double-clicking the field identifier, the field configuration prompt information shown in Figure 5 (b) can be displayed on the visual interface. It may include an input box for setting the minimum length and maximum length of the field content, or an input box for setting a regular expression for verifying the field content, and may also include an input box for setting the date format or enumeration value. According to the content entered by the user in the input box, the verification rules for the external field can be configured, etc. Then, combined with the user's adjustment of the field type and field attributes, the preset field configuration information of the external field is adjusted.
[0085] In this embodiment, the preset field configuration information for the external field is determined and displayed based on the configuration information of the internal field corresponding to the external field. Then, based on the user's field configuration operation, the final applied field configuration information is determined. This process balances the simplicity and adjustability of the configuration process, allowing users to quickly and easily configure field configuration information.
[0086] In one embodiment, step S104 configures a message conversion tool corresponding to the internal interface according to the field mapping relationship and field configuration information, including: generating an object class code corresponding to the external message style according to the field configuration information; and configuring a message conversion tool corresponding to the internal interface according to the field mapping relationship and the object class code.
[0087] Specifically, in this embodiment, object class code corresponding to the external message style can be generated based on the field configuration information of the external field. This object class code can serialize and deserialize messages that conform to the external message style. For example, in this embodiment, based on the field configuration information of the external field, a template engine such as Freemarker can be used to generate POJO (Plain Old Java Object) code corresponding to the field configuration information. This code contains configuration information such as the field type and validation rules of the external field.
[0088] Then, based on the field mapping relationship corresponding to the internal interface and the generated object class code, a configuration file of the object mapping framework can be generated, wherein the configuration file can include the object class mapping relationship between the internal field and the external field, as well as the field mapping relationship.
[0089] In this step, the generated object class code can be further compiled into a JAR package (Java Archive). Then, when the message conversion tool is subsequently loaded, this JAR package can be loaded through a custom class loader. This allows the system to serialize and deserialize messages that conform to the external message format and convert objects between the two message formats using the object mapping framework.
[0090] In this embodiment, based on the field configuration information of the external field, the object class code corresponding to the external message style is generated, and combined with the field mapping relationship corresponding to the internal interface and the generated object class code, the message conversion tool corresponding to the interface is configured, which enables the message conversion tool to realize the serialization and deserialization of the externally received messages and the object conversion function between the two message styles after subsequent loading.
[0091] In one embodiment, Figure 6 As shown, the method of the present application may further include the following steps:
[0092] Step S601: In response to a mapping adjustment operation, the field mapping relationship corresponding to the internal interface is updated.
[0093] Step S602: In response to the configuration adjustment operation, the field configuration information of the external field is updated.
[0094] Among them, for the internal interface that has been configured, the field mapping relationship corresponding to the interface can be displayed through the visual interface, and the field configuration information of the external field can also be displayed at the same time.
[0095] In step S601, the user can perform mapping adjustment operations on the visual interface for the displayed content. According to the user's mapping adjustment operations, the field mapping relationship corresponding to the existing internal interface can be deleted, added, modified, etc. to obtain an updated field mapping relationship.
[0096] In step S602, the user can also perform configuration adjustment operations on the visual interface for the field configuration information of the external field displayed on the visual interface. According to the user's configuration adjustment operation, the field type, field attributes, verification rules, etc. of the external field can be modified to obtain updated field configuration information.
[0097] Step S603: Update the message conversion tool corresponding to the internal interface according to the updated field mapping relationship corresponding to the internal interface and / or the updated field configuration information of the external field.
[0098] Step S604: In response to the loading operation, the message conversion tool corresponding to the updated internal interface is loaded.
[0099] Among them, when one of the field mapping relationship corresponding to the internal interface and the field configuration information of the external field is updated or updated at the same time, the message conversion tool corresponding to the internal interface can be updated in step S603 according to the latest field mapping relationship field configuration information. Exemplarily, the update of the message conversion tool can be to update the configuration file of the object mapping framework, update the object class code corresponding to the external message style, etc. Then, in step S604, the updated message conversion tool can be loaded into the system according to the user's loading operation in the visual interface. Thereby, the system can use the new message conversion tool to perform message conversion between the two message styles.
[0100] In this embodiment, for a message conversion tool that has already been configured and loaded, its corresponding configuration information is displayed to the user through a visual interface. The message conversion tool is then updated based on the user's modifications, and then loaded into the system based on the user's loading operation. This solution allows users to conveniently modify existing message conversion tools and hot-load the updated message conversion tool into the system without downtime, allowing the new message conversion tool to provide new message conversion functions in real time.
[0101] In one embodiment, the method of the present application may further include the steps of: displaying the message conversion tools of various versions corresponding to the internal interface according to the update records of the message conversion tools corresponding to the internal interface; and loading the target version of the message conversion tool in response to the version loading operation.
[0102] Specifically, if Figure 7 As shown, in this embodiment, multiple versions of the message conversion tool corresponding to the internal interface can also be displayed on the visual interface. The visual interface can display information such as the name, version number, status, and creation time of the message conversion tool. The status column can display the loading status of the message conversion tool. For example, "Loaded" indicates that the message conversion tool is currently loaded, and "Not Loaded" indicates that the message conversion tool is currently not loaded.
[0103] Each version of the message conversion tool corresponds to an update record or initial creation record. Users can, for example, click on a version of the message conversion tool in the visual interface to view the corresponding mapping adjustment operation record, configuration adjustment operation record, and other content of the message conversion tool. They can also obtain the code corresponding to that version of the message conversion tool.
[0104] The user may further determine a target version among multiple versions of the message conversion tool, and perform a version loading operation in the visual interface to select the target version of the message conversion tool and load it into the system.
[0105] This embodiment displays multiple versions of the message conversion tool through a visual interface based on the tool's update history. Based on the user's version loading operation, the selected target version of the message conversion tool is loaded. This solution enables version control of the message conversion tool, intuitively displays update history to the user, and facilitates version rollback in the event of problems with the new version of the tool, ensuring system reliability.
[0106] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0107] Based on the same inventive concept, embodiments of the present application further provide an interface message processing device for implementing the aforementioned interface message processing method. The implementation solution provided by this device is similar to the implementation solution described in the aforementioned method. Therefore, the specific limitations of one or more of the following embodiments of the interface message processing device can be found in the above-described limitations of the interface message processing method and will not be further elaborated here.
[0108] In one embodiment, Figure 8 As shown, an interface message processing device 800 is provided, including:
[0109] An internal field determination module 801 is configured to determine an internal field corresponding to an internal interface according to an internal message pattern of the internal interface;
[0110] The external field determination module 802 is used to determine the external field according to a preset external message format;
[0111] A configuration determination module 803 is configured to determine, in response to a configuration operation, a field mapping relationship between an internal field corresponding to the internal interface and the external field, and to determine field configuration information of the external field;
[0112] A conversion configuration module 804, configured to configure a message conversion tool corresponding to the internal interface according to the segment mapping relationship and the field configuration information;
[0113] Loading module 805 is used to load the message conversion tool corresponding to the internal interface in response to the release of the internal interface; to convert the message sent by the internal interface from the internal message style to the external message style, and to convert the message used to call the internal interface from the external message style to the internal message style.
[0114] In one embodiment, the configuration operation includes a first mapping configuration operation and a second mapping configuration operation, and the device also includes a preset mapping relationship display module, which is used to determine the preset mapping relationship between the internal field and the external field based on the field identifiers of the internal field and the external field; and display the preset mapping relationship; the configuration determination module 803 is also used to: in response to the first mapping configuration operation, configure the preset mapping relationship as a field mapping relationship between the internal field corresponding to the internal interface and the external field; in response to the second mapping configuration operation, adjust the preset mapping relationship, and configure the adjusted preset mapping relationship as a field mapping relationship between the internal field corresponding to the internal interface and the external field.
[0115] In one embodiment, the configuration operation includes a first field configuration operation and a second field configuration operation, and the configuration determination module 803 is also used to: determine the internal field corresponding to the external field based on the field mapping relationship between the internal field corresponding to the internal interface and the external field; display the preset field configuration information of the external field based on the field configuration information of the internal field corresponding to the external field; in response to the first field configuration operation, configure the preset field configuration information as the field configuration information of the external field; in response to the second field configuration operation, adjust the preset field configuration information, and configure the adjusted preset field configuration information as the field configuration information of the external field.
[0116] In one embodiment, the conversion configuration module 804 is further configured to: generate an object class code corresponding to the external message style based on the field configuration information; and configure a message conversion tool corresponding to the internal interface based on the field mapping relationship and the object class code.
[0117] In one embodiment, the device 800 also includes: a mapping adjustment module, which is used to update the field mapping relationship corresponding to the internal interface in response to a mapping adjustment operation; a configuration adjustment module, which is used to update the field configuration information of the external field in response to a configuration adjustment operation; an update module, which is used to update the message conversion tool corresponding to the internal interface according to the updated field mapping relationship corresponding to the internal interface, and / or the updated field configuration information of the external field; and a loading update module, which is used to load the updated message conversion tool corresponding to the internal interface in response to a loading operation.
[0118] In one embodiment, the device 800 also includes: a version display module, which is used to display the message conversion tools of various versions corresponding to the internal interface according to the update record of the message conversion tools corresponding to the internal interface; and a version loading module, which is used to load the target version of the message conversion tool in response to the version loading operation.
[0119] Each module in the above-mentioned interface message processing device can be implemented in whole or in part through software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor of the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each of the above modules.
[0120] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 9 As shown. The computer device includes a processor, memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals via wired or wireless means, and the wireless means can be implemented via Wi-Fi, mobile cellular networks, NFC (near-field communication), or other technologies. When executed by the processor, the computer program implements an interface message processing method. The display unit of the computer device is used to produce a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse.
[0121] Those skilled in the art will understand that Figure 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0122] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0123] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0124] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0125] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions.
[0126] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), data processing logic devices based on quantum computing, and the like.
[0127] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0128] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A method for processing interface messages, characterized in that: The method comprises: Determining an internal field corresponding to the internal interface according to an internal message pattern of the internal interface; Determine the external fields according to the preset external message style; In response to a configuration operation, determining a field mapping relationship between an internal field corresponding to the internal interface and the external field, and determining field configuration information of the external field; Configuring a message conversion tool corresponding to the internal interface according to the field mapping relationship and the field configuration information; In response to the release of the internal interface, the message conversion tool corresponding to the internal interface is loaded to convert the message sent by the internal interface from the internal message style to the external message style, and to convert the message used to call the internal interface from the external message style to the internal message style.
2. The method according to claim 1, characterized in that The configuration operation includes a first mapping configuration operation and a second mapping configuration operation, and the method further includes: Determining a preset mapping relationship between the internal field and the external field according to the field identifiers of the internal field and the external field; Displaying the preset mapping relationship; The determining, in response to the configuration operation, a field mapping relationship between the internal field corresponding to the internal interface and the external field includes: In response to the first mapping configuration operation, configuring the preset mapping relationship as a field mapping relationship between the internal field corresponding to the internal interface and the external field; In response to the second mapping configuration operation, the preset mapping relationship is adjusted, and the adjusted preset mapping relationship is configured as a field mapping relationship between the internal field corresponding to the internal interface and the external field.
3. The method according to claim 1, characterized in that The configuration operation includes a first field configuration operation and a second field configuration operation. In response to the configuration operation, determining the field configuration information of the external field includes: Determine the internal field corresponding to the external field according to the field mapping relationship between the internal field corresponding to the internal interface and the external field; Displaying the preset field configuration information of the external field according to the field configuration information of the internal field corresponding to the external field; In response to the first field configuration operation, configuring the preset field configuration information as the field configuration information of the external field; In response to the second field configuration operation, the preset field configuration information is adjusted, and the adjusted preset field configuration information is configured as the field configuration information of the external field.
4. The method according to claim 1, wherein Configuring a message conversion tool corresponding to the internal interface according to the field mapping relationship and the field configuration information includes: Generate an object class code corresponding to the external message style according to the field configuration information; According to the field mapping relationship and the object class code, a message conversion tool corresponding to the internal interface is configured.
5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: In response to the mapping adjustment operation, updating the field mapping relationship corresponding to the internal interface; In response to the configuration adjustment operation, updating the field configuration information of the external field; Update the message conversion tool corresponding to the internal interface according to the updated field mapping relationship corresponding to the internal interface and / or the updated field configuration information of the external field; In response to the loading operation, the updated message conversion tool corresponding to the internal interface is loaded.
6. The method according to claim 5, characterized in that The method further comprises: According to the update record of the message conversion tool corresponding to the internal interface, display the message conversion tools of various versions corresponding to the internal interface; In response to the version loading operation, the message conversion tool of the target version is loaded.
7. An interface message processing device, characterized in that: The device comprises: An internal field determination module, configured to determine an internal field corresponding to the internal interface according to an internal message pattern of the internal interface; An external field determination module, used to determine the external field according to a preset external message style; a configuration determination module, configured to determine, in response to a configuration operation, a field mapping relationship between an internal field corresponding to the internal interface and the external field, and to determine field configuration information of the external field; A conversion configuration module, configured to configure a message conversion tool corresponding to the internal interface according to the field mapping relationship and the field configuration information; A loading module is used to load the message conversion tool corresponding to the internal interface in response to the release of the internal interface, so as to convert the message sent by the internal interface from the internal message style to the external message style, and to convert the message used to call the internal interface from the external message style to the internal message style.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Interface message conversion method, device and system
CN112115190A
Interface data processing method and device, electronic equipment and storage medium
CN114500690A
IMIX message conversion method and device
CN115619520A
Message conversion method and device, equipment and storage medium
CN116436989A
Interface calling method and device, electronic equipment and computer storage medium
CN116483380A