Interface calling method, device and system
By introducing converters and intermediate devices into the interface call system, the problem of low efficiency in existing interface calls is solved, and efficient interface calls between different trust domains are realized, thereby improving the security and efficiency of the system.
Patent Information
- Application Number
- CN202411045367.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2026-02-03
AI Technical Summary
The existing API call method requires writing scripts and manually transmitting them, resulting in low efficiency and failing to meet the needs of high-efficiency system security and business requirements.
By introducing a converter into the interface call system, interface calls between different trust domains can be realized using intermediate devices. The converter converts the interface call request or response data into a data format supported by the intermediate devices and transmits it between different trust domains through the intermediate devices, avoiding manual intervention.
It improves the efficiency of API calls, reduces manual operations, and enhances the efficiency and security of the system.
Smart Images

Figure CN121456033A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to an interface calling method, apparatus and system. Background Technology
[0002] With the continuous development of computer technology, companies are paying increasing attention to the security of their internal systems.
[0003] To meet both the company's internal system security requirements and the business or operational needs of other companies calling its internal system interfaces, common interface calling methods include: the caller writes a script to call the interface, and then manually provides the script to the callee; subsequently, the callee executes the script locally and obtains the execution result; finally, the callee manually provides the execution result to the caller, thereby enabling the caller to call the callee's interface.
[0004] However, the above method requires writing a script, and the script and its execution result need to be manually transmitted. Therefore, the execution efficiency of the above interface call method is low, thus reducing the efficiency of interface call. Summary of the Invention
[0005] This application provides an interface calling method, apparatus, and system that can improve the efficiency of interface calling.
[0006] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:
[0007] In a first aspect, embodiments of this application provide an interface invocation method. This method is applied to a converter deployed in an interface invocation system, which further includes an invocation device, an intermediate device, and a invoked device. The invocation device and the invoked device belong to different trust domains, and the intermediate device supports access from both the invocation device and the invoked device. The method includes: the converter obtaining first data to be processed from a device in the same trust domain; the first data to be processed includes a first interface invocation request, or a response to the first interface invocation request, the first interface invocation request being used to invoke an interface in the invoked device; the converter sending the first data to be processed to the intermediate device in a first data format, so that a device in another trust domain can obtain the first data to be processed from the intermediate device; wherein the first data format is a data format supported by the intermediate device.
[0008] In the above embodiments, the converter obtains first pending data, including a first interface call request or a response to the first interface call request, from a device in the same trust domain, and sends it to the intermediate device in a data format supported by the intermediate device (i.e., a first data format), so that the device in the trust domain can obtain the first pending data from the intermediate device. Therefore, when the first pending data is a first interface call request, the converter obtains the first interface call request from the calling device in the same trust domain, sends it to the intermediate device in the first data format, so that the called device can obtain the first interface call request from the intermediate device and respond to it. When the first data to be processed is the response to the first interface call request, the converter obtains the response to the first interface call request from the called device in the same trust domain and sends the response to the intermediate device in the form of a first data format, so that the calling device can obtain the response to the first interface call request from the intermediate device; thereby enabling the calling device to call the interface in the called device in different trust domains; since this process does not require manual access, but is implemented by the calling device through an intermediate device that supports access by both the calling device and the called device, the calling efficiency of the interface is improved.
[0009] In one possible implementation, the method further includes: the converter obtaining second data to be processed from an intermediate device sent by a device in another trust domain, the second data to be processed including a second interface call request in a first data format, or a response to the second interface call request in the first data format, the second interface call request being used to call an interface in the called device; the converter sending the second data to be processed, in the form of a second data format, to a device in the same trust domain for processing.
[0010] In the above embodiments, the converter obtains second data to be processed from an intermediate device, sent by a device in another trust domain. This second data to be processed includes a second interface call request in a first data format, or a response to the second interface call request in a first data format. The second interface call request is used to call an interface in the called device. The converter then sends the second data to be processed, in the second data format, to a device in the same trust domain for processing. Therefore, when the second data to be processed is a second interface call request, the converter is a second converter. In this case, the second converter sends the second interface call request obtained from the intermediate device to the called device, so that the called device responds to the second interface call request and calls its interface. When the second data to be processed is a response to the second interface call request, the converter is the first converter. In this case, the first converter obtains the response of the called device to the second interface call request from the intermediate device and sends the response to the calling device to enable the calling device to call the interface in the called device. Since this process does not require manual access, but is implemented by the calling device through an intermediate device that supports access by both the calling device and the called device, the calling efficiency of the interface is improved.
[0011] In one possible implementation, the converter includes a first converter belonging to the same trust domain as the calling device, and the first data to be processed is a first interface call request. The converter obtains the first data to be processed from the device in the same trust domain, including: the first converter obtaining the first interface call request from the calling device; the converter sends the first data to be processed to an intermediate device in a first data format so that the device in another trust domain can obtain the first data to be processed from the intermediate device, including: the first converter sending the first interface call request to the intermediate device in a first data format so that the device in another trust domain can obtain the first interface call request from the intermediate device.
[0012] In one possible implementation, the converter includes a second converter belonging to the same trust domain as the called device, and the first data to be processed is a response to a first interface call request. The converter obtains the first data to be processed from the device in the same trust domain, including: the second converter obtaining the response to the first interface call request from the called device; the converter sends the first data to be processed to an intermediate device in a first data format, so that a device in another trust domain can obtain a response to the first data to be processed from the intermediate device, including: the second converter sending the response to the first interface call request to the intermediate device in a first data format, so that a device in another trust domain can obtain a response to the first interface call request from the intermediate device.
[0013] In the above embodiments, a first converter converts the first interface call request into a first data format supported by an intermediate device, and stores the converted first interface call request in an intermediate device accessible to both the calling device and the called device. Then, a second converter retrieves the first interface call request from the intermediate device and sends it to the called device in the form of a request message. This causes the called device to send a response to the first interface call request to the second converter. The second converter then sends the response to the first interface call request to the intermediate device in the first data format. The first converter retrieves this response from the intermediate device and sends it to the calling device in the form of a response message, thereby enabling the calling device to invoke the interface in the called device. Since this process does not require manual intervention, but rather the calling device invokes the interface in the called device through an intermediate device accessible to both the calling device and the called device, the efficiency of interface invocation is improved.
[0014] In one possible implementation, the converter includes a first converter, which belongs to the same trust domain as the calling device, and the second data to be processed is the response to the second interface call request. The converter obtains the second data to be processed sent by a device in another trust domain from an intermediate device, including: the first converter obtaining the response to the second interface call request in a first data format from the intermediate device; the converter sends the second data to be processed to a device in the same trust domain for processing, including: the first converter sending the response to the second interface call request to the calling device in the form of a response message; the second data format includes: the form of a response message.
[0015] In one possible implementation, the converter includes a second converter belonging to the same trust domain as the called device, and the second data to be processed is a second interface call request. The converter obtains the second data to be processed sent by a device in another trust domain from an intermediate device, including: the second converter obtaining the second interface call request in a first data format from the intermediate device; the converter sends the second data to be processed to a device in the same trust domain for processing, including: the second converter sending the second interface call request in the form of a request message to the called device, so that the called device responds to the second interface call.
[0016] In one possible implementation, the aforementioned intermediate devices include: a mail server, a database server, a file storage server, or a message queue server; wherein the file storage server includes an OBS storage server and a cloud storage server.
[0017] In one possible implementation, when the intermediate device is a mail server, the intermediate device includes a first server and a second server, which are connected in communication, and the first data format is text format. When the first data to be processed is a first interface call request, the converter includes a first converter, which belongs to the same trust domain as the calling device. The converter sends the first data to be processed to the intermediate device in the first data format, so that a device in another trust domain can obtain the first data to be processed from the intermediate device. This includes: the first converter sending the first interface call request to the first server in text format; and the first server sending the first interface call request via email. The first interface call request is sent to a second server so that a device in another trust domain can obtain the first interface call request from the second server. If the first data to be processed is a response to the first interface call request, the converter includes a second converter, which belongs to the same trust domain as the called device. The converter sends the first data to be processed to an intermediate device in a first data format so that a device in another trust domain can obtain the first data to be processed from the intermediate device. This includes: the second converter sending the response to the first interface call request to the second server in the aforementioned text format; the second server is used to send the response to the first interface call request to the first server via email so that the calling device can obtain the response to the first interface call request from the first server.
[0018] In the above embodiment, the first converter sends the first interface call request sent by the calling device in text format to a first server in the mail server. The first server then sends an email containing the first interface call request to a second server in the mail server, so that the second converter can obtain the first interface call request from the email in the second server and send it to the called device in the form of a request message. The called device responds to the first interface call request and sends the response to the first interface call request to the second converter. The second converter then sends the response to the first interface call request to the first server via the second server in the form of an email. This allows the first converter to obtain the response to the first interface call request from the first server and send it to the calling device in the form of a response message, thereby enabling the calling device to call the interface in the called device. It is evident that the above embodiment allows the calling device and the backup calling device to interact via email through a mail server, without requiring manual intervention, thus improving the efficiency of interface calls.
[0019] Secondly, embodiments of this application provide an interface invocation method applied to an interface invocation system. The interface invocation system includes: an invocation device, a first converter, an intermediate device, a second converter, and a invoked device; wherein the invocation device and the first converter belong to the same trust domain, and the invoked device and the second converter belong to the same trust domain; the invocation device and the invoked device belong to different trust domains, and the intermediate device supports access to both the invocation device and the invoked device; the method includes: the invocation device sending a first interface invocation request; the first interface invocation request being used to invoke an interface in the invoked device; the first converter receiving the first interface invocation request from the invocation device and sending the first interface invocation request to the intermediate device in a first data format; the second converter obtaining the first interface invocation request in the first data format from the intermediate device and sending the first interface invocation request to the invoked device in the form of a request message; and the invoked device receiving the first interface invocation request from the second converter, invoking the interface, and responding to the first interface invocation request.
[0020] The interface invocation method provided in the above embodiments is applied to an interface invocation system, which includes: an invocation device, a first converter, an intermediate device, a second converter, and a called device; wherein, the invocation device and the first converter belong to the same trust domain, and the called device and the second converter belong to the same trust domain; the invocation device and the called device belong to different trust domains, and the intermediate device supports access to the invocation device and the called device; after the invocation device sends a first interface invocation request, the first converter receives the first interface invocation request, converts the request into a first data format supported by the intermediate device, and sends it to the intermediate device; then, the second converter obtains the first interface invocation request in the first data format from the intermediate device, and sends the first interface invocation request to the called device in the form of a request message, thereby realizing the invocation of the interface in the called device; since this process does not require manual access, but is implemented by the invocation device through an intermediate device that supports access by both the invocation device and the called device, the efficiency of interface invocation is improved.
[0021] In one possible implementation, the method further includes: the called device sending a response to the first interface call request; the second converter sending the response to the first interface call request to an intermediate device in the form of a first data format; the first converter obtaining the response to the first interface call request in the first data format from the intermediate device; the first converter sending the response to the first interface call request to the calling device in the form of a response message; and the calling device obtaining the response to the first interface call request in the form of a response message from the first converter.
[0022] In the above embodiment, after the interface in the called device is invoked, the second converter sends the response to the first interface call request sent by the called device to the intermediate device in the form of a first data format. Then, the first converter obtains the response to the first interface call request in the first data format from the intermediate device. The first converter sends the response to the first interface call request to the calling device in the form of a response message, thereby realizing the return of response information. Since this process does not require manual intervention, but is implemented by the calling device through an intermediate device that supports access by both the calling device and the called device, the return of response information for the call to the interface in the called device is achieved, thus improving the efficiency of interface invocation.
[0023] Thirdly, embodiments of this application provide an interface invocation device deployed in a converter, which is deployed in an interface invocation system. The interface invocation system further includes an invocation device, an intermediate device, and a invoked device. The invocation device and the invoked device belong to different trust domains, and the intermediate device supports access from both the invocation device and the invoked device. The converter includes a receiving unit and a sending unit. The receiving unit is used to obtain first data to be processed from a device in the same trust domain. The first data to be processed includes a first interface invocation request, or a response to the first interface invocation request, which is used to invoke an interface in the invoked device. The sending unit is used to send the first data to be processed to the intermediate device in a first data format, so that a device in another trust domain can obtain the first data to be processed from the intermediate device. The first data format is a data format supported by the intermediate device.
[0024] Fourthly, embodiments of this application provide an interface invocation system, which includes: an invocation device, a first converter, an intermediate device, a second converter, and a invoked device; wherein the invocation device and the first converter belong to the same trust domain, and the invoked device and the second converter belong to the same trust domain; the invocation device and the invoked device belong to different trust domains, and the intermediate device supports access to both the invocation device and the invoked device; the system includes: an invocation device, used to send a first interface invocation request; the first interface invocation request is used to invoke an interface in the invoked device; a first converter, used to receive the first interface invocation request from the invocation device, and send the first interface invocation request to the intermediate device in the form of a first data format; a second converter, used to obtain the first interface invocation request in the first data format from the intermediate device, and send the first interface invocation request to the invoked device in the form of a request message; and an invoked device, used to receive the first interface invocation request from the second converter, invoke an interface, and respond to the first interface invocation request.
[0025] Fifthly, embodiments of this application provide a computing device including a memory and at least one processor connected to the memory. The memory is used to store computer program code, which includes computer instructions. When the computer instructions are executed by the at least one processor, the computing device performs the method described in any one of the first aspect, the second aspect, and their possible implementations.
[0026] In a sixth aspect, embodiments of this application provide a computer-readable storage medium storing computer instructions, which, when executed on a computer, perform any one of the methods of the first aspect, the second aspect, and their possible implementations.
[0027] In a seventh aspect, embodiments of this application provide a computer program product comprising computer instructions that, when executed on a computer, perform the method described in any one of the first aspect, the second aspect, and their possible implementations.
[0028] It should be understood that the beneficial effects of the third to the other aspects of the technical solutions and the corresponding possible implementations of this application can be found in the above description of the technical effects of the first aspect, the second aspect and the corresponding possible implementations, and will not be repeated here. Attached Figure Description
[0029] Figure 1 A schematic diagram of an interface call system provided in an embodiment of this application;
[0030] Figure 2 A hardware schematic diagram of a computing device provided in an embodiment of this application;
[0031] Figure 3 A flowchart illustrating an interface calling method provided in this application embodiment. Figure 1 ;
[0032] Figure 4 A flowchart illustrating an interface calling method provided in this application embodiment. Figure 2 ;
[0033] Figure 5 A flowchart illustrating an interface calling method provided in this application embodiment. Figure 3 ;
[0034] Figure 6 A text data illustration provided for an embodiment of this application. Figure 1 ;
[0035] Figure 7 This application provides a schematic diagram of data storage for an OBS storage server.
[0036] Figure 8A text data illustration provided for an embodiment of this application. Figure 2 ;
[0037] Figure 9 This is a schematic diagram of another OBS storage server data storage provided in an embodiment of this application;
[0038] Figure 10 A flowchart illustrating an interface calling method provided in this application embodiment. Figure 4 ;
[0039] Figure 11 A text data illustration provided for an embodiment of this application. Figure 3 ;
[0040] Figure 12 An illustration of an email including file data provided in an embodiment of this application;
[0041] Figure 13 A text data illustration provided for an embodiment of this application. Figure 4 ;
[0042] Figure 14 This is a schematic diagram of an interface calling device provided in an embodiment of this application. Detailed Implementation
[0043] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0044] The terms "first" and "second," etc., used in the specification and claims of this application are used to distinguish different objects, not to describe a specific order of objects. For example, "first interface call request" and "second interface call request" are used to distinguish different interface call requests, not to describe a specific order of interface call requests.
[0045] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0046] First, some concepts involved in the interface calling method, query device, processor, and computing device provided in the embodiments of this application will be explained as follows:
[0047] Trust domain: refers to the set of devices within an organization that can access each other under a set of common security policies; that is, devices in the same trust domain can access each other, while devices in different trust domains cannot access each other.
[0048] A common approach to resolving interface call issues between devices in different trust domains is for the caller to write a script to invoke the interface; then, manually provide the script to the callee; subsequently, the callee executes the script locally and obtains the execution result; finally, the callee manually transmits the execution result to the caller, thereby enabling the caller to invoke the callee's interface.
[0049] As can be seen, the above method requires manual transmission of the script and its execution result. In this case, if the interface of the callee changes, the caller needs to update the script and manually transmit the updated script to the callee. The whole process requires constant manual intervention and is quite cumbersome, thus reducing the efficiency of the interface call.
[0050] In view of this, embodiments of this application provide an interface invocation method. In this method, the invoking device sends an interface invocation request to an intermediate device for invoking an interface in the called device. The intermediate device is a device that supports access to both the invoking device and the called device. Then, the called device obtains and responds to the interface invocation request from the intermediate device, invoking its interface; thus, the invoking device invokes the interface in the called device. It is evident that the above method does not require manual intervention; instead, the invoking device invokes the interface in the called device through an intermediate device; therefore, the efficiency of interface invocation is improved.
[0051] In some embodiments, this application provides an interface invocation method. The method is applied to a converter deployed in an interface invocation system, which further includes an invoking device, an intermediate device, and a invoked device. The invoking device and the invoked device belong to different trust domains, and the intermediate device supports access to both the invoking device and the invoked device. The method includes: the converter obtaining first data to be processed from a device in the same trust domain; the first data to be processed includes a first interface invocation request, or a response to the first interface invocation request, the first interface invocation request being used to invoke an interface in the invoked device; the converter sending the first data to be processed to the intermediate device in a first data format, so that a device in another trust domain can obtain the first data to be processed from the intermediate device; wherein the first data format is a data format supported by the intermediate device.
[0052] In the above embodiments, the converter obtains first pending data, including a first interface call request or a response to the first interface call request, from a device in the same trust domain, and sends it to the intermediate device in a data format supported by the intermediate device (i.e., a first data format), so that the device in the trust domain can obtain the first pending data from the intermediate device. Therefore, when the first pending data is a first interface call request, the converter obtains the first interface call request from the calling device in the same trust domain, sends it to the intermediate device in the first data format, so that the called device can obtain the first interface call request from the intermediate device and respond to it. When the first data to be processed is the response to the first interface call request, the converter obtains the response to the first interface call request from the called device in the same trust domain and sends the response to the intermediate device in the form of a first data format, so that the calling device can obtain the response to the first interface call request from the intermediate device; thereby enabling the calling device to call the interface in the called device in different trust domains; since this process does not require manual access, but is implemented by the calling device through an intermediate device that supports access by both the calling device and the called device, the calling efficiency of the interface is improved.
[0053] The interface calling method provided in this application embodiment is applied to... Figure 1 The interface invocation system shown includes an invoking device, a first converter, an intermediate device, a second converter, and a called device; wherein the invoking device and the first converter belong to trust domain A, and the called device and the second converter belong to trust domain B, and the invoking device and the called device belong to different trust domains.
[0054] The aforementioned calling device is used to send an interface call request to call an interface (e.g., interface A) in the called device; the first converter is used to send the interface call request to the intermediate device in a data format supported by the intermediate device (hereinafter referred to as: the first data format). The aforementioned second converter is used to obtain the interface call request in the first data format from the intermediate device and send the interface call request to the called device in the form of a request message. The called device is used to respond to the interface call request and call interface A on its device.
[0055] The called device is also used to send the execution result of the called interface A (i.e., the response to the interface call request) to the calling device in the form of a response message; the second converter is used to send the response to the interface call request to the intermediate device in the form of a first data format. The first converter is used to obtain the response to the interface call request in the first data format from the intermediate device; and send the response to the interface call request to the calling device in the form of a response message, thereby realizing the calling device's call to the interface in the called device.
[0056] The aforementioned calling device and called device can be servers, such as central servers, edge servers, or local servers in a local data center; similarly, the aforementioned calling device and called device can also be devices such as virtual servers implemented with cloud technology. In some embodiments, the aforementioned calling device and called device can also be computing devices with transceiver functions, such as desktop computers, laptops, or smartphones.
[0057] The aforementioned converters (i.e., the first converter and the second converter) can be computing devices with sending and receiving capabilities and data format conversion capabilities, such as servers, desktop computers, cloud servers, and mobile phones.
[0058] The aforementioned intermediate devices can be computing devices with data caching functions, such as mail servers, database servers, object storage service (OBS) storage servers, cloud storage servers, and message queue servers.
[0059] Optionally, in one implementation, the first converter described above may be a unit module integrated in the calling device; similarly, the second converter may also be a unit module integrated in the called device.
[0060] For example, Figure 2 This is a schematic diagram of a hardware structure for a computing device, comprising the aforementioned converters (i.e., the first converter and the second converter). The computing device may include a processor 101, a memory 102, and a communication interface 103. The processor 101, memory 102, and communication interface 103 can be connected via a bus 104 or other means.
[0061] Processor 101 includes one or more CPUs. The CPU can be a single-core CPU or a multi-core CPU. Optionally, processor 101 may also include a graphics processing unit (GPU), a field-programmable gate array (FPGA), an application-specific integrated circuit (ASIC), etc.
[0062] The processor 101 is used to receive from the communication interface 103 an interface call request or an interface call request response sent by a device in the same trust domain; and then, to send the interface call request or the interface call request response to the intermediate device through the communication interface 103 in the form of a data format supported by the intermediate device.
[0063] The memory 102 includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical memory, magnetic disk storage media, or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer. In this embodiment, the memory 102 may store computer instructions and operating system information.
[0064] In one possible implementation, the memory 102 may exist independently of the processor 101. The memory 102 can be connected to the processor 101 via a bus 104 and is used to store data, instructions, or program code. When the processor 101 calls and executes the instructions or program code stored in the memory 102, it can implement the relevant steps in the interface calling method provided in the embodiments of this application.
[0065] In another possible implementation, the memory 102 can also be integrated with the processor 101.
[0066] The communication interface 103 can be a transceiver module used to communicate with other devices or communication networks, such as Ethernet, RAN, wireless local area networks (WLAN), etc. The communication interface 103 can receive commands, messages, or data. The transceiver module can be a transceiver or a similar device.
[0067] Optionally, the communication interface 103 can also be a transceiver circuit located within the processor 101, used to implement signal input and signal output of the processor 101, such as acquiring interface call requests and outputting responses to interface call requests. The communication interface 103 can be a wired interface (port), such as a fiber distributed data interface (FDDI) or a gigabit Ethernet (GE) interface, or the communication interface 103 can also be a wireless interface.
[0068] Bus 104 can be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. The bus can also be divided into serial bus and parallel bus. For ease of representation, Figure 2 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0069] It should be understood that, Figure 2 The computing device mentioned is merely one example of a computing device; it can have more than Figure 2 The more or fewer components shown can be combined into two or more components, or they can have different component configurations. For example, a computing device can also include a smart network card, such as a data processing unit (DPU).
[0070] It should be noted that the system architecture and application scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0071] The interface calling method provided in the embodiments of this application is applied to Figure 1 The interface call system shown can be a converter, wherein the converter can be... Figure 1 The interface shown can call the first converter in the system, which can also be used as... Figure 1 The interface shown calls the second converter in the system; as... Figure 3 As shown, the method includes: S110-S120.
[0072] S110, The converter obtains the first data to be processed from a device in the same trust domain.
[0073] The aforementioned first data to be processed includes a first interface call request, or a response to the first interface call request; wherein, the first interface call request is used to call... Figure 1 The interface shown is used to call the interface (e.g., the first interface) of the called device in the system.
[0074] Specifically, in the above converter, Figure 1In the case of the first converter in the interface call system shown, the calling device in the same trust domain is... Figure 1 In the context of the calling device, the first data to be processed is the first interface call request.
[0075] Based on this, the above-mentioned S110 is implemented as follows: the first converter receives the first interface call request from the calling device in the same trust domain; that is, the first interface call request is a request sent by the calling device.
[0076] The above converter is Figure 1 In the case of the interface calling the second converter in the system, the devices in the same trust domain mentioned above are... Figure 1 The called device in the above-mentioned first data to be processed is the response to the first interface call request.
[0077] Based on this, the above-mentioned S110 is implemented as follows: the second converter receives the response of the first interface call request from the called device in the same trust domain; wherein, the response is the execution result of calling the first interface in the called device, that is, the response of the first interface call request is the execution result of the called device calling the first interface on it in response to the above-mentioned first interface call request.
[0078] S120, The converter sends the first data to be processed to the intermediate device in the form of a first data format, so that the device in another trusted domain can obtain the first data to be processed from the intermediate device.
[0079] It should be noted that the first data format mentioned above is a data format supported by the intermediate device; wherein, the intermediate device supports access to both the calling device and the called device.
[0080] The aforementioned intermediate equipment includes servers with caching capabilities, such as mail servers, database servers, file storage servers, or message queue servers. Database services include servers running relational or non-relational databases, such as MySQL servers, Redis servers, and MongoDB servers. File storage servers include servers capable of storing files, such as OBS storage servers and cloud storage servers. Message queue servers include servers with message caching capabilities, such as Kafka servers, ActiveMQ servers, and RabbitMQ servers.
[0081] For example, when the intermediate device is a mail server, the first data format is a text format; when the intermediate device is a Redis server, the first data format is a key-value format; when the intermediate device is a file storage server, the first data format is a JavaScript key-value pair data (JSON), Extensible Markup Language (XML), or another markup language (YAML ain't markup language); when the intermediate device is a message queue server, the first data format is a JSON data format.
[0082] In the case where the aforementioned converter is the first converter, the aforementioned first data to be processed is a first interface call request, and the aforementioned device in the other trust domain is... Figure 1 The device being invoked in the context of the system.
[0083] Based on this, the above-mentioned S120 is implemented as follows: the first converter converts the first interface call request in the request message format into the form of a first data format, and sends the converted first interface call request to the intermediate device; so that the second converter obtains the first interface call request in the first data format from the intermediate device, converts the first interface call request into the form of a request message, sends it to the called device, and then causes the called device to respond to the first interface call request and call its first interface.
[0084] In the case where the aforementioned converter is the second converter, the aforementioned first data to be processed is a response to the first interface call request, and the aforementioned device in the other trust domain is... Figure 1 The device to be invoked in the process.
[0085] Based on this, the above-mentioned S120 is implemented as follows: the second converter converts the response of the first interface call request in the response message format into the form of the first data format, and sends the converted response of the first interface call request to the intermediate device; so that the first converter obtains the response of the first interface call request in the first data format from the intermediate device, converts the response into the format of the response message, and sends it to the calling device, thereby enabling the calling device to obtain the execution result of calling the first interface in the called device.
[0086] In the above embodiments, the converter obtains first pending data, including a first interface call request or a response to the first interface call request, from a device in the same trust domain, and sends it to the intermediate device in a data format supported by the intermediate device (i.e., a first data format), so that the device in the trust domain can obtain the first pending data from the intermediate device. Therefore, when the first pending data is a first interface call request, the converter obtains the first interface call request from the calling device in the same trust domain, sends it to the intermediate device in the first data format, so that the called device can obtain the first interface call request from the intermediate device and respond to it. When the first data to be processed is the response to the first interface call request, the converter obtains the response to the first interface call request from the called device in the same trust domain and sends the response to the intermediate device in the form of a first data format, so that the calling device can obtain the response to the first interface call request from the intermediate device; thereby enabling the calling device to call the interface in the called device in different trust domains; since this process does not require manual access, but is implemented by the calling device through an intermediate device that supports access by both the calling device and the called device, the calling efficiency of the interface is improved.
[0087] Based on Figure 3 Based on the interface call method shown (i.e., after the converter sends the first data to be processed to the intermediate device), the above method also includes, as Figure 4 S210-S220 are shown.
[0088] S210, The converter obtains the second data to be processed sent by the device in another trusted domain from the intermediate device.
[0089] The aforementioned second data to be processed includes: a second interface call request in a first data format, or a response to the second interface call request in a first data format; wherein, the second interface call request is used to call an interface (e.g., a second interface) in the called device, and the response to the second interface call request is that the called device responds to the aforementioned second interface call request by calling the execution result of the second interface on its device.
[0090] It should be noted that the above-mentioned second interface call request may be the same as or different from the above-mentioned first interface call request. The specific embodiments of this application do not limit it.
[0091] In the case where the second data to be processed is a second interface call request, the converter is the second converter, and the devices in the other trust domains are... Figure 1 The device to be invoked in the process.
[0092] Based on this, the above-mentioned S210 is implemented as follows: the second converter obtains a second interface call request in a first data format from the intermediate device; wherein, the second interface call request is a request sent by the calling device to the intermediate device through the first converter.
[0093] If the second data to be processed is a response to the second interface call request, then the converter is the first converter; in this case, the devices in the other trust domains are... Figure 1 The device being invoked in the context of the system.
[0094] Based on this, the above-mentioned S210 is implemented as follows: the first converter obtains the response of the second interface call request in the first data format from the intermediate device; wherein, the response of the second interface call request is that the called device responds to the second interface call request sent by the calling device and sends the execution result of the second interface on it to the intermediate device through the second converter.
[0095] S220: The converter sends the second data to be processed, in the form of a second data format, to a device in the same trust domain for processing.
[0096] In the case where the second data to be processed is a second interface call request, the converter is the second converter, and consequently, the device in the same trust domain is... Figure 1 The device being invoked in the context of the system.
[0097] Based on this, the above-mentioned S220 is implemented as follows: the second converter converts the second interface call request in the first data format obtained from the intermediate device into the form of a request message, and sends the converted second interface call request to the called device; so that the called device responds to the second interface call request and calls the second interface on it; wherein, the second interface is the interface to be called indicated by the second interface call request, and the above-mentioned second data format includes the form of a request message.
[0098] If the second data to be processed is a response to the second interface call request, then the converter is the first converter, and subsequently, the devices in the same trust domain are... Figure 1 The device to be invoked in the process.
[0099] Based on this, the above-mentioned S220 is implemented as follows: the first converter converts the response of the second interface call request in the first data format obtained from the intermediate device into the form of a response message, and sends the converted response of the second interface call request to the calling device, so that the calling device can obtain the execution result of calling the second interface in the called device.
[0100] In the above embodiments, the converter obtains second data to be processed from an intermediate device, sent by a device in another trust domain. This second data to be processed includes a second interface call request in a first data format, or a response to the second interface call request in a first data format. The second interface call request is used to call an interface in the called device. The converter then sends the second data to be processed, in the second data format, to a device in the same trust domain for processing. Therefore, when the second data to be processed is a second interface call request, the converter is a second converter. In this case, the second converter sends the second interface call request obtained from the intermediate device to the called device, so that the called device responds to the second interface call request and calls its interface. When the second data to be processed is a response to the second interface call request, the converter is the first converter. In this case, the first converter obtains the response of the called device to the second interface call request from the intermediate device and sends the response to the calling device to enable the calling device to call the interface in the called device. Since this process does not require manual access, but is implemented by the calling device through an intermediate device that supports access by both the calling device and the called device, the calling efficiency of the interface is improved.
[0101] based on Figure 3 or Figure 4 The method shown in this application provides a specific implementation method, which is applied to... Figure 1 The interface shown is used to call the system; such as Figure 5 As shown, the method includes: S310-S380.
[0102] It should be noted that the interface call request in this application embodiment can be either the first interface call request or the second interface call request mentioned above. For ease of description, this application embodiment will use the first interface call request as an example for explanation, and will not be repeated hereafter.
[0103] S310, The first converter obtains the first interface call request from the calling device.
[0104] The aforementioned first interface call request is sent by the calling device to call the first interface in the called device. The data format of the first interface call request is the data format of the request message; wherein, the first interface is any interface in the called device.
[0105] The above-mentioned S310 is implemented as follows: the calling device sends the above-mentioned first interface call request, and correspondingly, the first converter receives the first interface call request from the calling device.
[0106] S320, the first converter sends the first interface call request to the intermediate device in the form of a first data format.
[0107] The first data format mentioned above is a data format supported by the intermediate device. For a detailed description of the first data format, please refer to the relevant description of S120 above, which will not be repeated here.
[0108] The aforementioned intermediate device is used to store the aforementioned first interface call request.
[0109] For example, assuming the aforementioned intermediate device is an OBS storage server, and the aforementioned first interface call request is a Hypertext Transfer Protocol (HTTP) request message for querying data, "GET https: / / test.example.com / v1 / test"; then, the first converter will convert this request message form of the first interface call request into... Figure 6 The text A shown includes the following information: "GET https: / / test.example.com / v1 / test HTTP / 1.1", "Host:test.example.com", "Cookie:locale=zh-cn", and "Accept:application / json". "HTTP / 1.1" indicates the version number of the HTTP protocol on which the first interface call request is based; "Host:test.example.com" indicates the address of the called device; "Cookie:locale=zh-cn" indicates the locale of the current request; and "Accept:application / json" indicates that the return value of the request is of type application / json.
[0110] Then, the first converter sends the text A to the OBS storage server, so that the OBS storage server can use it as follows: Figure 7 The text A is stored in the form of "
[00001] [request]Query Data" in the OBS storage server. Specifically, the title of the text A stored in the OBS storage server is "
[00001] [request]Query Data". Here, "00001" is the identifier of the text A used to describe the first interface call request in the OBS storage server; "request" indicates that the file content of text A is used to describe the information of the request message; and query data is used to indicate the purpose or function of the above-mentioned first interface call request.
[0111] S330, the second converter obtains the first interface call request from the intermediate device.
[0112] It should be understood that the first interface call request mentioned above is stored in the intermediate device in the form of a first data format. Therefore, the data format of the first interface call request obtained by the second converter from the intermediate device is the first data format. That is, the implementation of S330 is as follows: the second converter obtains the first interface call request in the first data format from the intermediate device.
[0113] It should be noted that the second converter may actively obtain the first interface call request from the intermediate device, or the intermediate device may send a notification message to the second converter, and the second converter may respond to the notification message and read the first interface call request from the intermediate device; or the intermediate device (e.g., the intermediate device is a mail server) may send the first interface call request to the second converter. The specific implementation of S330 in this application embodiment is not limited.
[0114] For example, based on the example in S320 above, the second converter obtains the file content in text A with the storage title "
[00001] [request] Query Data" from the OBS storage server; the file content is used to describe the first interface call request mentioned above.
[0115] It should be understood that when there are multiple interface call requests in the intermediate device, the second converter obtains the interface call requests that have not been sent to the called device (i.e., the interface call requests that have not been consumed) from these multiple interface call requests.
[0116] It should be noted that although the second converter obtained the first interface call request from the intermediate device, the data format of the first interface call request is a first data format (e.g., text format). Therefore, if the second converter directly sends the text format first interface call request (e.g., text A in the example) to the called device, the called device will not recognize the text format first interface call request as a request that needs to be responded to, but will only recognize it as text, so it will not call the first interface in response to the request. Based on this, the second converter needs to execute the following S340.
[0117] S340, the second converter sends the first interface call request to the called device in the form of a request message.
[0118] The above-mentioned S340 is implemented as follows: the second converter converts the first interface call request in the first data format into the form of a request message, and sends the converted first interface call request to the called device; correspondingly, the called device receives the first interface call from the second converter.
[0119] For example, based on the example in S330 above, the second converter obtains the file content in text A and generates a first interface call request of the HTTP protocol based on the file content; then, the second converter sends the first interface call request of the HTTP protocol to the called device.
[0120] S350, the called device responds to the first interface call request and sends the response to the first interface call request to the second converter.
[0121] It should be noted that after receiving the first interface call request, the called device calls the interface indicated by the first interface call request (i.e., the first interface) to respond to the first interface call request.
[0122] The response to the aforementioned first interface call request is the execution result of calling the first interface in the called device; that is, the response to the aforementioned first interface call request is the return result after calling the first interface in the called device; wherein, the response to the first interface call request is in the form of a response message.
[0123] The above-mentioned S350 is implemented as follows: the called device responds to the above-mentioned first interface call request, calls the first interface on it, and sends the return result of the call to the first interface to the second converter.
[0124] S360 and the second converter send the response to the first interface call request to the intermediate device in the form of a first data format.
[0125] The above-mentioned S360 is implemented as follows: the second converter converts the response of the first interface call request in the form of a response message into the form of a first data format (e.g., text format); and sends the response of the first interface call request in the first data format to the intermediate device so that the intermediate device stores the response of the first interface call request.
[0126] For example, assuming the response to the first interface call request is an HTTP protocol response message, and the data content in the response is "success"; then, the second converter converts the response message into text format (i.e., the first data format), such as... Figure 8 As shown, the text is text B, which contains the following information: "HTTP / 1.1 200" (indicating the version number of the HTTP protocol on which the response message is based), "Content-Type: application / json" (indicating the type of returned data), "Content-Length: 18" (indicating the length of the returned content), and ""data":"success" (indicating that the returned data was successful).
[0127] Then, the second converter sends text B to the OBS storage server, so that the OBS storage server can... Figure 9 As shown, the text B is stored with the title "
[00001] [responseset]Query Data".
[0128] S370, the first converter obtains the response to the first interface call request from the intermediate device.
[0129] S380, the first converter sends the response to the first interface call request to the calling device in the form of a response message.
[0130] It should be noted that the implementation methods of S370-S380 are similar to those of S330-S340. For a detailed description of S370-S380, please refer to the relevant descriptions of S330-S340 above. They will not be repeated here.
[0131] In step S380 above, the first converter sends the response to the first interface call request to the calling device in the form of a response message; correspondingly, the calling device obtains the response to the first interface call request in the form of a response message from the first converter.
[0132] In the above embodiments, a first converter converts the first interface call request into a first data format supported by an intermediate device, and stores the converted first interface call request in an intermediate device accessible to both the calling device and the called device. Then, a second converter retrieves the first interface call request from the intermediate device and sends it to the called device in the form of a request message. This causes the called device to send a response to the first interface call request to the second converter. The second converter then sends the response to the first interface call request to the intermediate device in the first data format. The first converter retrieves this response from the intermediate device and sends it to the calling device in the form of a response message, thereby enabling the calling device to invoke the interface in the called device. Since this process does not require manual intervention, but rather the calling device invokes the interface in the called device through an intermediate device accessible to both the calling device and the called device, the efficiency of interface invocation is improved.
[0133] In the case where the aforementioned intermediate device is a mail server, the mail server includes: a first server and a second server, in which case, based on Figure 5 The method shown in the embodiments of this application provides another implementation method, such as... Figure 10 As shown, the method includes: S410-S490.
[0134] S410, The first converter obtains the first interface call request from the calling device.
[0135] It should be noted that the implementation of S410 is similar to that of S310. For a detailed description of S410, please refer to the relevant description of S310 above. It will not be repeated here.
[0136] S420: The first converter sends the first interface call request to the first server in text format.
[0137] It should be noted that the first server mentioned above is the email server used by the device or user within the trust domain (e.g., trust domain A) where the first converter is located. In other words, when an email needs to be sent from trust domain A, the content to be sent must first be uploaded to the first server, and then the first server sends the email containing the content to be sent. Similarly, the second server mentioned above is the email server used by the device or user within the trust domain (e.g., trust domain B) where the second converter is located.
[0138] The above-mentioned implementation of S420 includes: S421-S422.
[0139] S421, The first converter converts the first interface call request in the form of a request message into the first interface call request in the form of a text message.
[0140] The first interface call request in the above text format includes: text content and target email address; wherein, the text content is used to describe the first interface call request; the target email address is the address of the email server used by the destination device of the first interface call request; since the first interface call request is a request that needs to be sent to the called device, the target email address is the address of the email server used by the called device (i.e., the address of the second server).
[0141] It should be noted that the target email address mentioned above is determined by the first converter based on the destination address (i.e., the address of the called device) in the first interface call request, from the corresponding relationship; wherein, the corresponding relationship describes the correspondence between a device and the email server used by that device. Since the second converter mentioned above and the called device belong to the same trust domain, the email server used by the called device is the second server mentioned above, that is, the corresponding relationship includes the correspondence between the called device and the second server.
[0142] Optionally, the first interface call request in the above-mentioned text format may include, in addition to the text content and the target email address, a text subject; wherein, the text subject includes: the identifier of the first interface call request, the type of the first interface call request (e.g., request type or response type), and the purpose of the first interface call request; the text subject is similar to the storage subject in S320 above, and for a specific description of the text subject, please refer to the relevant description in S320 above, which will not be repeated here.
[0143] For example, assuming the first interface call request is an HTTP request message for querying data, "GET https: / / test.example.com / v1 / test", then the first converter will convert this first interface call request from a request message format into a text format, specifically as follows: Figure 11 As shown; the first interface call request, which is in text format, includes: text content, target email address, and text subject.
[0144] The text content includes information such as "GET https: / / test.example.com / v1 / test HTTP / 1.1", "Host:test.example.com", "Cookie:locale=zh-cn", and "Accept:application / json". "HTTP / 1.1" indicates the version number of the HTTP protocol on which the first interface call request is based; "Host:test.example.com" indicates the address of the called device; "Cookie:locale=zh-cn" indicates the locale of the current request; and "Accept:application / json" indicates that the return value of this request is of type application / json. The target email address is "test@example.com", which indicates the second server; the text subject is "
[00001] [request] Query data".
[0145] S422, The first converter sends a text-formatted first interface call request to the first server.
[0146] The above-mentioned S422 can be implemented as follows: the first converter uploads the text-formatted first interface call request to the first server in the form of an email; wherein, the email is as follows: Figure 12As shown, the recipient is the target email address (e.g., the address of the second server) "test@example.com" in the first interface call request, and the email subject is the text subject "
[00001] [request]Query Data" in the first interface call request; the email content is the text content of the first interface call request, including "GET https: / / test.example.com / v1 / test HTTP / 1.1", "Host:test.example.com", "Cookie:locale=zh-cn" and "Accept:application / json" and other information.
[0147] Optionally, the above-mentioned S422 can also be implemented in such a way that the first converter sends the first interface call request to the first server in text format.
[0148] S430, the first server sends the first interface call request to the second server via email.
[0149] In the case where the first interface call request in text format is uploaded to the first server via email in S422 above, the implementation of S430 above is as follows: since the recipient in the email is the address of the second server, the first server forwards the email to the second server.
[0150] In the case where the first interface call request is sent to the first server in text format in S422, the implementation of S430 is as follows: the first server generates a target email based on the first interface call request in text format; then, the first server sends the target email to the second server; wherein, the recipient in the target email is the target email address in the first interface call request in text format, the email subject is the aforementioned text subject, and the email content is the aforementioned text content.
[0151] S440: The second converter obtains the first interface call request from the second server and sends the first interface call request to the called device in the form of a request message.
[0152] The aforementioned first interface call request may be actively obtained by the second converter from the second server, or the second server may send a notification message to the second converter, and the second converter may respond to the notification message by obtaining the first interface call request from the second server; or the second server may actively send an email containing the first interface call request to the second converter. The specific embodiments of this application do not limit it in detail.
[0153] It should be understood that, since the first server in S430 sends the first interface call request to the second server via email, the first interface call request obtained by the second converter from the second server is contained in the email. At this time, the second converter obtains the first interface call request in text format from the email content.
[0154] Subsequently, the implementation of S440 includes: the second converter obtaining the target email from the second server; then, the second converter obtaining the first interface call request in text format from the email content of the target email; subsequently, the second converter converting the first interface call request from text format to request message format; finally, the second converter sending the first interface call request to the called device in the form of a request message.
[0155] Optionally, in one implementation, the first server retrieves emails from the second server in a polling manner; and verifies the retrieved emails, retrieving interface call requests from the emails that pass verification; wherein, the verification method for an email (e.g., email A) includes: determining whether the identifier of the server that sent email A to the second server is included in a preset whitelist; and / or whether the email content in email A meets preset conditions (e.g., whether the email content is used to describe a request message or a response message).
[0156] S450, the called device responds to the first interface call request and sends the response to the first interface call request to the second converter.
[0157] It should be noted that the implementation of S450 is similar to that of S350. For a detailed description of S450, please refer to the relevant description of S350 above. It will not be repeated here.
[0158] S460, the second converter sends the response to the first interface call request to the second server in text format.
[0159] For example, assuming the response to the first interface call request is an HTTP protocol response message, and the data content in the response is "success"; then, the second converter will convert the response from the response message format to a text format, such as... Figure 13 As shown, the response to the first API call request in this text format includes: text content, target email address, and text subject.
[0160] The text content includes: "HTTP / 1.1 200" (indicating the version number of the HTTP protocol on which the response message is based), "Content-Type: application / json" (indicating the type of returned data), "Content-Length: 18" (indicating the length of the returned content), and ""data":"success" (indicating that the returned data was successful). The text subject is "
[00001] [response] Query Data", and the target email address is "input@example.com" (indicating the address of the first server).
[0161] It should be noted that the implementation of S460 is similar to that of S420. For a detailed description of S460, please refer to the relevant description of S420 above. It will not be repeated here.
[0162] S470, the second server, sends the response to the first interface call request to the first server in the form of email.
[0163] S480: The first converter obtains the response to the first interface call request in email form from the first server.
[0164] S490, the first converter sends the response to the first interface call request to the calling device in the form of a response message.
[0165] It should be noted that the implementation methods of S470-S490 are similar to those of S430-S440. For a detailed description of S470-S490, please refer to the relevant descriptions of S430-S440 above. They will not be repeated here.
[0166] In the above embodiment, the first converter sends the first interface call request sent by the calling device in text format to a first server in the mail server. The first server then sends an email containing the first interface call request to a second server in the mail server, so that the second converter can obtain the first interface call request from the email in the second server and send it to the called device in the form of a request message. The called device responds to the first interface call request and sends a response to the first interface call request to the second converter. The second converter then sends the response to the first interface call request to the first server via the second server in the form of an email. This allows the first converter to obtain the response to the first interface call request from the first server and send it to the calling device in the form of a response message, thereby enabling the calling device to call the interface in the called device. As can be seen, the above embodiment allows the calling device and the backup calling device to interact via email through a mail server, without requiring manual intervention, thus improving the efficiency of interface calls.
[0167] The foregoing mainly describes the solutions provided by the embodiments of this application from a methodological perspective. To achieve the above functions, the interface calling device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0168] This application embodiment can, according to the above method, exemplarily divide the interface calling device into functional modules. For example, the interface calling device may include various functional modules corresponding to each functional division, or two or more functions may be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division; in actual implementation, there may be other division methods.
[0169] When dividing each function into modules according to its corresponding function. Figure 14 This diagram illustrates a possible structural design of the interface invocation device 1400 involved in the above embodiments. The interface invocation device 1400 is deployed within a converter, which is deployed in… Figure 1The interface calling system shown includes a calling device, an intermediate device, and a called device; wherein the calling device and the called device belong to different trust domains, and the intermediate device supports the calling device and the called device to access the interface; the calling device 1400 includes a receiving unit 1401 and a sending unit 1402.
[0170] The receiving unit 1401 is used to obtain first data to be processed from a device in the same trust domain; for example, to perform step S110 in the above method embodiment.
[0171] The sending unit 1402 is used to send the first data to be processed to the intermediate device in the form of a first data format, so that the device in another trusted domain can obtain the first data to be processed from the intermediate device; for example, to perform step S120 in the above method embodiment.
[0172] Optionally, the receiving unit 1401 is used to obtain second data to be processed sent by a device in another trusted domain from an intermediate device; for example, to perform step S210 in the above method embodiment.
[0173] The sending unit 1402 is used to send the second data to be processed, in the form of a second data format, to a device in the same trust domain for processing; for example, to perform step S220 in the above method embodiment.
[0174] Optionally, if the converter is the first converter:
[0175] The receiving unit 1401 is used to obtain a first interface call request from the calling device; for example, to execute step S310 in the above method embodiment.
[0176] The sending unit 1402 is used to send the first interface call request to the intermediate device in the form of a first data format, so that the device in another trust domain can obtain the first interface call request from the intermediate device; for example, to execute step S320 in the above method embodiment.
[0177] Optionally, if the converter is a second converter:
[0178] The receiving unit 1401 is used to obtain the response of the first interface call request from the called device.
[0179] The sending unit 1402 is used to send the response to the first interface call request to the intermediate device in the form of a first data format; for example, to perform step S360 in the above method embodiment.
[0180] Optionally, if the converter is the first converter:
[0181] The receiving unit 1401 is used to obtain the response of the second interface call request in the first data format from the intermediate device.
[0182] The sending unit 1402 is used to send the response to the second interface call request to the calling device in the form of a response message; the second data format includes the form of a response message.
[0183] Optionally, if the converter is a second converter:
[0184] The receiving unit 1401 is used to obtain a second interface call request in a first data format from the intermediate device.
[0185] The sending unit 1402 is used to send the second interface call request to the called device in the form of a request message, so that the called device can respond to the second interface call.
[0186] Optionally, the aforementioned intermediate devices include: mail servers, database servers, file storage servers, or message queue servers; wherein, file storage servers include OBS storage servers and cloud storage servers.
[0187] Optionally, if the intermediate device is a mail server, the intermediate device includes: a first server and a second server, the first server and the second server having a communication connection, and the first data format being a text format.
[0188] When the converter is the first converter:
[0189] The sending unit 1402 is used to send the first interface call request to the first server in text format; the first server sends the first interface call request to the second server in the form of email, so that the device in another trust domain can obtain the first interface call request from the second server.
[0190] When the converter is a second converter:
[0191] The sending unit 1402 is used to send the response of the first interface call request to the second server in text format; the second server is used to send the response of the first interface call request to the first server in the form of email, so that the calling device can obtain the response of the first interface call request from the first server.
[0192] This application provides an interface invocation system, which includes: an invocation device, a first converter, an intermediate device, a second converter, and a invoked device; wherein the invocation device and the first converter belong to the same trust domain, and the invoked device and the second converter belong to the same trust domain; the invocation device and the invoked device belong to different trust domains, and the intermediate device supports access to both the invocation device and the invoked device; the system includes: an invocation device for sending a first interface invocation request; the first interface invocation request is used to invoke an interface in the invoked device; a first converter for receiving the first interface invocation request from the invocation device and sending the first interface invocation request to the intermediate device in the form of a first data format; a second converter for obtaining the first interface invocation request in the first data format from the intermediate device and sending the first interface invocation request to the invoked device in the form of a request message; and an invoked device for receiving the first interface invocation request from the second converter, invoking the interface, and responding to the first interface invocation request.
[0193] This application provides a computing device including a memory and at least one processor connected to the memory. The memory is used to store computer program code, which includes computer instructions. When the computer instructions are executed by the at least one processor, the computing device performs the method described in the above embodiments.
[0194] This application provides a computer-readable storage medium storing computer instructions, which, when executed on a computer, perform the methods described in the above embodiments.
[0195] This application provides a computer program product containing computer instructions that, when executed on a computer, perform the methods described in the above embodiments.
[0196] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software programs, implementation can be, in whole or in part, in the form of a computer program product. This computer program product includes one or more computer instructions. When these computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center integrating one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital video discs (DVDs)), or semiconductor media (e.g., solid-state drives (SSDs)).
[0197] Through the above description of the embodiments, those skilled in the art will clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0198] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.
[0199] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0200] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0201] If the integrated unit is implemented as 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 this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as flash memory, portable hard disk, read-only memory, random access memory, magnetic disk, or optical disk.
[0202] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. An interface invocation method, characterized in that, The method is applied to a converter, which is deployed in an interface invocation system. The interface invocation system further includes a calling device, an intermediate device, and a called device; wherein the calling device and the called device belong to different trust domains, and the intermediate device supports access to both the calling device and the called device; the method includes: The converter obtains first data to be processed from a device in the same trust domain. The first data to be processed includes a first interface call request or a response to the first interface call request. The first interface call request is used to call an interface in the called device. The converter sends the first data to be processed to the intermediate device in a first data format, so that a device in another trusted domain can obtain the first data to be processed from the intermediate device; wherein, the first data format is a data format supported by the intermediate device.
2. The method according to claim 1, characterized in that, The method further includes: The converter obtains second data to be processed from the intermediate device, which is sent by a device in another trust domain. The second data to be processed includes a second interface call request in the first data format, or a response to the second interface call request in the first data format. The second interface call request is used to call an interface in the called device. The converter sends the second data to be processed, in the form of a second data format, to a device in the same trust domain for processing.
3. The method according to claim 1 or 2, characterized in that, The converter includes a first converter, which belongs to the same trust domain as the calling device, and the first data to be processed is the first interface call request. The converter obtains first data to be processed from devices in the same trust domain, including: The first converter obtains the first interface call request from the calling device; The converter sends the first data to be processed to the intermediate device in a first data format, so that a device in another trusted domain can obtain the first data to be processed from the intermediate device, including: The first converter sends the first interface call request to the intermediate device in the form of a first data format, so that a device in another trust domain can obtain the first interface call request from the intermediate device.
4. The method according to any one of claims 1-3, characterized in that, The converter includes a second converter, which belongs to the same trust domain as the called device, and the first data to be processed is the response to the first interface call request; The converter obtains first data to be processed from devices in the same trust domain, including: The second converter obtains the response to the first interface call request from the called device; The converter sends the first data to be processed to the intermediate device in a first data format, so that a device in another trust domain can obtain a response from the intermediate device regarding the first data to be processed, including: The second converter sends the response to the first interface call request to the intermediate device in the form of a first data format, so that a device in another trust domain can obtain the response to the first interface call request from the intermediate device.
5. The method according to claim 2, characterized in that, The converter includes a first converter, which belongs to the same trust domain as the calling device, and the second data to be processed is the response to the second interface call request; The converter obtains second data to be processed sent by devices in other trust domains from the intermediate device, including: The first converter obtains a response from the intermediate device to the second interface call request in the first data format; The converter sends the second data to be processed to a device in the same trust domain for processing, including: The first converter sends the response to the second interface call request to the calling device in the form of a response message; the second data format includes the form of the response message.
6. The method according to claim 2 or 5, characterized in that, The converter includes a second converter, which belongs to the same trust domain as the called device, and the second data to be processed is the second interface call request. The converter obtains second data to be processed sent by devices in other trust domains from the intermediate device, including: The second converter obtains a second interface call request in the first data format from the intermediate device; The converter sends the second data to be processed to a device in the same trust domain for processing, including: The second converter sends the second interface call request to the called device in the form of a request message, so that the called device can respond to the second interface call.
7. An interface invocation method, characterized in that, The method is applied to an interface invocation system, which includes: an invocation device, a first converter, an intermediate device, a second converter, and a invoked device; wherein the invocation device and the first converter belong to the same trust domain, and the invoked device and the second converter belong to the same trust domain; the invocation device and the invoked device belong to different trust domains, and the intermediate device supports access to both the invocation device and the invoked device; the method includes: The calling device sends a first interface call request; the first interface call request is used to call an interface in the called device. The first converter receives the first interface call request from the calling device and sends the first interface call request to the intermediate device in the form of a first data format, wherein the first data format is a data format supported by the intermediate device; The second converter obtains the first interface call request in the first data format from the intermediate device and sends the first interface call request to the called device in the form of a request message; The called device receives the first interface call request from the second converter, calls the interface, and responds to the first interface call request.
8. The method according to claim 7, characterized in that, The method further includes: The called device sends a response to the first interface call request; The second converter sends the response to the first interface call request to the intermediate device in the form of the first data format; The first converter obtains the response to the first interface call request in the first data format from the intermediate device; The first converter sends the response to the first interface call request to the calling device in the form of a response message; The calling device obtains a response to the first interface call request in the form of a response message from the first converter.
9. An interface calling device, characterized in that, The interface invocation device is deployed in the converter, and the converter is deployed in the interface invocation system. The interface invocation system further includes: an invocation device, an intermediate device, and a invoked device; wherein, the invocation device and the invoked device belong to different trust domains, and the intermediate device supports access to both the invocation device and the invoked device; the converter includes: a receiving unit and a sending unit. The receiving unit is configured to obtain first data to be processed from a device in the same trust domain. The first data to be processed includes a first interface call request or a response to the first interface call request. The first interface call request is used to call an interface in the called device. The sending unit is configured to send the first data to be processed to the intermediate device in a first data format, so that a device in another trusted domain can obtain the first data to be processed from the intermediate device; wherein, the first data format is a data format supported by the intermediate device.
10. An interface call system, characterized in that, The interface invocation system includes: an invocation device, a first converter, an intermediate device, a second converter, and a invoked device; wherein, the invocation device and the first converter belong to the same trust domain, and the invoked device and the second converter belong to the same trust domain; the invocation device and the invoked device belong to different trust domains, and the intermediate device supports access to both the invocation device and the invoked device; the system includes: The calling device is used to send a first interface call request; the first interface call request is used to call an interface in the called device. The first converter is configured to receive the first interface call request from the calling device and send the first interface call request to the intermediate device in the form of a first data format; The second converter is used to obtain the first interface call request in the first data format from the intermediate device, and send the first interface call request to the called device in the form of a request message; The called device is configured to receive the first interface call request from the second converter, call the interface, and respond to the first interface call request.