Interface interaction method and device
By transforming and processing data during the interface interaction process through the target engine, the problem of low interface interaction efficiency is solved, an interface interaction method without writing docking code is realized, and the efficiency and flexibility of interface interaction are improved.
Patent Information
- Application Number
- CN202211698837.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-28
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2042-12-28
AI Technical Summary
During the interface interaction process, the need to develop docking code leads to low interaction efficiency. Especially when the ecological platform is connected to the application products of third-party manufacturers, the existing customized docking method cannot be quickly supported, which increases the workload of third-party application manufacturers and reduces the attractiveness of the ecological platform.
The target engine receives the request information, converts the request data into the format required by the target interface based on the interface interaction rules, processes it and sends it to the target server, receives and formats the response data, and realizes an interface interaction method without writing docking code.
It improves the efficiency of interface interaction, avoids the step of writing docking code, and improves the flexibility and efficiency of interface interaction.
Smart Images

Figure CN116233030B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an interface interaction method and device. Background Art
[0002] In industry applications, to enhance the security of interface interactions, common technologies used to implement interface interactions not only specify the formats of request and response data but also implement standardized signature values and encryption / decryption mechanisms to ensure the security of interface calls. Based on these rules, when implementing interface integration with partner vendors, a common practice is to first produce an interface document detailing the interface address, request method, data format, signature calculation rules, encryption / decryption algorithms, and methods for obtaining the associated keys. The technical team is then required to develop integration code based on this document. However, this customized integration approach presents significant drawbacks when applied to integrating any third-party application product into the ecosystem platform. Specifically, a model where ecosystem platform technicians implement customization according to the third-party application interface specifications cannot quickly support integration of any third-party application product into the ecosystem platform. If third-party application technicians implement customization according to the ecosystem platform interface specifications, this increases the workload for third-party application vendors and reduces the ecosystem platform's attractiveness. Summary of the Invention
[0003] The embodiments of the present application provide an interface interaction method and device to at least solve the technical problem of low interaction efficiency caused by the need to develop docking code during the interface interaction process.
[0004] According to one aspect of an embodiment of the present application, an interface interaction method is provided, including: a target engine receives request information transmitted by a source server, the request information including at least: request data and interface interaction rules; based on the interface interaction rules, converting the request data into target data in a first target format required by a target interface, and processing the target data according to the requirements of the target interface to obtain processed target data, and sending the processed target data to a target server through the target interface; receiving response data returned by the target server, and sending the response data to the source server in a second target format in the interface interaction rules.
[0005] Optionally, converting the request data into target data in a first target format required by the target interface based on the interface interaction rules includes: determining a mapping relationship between a first field in the request data and a second field in the response data; extracting the first target format from the interface interaction rules; converting the request data and the mapping relationship into the target data according to the first target format, wherein the data value of the target data is assembled in the form of a node path, wherein the preset characters in the node path are used to represent the hierarchical relationship between the target data fields.
[0006] Optionally, after obtaining the target data, the method further includes: determining address information of the target interface from the interface interaction rule.
[0007] Optionally, the target data is processed according to the requirements of the target interface to obtain the processed target data, including: determining the requirements of the target interface, the requirements including at least one of the following: encrypting the target data, constructing a signature value for the data value corresponding to the target data, and generating an anti-replay value for the data value corresponding to the target data; extracting the corresponding processing method from the interface interaction rules according to the requirements of the target interface, processing the target data, and obtaining the processed target data.
[0008] Optionally, according to the requirements of the target interface, a corresponding processing method is extracted from the interface interaction rules, and the target data is processed to obtain the processed target data, including: when the requirement of the target interface is to encrypt the target data, an encryption rule is selected from the interaction rules to encrypt the target data; when the requirement of the target interface is to construct a signature value for the data value corresponding to the target data, an encryption rule is selected from the interaction rules to encrypt the data value corresponding to the target data to obtain a corresponding signature value; when the requirement of the target interface is to generate an anti-replay value for the data value corresponding to the target data, a target algorithm is selected from the interaction rules to generate a corresponding anti-replay value.
[0009] Optionally, sending the processed target data to the target server through the target interface includes: sending the processed target data to the target interface through a preset action, and transmitting the processed target data to the target server through the target interface.
[0010] Optionally, the response data is sent to the source server in accordance with the second target format in the interface interaction rules, including: extracting the data value corresponding to the target data in the response data according to the mapping relationship, and completing the parsing of the response data in a node path manner; and sending the parsed response data to the source server in accordance with the second target format required by the source server in the interface interaction rules.
[0011] According to another aspect of an embodiment of the present application, an interface interaction device is also provided, including: a receiving module, used for a target engine to receive request information transmitted by a source server, the request information including at least: request data and interface interaction rules; a processing module, used to convert the request data into target data in a first target format required by a target interface based on the interface interaction rules, and process the target data according to the requirements of the target interface to obtain processed target data, and send the processed target data to a target server through the target interface; a response module, used to receive response data returned by the target server, and send the response data to the source server in a second target format in the interface interaction rules.
[0012] According to another aspect of the embodiments of the present application, a non-volatile storage medium is provided, in which a program is stored. When the program is running, the device where the non-volatile storage medium is located is controlled to execute the above-mentioned interface interaction method.
[0013] According to another aspect of the embodiments of the present application, a computer device is provided, including: a memory and a processor, the processor being configured to run a program stored in the memory, wherein the above-mentioned interface interaction method is executed when the program is run.
[0014] In an embodiment of the present application, a target engine is used to receive request information transmitted by a source server, wherein the request information includes at least: request data and interface interaction rules; based on the interface interaction rules, the request data is converted into target data in a first target format required by the target interface, and the target data is processed according to the requirements of the target interface to obtain processed target data, and the processed target data is sent to the target server through the target interface; response data returned by the target server is received, and the response data is sent to the source server in a second target format in the interface interaction rules. In this way, the target engine converts the request data into target data in the first target format required by the target interface, processes the target data according to the requirements of the target interface, transmits the target data to the target server through the target interface, and returns the response data, thereby achieving the purpose of avoiding the writing of docking code and realizing the technical effect of improving the efficiency of interface interaction, thereby solving the technical problem of low interaction efficiency due to the need to develop docking code during the interface interaction process. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0016] Figure 1 This is a hardware structure block diagram of a computer terminal (or mobile device) for an interface interaction method according to an embodiment of the present application;
[0017] Figure 2 This is a flow chart of an interface interaction method according to the present application;
[0018] Figure 3 It is a structural diagram of an optional interface interaction device according to an embodiment of the present application. DETAILED DESCRIPTION
[0019] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0020] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0021] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0022] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG1 shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing an interface interaction method. Figure 1 As shown, the computer terminal 10 (or mobile device 10) may include one or more (illustrated as 102a, 102b, ..., 102n) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0023] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuitry may be a single independent processing module, or may be incorporated in whole or in part into any of the other components of the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuitry serves as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0024] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the interface interaction method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizing the above-mentioned interface interaction method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0025] The transmission device 106 is configured to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by the communications provider of the computer terminal 10. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is configured to communicate with the Internet wirelessly.
[0026] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0027] In the above operating environment, the embodiment of the present application provides an interface interaction method, such as Figure 2 As shown, the method includes the following steps:
[0028] Step S202: The target engine receives the request information transmitted by the source server, wherein the request information includes at least request data and interface interaction rules.
[0029] Step S204: converting the request data into target data in a first target format required by the target interface based on the interface interaction rule, processing the target data according to the requirements of the target interface to obtain processed target data, and sending the processed target data to the target server through the target interface;
[0030] Step S206: Receive response data returned by the target server, and send the response data to the source server according to the second target format in the interface interaction rule.
[0031] Through the above steps, the target data can be transmitted to the target server through the target interface and the response data can be returned, thereby avoiding the need to write docking code and achieving the technical effect of improving the efficiency of interface interaction, thereby solving the technical problem of low interaction efficiency caused by the need to develop docking code during the interface interaction process.
[0032] It should be noted that in the relevant technology, there are two forms of interface interaction: interfaces developed in the form of REST APIs and interfaces developed in the form of WEB SERVICEs. In industry applications, in order to improve the security of interface interaction, in the process of implementing interface interaction using the above two technologies, in addition to agreeing on the formats of request data and response data, a signature value and encryption and decryption mechanism with certain rules will be added to ensure the security of interface calls. Among them, interface interaction generally adopts request methods such as GET, POST, PUT, DELETE, and the formats of request data and response data generally adopt XML, JSON, INI and other formats. The signature mechanism generally sorts the request parameters and request headers passed by the interface according to certain rules to form a string, and then uses an algorithm agreed upon by both parties, such as MD5 and SHA256, to perform encryption and generate a signature value. Among them, the encryption and decryption mechanism generally adopts an algorithm agreed upon by both parties, such as symmetric encryption and decryption, asymmetric encryption and decryption, national encryption and decryption, and digital envelope encryption and decryption, to encrypt and decrypt data content.
[0033] In step S204, the first target format includes but is not limited to JSON format, XML format, INI format or other customized standard formats, and the interaction rules include but are not limited to: request protocol, domain name, interface address, request data format, request method and interface signature method.
[0034] Steps S202 to S206 are described below through a specific embodiment.
[0035] In an optional manner, the request data is converted into target data in a first target format required by the target interface based on the interface interaction rules, including: determining a mapping relationship between a first field in the request data and a second field in the response data; extracting the first target format from the interface interaction rules; converting the request data and the mapping relationship into the target data according to the first target format, wherein the data value of the target data is assembled in the form of a node path, wherein the preset characters in the node path are used to represent the hierarchical relationship between the target data fields.
[0036] Specifically, the request data assembler in the target engine is used to assemble the request data required by the target interface according to the specified specifications. Specifically, the encryptor is used to encrypt the request data and request data header using a specified encryption algorithm; the format assembler is used to assemble the request data using the first target format (XML, JSON, INI, or a custom format), and the node path is used to assemble the corresponding data value.
[0037] During the assembly process, matching is performed based on the mapping relationship between the data fields of the two parties in the interface interaction, and the structure assembly is completed according to the node path expression.
[0038] It should be noted that the above node path expression uses the preset character "." to represent the hierarchical relationship between fields. For example, "xyz" represents the z field under the y level under the x level.
[0039] Use the request header assembler: add custom request headers.
[0040] In some embodiments of the present application, after obtaining the target data, it is also necessary to determine the address information of the target interface from the interface interaction rules.
[0041] In actual application scenarios, the protocol setter in the target engine can be used to specify the interface request method; and the domain name setter can be used to specify the interface domain name.
[0042] The specific steps of processing the target data according to the requirements of the target interface to obtain the processed target data are as follows:
[0043] Determine the requirements of the target interface, where the requirements include at least one of the following: encrypting the target data, constructing a signature value for the data value corresponding to the target data, and generating an anti-replay value for the data value corresponding to the target data; extracting a corresponding processing method from the interface interaction rules according to the requirements of the target interface, processing the target data, and obtaining the processed target data.
[0044] In an optional manner, when the target interface requires encryption of the target data, an encryption rule is selected from the interaction rule to encrypt the target data, for example: utilizing the parameter sorter in the target engine: sorting the request data in ascending order, descending order of the specified field name, or in a custom manner and serializing the sorted request data into a string.
[0045] In the case that the target interface requires constructing a signature value for the data value corresponding to the target data, an encryption rule is selected from the interaction rule to encrypt the data value corresponding to the target data to obtain the corresponding signature value. For example, the request data body and the request data header are encrypted using a specified encryption algorithm to generate a signature value. An optional interface signature method is: after arranging the request data in ascending text dictionary order according to the data name, the data is concatenated into a string form of "a=xx&b=xx", and then MD5 encoding is used to generate a signature value, and the signature parameter is added to the parameter list as the signature value. Other different methods can also be used, which will not be repeated here.
[0046] When the target interface requires generating an anti-replay value for the data value corresponding to the target data, a target algorithm is selected from the interaction rule to generate a corresponding anti-replay value, for example, a UUID value, timestamp, snowflake ID or other algorithm is used to generate a unique value for anti-replay processing.
[0047] The processed target data is sent to the target interface through a preset action, and is transmitted to the target server through the target interface.
[0048] It should be noted that the preset actions include: GET, PUT, POST, DELETE and other actions.
[0049] Sending the response data to the source server according to the second target format in the interface interaction rules specifically includes: extracting the data value corresponding to the target data in the response data according to the mapping relationship, and completing the parsing of the response data in a node path manner; sending the parsed response data to the source server according to the second target format required by the source server in the interface interaction rules.
[0050] For example: using the format parser in the target engine: using XML, JSON, INI or a custom format to parse the response data, constructing a syntax tree, and using the node path to extract the corresponding data value; during the parsing process, matching will be performed based on the mapping relationship between the data fields of the two parties in the interface interaction, and the structure parsing will be completed according to the node path expression; the above node path expression uses "." to represent the hierarchical relationship between fields, for example: "xyz" represents the z field under the y level under the x level; using the decryptor in the target engine: using the specified decryption algorithm to decrypt the response data body and response data header; using the structure reconstructor in the target engine: encapsulate the obtained plaintext response data value into the second target format (XML, JSON, INI or a custom data structure) and return it.
[0051] It should be noted that multiple processors in the target engine can provide an extended method library, for example: Encryptor: corresponds to an encryption algorithm library, built-in: DES, AES, RSA, SM4, digital envelope encryption and decryption, and custom encryption algorithms; Decryptor: corresponds to a decryption algorithm library, built-in: DES, AES, RSA, SM4, digital envelope encryption and decryption, and custom decryption algorithms; Format Assembler: corresponds to a format assembly method, built-in: XML, JSON, INI, YML, and custom text format generation method; Signature Constructor: corresponds to a signature algorithm library, built-in: MD5, SHA256, and custom signature generation method.
[0052] Among them, the method in the method library corresponding to each processor is given a unique identifier, which is defined in the interface interaction rules and is used to match the corresponding processing logic.
[0053] The embodiment of the present application provides an interface interaction device, such as Figure 3 As shown, it includes: a receiving module 30, which is used for the target engine to receive the request information transmitted by the source server, and the request information at least includes: request data and interface interaction rules; a processing module 32, which is used to convert the request data into target data in the first target format required by the target interface based on the interface interaction rules, and process the target data according to the requirements of the target interface to obtain the processed target data, and send the processed target data to the target server through the target interface; a sending module 34, which is used to receive the response data returned by the target server, and send the response data to the source server according to the second target format in the interface interaction rules.
[0054] The processing module 32 includes: a conversion submodule, an address submodule and a processing submodule, wherein the conversion submodule is used to determine the mapping relationship between the first field in the request data and the second field in the response data; extract the first target format from the interface interaction rules; and convert the request data and the mapping relationship into the target data according to the first target format, wherein the data value of the target data is assembled in the form of a node path, wherein the preset characters in the node path are used to represent the hierarchical relationship between the target data fields.
[0055] The address submodule is used to determine the address information of the target interface from the interface interaction rule.
[0056] A processing submodule is used to determine the requirements of the target interface, where the requirements include at least one of the following: encrypting the target data, constructing a signature value for the data value corresponding to the target data, and generating an anti-replay value for the data value corresponding to the target data; extracting a corresponding processing method from the interface interaction rules according to the requirements of the target interface, processing the target data, and obtaining the processed target data.
[0057] The processing submodule includes: a processing unit and a sending unit. The processing unit is used to select an encryption rule from the interaction rules to encrypt the target data when the target interface requires that the target data be encrypted; select an encryption rule from the interaction rules to encrypt the data value corresponding to the target data to obtain a corresponding signature value when the target interface requires that a signature value be constructed for the data value corresponding to the target data; and select a target algorithm from the interaction rules to generate a corresponding anti-replay value when the target interface requires that an anti-replay value be generated for the data value corresponding to the target data.
[0058] The sending unit is used to send the processed target data to the target interface through a preset action, and transmit the processed target data to the target server through the target interface.
[0059] The response module 34 includes a response sub-module, which is used to extract the data value corresponding to the target data in the response data according to the mapping relationship, and complete the parsing of the response data in the form of a node path; and send the parsed response data to the source server in the second target format required by the source server in the interface interaction rules.
[0060] According to another aspect of the embodiments of the present application, a non-volatile storage medium is provided, in which a program is stored. When the program is running, the device where the non-volatile storage medium is located is controlled to execute the above-mentioned interface interaction method.
[0061] According to another aspect of the embodiments of the present application, a computer device is provided, including: a memory and a processor, the processor being configured to run a program stored in the memory, wherein the above-mentioned interface interaction method is executed when the program is run.
[0062] It should be noted that the various modules in the above-mentioned interface interaction device can be program modules (for example, a set of program instructions that implement a certain specific function) or hardware modules. For the latter, it can be expressed in the following forms, but is not limited to this: the expression form of each of the above-mentioned modules is a processor, or the functions of each of the above-mentioned modules are implemented by a processor.
[0063] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0064] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0065] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0066] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected to achieve the purpose of the present embodiment according to actual needs.
[0067] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0068] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0069] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. An interface interaction method, characterized in that: include: The target engine receives the request information transmitted by the source server, wherein the request information includes at least: request data and interface interaction rules; converting the request data into target data in a first target format required by the target interface based on the interface interaction rule, processing the target data according to the requirements of the target interface to obtain processed target data, and sending the processed target data to the target server through the target interface; receiving response data returned by the target server, and sending the response data to the source server according to the second target format in the interface interaction rule; The method includes converting the request data into target data in a first target format required by the target interface based on the interface interaction rule, including: determining a mapping relationship between a first field in the request data and a second field in the response data; extracting the first target format from the interface interaction rule; converting the request data and the mapping relationship into the target data according to the first target format, wherein data values of the target data are assembled in a node path manner, wherein preset characters in the node path are used to represent a hierarchical relationship between the fields of the target data; After obtaining the target data, the address information of the target interface is determined from the interface interaction rule.
2. The method according to claim 1, characterized in that Processing the target data according to the requirements of the target interface to obtain processed target data includes: Determining requirements of the target interface, the requirements of the target interface including at least one of the following: encrypting the target data, constructing a signature value for a data value corresponding to the target data, and generating an anti-replay value for a data value corresponding to the target data; A corresponding processing method is extracted from the interface interaction rules according to the requirements of the target interface, and the target data is processed to obtain the processed target data.
3. The method according to claim 2, characterized in that Extracting a corresponding processing method from the interface interaction rule according to the requirements of the target interface, processing the target data, and obtaining the processed target data, including: In a case where the target interface requires that the target data be encrypted, selecting an encryption rule from the interaction rules to encrypt the target data; In a case where the target interface requires constructing a signature value for the data value corresponding to the target data, an encryption rule is selected from the interaction rule to encrypt the data value corresponding to the target data to obtain a corresponding signature value; In a case where the target interface requires generating an anti-replay value for a data value corresponding to the target data, a target algorithm is selected from the interaction rule to generate a corresponding anti-replay value.
4. The method according to claim 2, characterized in that Sending the processed target data to the target server through the target interface includes: The processed target data is sent to the target interface through a preset action, and is transmitted to the target server through the target interface.
5. The method according to claim 1, wherein Sending the response data to the source server according to the second target format in the interface interaction rule includes: Extracting the data value corresponding to the target data in the response data according to the mapping relationship, and completing the parsing of the response data in a node path manner; The parsed response data is sent to the source server in the second target format required by the source server in the interface interaction rule.
6. An interface interaction device, characterized in that: include: A receiving module, configured for the target engine to receive request information transmitted by the source server, wherein the request information includes at least request data and interface interaction rules; a processing module, configured to convert the request data into target data in a first target format required by a target interface based on the interface interaction rule, process the target data according to the requirements of the target interface to obtain processed target data, and send the processed target data to a target server through the target interface; a response module, configured to receive response data returned by the target server, and send the response data to the source server according to the second target format in the interface interaction rule; The method includes converting the request data into target data in a first target format required by the target interface based on the interface interaction rule, including: determining a mapping relationship between a first field in the request data and a second field in the response data; extracting the first target format from the interface interaction rule; converting the request data and the mapping relationship into the target data according to the first target format, wherein data values of the target data are assembled in a node path manner, wherein preset characters in the node path are used to represent a hierarchical relationship between the fields of the target data; After obtaining the target data, the address information of the target interface is determined from the interface interaction rule.
7. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the interface interaction method according to any one of claims 1 to 5.
8. A computer device, characterized in that: include: A memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the interface interaction method according to any one of claims 1 to 5 is executed when the program is run.
Citation Information
Patent Citations
Data interaction method and device
CN107800552A