WO2021232860A1 - Communication method, apparatus and system - Google Patents

Communication method, apparatus and system Download PDF

Info

Publication number
WO2021232860A1
WO2021232860A1 PCT/CN2021/075691 CN2021075691W WO2021232860A1 WO 2021232860 A1 WO2021232860 A1 WO 2021232860A1 CN 2021075691 W CN2021075691 W CN 2021075691W WO 2021232860 A1 WO2021232860 A1 WO 2021232860A1
Authority
WO
WIPO (PCT)
Prior art keywords
api
resource
interface
api gateway
same
Prior art date
Application number
PCT/CN2021/075691
Other languages
French (fr)
Chinese (zh)
Inventor
陈曦
李光成
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2021232860A1 publication Critical patent/WO2021232860A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms

Definitions

  • This application relates to the field of cloud computing, and in particular to a communication method, device and system.
  • Cloud technology is a hosting technology used to realize the calculation, storage, processing or sharing of data.
  • the platform used to implement cloud technology is called cloud platform.
  • a user may call different resources on different cloud platforms through user equipment. For example, create different virtual machines on different cloud platforms.
  • API application programming interface
  • the embodiments of the present application provide a communication method, device, and system.
  • the technical solution is as follows:
  • a communication method includes:
  • the first application program interface API gateway receives the first API request; the first API gateway determines the target cloud platform used to respond to the first API request among multiple cloud platforms, and the format of the first API request is the first API gateway Supported format; the first API gateway sends a second API request to the second API gateway, the second API request is determined based on the first API request, and the format of the second API request is a format supported by the second API gateway , The second API gateway is the API gateway of the target cloud platform.
  • the first API gateway determines the second API request in the format supported by the target cloud platform, and sends the second API request to the second API gateway of the target cloud platform .
  • the user only needs to use the API request in the format supported by the first API gateway to access the API unified gateway to achieve access to the target cloud platform among multiple cloud platforms, which reduces the user’s operational complexity and improves user equipment and different clouds.
  • the communication flexibility of the platform is not limited to.
  • the first API gateway needs to predetermine the format of the API request that it supports, so as to provide convenience for subsequent users.
  • the format of the API request is consistent with the format of the resource deployed by the first API gateway, so it is also called the resource format.
  • the resource format mainly includes two parts, one part is the format (schema, also called specification) of the resource parameters carried in the API request; the other part includes the interface calling rules corresponding to the API request.
  • the resource parameter refers to the parameter (also called the object) of the resource to which the data belongs.
  • the resource parameter format is the structure definition of the data object.
  • the interface calling rules of the calling operation are used to indicate the interface set corresponding to the calling operation and the calling timing of the interface set. Among them, the time sequence of the interface set called through the same API request is the same, and the time sequence of the interface set called through different API requests is different.
  • the embodiment of the present application describes the process of determining the format of the supported API request by the first API gateway in the following two aspects.
  • the first API gateway determines the resource parameter format of the supported API request.
  • the process includes:
  • the first API gateway integrates resource parameter formats corresponding to the same calling operation of the same resource in the multiple cloud platforms to obtain the resource parameter format of the same calling operation of the same resource supported by the first API gateway.
  • the resource parameter format of the same calling operation of the same resource supported by the first API gateway is a union of resource parameter formats corresponding to the same calling operation of the same resource in the multiple cloud platforms.
  • the resource parameter format corresponding to the same calling operation of the same resource in the multiple cloud platforms should be integrated to obtain the uniform resource parameter format of the same calling operation of the same resource supported by the first API gateway
  • the process includes: obtaining the union of resource parameter formats corresponding to the same calling operation of the same resource in the multiple cloud platforms, and obtaining the resource parameter format of the same calling operation of the same resource supported by the first API gateway.
  • the first API request includes first resource parameter data
  • the second API request includes second resource parameter data
  • the format of the first resource parameter data is supported by the first API gateway
  • the format of the first resource parameter data is a resource parameter format supported by the second API gateway
  • the second resource parameter data is obtained by converting the first resource parameter data into a resource parameter format.
  • the first API gateway determines the interface calling rules of the supported API requests.
  • the process includes:
  • the first API gateway determines the first interface calling rule corresponding to the same calling operation of the same resource based on the interface calling rule corresponding to the calling operation.
  • the interface calling rule of the calling operation is used to indicate the interface set corresponding to the calling operation and the calling timing of the interface set;
  • the first interface calling rule corresponding to the same calling operation of the same resource is to call the interface according to the calling sequence.
  • API interface in the interface set when the same call operation of the same resource in the multiple cloud platforms corresponds to the same interface set and the call sequence is different, the first interface call rule corresponding to the same call operation of the same resource is to use one API Request to call the API interface in the interface set corresponding to the same calling operation; when the same calling operation of the same resource in the multiple cloud platforms corresponds to different interface sets, the first interface calling rule corresponding to the same calling operation of the same resource To use one API request to call the API interface in the interface set corresponding to the same calling operation.
  • the second API request is sent by the first API gateway based on a second interface invocation rule
  • the second interface invocation rule is an interface invocation rule supported by the second API gateway.
  • the second interface call rule is determined by the first API gateway based on the first interface call rule supported by the first API gateway and the first API request; the method further includes:
  • the first API gateway receives the second API response sent by the second API gateway; based on the second API response, the first API gateway replies with the first API to the sender of the first API request according to the first interface calling rule response.
  • the API response includes resource parameter data.
  • the resource parameter data included in the second API response sent by the second API follows the resource parameter format supported by the API gateway of the target cloud platform.
  • the first API gateway publishes the format of the API request that it supports. Therefore, the user learns the first resource parameter format supported by the first API gateway. If the first API gateway directly passes the resource parameter data included in the second API response The first API response is fed back to the user, and the user also needs to learn the resource parameter format supported by the second API gateway, which will increase the user's learning cost.
  • the first API gateway may also escape the resource parameter data in the second API response sent by the second API gateway to obtain the resource parameter data in the first API response, which can reduce user learning costs.
  • the second API response includes fourth resource parameter data
  • the format of the third resource parameter data is the resource parameter format supported by the first API gateway
  • the format of the third resource parameter data is the first Second
  • the third resource parameter data is obtained by the first API gateway converting the fourth resource parameter data into the resource parameter format.
  • the resources provided by multiple cloud platforms provide the same or similar services, and the first API gateway needs to be determined in advance in multiple cloud platforms
  • the same resource that is, the resource of the same resource type, is used to integrate the resource format of the same resource.
  • the same resource is a resource whose similarity defined by the resource is greater than a similarity threshold.
  • the same type of resource is a resource whose identifier of the resource has a similarity greater than the second similarity threshold.
  • the first API gateway also supports other functions.
  • the first API gateway supports the presentation function of service information
  • the method further includes: the first API gateway uses the user interface cloud Service information of the resources of the platform, where the service information includes at least one of service capability information and service prices.
  • the first API gateway obtains the service information. For example, after receiving the service information retrieval request through the user interface, the first API gateway obtains the service information of the resources of the cloud platform; or, after receiving the first API request, the first API gateway obtains the cloud platform The service information of the resource.
  • each set of capability information may be presented in the form of a list.
  • the first API gateway after receiving the service information retrieval request, obtains the service information of the resources of the cloud platform, and presents the obtained service information through the user interface, which can realize the retrieval function of the service information through the user interface , Which is convenient for users to search on demand and get the service information they want to obtain. Users do not need to check whether resources meet their own needs on a cloud platform one by one, reducing user operation complexity and improving user experience.
  • the first API gateway after receiving the first API request, obtains the service information of the resources of the cloud platform, and presents the obtained service information through the user interface, which can realize that when the user makes an interface call, The user provides the service information of the resource that meets the demand, so that the user can understand the service information of the resource and make better interface calls.
  • the first API gateway may obtain the latest capability information of the resources of the cloud platform in the designated storage space after detecting that the user accesses the specified page for the presentation of capability information through the user interface, and The capacity information of the latest cloud platform resources is presented through the designated page.
  • the presented cloud platform is multiple cloud platforms managed by the first API gateway, it is convenient for the user to have an overall understanding of the capability information of the resources of the cloud platform managed by the first API gateway.
  • the aforementioned capability information may be real-time capability information, that is, the capability information is dynamically variable; the capability information may also be rated capability information, and the rated capability information is fixed and used to reflect resource Capability limit.
  • the capability information is real-time capability information
  • the first API gateway can present the real-time capability information of the resource to realize the user's timely and accurate understanding of the current capability information and improve the user experience.
  • the target cloud platform is determined based on a selection instruction sent by the management node, the selection instruction is used to instruct the target cloud platform, and the selection instruction is received by the management node through a user interface; or, the target cloud platform is based on If the selection instruction sent by the client is determined, the selection instruction is used to indicate the target cloud platform; or, the first API request includes the identifier of the target cloud platform.
  • the first API gateway also supports a resource migration function across cloud platforms. Then the method further includes: the first API gateway converts the resource parameter format of the resource parameter data of the resource to be migrated into the resource parameter format supported by the API gateway of the target cloud platform; the first API gateway converts the converted resource parameter data Sent to the API gateway of the destination cloud platform.
  • the first API request is sent by the client to the first API gateway; or, the first API request is received by the management node on the user interface and sent to the first API gateway.
  • the calling operation indicated by the first API request includes any one of the following: resource establishment operation, resource deletion operation, resource modification operation, and resource query operation.
  • a communication device which is applied to a first application program interface API gateway.
  • the device may include at least one module, and the at least one module may be used to implement the above-mentioned first aspect or various aspects of the first aspect. It is possible to implement the provided communication method.
  • the present application provides a communication system.
  • the communication system includes: a first API gateway and multiple cloud platforms, each cloud platform includes an API gateway, and the first API gateway includes any one described in the second aspect ⁇ Communication device.
  • this application provides a computer device including a processor and a memory.
  • the memory stores computer instructions; the processor executes the computer instructions stored in the memory, so that the computer device executes the methods provided by the foregoing first aspect or various possible implementations of the first aspect, so that the computer device deploys the foregoing second aspect or the first aspect.
  • the communication device provided by various possible implementations of the two aspects.
  • the present application provides a computer-readable storage medium having computer instructions stored in the computer-readable storage medium, and the computer instructions instruct the computer device to execute the above-mentioned first aspect or various possible implementations of the first aspect.
  • the method or the computer instruction instructs the computer device to deploy the communication device provided by the foregoing second aspect or various possible implementations of the second aspect.
  • the present application provides a computer program product.
  • the computer program product includes computer instructions, and the computer instructions are stored in a computer-readable storage medium.
  • the processor of the computer device can read the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the above-mentioned first aspect or the methods provided by various possible implementations of the first aspect, so that the computer
  • the device deploys the communication device provided by the foregoing second aspect or various possible implementations of the second aspect.
  • a chip in a sixth aspect, is provided.
  • the chip may include a programmable logic circuit and/or program instructions, and is used to implement any communication method as in the first aspect when the chip is running.
  • the first API gateway determines the second API request in the format supported by the target cloud platform, and sends the second API request to the second API gateway of the target cloud platform .
  • the user only needs to use the API request in the format supported by the first API gateway to access the API unified gateway to achieve access to the target cloud platform among multiple cloud platforms, which reduces the user’s operational complexity and improves user equipment and different clouds.
  • the communication flexibility of the platform is not limited to.
  • the user-oriented API gateway is the first API gateway, and the user only needs to program according to the resource format supported by the first API gateway or The call operation is triggered through the user interface of the management node, which reduces the user's repeated learning and configuration costs for similar resources (that is, the aforementioned same resource), and improves user experience.
  • the service information presentation function of the first API gateway can present the capability information of the resource of the cloud platform to the user, so that the user can understand the capability information of the resource.
  • the communication method provided in the embodiments of the present application can also be used for resource orchestration across cloud platforms.
  • the user arranges and generates a unified resource template in a blueprint.
  • the user only needs to set in the resource template which cloud platform (ie the aforementioned target cloud platform) each resource of the user system or application is deployed on, and then run the set resource template Deploy instances on multiple cloud platforms, and set the resource template of the target cloud platform as the aforementioned client. This can effectively reduce user operations and improve resource deployment efficiency.
  • the first API gateway can realize automatic resource migration across cloud platforms. There is no need for the user to reprogram, reducing operation complexity and improving user experience.
  • FIG. 1 is a schematic diagram of an application scenario of a communication system involved in a communication method provided by an embodiment of the present application;
  • FIG. 2 is a schematic diagram of an application scenario of another communication system provided by an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a communication method provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of another communication method provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a user interface provided by an embodiment of the present application.
  • FIG. 6 is a schematic diagram of another user interface provided by an embodiment of the present application.
  • FIG. 7 is a schematic flowchart of another communication method provided by an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a communication device provided by an exemplary embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of another communication device provided by an exemplary embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of another communication device provided by an exemplary embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of still another communication device according to an exemplary embodiment of the present application.
  • FIG. 12 is a schematic structural diagram of a communication device provided by another exemplary embodiment of the present application.
  • FIG. 13 is a schematic structural diagram of another communication device provided by another exemplary embodiment of the present application.
  • FIG. 14 schematically provides a possible basic hardware architecture in an actual application scenario of the first API gateway provided by an embodiment of the present application
  • FIG. 15 schematically provides a possible basic hardware architecture of a computer device provided in an embodiment of the present application.
  • Cloud platform also known as cloud system, cloud environment or cloud, is a software system for cloud technology (also known as cloud computing technology) services provided by cloud providers.
  • Public cloud is a cloud platform provided by a third-party public cloud provider for a large number of individuals or enterprises.
  • public clouds hardware, software, and other structures are owned and managed by third-party public cloud providers.
  • Private cloud is a dedicated cloud platform for an enterprise or organization.
  • the private cloud can be operated internally by the corresponding enterprise or organization.
  • Private cloud is mainly for enterprise users, also known as enterprise cloud.
  • Hybrid cloud refers to a cloud platform formed by different cloud platforms.
  • Hybrid cloud includes at least two cloud platforms, also known as multi-cloud platforms or multi-clouds.
  • hybrid cloud combines public and private clouds. For security reasons, some enterprise users prefer to store data in private clouds, but at the same time hope to obtain computing resources from public clouds. In this case, hybrid clouds including public clouds and private clouds are increasingly adopted. Hybrid cloud mixes and matches public and private clouds to obtain good usage results.
  • Virtual Machine refers to a complete computer system with complete hardware system functions that is simulated by software and runs in an isolated environment.
  • the work that can be done in a physical computer (referred to as a physical machine) can be realized in a virtual machine.
  • a virtual machine When creating a virtual machine in a computer, part of the hard disk and memory capacity of the physical computer needs to be used as the hard disk and memory capacity of the virtual machine.
  • each virtual machine has an independent Complementary Metal Oxide Semiconductor (CMOS), hard disk, and operating system, and the virtual machine can be operated like a physical computer.
  • CMOS Complementary Metal Oxide Semiconductor
  • Container also called container image
  • Container technology refers to a virtualization technology in a computer operating system, which enables processes to run in a relatively independent and isolated environment (including independent file systems, namespaces and/or resource views, etc.), thereby simplifying software
  • the deployment process enhances the portability and security of the software, and improves the utilization of system resources.
  • Container technology is widely used in service-oriented scenarios in the field of cloud computing.
  • Application program interface also known as program interface, is the "interface between program and operating system" provided by the cloud platform's operating system to users, such as programmers. This interface is for users to use when programming. Through the application program interface, users can access resources in the cloud platform and obtain corresponding services.
  • An application program interface is a collection of definitions, functions, procedures, and/or protocols.
  • an application program interface of a cloud platform includes one or more system calls, and each system call is a program that can complete a specific function.
  • API Gateway Application Programming Interface Gateway, APIG
  • APIG Application Programming Interface Gateway
  • Services including: computing services, storage services or network services, etc.
  • the devices or functions that the user equipment can access on the cloud platform can be regarded as the services provided by the cloud platform.
  • Resources hardware or software resources used to provide services.
  • resources include computing resources, storage resources, or network resources.
  • the computing resources include central processing unit (CPU, central processing unit) resources, memory resources, and/or hard disk resources.
  • FIG. 1 is a schematic diagram of an application scenario of a communication system involved in a communication method provided by an embodiment of the present application.
  • the communication system includes: a first API gateway 101, multiple cloud platforms 102, and one or more user equipment 103.
  • each cloud platform 102 includes an API gateway 1021, and each cloud platform 102 is deployed with one or more resources to provide services for the user equipment 103, and multiple cloud platforms 102 correspond to multiple API gateways 1021 one-to-one.
  • the first API gateway 101 establishes a communication connection with API gateways 1021 of multiple cloud platforms 102.
  • the first API gateway 101 also establishes a communication connection with the user equipment 103.
  • the first API gateway 101 is used to manage the information communicated between the user equipment 103 and the API gateways 1021 of the multiple cloud platforms 102.
  • the user equipment 103 may implement communication with the API gateway 1021 of the multiple cloud platforms 102 through the first API gateway 101.
  • the user equipment 103 is a computer device such as a computer or a notebook computer.
  • the user equipment 103 may be installed with a client, and the user realizes communication with the first API gateway 101 through the client.
  • the client is usually programmed by the user.
  • Fig. 2 is a schematic diagram of an application scenario of another communication system provided by an embodiment of the present application.
  • the communication system further includes: a management node 104, and the management node 101 may be a single node. It can be a server or a server cluster composed of multiple servers. It can also be one or more set minimum processing units, such as virtual machines or containers.
  • the management node 104 respectively establishes a communication connection with the first API gateway 101 and the user equipment 103.
  • the management node 104 may provide a user interface (UI) for the user equipment 103 for the user equipment 103 and the first API gateway 101 To communicate.
  • UI user interface
  • a web client corresponding to the management node 104 is installed in the user equipment 103, and the user equipment 103 accesses the user interface provided by the management node 104 by running the web client; in another optional manner A browser is installed in the user equipment 103, and the user equipment 103 can access the user interface of the webpage version provided by the management node 104 by running the browser.
  • FIG. 1 and FIG. 2 only take two cloud platforms 102 and one user equipment 103 as an example for description, and do not limit the number of cloud platforms and the number of user equipment in the communication system.
  • the first API gateway is an application in the form of a microservice, and each component included in it can be deployed in a virtual machine or container that is reachable on the network.
  • the information communicated between the user equipment 103 and the API gateways 1021 of the multiple cloud platforms 102 is uniformly managed, without the need for users to target different cloud platforms.
  • Different API requests are sent through the user equipment, thereby reducing the user's operational complexity and improving the communication flexibility between the user equipment and different cloud platforms.
  • the user only needs to learn the API request format supported by the first API gateway to access each cloud platform managed by the first API gateway. Therefore, the user's learning cost is reduced and the user experience is improved.
  • the newly added management node can also realize the communication between the user and different cloud platforms through the user interface, which further improves the communication flexibility between the user equipment and the different cloud platforms.
  • FIG. 3 is a schematic flowchart of a communication method provided by an embodiment of the present application.
  • the communication method may be applied to the communication system shown in FIG. 1 or FIG. 2. As shown in Figure 3, the method includes:
  • the first API gateway determines the format of the supported API request.
  • the first API gateway needs to predetermine the format of the API request that it supports, so as to provide convenience for subsequent users.
  • An API request is a call request sent by a user device when calling an API interface.
  • the format of the API request is consistent with the format of the resource deployed by the first API gateway, so it is also called the resource format.
  • the resource format mainly includes two parts, one part is the resource parameter format (schema, also called specification) carried in the API request, referred to as the resource parameter format or API format; the other part includes the interface calling rules corresponding to the API request.
  • the resource parameter refers to the parameter (also called the object) of the resource to which the data belongs.
  • the resource parameter format is the structural definition of the object of the data, that is, the definition of the resource parameter.
  • the resource parameter format corresponding to a certain call operation of a resource is: the resource parameter is the name and phone number, or the resource parameter is the number of CPUs and/or the number of GPUs (Graphics Processing Unit) And other computing resource specifications.
  • the interface calling rules of the calling operation are used to indicate the interface set (also called API interface set) corresponding to the calling operation and the calling sequence of the interface set. Among them, the time sequence of the interface set called through the same API request is the same, and the time sequence of the interface set called through different API requests is different.
  • the interface calling rule corresponding to a certain calling operation of a certain resource is: the interface set includes API interface 1 and API interface 2.
  • the timing of API interface 1 and API interface 2 is that API interface 1 comes first, and API interface 2 comes later. . That is, the interface calling rule is: call API interface 1 and API interface 2 in two times according to time sequence.
  • An interface set includes at least one API interface identifier, and the API interface identifier is used to identify one API interface.
  • the identifier of the API interface is the interface routing address of the API interface, such as a uniform resource identifier (URI).
  • URI uniform resource identifier
  • each cloud platform is deployed with one or more resources, and the first API gateway supports different invocation operations to different resources in the cloud platform.
  • the user equipment can perform different calling operations.
  • the calling operations supported by the first API gateway include any of the following: resource creation operations (also called creation operations or adding operations), resource deletion operations, resource modification operations, and resource query operations.
  • resource creation operations also called creation operations or adding operations
  • resource deletion operations are used for resource deletion, such as cloud disks, networks, virtual machines, or containers
  • resource modification Operations are used to modify resources, such as modifying the rules of computing resources, mirroring versions, or network bandwidth, etc.
  • resource query operations are used to query resources, such as querying resource running status or parameter specifications.
  • the format of the API request supported by the aforementioned first API gateway includes the format of the API request corresponding to the multiple calling operations of multiple resources supported by the first API gateway.
  • the resource parameter format supported by the first API gateway includes resource parameter formats corresponding to multiple invocation operations of multiple resources supported by the first API gateway.
  • the interface calling rules supported by the first API gateway include interface calling rules corresponding to multiple calling operations of multiple resources supported by the first API gateway.
  • the API request carries a corresponding call operation identifier, and the call operation identifier is used to identify the call operation.
  • the identification of the calling operation may be expressed by an action (verb) in the API request.
  • the identifier of the subsequent call operation is represented by the name of the call operation.
  • the first API gateway For each call operation of each resource, the first API gateway needs to determine a unified API request format, which includes a unified resource parameter format and a unified interface calling rule, so as to provide convenience for subsequent users.
  • the embodiment of the present application describes the process of determining the format of the supported API request by the first API gateway in the following two aspects.
  • the first API gateway determines the resource parameter format of the supported API request.
  • the process includes:
  • Step A1 The first API gateway obtains resource parameter formats corresponding to different invocation operations of various resources in multiple cloud platforms.
  • the first API gateway may determine the resource parameter format corresponding to different invocation operations of each resource in the multiple cloud platforms based on the resource definitions of the multiple resources in the multiple cloud platforms.
  • the resource definition is used to describe the corresponding resource, which includes the resource parameters involved in the resource. Resource definitions are usually stored in text form.
  • the first API gateway may obtain resource definitions of multiple resources in multiple cloud platforms, and obtain resource parameter formats corresponding to different invocation operations of various resources in multiple cloud platforms by identifying the resource definitions.
  • the resource definitions of multiple cloud platforms can be pulled from multiple cloud platforms by the first API gateway, or the resource definitions of multiple cloud platforms can be specified by the first API gateway storing resource definitions of multiple cloud platforms Storage space 1 is extracted.
  • the resource definitions of multiple cloud platforms can be pre-determined by the management personnel of the communication system and input into the designated storage space 1, or the resource definitions of multiple cloud platforms can be pulled from the designated storage space 1 in multiple cloud platforms And maintain.
  • the designated storage space 1 may be a database.
  • the first API gateway may also maintain different versions of resource definitions in the database, and the administrator of the communication system may also manage the resource definitions in the database, such as adding, deleting, modifying, and querying resource definitions.
  • the resource parameter format corresponding to different invocation operations of various resources in multiple cloud platforms can be predetermined by the management personnel of the communication system and input into the designated storage space 2, where the first API gateway is located.
  • the designated storage space 2 only needs to extract resource parameter formats corresponding to different invocation operations of various resources in multiple cloud platforms.
  • the designated storage space 2 may be a database.
  • Step A2 The first API gateway integrates resource parameter formats corresponding to the same calling operation of the same resource in multiple cloud platforms to obtain the resource parameter format of the same calling operation of the same resource supported by the first API gateway.
  • the first API gateway For each call operation of each resource, the first API gateway needs to determine a unified resource parameter format, so as to provide convenience for subsequent users.
  • the first API gateway integrates resource parameter formats corresponding to the same calling operation of the same resource in multiple cloud platforms to obtain the resource parameter format of the same calling operation of the same resource supported by the first API gateway.
  • the resource parameter format of the same calling operation of the same resource supported by the first API gateway is a union of resource parameter formats corresponding to the same calling operation of the same resource in multiple cloud platforms. Then the first API gateway can obtain the union of resource parameter formats corresponding to the same call operation of the same resource in multiple cloud platforms to obtain the resource parameter format of the same call operation of the same resource supported by the first API gateway .
  • the first API gateway obtains the cloud platform 1 to cloud platform n, n ⁇ 2, and the same call operation of the same resource is call operation 1 of resource 1, then the first API gateway obtains the cloud platform 1 to cloud platform n The union of the resource parameter formats corresponding to the calling operation 1 of the resource 1 obtains the resource parameter format of the calling operation 1 of the resource 1 supported by the first API gateway.
  • resource 1 is a virtual machine used to provide disk performance optimization
  • call operation 1 is a query operation.
  • the resource parameter format corresponding to the call operation 1 of the resource 1 of the cloud platform 1 is: the resource parameters are names and phone numbers respectively; the resource parameter format corresponding to the call operation 1 of the resource 1 of the cloud platform 2 is that the resource parameters are names, Phone number and favorite identifier (the favorite identifier is used to indicate whether to favorite the corresponding phone number).
  • the first API gateway obtains the union of the resource parameter format corresponding to the call operation 1 of the resource 1 of the cloud platform 1 and the resource parameter format corresponding to the call operation 1 of the resource 1 of the cloud platform 2, and the obtained first API gateway supports
  • the resource parameter format corresponding to the invocation operation 1 of resource 1 of resource 1 for example, the finally obtained resource parameter format is: the resource parameters are respectively the name, phone number, and collection identifier.
  • Obtaining the resource parameter format by taking the union method can ensure that the finally obtained resource parameter format is not only a unified format, but also meets the requirements of each cloud platform for the resource parameter format.
  • the first API gateway determines the interface calling rules of the supported API requests.
  • the first API gateway determines the first interface calling rule corresponding to the same calling operation of the same resource based on the interface calling rule corresponding to the calling operation.
  • the same invocation operation of the same resource in multiple cloud platforms is the first invocation operation
  • the number of interface invocations indicated by the first interface invocation rule (equal to the number of API requests) Less than or equal to the number of interface calls indicated by the API gateway corresponding to the API gateway of each of the multiple cloud platforms.
  • the first interface invocation rule corresponding to the first invocation operation satisfies:
  • the first interface calling rule corresponding to the first calling operation is to call the API interfaces in the interface set according to the calling timing; when multiple cloud platforms
  • the first call operation corresponds to the same set of interfaces, and the call sequence is different.
  • the first interface call rule corresponding to the first call operation is to use one API request to call the API interface in the interface set corresponding to the same call operation.
  • the corresponding interface set is the same.
  • this one API request can carry the identifier of the API interface in the interface set (such as uri), or it may not carry the identifier of the API interface in the interface set, but only carry the instruction information indicating the call to all API interfaces in the interface set;
  • the interface sets corresponding to the first calling operation of each cloud platform are different.
  • the first interface calling rule corresponding to the first calling operation is to use one API request to call the API interface in the interface set corresponding to the same calling operation.
  • Corresponding interface sets are different.
  • One API request cannot uniformly carry the API interface identifiers of different interface sets.
  • this API request may not carry the identifiers of the API interfaces in the interface set, but only carry the instruction information indicating to call all the API interfaces in the interface set, thus Ensure that for different cloud platforms, all API interfaces in the interface set can be called.
  • the first API gateway is based on the resources of cloud platform 1 to cloud platform n
  • the interface calling rule corresponding to the calling operation 2 of 2 determines the first interface calling rule of the calling operation 2 of the resource 2 supported by the first API gateway.
  • resource 2 is a virtual machine used to provide GPU acceleration services
  • calling operation 2 is a setup operation. If the interface calling rule corresponding to the calling operation 2 of resource 2 of cloud platform 1 is to call API interface 1 and API interface 2 in turn, that is, the interface set includes: API interface 1 and API interface 2, and the calling sequence is that API interface 1 is in First, the API interface 2 comes later; the interface calling rule corresponding to the calling operation 2 of the resource 2 of the cloud platform 2 is to call the API interface 1 and the API interface 2 in turn. Then, the interface calling rule corresponding to the calling operation 2 of resource 2 supported by the first API gateway is: calling API interface 1 and API interface 2 in turn.
  • the interface call rule corresponding to the call operation 2 of resource 2 of cloud platform 1 is to call API interface 2 and API interface 1 in turn, that is, the interface set includes: API interface 1 and API interface 2, and the calling sequence is API interface 2 in First, the API interface 1 comes later; the interface calling rule corresponding to the calling operation 2 of the resource 2 of the cloud platform 2 is to call the API interface 1 and the API interface 2 in turn. Then, the interface calling rule corresponding to the calling operation 2 of resource 2 supported by the first API gateway is: calling API interface 1 and API interface 2 with one API request.
  • the interface calling rule corresponding to the calling operation 2 of resource 2 of cloud platform 1 is to call API interface 1, API interface 2 and interface 3 in turn, that is, the interface set includes: API interface 1 and API interface 2, and the calling sequence is API interface. 1 first, API interface 2 is centered, and interface 3 is last; the interface calling rule corresponding to the calling operation 2 of resource 2 of cloud platform 2 is to call API interface 1 and API interface 2 in turn. Then, the interface calling rule corresponding to the calling operation 2 of the resource 2 supported by the first API gateway is: one API request is used to call the API interface in the interface set corresponding to the calling operation 2.
  • the corresponding interface calling rules are different. If the unified first interface calling rule changes greatly compared with the interface calling rules of each cloud platform, the subsequent first interface calling rules will actually be used. When used, it is easy to generate more storage and calculation overhead. Therefore, the aforementioned first interface calling rule is adopted. When the interface set corresponding to the first calling operation of multiple cloud platforms and the calling sequence of the interface set are the same, the first interface calling rule corresponding to the first calling operation is to call the interface according to the calling sequence.
  • the centralized API interface that is, the first interface call rule corresponding to the first call operation is unchanged from the interface call rule corresponding to the first call operation of multiple cloud platforms, which can reduce the first interface call rule compared to each
  • the change of the interface call rules of the cloud platform further reduces the storage and calculation overhead when the first interface call rule is actually used.
  • the first interface invocation rule corresponding to the first invocation operation may also have other setting methods.
  • the first interface calling rule is to use one API request to call the API interface in the interface set corresponding to one calling operation.
  • one API request is used to call the API interface in the interface set.
  • the first interface calling rule is to use one API request to call the API interface in the interface set corresponding to one calling operation.
  • one API request is used to call the API interface in the interface set.
  • the interface calling rules of different resources of the same cloud platform can be unified, and the learning cost of users can be reduced.
  • the first interface calling rule is to use one API request to call the API interface in the interface set corresponding to one calling operation.
  • one API request is used to call the API interface in the interface set.
  • the interface calling rules of different resources of different cloud platforms can be unified, and the learning cost of users can be reduced.
  • the services provided by the resources deployed by multiple cloud platforms are the same or similar, and the first API gateway needs to pre-determine the same type of resource in multiple cloud platforms, that is, resources. Resources of the same type, and then the integration of the resource format of the same resource.
  • the resource type is divided according to the service provided by the resource, for example, divided into GPU acceleration, disk performance optimization, or network speed and bandwidth optimization.
  • the first API gateway determines resources of the same resource type in multiple cloud platforms There are several optional implementation methods:
  • the same resource is a resource whose similarity defined by the resource is greater than the similarity threshold.
  • the value range of the similarity threshold is 80% to 90%.
  • the first API gateway may determine resources with similarity of resource definitions in multiple cloud platforms that are greater than the similarity threshold as the same resource.
  • the first API gateway may use a clustering algorithm to determine resources of the same resource type among multiple cloud platforms.
  • the first API gateway may execute a clustering algorithm on resource definitions of resources deployed in multiple cloud platforms.
  • the first API gateway may also use other algorithms to determine resources of the same resource type in multiple cloud platforms. The embodiment of the application does not limit this.
  • the same resource is preset.
  • the first API gateway determines the format of the API request (that is, the resource format) that it supports, it can store the determined resource format in the designated storage space 3.
  • the designated storage space 3 may be a database.
  • the resource format supported by the first API gateway may also be predetermined by the management personnel of the communication system and input to The storage space 3 is designated, and the first API gateway extracts the required resource format in the designated storage space 3.
  • the API interface corresponding to the resource format stored in the designated storage space 3 needs to be registered in the designated storage space 3.
  • the registered API interface is the interface that the first API gateway can call, and the unregistered API interface is due to its
  • the resource format of the cloud platform to which it belongs is not unified, so it cannot be called by the first API gateway.
  • the resource format stored in the designated storage space 3 can be manually adjusted by the manager, such as adding, modifying or deleting.
  • the first API gateway publishes the format of the API request supported by the first API gateway.
  • the first API gateway may push the format of the API request supported by the first API gateway to the client of the user equipment, so as to realize the publication of the format of the API request; in another optional manner, The first API gateway may present the format of the API request supported by the first API gateway through a user interface. For example, the format of the API request is presented through the user interface of the aforementioned management node. The first API gateway implements the pre-arrangement of the API request format between the first API gateway and the user equipment by publishing the format of the API request supported by the first API gateway.
  • the format of the API request supported by the aforementioned first API gateway there are multiple ways of expressing the format of the API request supported by the aforementioned first API gateway.
  • it can be represented by a software model; in another optional way, it can be represented by a software template; in another optional way, it can also be represented by a table or Graphical representation.
  • the embodiment of this application does not limit the format of the API request.
  • the format of the aforementioned API request can be set with reference to an industry standard format, such as the format of the openAPI2.0 standard.
  • the user equipment sends a first API request to the first API gateway.
  • the format of the first API request is a format supported by the first API gateway.
  • the user equipment may send the first API request to the first API gateway in multiple ways. For example, in the first method, the user equipment has a client installed, and the first API request is sent by the client to the first API gateway, that is, the user equipment sends the first API request through the client; in the second method , The user equipment sends a first API request to the management node through the user interface provided by the management node, and the first API request is received by the management node on the user interface and sent to the first API gateway.
  • the first API gateway After receiving the first API request, the first API gateway determines a target cloud platform for responding to the first API request among the multiple cloud platforms.
  • the first API gateway receives the first API request sent by the user equipment through the client; corresponding to the second method of S303, the first API gateway receives the first API request sent by the management node .
  • the embodiments of this application take the following optional methods as examples for description:
  • the target cloud platform is determined based on a selection instruction sent by the management node, the selection instruction is used to instruct the target cloud platform, and the selection instruction is received by the management node through a user interface.
  • the first API gateway determines the target cloud platform based on the selection instruction.
  • the management node presents the identities of multiple cloud platforms to the user equipment through the user interface. If the user wants to operate on the resources in a certain cloud platform, he can select and operate on the user interface through the user equipment, thereby triggering the management node to generate the corresponding
  • the selection instruction carries the identification of the target cloud platform selected by the user, and the management node sends the selection instruction to the first API gateway.
  • the first API gateway After receiving the selection instruction, the first API gateway extracts the identification of the target cloud platform to Determine the target cloud platform.
  • the identifier of the cloud platform may be the name of the cloud platform, such as "AA Cloud” or "BB Cloud”, or the identifier of the API gateway in the cloud platform, such as the address of the API gateway.
  • the management node may present the identities of multiple cloud platforms after the first API gateway receives the first API request; or after receiving the access instruction sent by the user equipment, the management node may present the identities of the multiple cloud platforms.
  • the target cloud platform is determined based on the selection instruction sent by the client, and the selection instruction is used to instruct the target cloud platform.
  • the first API gateway determines the target cloud platform based on the selection instruction. For example, if a user wants to operate on a resource in a cloud platform, he can generate a corresponding selection instruction through the client running on the user device.
  • the selection instruction carries the identifier of the target cloud platform selected by the user, and the client selects
  • the instruction is sent to the first API gateway, and after receiving the selection instruction, the first API gateway extracts the identifier of the target cloud platform to determine the target cloud platform.
  • the client may send the selection instruction after the first API gateway receives the first API request, or before the first API gateway receives the first API request, the client may send the selection instruction. This is not limited.
  • the first API request includes the identification of the target cloud platform.
  • the first API gateway determines the target cloud platform based on the first API request.
  • the first API gateway may first authenticate the first API request, and after the authentication succeeds, determine the target cloud platform. If the authentication fails, an API response indicating the authentication failure is sent to the user equipment, or the action is stopped. For example, referring to S302, the first API gateway may detect whether the API interface required to be called by the first API request is a registered interface, and if the API interface required to be called by the first API request is not a registered interface, it is determined that the authentication fails; if The API interface that the first API request needs to call is a registered interface, and it is determined that the authentication is successful.
  • the first API gateway may detect whether the user account carried in the first API request has the permission to access the first API gateway (or whether it is a legal account), if the user account carried in the first API request does not have access to the first API
  • the authority of the gateway determines that the authentication fails; if the user account carried in the first API request has the authority to access the first API gateway (or is a legal account), it is determined that the authentication is successful.
  • the first API gateway can ensure the security of the communication system and reduce unnecessary operations by authenticating the API request.
  • the first API gateway determines a second API request based on the first API request, the second API request is determined based on the first API request, and the format of the second API request is a format supported by the second API gateway, and the second API gateway It is the API gateway of the target cloud platform.
  • the API request includes resource parameter data. Since the first API gateway publishes the format of the API request it supports, the first API request sent by the user through the user device is sent in accordance with the resource parameter format supported by the first API gateway. When accessing the target cloud platform, the resource parameter The data follows the resource parameter format supported by the API gateway of the target cloud platform.
  • the second API request includes second resource parameter data
  • the format of the first resource parameter data is the resource parameter format supported by the first API gateway
  • the format of the first resource parameter data is the first resource parameter data format.
  • the resource parameter format supported by the API gateway, the second resource parameter data is obtained by the first resource parameter format conversion of the first resource parameter data by the first API gateway.
  • the first API gateway may perform resource parameter format conversion on the first resource parameter data in a variety of ways.
  • the embodiment of the present application takes the following two optional methods as examples for description:
  • the first API gateway establishes the resource parameters supported by the API gateway of each of the multiple cloud platforms after determining the resource parameter format of the supported API request The first correspondence between the format and the resource parameter format supported by the first API gateway.
  • the first API gateway queries the first correspondence based on the identifier of the second API gateway to obtain the resource parameter format supported by the second API gateway; and based on the resource parameter format supported by the second API gateway, The first resource parameter data included in the first API request is escaped to obtain the second resource parameter data.
  • the first correspondence can be expressed in multiple ways.
  • the first correspondence may include multiple sub-correspondences that correspond to multiple call operations one-to-one, and each sub-correspondence is used to record the resource identifier and resource parameter format supported by the API gateway of the cloud platform under the corresponding call operation. Correspondence with the resource parameter format supported by the first API gateway.
  • the first correspondence may include multiple sub-correspondences corresponding to the identifiers of multiple resources one-to-one, and each sub-correspondence is used to record the identifier of the corresponding resource, the identifier of the call operation, and the API gateway of the cloud platform supports The corresponding relationship between the resource parameter format and the resource parameter format supported by the first API gateway.
  • the sub-correspondence corresponding to the identifier of a certain resource may be as shown in Table 1.
  • Table 1 records the corresponding relationship between the call operation identifier, the resource parameter format supported by the API gateway of the cloud platform and the resource parameter format supported by the first API gateway under the identifier of the certain resource, where the call operation identifier uses the call
  • the name of the operation indicates that the resource parameter format supported by the API gateway of the cloud platform may adopt the identifier of the API gateway and the identifier of the resource parameter format. It can be seen from Table 1 that there are two cloud platforms in the multiple cloud platforms deploying the resource corresponding to the identifier of the certain resource, the identifiers of the API gateways of the two cloud platforms are 1 and 2, respectively, and the identifier of the first API gateway Is 0.
  • the resource parameter format X1 of the API gateway 1 corresponds to the resource parameter format M1 of the first AP1 gateway 0; for the establishment operation, the resource parameter format X2 of the API gateway 2 corresponds to the resource parameter format M1 of the first AP1 gateway 0;
  • the resource parameter format Y1 of the API gateway 1 corresponds to the resource parameter format M2 of the first AP1 gateway 0; for the establishment operation, the resource parameter format Y2 of the API gateway 2 corresponds to the resource parameter format M2 of the first AP1 gateway 0.
  • Table 1 for the corresponding relationship, which is not described in detail in the embodiment of the present application.
  • the first correspondence may include the identity of the calling operation, the identity of the resource, and the correspondence between the resource parameter format supported by the API gateway of the cloud platform and the resource parameter format supported by the first API gateway.
  • the first API gateway determines the resource parameter format of the supported API request, it is based on the resource parameters supported by the API gateway of each of the multiple cloud platforms Format, and the resource parameter format supported by the first API gateway, establish an escape model, which is used to output resource parameter data corresponding to the received API gateway identifier after receiving the API gateway identifier and resource parameter data.
  • the first API gateway inputs the first resource parameter data included in the first API request and the identification of the second API gateway (or the identification of the target cloud platform) into the escape model, and the escape The resource parameter data output by the model is determined to be the second resource parameter data.
  • the first resource parameter format of the same calling operation of the same resource supported by the first API gateway is a union of resource parameter formats corresponding to the same calling operation of the same resource in multiple cloud platforms.
  • the first resource parameter format includes the second resource parameter format, that is, the second parameter resource format belongs to the first resource parameter format
  • the second resource parameter data may include data that is not required by the second API gateway, that is, invalid data.
  • the data is data that does not correspond to the second parameter resource format.
  • the first API gateway may eliminate invalid data in the second parameter data, obtain updated second parameter data, and generate a second API request including the updated second parameter data .
  • the format of the first resource parameter is: the resource parameters are name, phone number, and age.
  • the second resource parameter format is: the resource parameters are the name and the phone number respectively. Since the data corresponding to the age does not correspond to the second resource parameter format, the data corresponding to the age in the first resource parameter data is invalid data.
  • the first API gateway may generate a second API request, the second API request includes the second parameter data, after the second API gateway receives the second API request, the second parameter data The invalid data in the data is eliminated, and the updated second parameter data is obtained.
  • the first API gateway sends a second API request to the second API gateway.
  • the second API request is sent by the first API gateway based on the second interface calling rule
  • the second interface calling rule is the interface calling rule supported by the second API gateway
  • the second interface calling rule is based on the first API gateway by the first API gateway
  • the supported first interface calling rules and the first API request are determined.
  • the first API gateway sends the second API request to the second API gateway according to the second interface invocation rule, which can ensure that the sent second API request follows the interface invocation rule supported by the second API gateway, thereby ensuring the effective invocation of the API interface.
  • the first API gateway may determine the second interface calling rule in multiple ways. For example, please refer to the second aspect of the aforementioned S301.
  • the first API gateway After determining the interface calling rules of the supported API requests, the first API gateway establishes the interface calling rules supported by the API gateway of each cloud platform in the multiple cloud platforms and the first API. The second corresponding relationship of the interface invocation rule supported by the gateway.
  • the first API gateway queries the second correspondence based on the identifier of the second API gateway to obtain the second interface calling rule corresponding to the second API gateway.
  • the second correspondence can be expressed in multiple ways.
  • the second correspondence may include multiple sub-correspondences corresponding to multiple call operations one-to-one, and each sub-correspondence is used to record the resource identification and the interface call rules supported by the API gateway of the cloud platform under the corresponding call operation. Correspondence with the interface calling rules supported by the first API gateway.
  • the second correspondence may include multiple sub-correspondences corresponding to the identifiers of multiple resources one-to-one, and each sub-correspondence is used to record the identifier of the corresponding resource, the identifier of the call operation, and the API gateway support of the cloud platform. Correspondence between the interface calling rules of the API and the interface calling rules supported by the first API gateway.
  • the sub-correspondence corresponding to the identifier of a certain resource may be as shown in Table 2.
  • This table 2 records the corresponding relationship between the call operation identifier, the interface call rule supported by the API gateway of the cloud platform, and the interface call rule supported by the first API gateway under the identifier of the certain resource, where the call operation identifier uses the call
  • the name of the operation indicates that the interface call rule supported by the API gateway of the cloud platform can be expressed by the identifier of the API gateway and the identifier of the interface call rule. It can be seen from Table 2 that there are two cloud platforms in the multiple cloud platforms deploying the resource corresponding to the identifier of the certain resource, the API gateway identifiers of the two cloud platforms are 1 and 2, respectively, and the identifier of the first API gateway Is 0.
  • the interface calling rule A1 of the API gateway 1 corresponds to the interface calling rule E1 of the first AP1 gateway 0; for the establishment operation, the interface calling rule A2 of the API gateway 2 corresponds to the interface calling rule E1 of the first AP1 gateway 0;
  • the interface calling rule B1 of the API gateway 1 corresponds to the interface calling rule E2 of the first AP1 gateway 0;
  • the interface calling rule B2 of the API gateway 2 corresponds to the interface calling rule E2 of the first AP1 gateway 0.
  • Table 2 for the corresponding relationship, which is not described in detail in the embodiment of the present application.
  • the second correspondence may include the identity of the calling operation, the identity of the resource, and the correspondence between the interface calling rules supported by the API gateway of the cloud platform and the interface calling rules supported by the first API gateway.
  • the second API gateway sends a second API response to the first API gateway.
  • the second API gateway After receiving the second API request, the second API gateway calls the API interface in the target cloud platform according to the second API request, and after completing the interface call corresponding to the second API request, sends the second API to the first API gateway response.
  • the second API gateway may first authenticate the second API request, and after the authentication succeeds, perform the interface call action. If the authentication fails, an API response indicating the authentication failure is sent to the first API gateway, or the action is stopped. For example, the second API gateway can detect whether the API interface called by the second API request is a registered interface in the target cloud platform, and if the API interface called by the second API request is not a registered interface, it is determined that the authentication fails ; If the API interface to be called by the second API request is a registered interface, it is determined that the authentication is successful.
  • the second API gateway may detect whether the user account carried in the second API request has the permission to access the second API gateway (or whether it is a legal account), if the user account carried in the second API request does not have access to the second API
  • the authority of the gateway determines that the authentication fails; if the user account carried in the second API request has the authority to access the second API gateway (or is a legal account), it is determined that the authentication is successful.
  • the second API gateway can ensure the security of the communication system and reduce unnecessary operations by authenticating the API request.
  • the second API gateway sends the first API response to the user equipment based on the second API response.
  • the sender of the first API request is the user equipment.
  • the first API gateway sends the first API request to the client running on the user equipment, or sends the first API request to the management node.
  • the management node forwards it to the user equipment.
  • the first API gateway publishes the format of the API request that it supports, the first API request sent by the user through the user device is sent according to the first interface calling rule supported by the first API gateway.
  • the API gateway returns the corresponding API response, it needs to follow the same interface call rule, that is, send the first API response according to the first interface call rule.
  • the same invocation operation of the same resource in multiple cloud platforms is the first invocation operation.
  • the number of interface invocations indicated by the first interface invocation rule is less than or equal to that of the multiple clouds.
  • the number of interface calls indicated by the API gateway corresponding to each cloud platform of the platform. Therefore, the number of first API requests is less than or equal to the number of second API requests.
  • Each API gateway responds to the received API request in a question-and-answer manner, that is, every time an API request is received, an API response is returned.
  • the number of first API requests is equal to the number of first API responses; the number of second API requests is equal to the number of second API responses.
  • the first API gateway sends a second API request to the second API gateway every time after receiving a first API request. After a second API response returned by the second API gateway, a first API response is sent to the sender of the first API request.
  • the interface calling rules corresponding to the calling operation 2 of the resource 2 supported by the first API gateway and the second API gateway are both: calling API interface 1 and API interface 2 in turn. Then, after receiving the first API request for calling API interface 1, the first API gateway sends a second API request for calling API interface 1 to the second API gateway, and then receives the API interface 1 returned by the second API gateway.
  • the first API response corresponding to API interface 1 is sent to the sender of the first API request; after receiving the first API request for calling API interface 2, the first API gateway sends the second API The API gateway sends the second API request for calling API interface 2, and after receiving the second API response corresponding to API interface 2 returned by the second API gateway, sends the first API request corresponding to API interface 2 to the sender of the first API request. API response.
  • the first API gateway When the number of the first API request is less than the number of the second API request, the first API gateway will execute at least two call processes in sequence according to the second interface call rule after receiving a first API request each time until the received
  • the second API response can generate a first API response corresponding to the first API request, and then send the first API response to the sender of the first API request according to the first interface calling rule.
  • the calling process includes: sending a second API request to the second API gateway, and receiving a second API response sent by the second API gateway.
  • the second interface calling rule is to call API interface 1 and API interface 2 in sequence
  • the first interface calling rule is to call API interface 1 and API interface 2 with one API request.
  • the API response includes resource parameter data.
  • the resource parameter data included in the second API response sent by the second API follows the resource parameter format supported by the API gateway of the target cloud platform.
  • the first API gateway publishes the format of the API request that it supports. Therefore, the user learns the first resource parameter format supported by the first API gateway. If the first API gateway directly passes the resource parameter data included in the second API response, The first API response is fed back to the user, and the user also needs to learn the resource parameter format supported by the second API gateway, which will increase the user's learning cost.
  • the first API gateway may also escape the resource parameter data in the second API response sent by the second API gateway to obtain the resource parameter data in the first API response, which can reduce user learning costs.
  • the second API response includes fourth resource parameter data
  • the format of the third resource parameter data is the resource parameter format supported by the first API gateway
  • the format of the third resource parameter data is the first Second
  • the third resource parameter data is obtained by the first API gateway converting the fourth resource parameter data into the resource parameter format.
  • the first API gateway may perform resource parameter format conversion on the fourth resource parameter data in a variety of ways.
  • the embodiment of the present application takes the following two optional methods as examples for description:
  • the first API gateway establishes the resource parameters supported by the API gateway of each of the multiple cloud platforms after determining the resource parameter format of the supported API request The first correspondence between the format and the resource parameter format supported by the first API gateway.
  • the first API gateway queries the first correspondence based on the identifier of the first API gateway to obtain the resource parameter format supported by the first API gateway; and based on the resource parameter format supported by the first API gateway, The fourth resource parameter data included in the second API response is escaped to obtain the third resource parameter data.
  • the first API gateway determines the resource parameter format of the supported API request, it is based on the resource parameter format supported by the API gateway of each cloud platform among the multiple cloud platforms, and the first API gateway supports An escape model is established, which is used to output resource parameter data corresponding to the received API gateway identifier and resource parameter data after receiving the API gateway identifier and resource parameter data.
  • the first API gateway inputs the fourth resource parameter data included in the second API response and the identification of the first API gateway into the escape model, and determines the resource parameter data output by the escape model as The third resource parameter data.
  • the first API gateway determines the second API request in the format supported by the target cloud platform, and sends the second API request to the second API gateway of the target cloud platform .
  • the user only needs to use the API request in the format supported by the first API gateway to access the API unified gateway to achieve access to the target cloud platform among multiple cloud platforms, which reduces the user’s operational complexity and improves user equipment and different clouds.
  • the communication flexibility of the platform is not limited to.
  • the user-oriented API gateway is the first API gateway, and the user only needs to support according to the first API gateway.
  • the resource format is programmed or the call operation is triggered through the user interface of the management node, which reduces the user's repeated learning and configuration costs for the same or similar resources (that is, the aforementioned same resource), and improves the user experience.
  • a set of user systems or an application may be deployed hierarchically using the resources of multiple cloud platforms.
  • users need to use corresponding resources on the multiple cloud platforms in a programmatic manner to implement word segmentation deployment of user systems or applications.
  • the communication method provided in the embodiment of the present application can also be used for resource orchestration across cloud platforms.
  • the user arranges and generates a unified resource template in a blueprint.
  • the user only needs to set in the resource template which cloud platform (ie the aforementioned target cloud platform) each resource of the user system or application is deployed on, and then run the set resource template Deploy instances on multiple cloud platforms, and set the resource template of the target cloud platform as the aforementioned client. This can effectively reduce user operations and improve resource deployment efficiency.
  • the first API gateway also supports other functions.
  • the first API gateway supports the presentation function of service information.
  • the communication method provided in the embodiment of the present application also include:
  • the first API gateway obtains service information of the resources of the cloud platform, where the service information includes at least one of service capability information and service prices.
  • the service information is information related to the service provided by the resource.
  • the service capability information is used to reflect the size of the resource's ability to provide services.
  • the service capability information includes one or more parameter values that reflect the service capability, or the service capability information may be a service capability index value, which may be based on The aforementioned parameter values are determined, and can also be preset values.
  • its service capability information includes one or one of the number of CPUs, the number of memory, the size of memory (for example, 4G memory), the system architecture, the information of the intranet transceiver capability, and the GPU indicator.
  • Intranet sending and receiving capability information is used to reflect the information sending and receiving capability of resources in the internal network.
  • the information is the number of packets per second (PPS).
  • PPS packets per second
  • the system architecture is used to indicate the system architecture supported by the resource.
  • the system architecture can be at least one of the IOS architecture, the Android architecture and the Kunpeng architecture, for example,
  • the values 0, 1, and 2 respectively represent the aforementioned three architectures;
  • the GPU indicator is used to indicate whether the corresponding resource has a GPU or the number of GPUs. There is a GPU; the service price is used to reflect the price of the service provided by the resource.
  • the first API gateway has the ability to identify service information of resources in each cloud platform. There may be multiple situations when the first API gateway obtains the service information.
  • the embodiments of this application take the following three situations as examples for description:
  • the first API gateway obtains the service information of the resources of the cloud platform after receiving the service information retrieval request through the user interface.
  • the management node can provide a user interface to the user equipment, and the user can perform retrieval operations on the user interface through the user equipment.
  • the management node sends the service information retrieval request to the first API gateway, and the first API gateway obtains the service information of the resources of the cloud platform based on the service information retrieval request.
  • the service information retrieval request includes the resource requirements of the retrieved cloud platform, including requirements on the function, resource format, and resource performance of the resource.
  • the resources of the cloud platform from which the first API gateway obtains the service information need to meet the service information retrieval request , That is, it matches the service information retrieval request.
  • the user interface 50 provided by the management node may be as shown in FIG.
  • the management node receives the service information retrieval request triggered by the retrieval operation, the service information retrieval request includes the keyword, and the first API gateway may obtain the service information of the resource matching the keyword based on the service information retrieval request. For example, if the keyword is: "GPU acceleration, 4-core CPU", the first API gateway obtains service information of a resource with a 4-core CPU for providing GPU acceleration services.
  • the user interface 60 provided by the management node may be as shown in FIG. 6.
  • the user interface 60 includes one or more prompt options 601, and the one or more prompt options 601 may include resource category prompt options. 6011, used to prompt the types of resources deployed in multiple cloud platforms. This type can be the service type provided by the resource, such as GPU acceleration, disk performance optimization, or network speed and bandwidth optimization; this type can also be the resource's own attribute type , Such as virtual machines or containers.
  • the one or more prompt options 601 may also include prompt options 6012 reflecting parameters of the service capability, such as the number of CPU options or the number of memory options. Each prompt option 601 is provided with a pull button.
  • the management node receives the service information retrieval request triggered by the retrieval operation.
  • the service information retrieval request includes the prompt information selected by the user.
  • the first API gateway may obtain the service information retrieval request based on the service information retrieval request. Service information of the resource. For example, the service information retrieval request indicates that the resource category is GPU accelerated, the number of CPUs is 4, and the number of memory is 8.
  • the management node may simultaneously present a search box and one or more prompt options on the user interface.
  • the management node may simultaneously present a search box and one or more prompt options on the user interface.
  • the first API gateway after receiving the first API request, obtains the service information of the resources of the cloud platform.
  • the service information of the resource of the cloud platform matches the first API request.
  • the first API request includes the identifier of the resource
  • the service information of the resource acquired by the first API gateway is the service information of the resource corresponding to the identifier of the resource.
  • the identifier of the resource is "GPU acceleration”
  • the service information of the resource acquired by the first API gateway is the service information of the resource used to provide GPU acceleration services in multiple cloud platforms.
  • the first API gateway periodically obtains the capability information of the resources of multiple cloud platforms.
  • the multiple cloud platforms may be all cloud platforms managed by the first API gateway, and each time the resources of the multiple cloud platforms are obtained After the capability information, the first API gateway stores the acquired capability information of the resources of the cloud platform in the designated storage space 4.
  • the first API gateway presents the capability information of the resources of the cloud platform through the user interface.
  • the first API gateway sends the acquired capability information of the resources of the cloud platform to the management node, and the management node presents the capability information of the resources of the cloud platform through a user interface.
  • each set of capability information may be presented in the form of a list.
  • the service information presentation function of the first API gateway can present the capability information of the resources of the cloud platform to the user, so that the user can understand the capability information of the resource.
  • the first API gateway after receiving the service information retrieval request, obtains the service information of the resources of the cloud platform, and presents the obtained service information through the user interface, which can be realized through the user
  • the interface performs the retrieval function of service information, so that users can retrieve on demand and obtain the service information they want to obtain. Users do not need to check whether resources meet their own needs on a cloud platform one by one, reducing user operation complexity and improving user experience.
  • S309 and S310 may be performed before the aforementioned S303. Then in S303, the user can send the first API request to the first API gateway through the user equipment based on the search result.
  • the first API gateway After receiving the first API request, the first API gateway obtains the service information of the resources of the cloud platform, and presents the obtained service information through the user interface, which can realize that when the user makes an interface call, The user provides the service information of the resource that meets the demand, so that the user can understand the service information of the resource and make better interface calls.
  • S309 and S310 may be executed after the aforementioned S303.
  • the first API gateway may obtain the latest capability information of the resources of the cloud platform in the designated storage space 4 after detecting that the user accesses the specified page for presentation of capability information through the user interface. And the latest cloud platform resource capability information is presented through the designated page.
  • the capability information of the resources of the latest cloud platform is presented as multiple cloud platforms managed by the first API gateway, it is convenient for the user to have an overall understanding of the capability information of the resources of the cloud platform managed by the first API gateway.
  • the aforementioned capability information may be real-time capability information, that is, the capability information is dynamically variable; the capability information may also be rated capability information, and the rated capability information is fixed and used to reflect resource Capability limit.
  • the capability information is real-time capability information
  • the first API gateway can present the real-time capability information of the resource to realize the user's timely and accurate understanding of the current capability information and improve the user experience.
  • the aforementioned management node may also support the resource quota allocation function.
  • the management node presents a unified user interface of multiple cloud platforms. The user can perform resource allocation through the user interface. After receiving the allocation instruction, the management node performs resource quota Distribution. For example, the user needs to create virtual machine 1 on cloud platform 1 and virtual machine 2 on cloud platform 2, and the user allocates resource quotas for the two virtual machines through the user interface. For example, a 4-core CPU and 2G memory are allocated to virtual machine 1; an 8-core CPU and 4G memory are allocated to virtual machine 2.
  • the aforementioned management node may also support the function of setting resource usage rights.
  • the management node presents a unified user interface of multiple cloud platforms. The user can set the resource usage rights on the user interface. After the management node receives the permission instruction instruction , Set up resource usage permissions. For example, the aforementioned user whose user account is M1 has the right to use virtual machine 1; the user whose user account is M2 has the right to use virtual machine 2.
  • the first API gateway also supports a resource migration function across cloud platforms.
  • the communication method provided by the embodiment of the present application further includes:
  • the first API gateway converts the resource parameter format of the resource parameter data of the resource to be migrated into a resource parameter format supported by the API gateway of the target cloud platform.
  • the first API gateway When the first API gateway performs resource migration, it first determines the source cloud platform to which the resource to be migrated belongs and the destination cloud platform to which it needs to be migrated, and then obtains the resource parameter data of the resource to be migrated on the source cloud platform, and the resource parameter data
  • the resource parameter format is converted into the resource parameter format supported by the API gateway of the target cloud platform.
  • the first API gateway can determine the source cloud platform and the destination cloud platform in a variety of ways.
  • the first API gateway receives a resource migration request, and the resource migration request indicates a source cloud platform and a destination cloud platform; in another optional example, the source cloud platform and the destination cloud platform are preset Cloud platform.
  • the first API gateway may convert the resource parameter format of the resource parameter data into a resource parameter format supported by the target cloud platform in various ways.
  • the first API gateway may first convert the resource parameter format of the resource parameter data into the resource parameter format supported by the first API gateway. This conversion process is called the first conversion, and then the converted The resource parameter format of the resource parameter data is converted into the resource parameter format supported by the destination cloud platform. This conversion process is called the second conversion.
  • the first API gateway pre-establishes a first correspondence between the resource parameter format supported by the API gateway of each cloud platform in the multiple cloud platforms and the resource parameter format supported by the first API gateway.
  • the API gateway determines the correspondence between the resource parameter format supported by the first API gateway and the resource parameter format supported by the source cloud platform, as well as the resource parameter format supported by the first API gateway and the resource supported by the destination cloud platform. Correspondence of parameter format 2.
  • the first API gateway completes the aforementioned first conversion based on the corresponding relationship 1, and completes the aforementioned second conversion based on the corresponding relationship 2.
  • the first API gateway may directly convert the resource parameter format of the resource parameter data into the resource parameter format supported by the target cloud platform.
  • the first API gateway determines the correspondence between the resource parameter format supported by the first API gateway and the resource parameter format supported by the source cloud platform based on the first correspondence1, and Correspondence between the resource parameter format supported by the first API gateway and the resource parameter format supported by the target cloud platform 2, and then determine the resource parameter format supported by the source cloud platform and the resource parameter format supported by the destination cloud platform based on the corresponding relationship 1 and the corresponding relationship 2.
  • the corresponding relationship 3. The first API gateway completes the process of converting the resource parameter format of the resource parameter data into the resource parameter format supported by the target cloud platform based on the correspondence relationship 3.
  • the first API gateway sends the transformed resource parameter data to the API gateway of the target cloud platform.
  • the first API gateway sends the converted resource parameter data to the API gateway of the target cloud platform.
  • the API gateway of the target cloud platform creates a new resource based on the transformed resource parameter data, thereby realizing the resource parameter data from the source cloud platform to the target Migration of cloud platforms.
  • the target cloud platform and the foregoing target cloud platform may be the same or different, which is not limited in the embodiment of the present application.
  • the resources of the platform 1 need to be deleted first, and then new resources are created on the cloud platform 2 through reprogramming.
  • the first API gateway can realize the automatic resource migration across cloud platforms. , No need for users to reprogram, reduce operation complexity and improve user experience.
  • the business data generated when the resources in the source cloud platform provide services also needs to be controlled by the user to send from the source cloud platform to the destination cloud platform to realize the complete migration of resources and business data .
  • User X needs to create a virtual machine with a 4-core CPU, 8G memory, and GPU, which is accessed by running the web client corresponding to the management node on the user device
  • the user interface provided by the management node the user interface may be as shown in Figure 5 or Figure 6, the user performs a retrieval operation through the user interface, and triggers a service information retrieval request "4 core CPU, 8G memory, with GPU".
  • the first API gateway obtains a resource that meets the requirements of the service information retrieval request and obtains its service information.
  • the service information of the resource obtained by the first API gateway is presented through the user interface of the management node.
  • the service information of the resource is presented in the form of a table (refer to the aforementioned S309 and S310 for this process).
  • Users can determine the target cloud platform based on the service information of multiple resources.
  • the user interface also presents the identification of the cloud platform to which multiple resources belong (for example, the name of the cloud platform), and the user selects the target cloud platform on the user interface through the web client.
  • the management node receives the selection instruction and will indicate The selection instruction of the target cloud platform is sent to the first API gateway.
  • the user equipment sends a first API request to the first API gateway through the client or the management node according to the first interface calling rule, and the calling operation indicated by the first API request is a resource establishment operation.
  • the first API gateway After receiving the first API request, the first API gateway converts the first resource data in the first API request into resource parameter format to obtain the second resource parameter data, and according to the second interface calling rule, converts the second parameter data including the second parameter data.
  • the API request is sent to the second API gateway in the target cloud platform. Assuming that the first API request indicates that the resource to be established is a virtual machine, the second API gateway establishes a virtual machine with "4-core CPU, 8G memory, and GPU" in the target cloud platform based on the second API request.
  • the second API gateway sends a second API response to the first API gateway. After receiving the second API response, the first API gateway sends the first API response to the user equipment according to the first interface calling rule (refer to the foregoing S303 to S308 for this process).
  • An embodiment of the present application provides a communication device 70, which is applied to a first API gateway. As shown in FIG. 8, the device 70 includes:
  • the receiving module 701 is used to receive the first API request; the determining module 702 is used to determine the target cloud platform used to respond to the first API request among multiple cloud platforms, and the format of the first API request is supported by the first API gateway Format; sending module 703, used to send a second API request to the second API gateway, the second API request is determined based on the first API request, and the format of the second API request is a format supported by the second API gateway, the second API gateway It is the API gateway of the target cloud platform.
  • the determining module determines the second API request in the format supported by the target cloud platform
  • the sending module sends the second API request to the second API request of the target cloud platform.
  • API gateway the user only needs to use the API request in the format supported by the first API gateway to access the API unified gateway to achieve access to the target cloud platform among multiple cloud platforms, which reduces the complexity of user operations and improves user equipment and Communication flexibility of different cloud platforms.
  • the first API request includes first resource parameter data
  • the second API request includes second resource parameter data.
  • the format of the first resource parameter data is the resource parameter format supported by the first API gateway.
  • the format is a resource parameter format supported by the second API gateway, and the second resource parameter data is obtained by converting the first resource parameter data into the resource parameter format.
  • the device 70 further includes: an integration module 704, configured to integrate resource parameter formats corresponding to the same invocation operation of the same resource in multiple cloud platforms, to be supported by the first API gateway The resource parameter format of the same call operation of the same resource.
  • an integration module 704 configured to integrate resource parameter formats corresponding to the same invocation operation of the same resource in multiple cloud platforms, to be supported by the first API gateway The resource parameter format of the same call operation of the same resource.
  • the resource parameter format of the same calling operation of the same resource supported by the first API gateway is a union of resource parameter formats corresponding to the same calling operation of the same resource in multiple cloud platforms.
  • the second API request is sent by the first API gateway based on the second interface calling rule
  • the second interface calling rule is the interface calling rule supported by the second API gateway
  • the second interface calling rule is based on the first API gateway.
  • the receiving module 701 is also used to receive the second API response sent by the second API gateway;
  • the sending module 703 is also used to follow the second API response based on the second API response
  • An interface calling rule replies the first API response to the sender of the first API request.
  • the apparatus 70 further includes: a rule determination module 705, configured to determine the same calling operation for the same resource in multiple cloud platforms based on the interface calling rule corresponding to the calling operation The first interface calling rule corresponding to the same calling operation of the resource.
  • a rule determination module 705 configured to determine the same calling operation for the same resource in multiple cloud platforms based on the interface calling rule corresponding to the calling operation The first interface calling rule corresponding to the same calling operation of the resource.
  • the interface calling rules of the calling operation are used to indicate the interface set corresponding to the calling operation and the calling timing of the interface set; when the same calling operation of the same resource in multiple cloud platforms corresponds to the interface set and the calling timing of the interface set
  • the first interface calling rule corresponding to the same calling operation of the same resource is to call the API interfaces in the interface set according to the calling sequence; when the same calling operation of the same resource in multiple cloud platforms corresponds to the same set of interfaces, the calling sequence Different, the first interface calling rule corresponding to the same calling operation of the same resource is to use one API request to call the API interface in the interface set corresponding to the same calling operation; when the same calling operation of the same resource in multiple cloud platforms corresponds to the interface The set is different.
  • the first interface calling rule corresponding to the same calling operation of the same resource is to use one API request to call the API interface in the interface set corresponding to the same calling operation.
  • the same resource is a resource whose similarity defined by the resource is greater than a similarity threshold.
  • the device 70 further includes: a presentation module 706, configured to provide service information of the resources of the cloud platform through a user interface, the service information including at least one of service capability information and service prices.
  • a presentation module 706 configured to provide service information of the resources of the cloud platform through a user interface, the service information including at least one of service capability information and service prices.
  • the apparatus 70 further includes: an obtaining module 707, configured to obtain service information of the resources of the cloud platform after receiving the service information retrieval request through the user interface; or, after receiving the first service information retrieval request; After the API request, the service information of the resources of the cloud platform is obtained.
  • an obtaining module 707 configured to obtain service information of the resources of the cloud platform after receiving the service information retrieval request through the user interface; or, after receiving the first service information retrieval request; After the API request, the service information of the resources of the cloud platform is obtained.
  • the target cloud platform is determined based on the selection instruction sent by the management node, the selection instruction is used to instruct the target cloud platform, and the selection instruction is received by the management node through the user interface; or, the target cloud platform is based on the selection sent by the client If the instruction is determined, the selection instruction is used to indicate the target cloud platform; or, the first API request includes the identification of the target cloud platform.
  • the device 70 further includes: a conversion module 708, configured to convert the resource parameter format of the resource parameter data of the resource to be migrated into a resource parameter format supported by the API gateway of the target cloud platform; a sending module 703 It is also used to send the transformed resource parameter data to the API gateway of the target cloud platform.
  • a conversion module 708 configured to convert the resource parameter format of the resource parameter data of the resource to be migrated into a resource parameter format supported by the API gateway of the target cloud platform
  • a sending module 703 It is also used to send the transformed resource parameter data to the API gateway of the target cloud platform.
  • the first API request is sent by the client to the first API gateway; or, the first API request is received by the management node on the user interface and sent to the first API gateway.
  • the calling operation indicated by the first API request includes any one of the following: resource establishment operation, resource deletion operation, resource modification operation, and resource query operation.
  • FIG. 14 assumes that the above-mentioned communication device is the first API gateway, and FIG. 14 schematically provides a possible basic hardware architecture in an actual application scenario of the first API gateway provided by an embodiment of the present application.
  • the first API gateway 101 includes: an API service module 1011, an authority authentication module 1012, a resource management module 1013, an API analysis module 1014, and an API database 1015.
  • the API service module 1011 is used to publish the API request format supported by the first API gateway to provide a unified API interface to the user equipment, which can implement the aforementioned S302 function.
  • the permission authentication module 1012 is used to perform permission authentication on the received first API request, and it can implement the authentication function described in S304.
  • the resource management module 1013 is configured to determine the target cloud platform among multiple cloud platforms after receiving the first API request, and determine the second API request based on the first API request, which can implement the aforementioned functions of S304 and S305.
  • the API service module 1011 is further configured to receive the first API request, call the authority authentication module 1012 to authenticate the first API request, and transparently transmit the first API request that is successfully authenticated to the resource management module 1013.
  • the API analysis module 1014 is used to determine the format of the API request, which can implement the aforementioned function of S301.
  • the API database 1015 is used to store at least one of resource definitions of multiple cloud platforms, resource formats of multiple cloud platforms, and capability information of resources of multiple cloud platforms, which can implement the aforementioned designated storage space 1 to designated storage space 4 The function of at least one of them.
  • the environment outside the first API gateway 101 in FIG. 14 is only a schematic environment, and for related explanations, reference may be made to the corresponding explanations in FIGS. 1 and 2 described above.
  • FIG. 14 only provides an example in which the above-mentioned function allocation is completed by different function modules according to needs, and does not limit the division of modules in the first API gateway.
  • FIG. 15 schematically provides a possible basic hardware architecture of the computer device provided in the embodiment of the present application.
  • the computer device 900 includes a processor 901, a memory 902, a communication interface 903, and a bus 904.
  • the number of processors 901 may be one or more, and FIG. 15 only illustrates one of the processors 901.
  • the processor 901 may be a central processing unit (CPU). If the computer device 900 has multiple processors 901, the types of the multiple processors 901 may be different or may be the same.
  • multiple processors 901 of the computer device 900 may also be integrated into a multi-core processor.
  • the memory 902 stores computer instructions and data; the memory 902 may store computer instructions and data required to implement the communication method provided in the present application.
  • the memory 902 stores instructions for implementing the steps of the communication method.
  • the memory 902 may be any one or any combination of the following storage media: non-volatile memory (for example, read only memory (ROM), solid state drive (SSD), hard disk (HDD), optical disc), volatile memory.
  • the communication interface 903 may be any one or any combination of the following devices: a network interface (for example, an Ethernet interface), a wireless network card, and other devices with a network access function.
  • the communication interface 903 is used for data communication between the computer device 900 and other computer devices or terminals.
  • the bus 904 can connect the processor 901 with the memory 902 and the communication interface 903. In this way, through the bus 904, the processor 901 can access the memory 902, and can also use the communication interface 903 to interact with other computer devices or terminals.
  • the computer device 900 executes the computer instructions in the memory 902, so that the computer device 900 implements the communication method provided in this application, or causes the computer device 900 to deploy a communication system.
  • non-transitory computer-readable storage medium including instructions, such as a memory including instructions, which can be executed by a processor of a server to complete the communication methods shown in the various embodiments of the present application.
  • the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
  • An embodiment of the present application provides a communication system, including: a first API gateway and multiple cloud platforms, each cloud platform includes an API gateway, and the first API gateway includes any one of the communications provided in the embodiments of the present application A device, such as a communication device 70.
  • a device such as a communication device 70.
  • the structure of the communication system may refer to the structures in FIG. 1, FIG. 2 and FIG. 14.
  • the computer may be implemented in whole or in part by software, hardware, firmware, or any combination thereof.
  • software it may be implemented in the form of a computer program product in whole or in part, and the computer program product includes one or more computer instructions.
  • the computer program instructions When the computer program instructions are loaded and executed on the computer, the processes or functions described in the embodiments of the present application are generated in whole or in part.
  • the computer may be a general-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • the computer instructions may be transmitted from a website, computer, server, or data.
  • the center transmits to another website, computer, server, or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.).
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium, or a semiconductor medium (for example, a solid state hard disk).
  • the communication device or communication system provided in the above-mentioned embodiment executes the communication method
  • only the division of the above-mentioned functional modules is used as an example for illustration.
  • the above-mentioned functions can be allocated to different functions according to needs.
  • Module completion that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
  • the communication device, the communication system, and the communication method embodiments provided in the foregoing embodiments belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.

Abstract

Disclosed are a communication method, apparatus and system, which belong to the field of cloud computing. The method comprises: a first application programming interface (API) gateway receiving a first API request; the first API gateway determining, from among a plurality of cloud platforms, a target cloud platform for responding to the first API request, wherein the format of the first API request is a format supported by the first API gateway; and the first API gateway sending a second API request to a second API gateway, wherein the second API request is determined on the basis of the first API request, the format of the second API request is a format supported by the second API gateway, and the second API gateway is an API gateway of the target cloud platform. By means of the present application, the flexibility of the communication between a user equipment and different cloud platforms is improved.

Description

通信方法、装置及系统Communication method, device and system 技术领域Technical field
本申请涉及云计算领域,特别涉及一种通信方法、装置及系统。This application relates to the field of cloud computing, and in particular to a communication method, device and system.
背景技术Background technique
云技术(Cloudtechnology)是一种用于实现数据的计算、储存、处理或共享的托管技术。用于实现云技术的平台称为云平台。Cloud technology is a hosting technology used to realize the calculation, storage, processing or sharing of data. The platform used to implement cloud technology is called cloud platform.
随着用户对数据的不同需求的逐渐增大,一个用户可能会通过用户设备在不同的云平台上进行不同资源的调用。例如在不同云平台建立不同的虚拟机。如此,用户设备在访问不同云平台时,需要发出符合该不同云平台所支持的格式的不同的应用程序接口(Application Programming Interface,API)请求,用户设备与不同云平台的通信灵活性较低。As users' different requirements for data gradually increase, a user may call different resources on different cloud platforms through user equipment. For example, create different virtual machines on different cloud platforms. In this way, when the user equipment accesses different cloud platforms, it needs to issue different application programming interface (API) requests that conform to the formats supported by the different cloud platforms, and the communication flexibility between the user equipment and different cloud platforms is low.
发明内容Summary of the invention
本申请实施例提供了一种通信方法、装置及系统。所述技术方案如下:The embodiments of the present application provide a communication method, device, and system. The technical solution is as follows:
第一方面,提供了一种通信方法,所述方法包括:In a first aspect, a communication method is provided, and the method includes:
第一应用程序接口API网关接收第一API请求;第一API网关在多个云平台中确定用于响应该第一API请求的目标云平台,该第一API请求的格式为该第一API网关支持的格式;该第一API网关向第二API网关发送第二API请求,该第二API请求基于该第一API请求确定,且该第二API请求的格式为该第二API网关支持的格式,该第二API网关为该目标云平台的API网关。The first application program interface API gateway receives the first API request; the first API gateway determines the target cloud platform used to respond to the first API request among multiple cloud platforms, and the format of the first API request is the first API gateway Supported format; the first API gateway sends a second API request to the second API gateway, the second API request is determined based on the first API request, and the format of the second API request is a format supported by the second API gateway , The second API gateway is the API gateway of the target cloud platform.
本申请实施例中,由于第一API网关在接收到第一API请求后,确定目标云平台所支持格式的第二API请求,并将该第二API请求发送至目标云平台的第二API网关,用户仅需采用第一API网关所支持格式的API请求访问API统一网关即可实现对多个云平台中的目标云平台的访问,降低了用户的操作复杂度,提高了用户设备与不同云平台的通信灵活性。In the embodiment of the present application, after receiving the first API request, the first API gateway determines the second API request in the format supported by the target cloud platform, and sends the second API request to the second API gateway of the target cloud platform , The user only needs to use the API request in the format supported by the first API gateway to access the API unified gateway to achieve access to the target cloud platform among multiple cloud platforms, which reduces the user’s operational complexity and improves user equipment and different clouds. The communication flexibility of the platform.
在本申请实施例中,第一API网关需要预先确定自身支持的API请求的格式,从而为后续用户的使用提供便利。API请求的格式与第一API网关部署的资源的格式一致,因此也称资源格式。该资源格式主要包括两部分,一部分是API请求中携带的资源参数的格式(schema,也称规格);另一部分包括API请求对应的接口调用规则。其中,资源参数指的是数据所属的资源的参数(也称对象)。资源参数格式是该数据的对象的结构定义。调用操作的接口调用规则用于指示调用操作对应的接口集以及接口集的调用时序。其中,通过同一次API请求调用的接口集的时序相同,通过不同次API请求调用的接口集的时序不同。In the embodiment of the present application, the first API gateway needs to predetermine the format of the API request that it supports, so as to provide convenience for subsequent users. The format of the API request is consistent with the format of the resource deployed by the first API gateway, so it is also called the resource format. The resource format mainly includes two parts, one part is the format (schema, also called specification) of the resource parameters carried in the API request; the other part includes the interface calling rules corresponding to the API request. Among them, the resource parameter refers to the parameter (also called the object) of the resource to which the data belongs. The resource parameter format is the structure definition of the data object. The interface calling rules of the calling operation are used to indicate the interface set corresponding to the calling operation and the calling timing of the interface set. Among them, the time sequence of the interface set called through the same API request is the same, and the time sequence of the interface set called through different API requests is different.
本申请实施例分别以以下两方面对第一API网关确定支持的API请求的格式的过程进行说明。The embodiment of the present application describes the process of determining the format of the supported API request by the first API gateway in the following two aspects.
第一种可选实现方式,第一API网关确定支持的API请求的资源参数格式。 该过程包括:In the first optional implementation manner, the first API gateway determines the resource parameter format of the supported API request. The process includes:
该第一API网关将该多个云平台中的同一种资源的同一调用操作所对应的资源参数格式进行整合,得到该第一API网关支持的该同一种资源的同一调用操作的资源参数格式。The first API gateway integrates resource parameter formats corresponding to the same calling operation of the same resource in the multiple cloud platforms to obtain the resource parameter format of the same calling operation of the same resource supported by the first API gateway.
可选地,该第一API网关支持的同一种资源的同一调用操作的资源参数格式为该多个云平台中的同一种资源的同一调用操作所对应的资源参数格式的并集。Optionally, the resource parameter format of the same calling operation of the same resource supported by the first API gateway is a union of resource parameter formats corresponding to the same calling operation of the same resource in the multiple cloud platforms.
相应的,该将该多个云平台中的同一种资源的同一调用操作所对应的资源参数格式进行整合,得到该第一API网关支持的该同一种资源的同一调用操作的统一资源参数格式的过程,包括:获取该多个云平台中的同一种资源的同一调用操作所对应的资源参数格式的并集,得到该第一API网关支持的同一种资源的同一调用操作的资源参数格式。Correspondingly, the resource parameter format corresponding to the same calling operation of the same resource in the multiple cloud platforms should be integrated to obtain the uniform resource parameter format of the same calling operation of the same resource supported by the first API gateway The process includes: obtaining the union of resource parameter formats corresponding to the same calling operation of the same resource in the multiple cloud platforms, and obtaining the resource parameter format of the same calling operation of the same resource supported by the first API gateway.
与第一种可选实现方式对应的,该第一API请求包括第一资源参数数据,该第二API请求包括第二资源参数数据,该第一资源参数数据的格式为该第一API网关支持的资源参数格式,该第一资源参数数据的格式为该第二API网关支持的资源参数格式,该第二资源参数数据是将该第一资源参数数据进行资源参数格式转化得到的。Corresponding to the first optional implementation manner, the first API request includes first resource parameter data, the second API request includes second resource parameter data, and the format of the first resource parameter data is supported by the first API gateway The format of the first resource parameter data is a resource parameter format supported by the second API gateway, and the second resource parameter data is obtained by converting the first resource parameter data into a resource parameter format.
第二种可选实现方式,第一API网关确定支持的API请求的接口调用规则。该过程包括:In the second optional implementation manner, the first API gateway determines the interface calling rules of the supported API requests. The process includes:
对于该多个云平台中的同一种资源的同一调用操作,该第一API网关基于该调用操作所对应的接口调用规则,确定该同一种资源的同一调用操作对应的第一接口调用规则。For the same calling operation of the same resource in the multiple cloud platforms, the first API gateway determines the first interface calling rule corresponding to the same calling operation of the same resource based on the interface calling rule corresponding to the calling operation.
可选地,该调用操作的接口调用规则用于指示该调用操作对应的接口集以及接口集的调用时序;Optionally, the interface calling rule of the calling operation is used to indicate the interface set corresponding to the calling operation and the calling timing of the interface set;
当该多个云平台中的同一种资源的同一调用操作对应的接口集以及接口集的调用时序均相同,该同一种资源的同一调用操作对应的第一接口调用规则为按照该调用时序调用该接口集中的API接口;当该多个云平台中的同一种资源的同一调用操作对应的接口集相同,调用时序不同,该同一种资源的同一调用操作对应的第一接口调用规则为采用一次API请求调用该同一调用操作对应的接口集中的API接口;当该多个云平台中的同一种资源的同一调用操作对应的接口集不同,该同一种资源的同一调用操作对应的第一接口调用规则为采用一次API请求调用该同一调用操作对应的接口集中的API接口。When the interface set corresponding to the same calling operation of the same resource in the multiple cloud platforms and the calling sequence of the interface set are the same, the first interface calling rule corresponding to the same calling operation of the same resource is to call the interface according to the calling sequence. API interface in the interface set; when the same call operation of the same resource in the multiple cloud platforms corresponds to the same interface set and the call sequence is different, the first interface call rule corresponding to the same call operation of the same resource is to use one API Request to call the API interface in the interface set corresponding to the same calling operation; when the same calling operation of the same resource in the multiple cloud platforms corresponds to different interface sets, the first interface calling rule corresponding to the same calling operation of the same resource To use one API request to call the API interface in the interface set corresponding to the same calling operation.
与第二种可选实现方式对应的,该第二API请求由该第一API网关基于第二接口调用规则发送,该第二接口调用规则是该第二API网关支持的接口调用规则,该第二接口调用规则由该第一API网关基于该第一API网关支持的第一接口调用规则以及该第一API请求确定;该方法还包括:Corresponding to the second optional implementation manner, the second API request is sent by the first API gateway based on a second interface invocation rule, and the second interface invocation rule is an interface invocation rule supported by the second API gateway. The second interface call rule is determined by the first API gateway based on the first interface call rule supported by the first API gateway and the first API request; the method further includes:
该第一API网关接收该第二API网关发送的第二API响应;该第一API网关基于该第二API响应,按照该第一接口调用规则向该第一API请求的发送端回复第一API响应。The first API gateway receives the second API response sent by the second API gateway; based on the second API response, the first API gateway replies with the first API to the sender of the first API request according to the first interface calling rule response.
可选地,API响应包括资源参数数据。第二API发送的第二API响应包括的 资源参数数据遵循目标云平台的API网关支持的资源参数格式。而第一API网关发布的是自身支持的API请求的格式,因此用户学习的是第一API网关支持的第一资源参数格式,若第一API网关直接将第二API响应包括的资源参数数据通过第一API响应反馈给用户,用户还需要再学习第二API网关支持的资源参数格式,因此会增加用户的学习成本。本申请实施例中,第一API网关还可以对第二API网关发送的第二API响应中的资源参数数据进行转义,得到第一API响应中的资源参数数据,如此可以减少用户学习成本。Optionally, the API response includes resource parameter data. The resource parameter data included in the second API response sent by the second API follows the resource parameter format supported by the API gateway of the target cloud platform. The first API gateway publishes the format of the API request that it supports. Therefore, the user learns the first resource parameter format supported by the first API gateway. If the first API gateway directly passes the resource parameter data included in the second API response The first API response is fed back to the user, and the user also needs to learn the resource parameter format supported by the second API gateway, which will increase the user's learning cost. In the embodiment of the present application, the first API gateway may also escape the resource parameter data in the second API response sent by the second API gateway to obtain the resource parameter data in the first API response, which can reduce user learning costs.
假设第一API响应包括第三资源参数数据,第二API响应包括第四资源参数数据,第三资源参数数据的格式为第一API网关支持的资源参数格式,第三资源参数数据的格式为第二API网关支持的资源参数格式,则第三资源参数数据是第一API网关将第四资源参数数据进行资源参数格式转化得到的。Assuming that the first API response includes third resource parameter data, the second API response includes fourth resource parameter data, the format of the third resource parameter data is the resource parameter format supported by the first API gateway, and the format of the third resource parameter data is the first Second, the resource parameter format supported by the API gateway, the third resource parameter data is obtained by the first API gateway converting the fourth resource parameter data into the resource parameter format.
需要说明的是,前述第一种可选实现方式和第二种可选实现方式中,多个云平台提供的资源提供的服务相同或相似,第一API网关需要预先在多个云平台中确定同一种资源,也即是资源类型相同的资源,进而进行同一种资源的资源格式的整合。可选地,该同一种资源为资源定义的相似度大于相似度阈值的资源。或者,该同一种资源为资源的标识的相似度大于第二相似度阈值的资源。It should be noted that in the foregoing first optional implementation manner and the second optional implementation manner, the resources provided by multiple cloud platforms provide the same or similar services, and the first API gateway needs to be determined in advance in multiple cloud platforms The same resource, that is, the resource of the same resource type, is used to integrate the resource format of the same resource. Optionally, the same resource is a resource whose similarity defined by the resource is greater than a similarity threshold. Or, the same type of resource is a resource whose identifier of the resource has a similarity greater than the second similarity threshold.
可选地,第一API网关除了前述进行API请求的格式整合功能,还支持其他功能,例如第一API网关支持服务信息的呈现功能,则该方法还包括:该第一API网关通过用户界面云平台的资源的服务信息,该服务信息包括服务能力信息和服务价格中的至少一种。Optionally, in addition to the aforementioned format integration function for API requests, the first API gateway also supports other functions. For example, the first API gateway supports the presentation function of service information, and the method further includes: the first API gateway uses the user interface cloud Service information of the resources of the platform, where the service information includes at least one of service capability information and service prices.
第一API网关获取服务信息的时机可以有多种情况。例如在通过该用户界面接收到服务信息检索请求后,该第一API网关获取该云平台的资源的服务信息;或者,在接收到该第一API请求后,该第一API网关获取该云平台的资源的服务信息。There may be multiple situations when the first API gateway obtains the service information. For example, after receiving the service information retrieval request through the user interface, the first API gateway obtains the service information of the resources of the cloud platform; or, after receiving the first API request, the first API gateway obtains the cloud platform The service information of the resource.
可选地,当呈现的资源的能力信息包括与多个资源一一对应的多组能力信息时,每组能力信息可以以列表的方式呈现。Optionally, when the presented capability information of the resource includes multiple sets of capability information corresponding to multiple resources on a one-to-one basis, each set of capability information may be presented in the form of a list.
在一种实现方式中,第一API网关在接收到服务信息检索请求后,获取云平台的资源的服务信息,并通过用户界面呈现获取的服务信息,能够实现通过用户界面进行服务信息的检索功能,从而便于用户按需检索,得到自身想要获取的服务信息。用户无需逐个云平台查询资源是否满足自身需求,减少用户的操作复杂度,提高用户体验。In an implementation manner, after receiving the service information retrieval request, the first API gateway obtains the service information of the resources of the cloud platform, and presents the obtained service information through the user interface, which can realize the retrieval function of the service information through the user interface , Which is convenient for users to search on demand and get the service information they want to obtain. Users do not need to check whether resources meet their own needs on a cloud platform one by one, reducing user operation complexity and improving user experience.
在另一种实现方式中,第一API网关在接收到第一API请求后,获取云平台的资源的服务信息,并通过用户界面呈现获取的服务信息,能够实现在用户进行接口调用时,为用户提供满足需求的资源的服务信息,从而便于用户了解资源的服务信息,从而更好地进行接口调用。In another implementation manner, after receiving the first API request, the first API gateway obtains the service information of the resources of the cloud platform, and presents the obtained service information through the user interface, which can realize that when the user makes an interface call, The user provides the service information of the resource that meets the demand, so that the user can understand the service information of the resource and make better interface calls.
在又一种实现方式中,第一API网关可以在检测到用户通过用户界面访问用于进行能力信息呈现的指定页面的操作后,在指定存储空间获取最新的云平台的资源的能力信息,并通过该指定页面呈现最新的云平台的资源的能力信息。当呈现的云平台是第一API网关管理的多个云平台时,可以便于用户对第一API网关 管理的云平台的资源的能力信息进行整体的了解。In another implementation manner, the first API gateway may obtain the latest capability information of the resources of the cloud platform in the designated storage space after detecting that the user accesses the specified page for the presentation of capability information through the user interface, and The capacity information of the latest cloud platform resources is presented through the designated page. When the presented cloud platform is multiple cloud platforms managed by the first API gateway, it is convenient for the user to have an overall understanding of the capability information of the resources of the cloud platform managed by the first API gateway.
需要说明的是,前述能力信息可以是实时的能力信息,即该能力信息是动态可变的;该能力信息也可以是额定的能力信息,该额定的能力信息是固定的,用于反映资源的能力上限。当该能力信息是实时的能力信息时,第一API网关能够通过呈现资源的实时的能力信息,实现用户对当前的能力信息的及时准确的了解,提高用户体验。It should be noted that the aforementioned capability information may be real-time capability information, that is, the capability information is dynamically variable; the capability information may also be rated capability information, and the rated capability information is fixed and used to reflect resource Capability limit. When the capability information is real-time capability information, the first API gateway can present the real-time capability information of the resource to realize the user's timely and accurate understanding of the current capability information and improve the user experience.
可选地,目标云平台是基于管理节点发送的选择指令确定的,该选择指令用于指示该目标云平台,该选择指令是该管理节点通过用户界面接收的;或者,该目标云平台是基于客户端发送的选择指令确定的,该选择指令用于指示该目标云平台;或者,该第一API请求包括该目标云平台的标识。Optionally, the target cloud platform is determined based on a selection instruction sent by the management node, the selection instruction is used to instruct the target cloud platform, and the selection instruction is received by the management node through a user interface; or, the target cloud platform is based on If the selection instruction sent by the client is determined, the selection instruction is used to indicate the target cloud platform; or, the first API request includes the identifier of the target cloud platform.
可选地,第一API网关还支持跨云平台的资源迁移功能。则该方法还包括:该第一API网关将待迁移资源的资源参数数据的资源参数格式转化为目的云平台的API网关支持的资源参数格式;该第一API网关将转化后的该资源参数数据发送至该目的云平台的API网关。Optionally, the first API gateway also supports a resource migration function across cloud platforms. Then the method further includes: the first API gateway converts the resource parameter format of the resource parameter data of the resource to be migrated into the resource parameter format supported by the API gateway of the target cloud platform; the first API gateway converts the converted resource parameter data Sent to the API gateway of the destination cloud platform.
可选地,该第一API请求由客户端发送给该第一API网关;或者,该第一API请求由管理节点在用户界面接收并发送该第一API网关。Optionally, the first API request is sent by the client to the first API gateway; or, the first API request is received by the management node on the user interface and sent to the first API gateway.
可选地,该第一API请求指示的调用操作包括以下任一种:资源的建立操作、资源的删除操作、资源的修改操作以及资源的查询操作。Optionally, the calling operation indicated by the first API request includes any one of the following: resource establishment operation, resource deletion operation, resource modification operation, and resource query operation.
第二方面,提供了一种通信装置,该装置应用于第一应用程序接口API网关,该装置可以包括至少一个模块,该至少一个模块可以用于实现上述第一方面或者第一方面的各种可能实现提供的通信方法。In a second aspect, a communication device is provided, which is applied to a first application program interface API gateway. The device may include at least one module, and the at least one module may be used to implement the above-mentioned first aspect or various aspects of the first aspect. It is possible to implement the provided communication method.
第三方面,本申请提供一种通信系统,该通信系统包括:第一API网关和多个云平台,每个云平台包括一个API网关,所述第一API网关包括第二方面任一所述的通信装置。In a third aspect, the present application provides a communication system. The communication system includes: a first API gateway and multiple cloud platforms, each cloud platform includes an API gateway, and the first API gateway includes any one described in the second aspect的通信装置。 Communication device.
第三方面,本申请提供一种计算机设备,该计算机设备包括处理器和存储器。该存储器存储计算机指令;该处理器执行该存储器存储的计算机指令,使得该计算机设备执行上述第一方面或者第一方面的各种可能实现提供的方法,使得该计算机设备部署上述第二方面或者第二方面的各种可能实现提供的该通信装置。In a third aspect, this application provides a computer device including a processor and a memory. The memory stores computer instructions; the processor executes the computer instructions stored in the memory, so that the computer device executes the methods provided by the foregoing first aspect or various possible implementations of the first aspect, so that the computer device deploys the foregoing second aspect or the first aspect. The communication device provided by various possible implementations of the two aspects.
第四方面,本申请提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机指令,该计算机指令指示该计算机设备执行上述第一方面或者第一方面的各种可能实现提供的方法,或者该计算机指令指示该计算机设备部署上述第二方面或者第二方面的各种可能实现提供的通信装置。In a fourth aspect, the present application provides a computer-readable storage medium having computer instructions stored in the computer-readable storage medium, and the computer instructions instruct the computer device to execute the above-mentioned first aspect or various possible implementations of the first aspect. The method or the computer instruction instructs the computer device to deploy the communication device provided by the foregoing second aspect or various possible implementations of the second aspect.
第五方面,本申请提供一种计算机程序产品,该计算机程序产品包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器可以从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述第一方面或者第一方面的各种可能实现提供的方法,使得该计算机设备部署上述第二方面或者第二方面的各种可能实现提供的通信装置。In a fifth aspect, the present application provides a computer program product. The computer program product includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device can read the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the above-mentioned first aspect or the methods provided by various possible implementations of the first aspect, so that the computer The device deploys the communication device provided by the foregoing second aspect or various possible implementations of the second aspect.
第六方面,提供一种芯片,该芯片可以包括可编程逻辑电路和/或程序指令,当该芯片运行时用于实现如第一方面任一该的通信方法。In a sixth aspect, a chip is provided. The chip may include a programmable logic circuit and/or program instructions, and is used to implement any communication method as in the first aspect when the chip is running.
本申请实施例提供的技术方案带来的有益效果是:The beneficial effects brought about by the technical solutions provided by the embodiments of the present application are:
本申请实施例中,由于第一API网关在接收到第一API请求后,确定目标云平台所支持格式的第二API请求,并将该第二API请求发送至目标云平台的第二API网关,用户仅需采用第一API网关所支持格式的API请求访问API统一网关即可实现对多个云平台中的目标云平台的访问,降低了用户的操作复杂度,提高了用户设备与不同云平台的通信灵活性。In the embodiment of the present application, after receiving the first API request, the first API gateway determines the second API request in the format supported by the target cloud platform, and sends the second API request to the second API gateway of the target cloud platform , The user only needs to use the API request in the format supported by the first API gateway to access the API unified gateway to achieve access to the target cloud platform among multiple cloud platforms, which reduces the user’s operational complexity and improves user equipment and different clouds. The communication flexibility of the platform.
由于新增了第一API网关,为多个云平台的API接口调用提供了统一的入口,因此,面向用户的是第一API网关,用户仅需按照第一API网关支持的资源格式进行编程或者通过管理节点的用户界面触发调用操作,减少了用户对于相似资源(即前述的同一种资源)的重复学习和配置成本,提高了用户体验。Since the first API gateway is newly added, it provides a unified entrance for API interface calls of multiple cloud platforms. Therefore, the user-oriented API gateway is the first API gateway, and the user only needs to program according to the resource format supported by the first API gateway or The call operation is triggered through the user interface of the management node, which reduces the user's repeated learning and configuration costs for similar resources (that is, the aforementioned same resource), and improves user experience.
并且,第一API网关的服务信息的呈现功能,可以将云平台的资源的能力信息呈现给用户,便于用户了解资源的能力信息。In addition, the service information presentation function of the first API gateway can present the capability information of the resource of the cloud platform to the user, so that the user can understand the capability information of the resource.
本申请实施例中,由于第一API向用户提供了统一的资源格式,本申请实施例提供的通信方法还可以用于跨云平台的资源编排。用户在一个蓝图里编排生成统一的资源模板,用户仅需在该资源模板中设置用户系统或应用的各资源部署在哪个云平台(即前述目标云平台),即可通过运行设置好的资源模板在多个云平台部署实例,设置好目标云平台的资源模板即为前述客户端。如此能够有效减少用户的操作,提高资源部署效率。In the embodiments of the present application, since the first API provides users with a unified resource format, the communication method provided in the embodiments of the present application can also be used for resource orchestration across cloud platforms. The user arranges and generates a unified resource template in a blueprint. The user only needs to set in the resource template which cloud platform (ie the aforementioned target cloud platform) each resource of the user system or application is deployed on, and then run the set resource template Deploy instances on multiple cloud platforms, and set the resource template of the target cloud platform as the aforementioned client. This can effectively reduce user operations and improve resource deployment efficiency.
本申请实施例中,若用户需要进行跨云平台的资源迁移,仅需要通过资源迁移请求或其他方式指定源云平台和目的云平台,第一API网关即可实现资源跨云平台的自动迁移,无需用户再重新编程,减少操作复杂度,提高用户体验。In the embodiments of this application, if a user needs to perform resource migration across cloud platforms, he only needs to specify the source cloud platform and the destination cloud platform through a resource migration request or other means, and the first API gateway can realize automatic resource migration across cloud platforms. There is no need for the user to reprogram, reducing operation complexity and improving user experience.
附图说明Description of the drawings
图1是本申请实施例提供的一种通信方法所涉及的通信系统的应用场景示意图;FIG. 1 is a schematic diagram of an application scenario of a communication system involved in a communication method provided by an embodiment of the present application;
图2是本申请实施例提供的另一种通信系统的应用场景示意图;FIG. 2 is a schematic diagram of an application scenario of another communication system provided by an embodiment of the present application;
图3是本申请实施例提供的一种通信方法的流程示意图;FIG. 3 is a schematic flowchart of a communication method provided by an embodiment of the present application;
图4是本申请实施例提供的另一种通信方法的流程示意图;FIG. 4 is a schematic flowchart of another communication method provided by an embodiment of the present application;
图5是本申请实施例提供的一种用户界面的示意图;FIG. 5 is a schematic diagram of a user interface provided by an embodiment of the present application;
图6是本申请实施例提供的另一种用户界面的示意图;FIG. 6 is a schematic diagram of another user interface provided by an embodiment of the present application;
图7是本申请实施例提供的又一种通信方法的流程示意图;FIG. 7 is a schematic flowchart of another communication method provided by an embodiment of the present application;
图8是本申请一示意性实施例提供的一种通信装置的结构示意图;FIG. 8 is a schematic structural diagram of a communication device provided by an exemplary embodiment of the present application;
图9是本申请一示意性实施例提供的另一种通信装置的结构示意图;FIG. 9 is a schematic structural diagram of another communication device provided by an exemplary embodiment of the present application;
图10是本申请一示意性实施例提供的又一种通信装置的结构示意图;FIG. 10 is a schematic structural diagram of another communication device provided by an exemplary embodiment of the present application;
图11是本申请一示意性实施例提供的再一种通信装置的结构示意图;FIG. 11 is a schematic structural diagram of still another communication device according to an exemplary embodiment of the present application;
图12是本申请另一示意性实施例提供的一种通信装置的结构示意图;FIG. 12 is a schematic structural diagram of a communication device provided by another exemplary embodiment of the present application;
图13是本申请另一示意性实施例提供的另一种通信装置的结构示意图;FIG. 13 is a schematic structural diagram of another communication device provided by another exemplary embodiment of the present application;
图14示意性地提供本申请实施例提供的第一API网关的在实际应用场景中的一种可能的基本硬件架构;FIG. 14 schematically provides a possible basic hardware architecture in an actual application scenario of the first API gateway provided by an embodiment of the present application;
图15示意性地提供本申请实施例提供的计算机设备的一种可能的基本硬件架构。FIG. 15 schematically provides a possible basic hardware architecture of a computer device provided in an embodiment of the present application.
具体实施方式Detailed ways
为使本申请的原理和技术方案更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the principles and technical solutions of the present application clearer, the implementation manners of the present application will be further described in detail below with reference to the accompanying drawings.
为了便于读者理解,下面对本申请实施例所涉及的名词进行解释。In order to facilitate readers' understanding, the terms involved in the embodiments of the present application are explained below.
云平台,也称云系统、云环境或云,是一种云供应商提供的云技术(也称云计算(cloud computing)技术)服务的软件系统。Cloud platform, also known as cloud system, cloud environment or cloud, is a software system for cloud technology (also known as cloud computing technology) services provided by cloud providers.
公有云,是第三方的公有云供应商为广大的个人或企业提供的云平台。在公有云中,硬件、软件和其他结构均为第三方的公有云供应商所拥有和管理。Public cloud is a cloud platform provided by a third-party public cloud provider for a large number of individuals or enterprises. In public clouds, hardware, software, and other structures are owned and managed by third-party public cloud providers.
私有云,是为一个企业或组织提供的专用的云平台。私有云可以由对应的企业或组织进行内部操作。私有云主要是面向企业用户,也称企业云。Private cloud is a dedicated cloud platform for an enterprise or organization. The private cloud can be operated internally by the corresponding enterprise or organization. Private cloud is mainly for enterprise users, also known as enterprise cloud.
混合云,是指不同的云平台所形成的云平台。混合云包括至少两个云平台,也称多云平台或多云。可选地,混合云融合了公有云和私有云。出于安全考虑,一些企业用户更愿意将数据存放在私有云中,但是同时又希望可以获得公有云的计算资源。在这种情况下,包括公有云和私有云的混合云被越来越多地采用。混合云将公有云和私有云进行混合和匹配,以获得良好的使用效果。Hybrid cloud refers to a cloud platform formed by different cloud platforms. Hybrid cloud includes at least two cloud platforms, also known as multi-cloud platforms or multi-clouds. Optionally, hybrid cloud combines public and private clouds. For security reasons, some enterprise users prefer to store data in private clouds, but at the same time hope to obtain computing resources from public clouds. In this case, hybrid clouds including public clouds and private clouds are increasingly adopted. Hybrid cloud mixes and matches public and private clouds to obtain good usage results.
虚拟机(Virtual Machine,VM),指的是通过软件模拟的具有完整硬件系统功能的、运行在一个隔离环境中的完整计算机系统。在实体计算机(简称实体机)中能够完成的工作在虚拟机中都能够实现。在计算机中创建虚拟机时,需要将实体计算机的部分硬盘和内存容量作为虚拟机的硬盘和内存容量。可选地,每个虚拟机都有独立的互补金属氧化物半导体(Complementary Metal Oxide Semiconductor,CMOS)、硬盘和操作系统,可以像使用实体计算机一样对虚拟机进行操作。Virtual Machine (VM) refers to a complete computer system with complete hardware system functions that is simulated by software and runs in an isolated environment. The work that can be done in a physical computer (referred to as a physical machine) can be realized in a virtual machine. When creating a virtual machine in a computer, part of the hard disk and memory capacity of the physical computer needs to be used as the hard disk and memory capacity of the virtual machine. Optionally, each virtual machine has an independent Complementary Metal Oxide Semiconductor (CMOS), hard disk, and operating system, and the virtual machine can be operated like a physical computer.
容器(container),也称容器映像,是采用容器技术建立的软件的轻量级独立可执行软件包。容器技术指的是计算机操作系统中的一种虚拟化技术,该技术使得进程运行于相对独立和隔离的环境(包含独立的文件系统、命名空间和/或资源视图等),从而能够简化软件的部署流程,增强软件的可移植性和安全性,并提高系统资源利用率。容器技术广泛应用于云计算领域的服务化场景。Container (container), also called container image, is a lightweight independent executable software package built with container technology. Container technology refers to a virtualization technology in a computer operating system, which enables processes to run in a relatively independent and isolated environment (including independent file systems, namespaces and/or resource views, etc.), thereby simplifying software The deployment process enhances the portability and security of the software, and improves the utilization of system resources. Container technology is widely used in service-oriented scenarios in the field of cloud computing.
应用程序接口,又称程序接口,是云平台的操作系统向用户,如编程人员,提供的“程序与操作系统的接口”。该接口是为用户在编程时使用的。用户通过该应用程序接口,可访问云平台中的资源和取得相应的服务。一个应用程序接口是一组定义、函数、程序和/或协议的集合。例如,云平台的一个应用程序接口包括一个或多个系统调用(system call),每个系统调用都是一个能完成特定功能的程序。Application program interface, also known as program interface, is the "interface between program and operating system" provided by the cloud platform's operating system to users, such as programmers. This interface is for users to use when programming. Through the application program interface, users can access resources in the cloud platform and obtain corresponding services. An application program interface is a collection of definitions, functions, procedures, and/or protocols. For example, an application program interface of a cloud platform includes one or more system calls, and each system call is a program that can complete a specific function.
API网关(Application Programming Interface Gateway,APIG),一种提供API托管服务的网关,可对API进行统一鉴权、计量、发布和/或流量控制等管理。API Gateway (Application Programming Interface Gateway, APIG), a gateway that provides API hosting services, can perform unified authentication, metering, publishing, and/or flow control management of APIs.
服务,包括:计算服务、存储服务或网络服务等。用户设备在云平台可以访问到的设备或功能都可视为云平台提供的服务。Services, including: computing services, storage services or network services, etc. The devices or functions that the user equipment can access on the cloud platform can be regarded as the services provided by the cloud platform.
资源,用于提供服务的硬件或软件资源。例如,与计算服务、存储服务或网络服务对应的,资源包括计算资源、存储资源或网络资源。可选地,计算资源包括中央处理器(CPU,central processing unit)资源、内存资源和/或硬盘资源等。Resources, hardware or software resources used to provide services. For example, corresponding to computing services, storage services, or network services, resources include computing resources, storage resources, or network resources. Optionally, the computing resources include central processing unit (CPU, central processing unit) resources, memory resources, and/or hard disk resources.
图1是本申请实施例提供的一种通信方法所涉及的通信系统的应用场景示意图。如图1所示,该通信系统包括:第一API网关101、多个云平台102以及一个或多个用户设备103。其中,每个云平台102包括一个API网关1021,每个云平台102部署有一种或多种资源,以用于为用户设备103提供服务,多个云平台102与多个API网关1021一一对应。第一API网关101与多个云平台102的API网关1021建立有通信连接。可选地,第一API网关101还与用户设备103建立有通信连接。第一API网关101用于管理用户设备103与该多个云平台102的API网关1021之间通信的信息。用户设备103可以通过第一API网关101实现与该多个云平台102的API网关1021的通信。可选地,该用户设备103为计算机或笔记本电脑等计算机设备。可选地,用户设备103可以安装有客户端,用户通过该客户端实现与第一API网关101的通信。该客户端通常由用户编程得到。FIG. 1 is a schematic diagram of an application scenario of a communication system involved in a communication method provided by an embodiment of the present application. As shown in FIG. 1, the communication system includes: a first API gateway 101, multiple cloud platforms 102, and one or more user equipment 103. Wherein, each cloud platform 102 includes an API gateway 1021, and each cloud platform 102 is deployed with one or more resources to provide services for the user equipment 103, and multiple cloud platforms 102 correspond to multiple API gateways 1021 one-to-one. . The first API gateway 101 establishes a communication connection with API gateways 1021 of multiple cloud platforms 102. Optionally, the first API gateway 101 also establishes a communication connection with the user equipment 103. The first API gateway 101 is used to manage the information communicated between the user equipment 103 and the API gateways 1021 of the multiple cloud platforms 102. The user equipment 103 may implement communication with the API gateway 1021 of the multiple cloud platforms 102 through the first API gateway 101. Optionally, the user equipment 103 is a computer device such as a computer or a notebook computer. Optionally, the user equipment 103 may be installed with a client, and the user realizes communication with the first API gateway 101 through the client. The client is usually programmed by the user.
图2是本申请实施例提供的另一种通信系统的应用场景示意图。在图1的基础上,该通信系统还包括:管理节点104,管理节点101可以为单独一个节点。其可以为一个服务器或者由多个服务器组成的服务器集群。也可以是一个或多个设定的最小处理单元,如虚拟机或容器。该管理节点104分别与第一API网关101以及用户设备103建立有通信连接,该管理节点104可以为用户设备103提供用户界面(User Interface,UI),以供用户设备103与第一API网关101进行通信。在一种可选方式中,用户设备103中安装有与管理节点104对应的网页客户端,用户设备103通过运行该网页客户端访问管理节点104提供的用户界面;在另一种可选方式中,用户设备103中安装有浏览器,用户设备103通过运行浏览器可以访问管理节点104提供的网页版本的用户界面。Fig. 2 is a schematic diagram of an application scenario of another communication system provided by an embodiment of the present application. On the basis of FIG. 1, the communication system further includes: a management node 104, and the management node 101 may be a single node. It can be a server or a server cluster composed of multiple servers. It can also be one or more set minimum processing units, such as virtual machines or containers. The management node 104 respectively establishes a communication connection with the first API gateway 101 and the user equipment 103. The management node 104 may provide a user interface (UI) for the user equipment 103 for the user equipment 103 and the first API gateway 101 To communicate. In an optional manner, a web client corresponding to the management node 104 is installed in the user equipment 103, and the user equipment 103 accesses the user interface provided by the management node 104 by running the web client; in another optional manner A browser is installed in the user equipment 103, and the user equipment 103 can access the user interface of the webpage version provided by the management node 104 by running the browser.
其中,图1和图2仅以两个云平台102和一个用户设备103为例进行说明,并不对通信系统中的云平台个数和用户设备个数进行限定。Among them, FIG. 1 and FIG. 2 only take two cloud platforms 102 and one user equipment 103 as an example for description, and do not limit the number of cloud platforms and the number of user equipment in the communication system.
可选地,第一API网关为微服务形态的应用,其包括的各个组件均可以部署在网络可达的虚拟机或容器中。Optionally, the first API gateway is an application in the form of a microservice, and each component included in it can be deployed in a virtual machine or container that is reachable on the network.
传统的包括混合云的通信系统中,用户设备在访问不同云平台时,需要发出符合不同云平台所支持的格式的不同的API请求,导致用户设备与不同云平台的通信灵活性较低。并且,用户需要熟悉不同云平台支持的API请求的格式,学习成本较高,用户体验较差。In traditional communication systems including hybrid clouds, when user equipment accesses different cloud platforms, it needs to issue different API requests conforming to formats supported by different cloud platforms, resulting in low communication flexibility between the user equipment and different cloud platforms. In addition, users need to be familiar with the API request formats supported by different cloud platforms, which results in high learning costs and poor user experience.
本申请实施例提供的通信系统中,由于新增了第一API网关,对用户设备103与该多个云平台102的API网关1021之间通信的信息进行统一管理,无需用户针对不同的云平台通过用户设备发送不同的API请求,从而减少用户的操作复杂度,提高用户设备与不同云平台的通信灵活性。用户仅需学习第一API网关支持的API请求的格式即可访问第一API网关所管理的各个云平台。因此,降低了用户的学习成本,提高了用户体验。In the communication system provided by the embodiment of the present application, since the first API gateway is newly added, the information communicated between the user equipment 103 and the API gateways 1021 of the multiple cloud platforms 102 is uniformly managed, without the need for users to target different cloud platforms. Different API requests are sent through the user equipment, thereby reducing the user's operational complexity and improving the communication flexibility between the user equipment and different cloud platforms. The user only needs to learn the API request format supported by the first API gateway to access each cloud platform managed by the first API gateway. Therefore, the user's learning cost is reduced and the user experience is improved.
并且,本申请实施例提供的通信系统中,新增的管理节点还可以实现用户通过用户界面与不同云平台的通信,进一步提高了用户设备与不同云平台的通信灵活性。In addition, in the communication system provided by the embodiment of the present application, the newly added management node can also realize the communication between the user and different cloud platforms through the user interface, which further improves the communication flexibility between the user equipment and the different cloud platforms.
图3是本申请实施例提供的一种通信方法的流程示意图,该通信方法可以应用于如图1或图2所示的通信系统中。如图3所示,该方法包括:FIG. 3 is a schematic flowchart of a communication method provided by an embodiment of the present application. The communication method may be applied to the communication system shown in FIG. 1 or FIG. 2. As shown in Figure 3, the method includes:
S301、第一API网关确定支持的API请求的格式。S301. The first API gateway determines the format of the supported API request.
在本申请实施例中,第一API网关需要预先确定自身支持的API请求的格式,从而为后续用户的使用提供便利。API请求是用于调用API接口时,用户设备发送的调用请求。API请求的格式与第一API网关部署的资源的格式一致,因此也称资源格式。该资源格式主要包括两部分,一部分是API请求中携带的资源参数的格式(schema,也称规格),简称资源参数格式或API格式;另一部分包括API请求对应的接口调用规则。其中,资源参数指的是数据所属的资源的参数(也称对象)。资源参数格式是该数据的对象的结构定义,即对资源参数的定义。例如,与某一资源的某种调用操作对应的资源参数格式为:资源参数分别为姓名和电话号码,或者,资源参数为CPU个数和/或图形处理器(Graphics Processing Unit,GPU)个数等计算资源规格参数。调用操作的接口调用规则用于指示调用操作对应的接口集(也称API接口集)以及接口集的调用时序。其中,通过同一次API请求调用的接口集的时序相同,通过不同次API请求调用的接口集的时序不同。例如,与某一资源的某种调用操作对应的接口调用规则为:接口集包括API接口1和API接口2,API接口1和API接口2的时序为API接口1在先,API接口2在后。也即是该接口调用规则为:依时序分两次调用API接口1和API接口2。一个接口集中包括至少一个API接口的标识,API接口的标识用于标识一个API接口。可选地,API接口的标识为API接口的接口路由地址,如统一资源标识符(Uniform Resource Identifier,URI)。In the embodiment of the present application, the first API gateway needs to predetermine the format of the API request that it supports, so as to provide convenience for subsequent users. An API request is a call request sent by a user device when calling an API interface. The format of the API request is consistent with the format of the resource deployed by the first API gateway, so it is also called the resource format. The resource format mainly includes two parts, one part is the resource parameter format (schema, also called specification) carried in the API request, referred to as the resource parameter format or API format; the other part includes the interface calling rules corresponding to the API request. Among them, the resource parameter refers to the parameter (also called the object) of the resource to which the data belongs. The resource parameter format is the structural definition of the object of the data, that is, the definition of the resource parameter. For example, the resource parameter format corresponding to a certain call operation of a resource is: the resource parameter is the name and phone number, or the resource parameter is the number of CPUs and/or the number of GPUs (Graphics Processing Unit) And other computing resource specifications. The interface calling rules of the calling operation are used to indicate the interface set (also called API interface set) corresponding to the calling operation and the calling sequence of the interface set. Among them, the time sequence of the interface set called through the same API request is the same, and the time sequence of the interface set called through different API requests is different. For example, the interface calling rule corresponding to a certain calling operation of a certain resource is: the interface set includes API interface 1 and API interface 2. The timing of API interface 1 and API interface 2 is that API interface 1 comes first, and API interface 2 comes later. . That is, the interface calling rule is: call API interface 1 and API interface 2 in two times according to time sequence. An interface set includes at least one API interface identifier, and the API interface identifier is used to identify one API interface. Optionally, the identifier of the API interface is the interface routing address of the API interface, such as a uniform resource identifier (URI).
如图1和图2所示,每个云平台部署有一种或多种资源,第一API网关支持对云平台中的不同资源的不同的调用操作。如此,针对每种资源,用户设备可以执行不同的调用操作。As shown in Figure 1 and Figure 2, each cloud platform is deployed with one or more resources, and the first API gateway supports different invocation operations to different resources in the cloud platform. In this way, for each resource, the user equipment can perform different calling operations.
其中,第一API网关支持的调用操作包括以下任一种:资源的建立操作(也称创建操作或添加操作)、资源的删除操作、资源的修改操作以及资源的查询操作。前述资源的建立操作用于资源的建立,例如云盘、网络、虚拟机或容器的建立;资源的删除操作用于资源的删除,例如云盘、网络、虚拟机或容器的删除;资源的修改操作用于资源的修改,例如修改计算资源的规则、镜像版本或网络带宽等;资源的查询操作用于资源的查询,例如查询资源的运行状态或参数规格等。Wherein, the calling operations supported by the first API gateway include any of the following: resource creation operations (also called creation operations or adding operations), resource deletion operations, resource modification operations, and resource query operations. The aforementioned resource establishment operations are used for the establishment of resources, such as cloud disks, networks, virtual machines, or containers; resource deletion operations are used for resource deletion, such as cloud disks, networks, virtual machines, or containers; resource modification Operations are used to modify resources, such as modifying the rules of computing resources, mirroring versions, or network bandwidth, etc.; resource query operations are used to query resources, such as querying resource running status or parameter specifications.
则前述第一API网关支持的API请求的格式包括第一API网关支持的多种资源的多种调用操作对应的API请求的格式。第一API网关支持的资源参数格式包括第一API网关支持的多种资源的多种调用操作对应的资源参数格式。第一API网关支持的接口调用规则包括第一API网关支持的多种资源的多种调用操作对应的接口调用规则。Then, the format of the API request supported by the aforementioned first API gateway includes the format of the API request corresponding to the multiple calling operations of multiple resources supported by the first API gateway. The resource parameter format supported by the first API gateway includes resource parameter formats corresponding to multiple invocation operations of multiple resources supported by the first API gateway. The interface calling rules supported by the first API gateway include interface calling rules corresponding to multiple calling operations of multiple resources supported by the first API gateway.
可选地,API请求中携带有对应的调用操作的标识,该调用操作的标识用于标识调用操作。示例的,该调用操作的标识可以通过API请求中的动作(verb)表示。为了便于读者理解,后续调用操作的标识采用调用操作的名称表示。Optionally, the API request carries a corresponding call operation identifier, and the call operation identifier is used to identify the call operation. For example, the identification of the calling operation may be expressed by an action (verb) in the API request. In order to facilitate the reader's understanding, the identifier of the subsequent call operation is represented by the name of the call operation.
针对每种资源的每种调用操作,第一API网关需要确定统一的API请求的格式,其包括统一的资源参数格式,以及一个统一的接口调用规则,从而为后续用户的使用提供便利。For each call operation of each resource, the first API gateway needs to determine a unified API request format, which includes a unified resource parameter format and a unified interface calling rule, so as to provide convenience for subsequent users.
本申请实施例分别以以下两方面对第一API网关确定支持的API请求的格式的过程进行说明。The embodiment of the present application describes the process of determining the format of the supported API request by the first API gateway in the following two aspects.
第一方面,第一API网关确定支持的API请求的资源参数格式。该过程包括:In the first aspect, the first API gateway determines the resource parameter format of the supported API request. The process includes:
步骤A1、第一API网关获取多个云平台中各个资源的不同调用操作所对应的资源参数格式。Step A1. The first API gateway obtains resource parameter formats corresponding to different invocation operations of various resources in multiple cloud platforms.
在第一种可选实现方式中,第一API网关可以基于多个云平台中多个资源的资源定义,确定多个云平台中各个资源的不同调用操作所对应的资源参数格式。资源定义用于描述对应的资源,其包括资源所涉及的资源参数。资源定义通常以文本形式存储。第一API网关可以获取多个云平台中多个资源的资源定义,并通过识别资源定义获取多个云平台中各个资源的不同调用操作所对应的资源参数格式。其中,多个云平台的资源定义可以由第一API网关在多个云平台拉取,或者,多个云平台的资源定义可以由第一API网关在存储有多个云平台的资源定义的指定存储空间1提取。其中,多个云平台的资源定义可以由通信系统的管理人员预先确定,输入至指定存储空间1,或者,多个云平台的资源定义可以由该指定存储空间1在多个云平台中拉取并维护。该指定存储空间1可以为一个数据库。In the first optional implementation manner, the first API gateway may determine the resource parameter format corresponding to different invocation operations of each resource in the multiple cloud platforms based on the resource definitions of the multiple resources in the multiple cloud platforms. The resource definition is used to describe the corresponding resource, which includes the resource parameters involved in the resource. Resource definitions are usually stored in text form. The first API gateway may obtain resource definitions of multiple resources in multiple cloud platforms, and obtain resource parameter formats corresponding to different invocation operations of various resources in multiple cloud platforms by identifying the resource definitions. Among them, the resource definitions of multiple cloud platforms can be pulled from multiple cloud platforms by the first API gateway, or the resource definitions of multiple cloud platforms can be specified by the first API gateway storing resource definitions of multiple cloud platforms Storage space 1 is extracted. Among them, the resource definitions of multiple cloud platforms can be pre-determined by the management personnel of the communication system and input into the designated storage space 1, or the resource definitions of multiple cloud platforms can be pulled from the designated storage space 1 in multiple cloud platforms And maintain. The designated storage space 1 may be a database.
可选地,第一API网关还可以维护该数据库中资源定义的不同版本,通信系统的管理人员也可以对该数据库中的资源定义进行管理,例如资源定义的增加、删除、修改和查询。Optionally, the first API gateway may also maintain different versions of resource definitions in the database, and the administrator of the communication system may also manage the resource definitions in the database, such as adding, deleting, modifying, and querying resource definitions.
在第二种可选实现方式中,多个云平台中各个资源的不同调用操作所对应的资源参数格式可以由通信系统的管理人员预先确定,输入至指定存储空间2,第一API网关在该指定存储空间2提取多个云平台中各个资源的不同调用操作所对应的资源参数格式即可。该指定存储空间2可以为一个数据库。In the second optional implementation manner, the resource parameter format corresponding to different invocation operations of various resources in multiple cloud platforms can be predetermined by the management personnel of the communication system and input into the designated storage space 2, where the first API gateway is located. The designated storage space 2 only needs to extract resource parameter formats corresponding to different invocation operations of various resources in multiple cloud platforms. The designated storage space 2 may be a database.
步骤A2、第一API网关将多个云平台中的同一种资源的同一调用操作所对应的资源参数格式进行整合,得到第一API网关支持的同一种资源的同一调用操作的资源参数格式。Step A2. The first API gateway integrates resource parameter formats corresponding to the same calling operation of the same resource in multiple cloud platforms to obtain the resource parameter format of the same calling operation of the same resource supported by the first API gateway.
针对每种资源的每种调用操作,第一API网关需要确定一个统一的资源参数格式,从而为后续用户的使用提供便利。可选地,第一API网关将多个云平台中的同一种资源的同一调用操作所对应的资源参数格式进行整合,得到第一API网关支持的同一种资源的同一调用操作的资源参数格式。示例的,第一API网关支持的同一种资源的同一调用操作的资源参数格式为多个云平台中的同一种资源的同一调用操作所对应的资源参数格式的并集。则第一API网关可以求取多个云平台中的同一种资源的同一调用操作所对应的资源参数格式的并集,以得到第一API网关支持的同一种资源的同一调用操作的资源参数格式。For each call operation of each resource, the first API gateway needs to determine a unified resource parameter format, so as to provide convenience for subsequent users. Optionally, the first API gateway integrates resource parameter formats corresponding to the same calling operation of the same resource in multiple cloud platforms to obtain the resource parameter format of the same calling operation of the same resource supported by the first API gateway. For example, the resource parameter format of the same calling operation of the same resource supported by the first API gateway is a union of resource parameter formats corresponding to the same calling operation of the same resource in multiple cloud platforms. Then the first API gateway can obtain the union of resource parameter formats corresponding to the same call operation of the same resource in multiple cloud platforms to obtain the resource parameter format of the same call operation of the same resource supported by the first API gateway .
例如,假设多个云平台分别为云平台1至云平台n,n≥2,同一种资源的同一调用操作为资源1的调用操作1,则第一API网关获取云平台1至云平台n的资源1的调用操作1对应的资源参数格式的并集,得到第一API网关支持的资源1的调用操作1的资源参数格式。For example, suppose that multiple cloud platforms are cloud platform 1 to cloud platform n, n≥2, and the same call operation of the same resource is call operation 1 of resource 1, then the first API gateway obtains the cloud platform 1 to cloud platform n The union of the resource parameter formats corresponding to the calling operation 1 of the resource 1 obtains the resource parameter format of the calling operation 1 of the resource 1 supported by the first API gateway.
示例的,假设n=2,资源1为用于提供磁盘性能优化的虚拟机,调用操作1为查询操作。与云平台1的资源1的调用操作1对应的资源参数格式为:资源参数分别为姓名和电话号码;与云平台2的资源1的调用操作1对应的资源参数格式为资源参数分别为姓名、电话号码和收藏标识(该收藏标识用于指示是否收藏对应的电话号码)。则第一API网关求取云平台1的资源1的调用操作1对应的资源参数格式以及云平台2的资源1的调用操作1对应的资源参数格式的并集,得到的第一API网关支持的资源1的调用操作1对应的资源参数格式,例如,最终获取的资源参数格式为:资源参数分别为姓名、电话号码和收藏标识。For example, suppose n=2, resource 1 is a virtual machine used to provide disk performance optimization, and call operation 1 is a query operation. The resource parameter format corresponding to the call operation 1 of the resource 1 of the cloud platform 1 is: the resource parameters are names and phone numbers respectively; the resource parameter format corresponding to the call operation 1 of the resource 1 of the cloud platform 2 is that the resource parameters are names, Phone number and favorite identifier (the favorite identifier is used to indicate whether to favorite the corresponding phone number). Then the first API gateway obtains the union of the resource parameter format corresponding to the call operation 1 of the resource 1 of the cloud platform 1 and the resource parameter format corresponding to the call operation 1 of the resource 1 of the cloud platform 2, and the obtained first API gateway supports The resource parameter format corresponding to the invocation operation 1 of resource 1, for example, the finally obtained resource parameter format is: the resource parameters are respectively the name, phone number, and collection identifier.
采用求取并集的方式获取资源参数格式,能够保证最终获取的资源参数格式不仅为统一的格式,还能满足各个云平台对资源参数格式的要求。Obtaining the resource parameter format by taking the union method can ensure that the finally obtained resource parameter format is not only a unified format, but also meets the requirements of each cloud platform for the resource parameter format.
第二方面,第一API网关确定支持的API请求的接口调用规则。In the second aspect, the first API gateway determines the interface calling rules of the supported API requests.
对于多个云平台中的同一种资源的同一调用操作,第一API网关基于调用操作所对应的接口调用规则,确定同一种资源的同一调用操作对应的第一接口调用规则。For the same calling operation of the same resource in multiple cloud platforms, the first API gateway determines the first interface calling rule corresponding to the same calling operation of the same resource based on the interface calling rule corresponding to the calling operation.
可选地,假设多个云平台中的同一种资源的同一调用操作为第一调用操作,则对于第一调用操作,第一接口调用规则所指示的接口调用次数(等于API请求的个数)小于或等于多个云平台的每个云平台的API网关对应的接口调用规则所指示的接口调用次数。例如,第一调用操作对应的第一接口调用规则满足:Optionally, assuming that the same invocation operation of the same resource in multiple cloud platforms is the first invocation operation, for the first invocation operation, the number of interface invocations indicated by the first interface invocation rule (equal to the number of API requests) Less than or equal to the number of interface calls indicated by the API gateway corresponding to the API gateway of each of the multiple cloud platforms. For example, the first interface invocation rule corresponding to the first invocation operation satisfies:
当多个云平台的第一调用操作对应的接口集以及接口集的调用时序均相同,第一调用操作对应的第一接口调用规则为按照调用时序调用接口集中的API接口;当多个云平台的第一调用操作对应的接口集相同,调用时序不同,第一调用操作对应的第一接口调用规则为采用一次API请求调用同一调用操作对应的接口集中的API接口,其中,由于第一调用操作对应的接口集相同,因此该一次API请求可以携带接口集中API接口的标识(如uri),也可以不携带接口集中API接口的标识,只携带指示调用接口集中全部API接口的指示信息;当多个云平台的第一调用操作对应的接口集不同,第一调用操作对应的第一接口调用规则为采用一次API请求调用该同一调用操作对应的接口集中的API接口,其中,由于第一调用操作对应的接口集不同,一次API请求无法统一携带不同的接口集中API接口的标识,因此该一次API请求可以不携带接口集中API接口的标识,只携带指示调用接口集中全部API接口的指示信息,从而保证针对不同云平台,都能实现接口集中全部API接口的调用。When the interface set corresponding to the first calling operation of multiple cloud platforms and the calling timing of the interface set are the same, the first interface calling rule corresponding to the first calling operation is to call the API interfaces in the interface set according to the calling timing; when multiple cloud platforms The first call operation corresponds to the same set of interfaces, and the call sequence is different. The first interface call rule corresponding to the first call operation is to use one API request to call the API interface in the interface set corresponding to the same call operation. The corresponding interface set is the same. Therefore, this one API request can carry the identifier of the API interface in the interface set (such as uri), or it may not carry the identifier of the API interface in the interface set, but only carry the instruction information indicating the call to all API interfaces in the interface set; The interface sets corresponding to the first calling operation of each cloud platform are different. The first interface calling rule corresponding to the first calling operation is to use one API request to call the API interface in the interface set corresponding to the same calling operation. Corresponding interface sets are different. One API request cannot uniformly carry the API interface identifiers of different interface sets. Therefore, this API request may not carry the identifiers of the API interfaces in the interface set, but only carry the instruction information indicating to call all the API interfaces in the interface set, thus Ensure that for different cloud platforms, all API interfaces in the interface set can be called.
例如,多个云平台分别为云平台1至云平台n,n≥2,同一种资源的同一调用操作为资源2的调用操作2,则第一API网关基于云平台1至云平台n的资源2的调用操作2对应的接口调用规则,确定第一API网关支持的资源2的调用操作2的第一接口调用规则。For example, if multiple cloud platforms are cloud platform 1 to cloud platform n, n≥2, and the same call operation of the same resource is call operation 2 of resource 2, then the first API gateway is based on the resources of cloud platform 1 to cloud platform n The interface calling rule corresponding to the calling operation 2 of 2 determines the first interface calling rule of the calling operation 2 of the resource 2 supported by the first API gateway.
假设n=2,资源2为用于提供GPU加速服务的虚拟机,调用操作2为建立操作。若与云平台1的资源2的调用操作2对应的接口调用规则为依次调用API接口1和API接口2,也即是接口集包括:API接口1和API接口2,调用时序为API接口1在先,API接口2在后;与云平台2的资源2的调用操作2对应的接口调用规则为依次调用API接口1和API接口2。则第一API网关支持的资源2的调用操作2对应的接口调用规则为:依次调用API接口1和API接口2。Assuming n=2, resource 2 is a virtual machine used to provide GPU acceleration services, and calling operation 2 is a setup operation. If the interface calling rule corresponding to the calling operation 2 of resource 2 of cloud platform 1 is to call API interface 1 and API interface 2 in turn, that is, the interface set includes: API interface 1 and API interface 2, and the calling sequence is that API interface 1 is in First, the API interface 2 comes later; the interface calling rule corresponding to the calling operation 2 of the resource 2 of the cloud platform 2 is to call the API interface 1 and the API interface 2 in turn. Then, the interface calling rule corresponding to the calling operation 2 of resource 2 supported by the first API gateway is: calling API interface 1 and API interface 2 in turn.
若与云平台1的资源2的调用操作2对应的接口调用规则为依次调用API接口2和API接口1,也即是接口集包括:API接口1和API接口2,调用时序为API接口2在先,API接口1在后;与云平台2的资源2的调用操作2对应的接口调用规则为依次调用API接口1和API接口2。则第一API网关支持的资源2的调用操作2对应的接口调用规则为:采用一次API请求调用API接口1和API接口2。If the interface call rule corresponding to the call operation 2 of resource 2 of cloud platform 1 is to call API interface 2 and API interface 1 in turn, that is, the interface set includes: API interface 1 and API interface 2, and the calling sequence is API interface 2 in First, the API interface 1 comes later; the interface calling rule corresponding to the calling operation 2 of the resource 2 of the cloud platform 2 is to call the API interface 1 and the API interface 2 in turn. Then, the interface calling rule corresponding to the calling operation 2 of resource 2 supported by the first API gateway is: calling API interface 1 and API interface 2 with one API request.
与云平台1的资源2的调用操作2对应的接口调用规则为依次调用API接口1、API接口2和接口3,也即是接口集包括:API接口1和API接口2,调用时序为API接口1在先,API接口2居中,接口3最后;与云平台2的资源2的调用操作2对应的接口调用规则为依次调用API接口1和API接口2。则第一API网关支持的资源2的调用操作2对应的接口调用规则为:采用一次API请求调用该调用操作2对应的接口集中的API接口。The interface calling rule corresponding to the calling operation 2 of resource 2 of cloud platform 1 is to call API interface 1, API interface 2 and interface 3 in turn, that is, the interface set includes: API interface 1 and API interface 2, and the calling sequence is API interface. 1 first, API interface 2 is centered, and interface 3 is last; the interface calling rule corresponding to the calling operation 2 of resource 2 of cloud platform 2 is to call API interface 1 and API interface 2 in turn. Then, the interface calling rule corresponding to the calling operation 2 of the resource 2 supported by the first API gateway is: one API request is used to call the API interface in the interface set corresponding to the calling operation 2.
由于对于不同云平台的不同资源的不同调用操作,对应的接口调用规则不同,若统一的第一接口调用规则相较于各个云平台的接口调用规则变化较大,在后续第一接口调用规则实际使用时,容易产生较多的存储及计算开销。因此采用前述第一接口调用规则,在多个云平台的第一调用操作对应的接口集以及接口集的调用时序均相同时,第一调用操作对应的第一接口调用规则为按照调用时序调用接口集中的API接口,也即是第一调用操作对应的第一接口调用规则相对于多个云平台的第一调用操作对应的接口调用规则不变,从而可以减少第一接口调用规则相较于各个云平台的接口调用规则的变化,进而减少第一接口调用规则实际使用时的存储及计算开销。Due to different calling operations for different resources of different cloud platforms, the corresponding interface calling rules are different. If the unified first interface calling rule changes greatly compared with the interface calling rules of each cloud platform, the subsequent first interface calling rules will actually be used. When used, it is easy to generate more storage and calculation overhead. Therefore, the aforementioned first interface calling rule is adopted. When the interface set corresponding to the first calling operation of multiple cloud platforms and the calling sequence of the interface set are the same, the first interface calling rule corresponding to the first calling operation is to call the interface according to the calling sequence. The centralized API interface, that is, the first interface call rule corresponding to the first call operation is unchanged from the interface call rule corresponding to the first call operation of multiple cloud platforms, which can reduce the first interface call rule compared to each The change of the interface call rules of the cloud platform further reduces the storage and calculation overhead when the first interface call rule is actually used.
值得说明的是,第一调用操作对应的第一接口调用规则还可以有其他设置方式。例如,对于同一种资源,第一接口调用规则均为采用一次API请求调用一次调用操作对应的接口集中的API接口。如此,对于同一种资源,无论是哪种调用操作,对于一次调用操作均采用一次API请求进行接口集中的API接口的调用。从而可以将同一种资源的接口调用规则进行统一,减少用户的学习成本。It is worth noting that the first interface invocation rule corresponding to the first invocation operation may also have other setting methods. For example, for the same resource, the first interface calling rule is to use one API request to call the API interface in the interface set corresponding to one calling operation. In this way, for the same resource, no matter what kind of calling operation, for one calling operation, one API request is used to call the API interface in the interface set. Thereby, the interface calling rules of the same resource can be unified, and the learning cost of users can be reduced.
又例如,对于同一云平台中的不同资源,第一接口调用规则均为采用一次API请求调用一次调用操作对应的接口集中的API接口。如此,对于同一云平台,无论是哪种资源,以及哪种调用操作,对于一次调用操作均采用一次API请求进行接口集中的API接口的调用。从而可以将同一云平台的不同资源的接口调用规则进行统一,减少用户的学习成本。For another example, for different resources in the same cloud platform, the first interface calling rule is to use one API request to call the API interface in the interface set corresponding to one calling operation. In this way, for the same cloud platform, no matter what kind of resource and what kind of call operation, for one call operation, one API request is used to call the API interface in the interface set. In this way, the interface calling rules of different resources of the same cloud platform can be unified, and the learning cost of users can be reduced.
再例如,对于多个云平台中的不同资源,第一接口调用规则均为采用一次API请求调用一次调用操作对应的接口集中的API接口。如此,无论是哪种资源,以 及哪种调用操作,对于一次调用操作均采用一次API请求进行接口集中的API接口的调用。从而可以将不同云平台的不同资源的接口调用规则进行统一,减少用户的学习成本。For another example, for different resources in multiple cloud platforms, the first interface calling rule is to use one API request to call the API interface in the interface set corresponding to one calling operation. In this way, no matter what kind of resource and what kind of calling operation, for one calling operation, one API request is used to call the API interface in the interface set. In this way, the interface calling rules of different resources of different cloud platforms can be unified, and the learning cost of users can be reduced.
需要说明的是,前述第一方面和第二方面中,多个云平台部署的资源提供的服务相同或相似,第一API网关需要预先在多个云平台中确定同一种资源,也即是资源类型相同的资源,进而进行同一种资源的资源格式的整合。可选地,资源类型是按照资源所提供的服务划分的,例如,分为GPU加速、磁盘性能优化或网速带宽优化等类型,第一API网关在多个云平台中确定资源类型相同的资源有以下几种可选实现方式:It should be noted that in the aforementioned first aspect and second aspect, the services provided by the resources deployed by multiple cloud platforms are the same or similar, and the first API gateway needs to pre-determine the same type of resource in multiple cloud platforms, that is, resources. Resources of the same type, and then the integration of the resource format of the same resource. Optionally, the resource type is divided according to the service provided by the resource, for example, divided into GPU acceleration, disk performance optimization, or network speed and bandwidth optimization. The first API gateway determines resources of the same resource type in multiple cloud platforms There are several optional implementation methods:
在第一种可选实现方式中,同一种资源为资源定义的相似度大于相似度阈值的资源。例如,相似度阈值的取值范围为80%至90%。第一API网关可以将多个云平台中资源定义的相似度大于相似度阈值的资源确定为同一种资源。In the first optional implementation manner, the same resource is a resource whose similarity defined by the resource is greater than the similarity threshold. For example, the value range of the similarity threshold is 80% to 90%. The first API gateway may determine resources with similarity of resource definitions in multiple cloud platforms that are greater than the similarity threshold as the same resource.
在前述第一种可选实现方式中,第一API网关可以采用聚类算法在多个云平台中确定资源类型相同的资源。示例的,第一API网关可以对多个云平台中的部署的资源的资源定义执行聚类算法。第一API网关也可以采用其他算法在多个云平台中确定资源类型相同的资源。本申请实施例对此不做限定。In the foregoing first optional implementation manner, the first API gateway may use a clustering algorithm to determine resources of the same resource type among multiple cloud platforms. For example, the first API gateway may execute a clustering algorithm on resource definitions of resources deployed in multiple cloud platforms. The first API gateway may also use other algorithms to determine resources of the same resource type in multiple cloud platforms. The embodiment of the application does not limit this.
在第二种可选实现方式中,同一种资源是预先设定的。In the second alternative implementation, the same resource is preset.
前述两方面,第一API网关确定了自身支持的API请求的格式(即资源格式)后,可以将确定的资源格式存储在指定存储空间3中。该指定存储空间3可以为一个数据库。In the foregoing two aspects, after the first API gateway determines the format of the API request (that is, the resource format) that it supports, it can store the determined resource format in the designated storage space 3. The designated storage space 3 may be a database.
前述两方面是以第一API网关自动确定自身支持的API请求的格式为例进行说明,本申请实施例中,第一API网关支持的资源格式还可以由通信系统的管理人员预先确定,输入至指定存储空间3,第一API网关在该指定存储空间3提取所需的资源格式即可。The foregoing two aspects are described by taking the first API gateway automatically determining the format of the API request supported by itself as an example. In the embodiment of this application, the resource format supported by the first API gateway may also be predetermined by the management personnel of the communication system and input to The storage space 3 is designated, and the first API gateway extracts the required resource format in the designated storage space 3.
可选地,存储在指定存储空间3的资源格式所对应的API接口需要在该指定存储空间3注册,注册后的API接口是第一API网关可以调用的接口,未注册的API接口,由于其所属云平台的资源格式未被统一,因此不能被第一API网关调用。存储在指定存储空间3的资源格式可以由管理人员手动调整,例如添加、修改或删除。Optionally, the API interface corresponding to the resource format stored in the designated storage space 3 needs to be registered in the designated storage space 3. The registered API interface is the interface that the first API gateway can call, and the unregistered API interface is due to its The resource format of the cloud platform to which it belongs is not unified, so it cannot be called by the first API gateway. The resource format stored in the designated storage space 3 can be manually adjusted by the manager, such as adding, modifying or deleting.
值得说明的是,本申请实施例中指定存储空间1、2和3可以相同也可以不同,本申请实施例对此不做限定。It is worth noting that the designated storage spaces 1, 2 and 3 in the embodiment of the present application may be the same or different, which is not limited in the embodiment of the present application.
S302、第一API网关发布第一API网关支持的API请求的格式。S302. The first API gateway publishes the format of the API request supported by the first API gateway.
在一种可选方式中,第一API网关可以向用户设备的客户端推送第一API网关支持的API请求的格式,以实现该API请求的格式的发布;在另一种可选方式中,第一API网关可以通过用户界面呈现该第一API网关支持的API请求的格式。例如通过前述管理节点的用户界面呈现API请求的格式。第一API网关通过发布自身支持的API请求的格式,实现第一API网关与用户设备对API请求的格式的预先约定。In an optional manner, the first API gateway may push the format of the API request supported by the first API gateway to the client of the user equipment, so as to realize the publication of the format of the API request; in another optional manner, The first API gateway may present the format of the API request supported by the first API gateway through a user interface. For example, the format of the API request is presented through the user interface of the aforementioned management node. The first API gateway implements the pre-arrangement of the API request format between the first API gateway and the user equipment by publishing the format of the API request supported by the first API gateway.
可选地,前述第一API网关支持的API请求的格式的表示方式有多种。在一 种可选方式中,其可以通过软件模型的方式表示;在另一种可选方式中,其可以通过软件模板的方式表示;在又一种可选方式中,其还可以通过表格或者图形的方式表示。本申请实施例对API请求的格式的表示方式不做限定。示例的,前述API请求的格式可以参照行业标准格式设置,例如openAPI2.0标准的格式。Optionally, there are multiple ways of expressing the format of the API request supported by the aforementioned first API gateway. In an optional way, it can be represented by a software model; in another optional way, it can be represented by a software template; in another optional way, it can also be represented by a table or Graphical representation. The embodiment of this application does not limit the format of the API request. For example, the format of the aforementioned API request can be set with reference to an industry standard format, such as the format of the openAPI2.0 standard.
S303、用户设备向第一API网关发送第一API请求。S303. The user equipment sends a first API request to the first API gateway.
第一API请求的格式为第一API网关支持的格式。用户设备可以通过多种方式向第一API网关发送第一API请求。例如,在第一种方式中,用户设备安装有客户端,第一API请求由客户端发送给第一API网关,也即是,用户设备通过客户端发送第一API请;在第二种方式中,用户设备通过管理节点提供的用户界面向管理节点发送第一API请求,第一API请求由管理节点在用户界面接收并发送给第一API网关。The format of the first API request is a format supported by the first API gateway. The user equipment may send the first API request to the first API gateway in multiple ways. For example, in the first method, the user equipment has a client installed, and the first API request is sent by the client to the first API gateway, that is, the user equipment sends the first API request through the client; in the second method , The user equipment sends a first API request to the management node through the user interface provided by the management node, and the first API request is received by the management node on the user interface and sent to the first API gateway.
S304、第一API网关在接收到第一API请求后,在多个云平台中确定用于响应第一API请求的目标云平台。S304. After receiving the first API request, the first API gateway determines a target cloud platform for responding to the first API request among the multiple cloud platforms.
与前述S303对应的,第一API网关接收到第一API请求的方式有多种。与S303的第一种方式对应的,第一API网关接收用户设备通过客户端发送的第一API请求;与S303的第二种方式对应的,第一API网关接收管理节点发送的第一API请求。Corresponding to the aforementioned S303, there are multiple ways for the first API gateway to receive the first API request. Corresponding to the first method of S303, the first API gateway receives the first API request sent by the user equipment through the client; corresponding to the second method of S303, the first API gateway receives the first API request sent by the management node .
第一API网关在多个云平台中确定用于响应第一API请求的目标云平台的方式有多种。本申请实施例以以下几种可选方式为例进行说明:There are multiple ways for the first API gateway to determine the target cloud platform for responding to the first API request among multiple cloud platforms. The embodiments of this application take the following optional methods as examples for description:
第一种可选方式,目标云平台是基于管理节点发送的选择指令确定的,该选择指令用于指示目标云平台,该选择指令是管理节点通过用户界面接收的。相应的,第一API网关在接收到选择指令后,基于该选择指令确定目标云平台。例如,管理节点通过用户界面向用户设备呈现多个云平台的标识,用户若想对某一云平台中的资源进行操作,可以通过用户设备在该用户界面进行选择操作,从而触发管理节点生成相应的选择指令,该选择指令携带有用户选择的目标云平台的标识,管理节点将该选择指令发送至第一API网关,该第一API网关接收到选择指令后,提取该目标云平台的标识以确定目标云平台。其中,云平台的标识可以为云平台的名称,例如“AA云”或“BB云”,也可以是云平台中API网关的标识,如API网关的地址。In the first optional manner, the target cloud platform is determined based on a selection instruction sent by the management node, the selection instruction is used to instruct the target cloud platform, and the selection instruction is received by the management node through a user interface. Correspondingly, after receiving the selection instruction, the first API gateway determines the target cloud platform based on the selection instruction. For example, the management node presents the identities of multiple cloud platforms to the user equipment through the user interface. If the user wants to operate on the resources in a certain cloud platform, he can select and operate on the user interface through the user equipment, thereby triggering the management node to generate the corresponding The selection instruction carries the identification of the target cloud platform selected by the user, and the management node sends the selection instruction to the first API gateway. After receiving the selection instruction, the first API gateway extracts the identification of the target cloud platform to Determine the target cloud platform. The identifier of the cloud platform may be the name of the cloud platform, such as "AA Cloud" or "BB Cloud", or the identifier of the API gateway in the cloud platform, such as the address of the API gateway.
可选地,管理节点可以在第一API网关接收第一API请求后,呈现多个云平台的标识;也可以在接收到用户设备发送的访问指令后,呈现该多个云平台的标识。Optionally, the management node may present the identities of multiple cloud platforms after the first API gateway receives the first API request; or after receiving the access instruction sent by the user equipment, the management node may present the identities of the multiple cloud platforms.
第二种可选方式,目标云平台是基于客户端发送的选择指令确定的,该选择指令用于指示目标云平台。相应的,第一API网关在接收到选择指令后,基于该选择指令确定目标云平台。例如,用户若想对某一云平台中的资源进行操作,可以通过用户设备中运行的客户端生成相应的选择指令,该选择指令携带有用户选择的目标云平台的标识,客户端将该选择指令发送至第一API网关,第一API网关接收到选择指令后,提取该目标云平台的标识以确定目标云平台。In the second optional manner, the target cloud platform is determined based on the selection instruction sent by the client, and the selection instruction is used to instruct the target cloud platform. Correspondingly, after receiving the selection instruction, the first API gateway determines the target cloud platform based on the selection instruction. For example, if a user wants to operate on a resource in a cloud platform, he can generate a corresponding selection instruction through the client running on the user device. The selection instruction carries the identifier of the target cloud platform selected by the user, and the client selects The instruction is sent to the first API gateway, and after receiving the selection instruction, the first API gateway extracts the identifier of the target cloud platform to determine the target cloud platform.
可选地,客户端可以在第一API网关收到第一API请求后,发送该选择指令, 也可以在第一API网关收到第一API请求之前,发送该选择指令,本申请实施例对此不做限定。Optionally, the client may send the selection instruction after the first API gateway receives the first API request, or before the first API gateway receives the first API request, the client may send the selection instruction. This is not limited.
第三种可选方式,第一API请求包括目标云平台的标识。相应的,第一API网关在接收到第一API请求后,基于该第一API请求确定目标云平台。In the third optional manner, the first API request includes the identification of the target cloud platform. Correspondingly, after receiving the first API request, the first API gateway determines the target cloud platform based on the first API request.
值得说明的是,第一API网关在接收到第一API请求后,可以先对该第一API请求进行鉴权,在鉴权成功后,再确定目标云平台。若鉴权失败,则向用户设备发送指示鉴权失败的API响应,或者停止动作。示例的,参考S302,第一API网关可以检测第一API请求所需调用的API接口是否为已注册接口,若第一API请求所需调用的API接口不是已注册接口,确定鉴权失败;若第一API请求所需调用的API接口是已注册接口,确定鉴权成功。或者,第一API网关可以检测第一API请求所携带的用户账号是否具有访问第一API网关的权限(或者是否为合法账号),若第一API请求所携带的用户账号不具有访问第一API网关的权限(或者不为合法账号),确定鉴权失败;若第一API请求所携带的用户账号具有访问第一API网关的权限(或者为合法账号),确定鉴权成功。It is worth noting that, after receiving the first API request, the first API gateway may first authenticate the first API request, and after the authentication succeeds, determine the target cloud platform. If the authentication fails, an API response indicating the authentication failure is sent to the user equipment, or the action is stopped. For example, referring to S302, the first API gateway may detect whether the API interface required to be called by the first API request is a registered interface, and if the API interface required to be called by the first API request is not a registered interface, it is determined that the authentication fails; if The API interface that the first API request needs to call is a registered interface, and it is determined that the authentication is successful. Alternatively, the first API gateway may detect whether the user account carried in the first API request has the permission to access the first API gateway (or whether it is a legal account), if the user account carried in the first API request does not have access to the first API The authority of the gateway (or not a legal account) determines that the authentication fails; if the user account carried in the first API request has the authority to access the first API gateway (or is a legal account), it is determined that the authentication is successful.
第一API网关通过对API请求鉴权,可以保证通信系统的安全性,减少不必要的操作。The first API gateway can ensure the security of the communication system and reduce unnecessary operations by authenticating the API request.
S305、第一API网关基于第一API请求确定第二API请求,该第二API请求基于第一API请求确定,且第二API请求的格式为第二API网关支持的格式,该第二API网关为目标云平台的API网关。S305. The first API gateway determines a second API request based on the first API request, the second API request is determined based on the first API request, and the format of the second API request is a format supported by the second API gateway, and the second API gateway It is the API gateway of the target cloud platform.
参考S301和S302,API请求包括资源参数数据。由于第一API网关发布的是自身支持的API请求的格式,因此用户通过用户设备发送的第一API请求是按照第一API网关支持的资源参数格式发送的,而访问目标云平台时,资源参数数据遵循目标云平台的API网关支持的资源参数格式。With reference to S301 and S302, the API request includes resource parameter data. Since the first API gateway publishes the format of the API request it supports, the first API request sent by the user through the user device is sent in accordance with the resource parameter format supported by the first API gateway. When accessing the target cloud platform, the resource parameter The data follows the resource parameter format supported by the API gateway of the target cloud platform.
假设第一API请求包括第一资源参数数据,第二API请求包括第二资源参数数据,第一资源参数数据的格式为第一API网关支持的资源参数格式,第一资源参数数据的格式为第二API网关支持的资源参数格式,则第二资源参数数据是第一API网关将第一资源参数数据进行资源参数格式转化得到的。Assuming that the first API request includes first resource parameter data, the second API request includes second resource parameter data, the format of the first resource parameter data is the resource parameter format supported by the first API gateway, and the format of the first resource parameter data is the first resource parameter data format. 2. The resource parameter format supported by the API gateway, the second resource parameter data is obtained by the first resource parameter format conversion of the first resource parameter data by the first API gateway.
其中,第一API网关可以通过多种方式对第一资源参数数据进行资源参数格式转化。本申请实施例以以下两种可选方式为例进行说明:Among them, the first API gateway may perform resource parameter format conversion on the first resource parameter data in a variety of ways. The embodiment of the present application takes the following two optional methods as examples for description:
在第一种可选方式中,参考S301中的第一方面,第一API网关在确定支持的API请求的资源参数格式后,建立多个云平台中每个云平台的API网关支持的资源参数格式与第一API网关支持的资源参数格式的第一对应关系。第一API网关在接收到第一API请求后,基于第二API网关的标识查询该第一对应关系得到第二API网关支持的资源参数格式;并基于该第二API网关支持的资源参数格式,将第一API请求包括的第一资源参数数据转义得到第二资源参数数据。In the first optional manner, referring to the first aspect in S301, the first API gateway establishes the resource parameters supported by the API gateway of each of the multiple cloud platforms after determining the resource parameter format of the supported API request The first correspondence between the format and the resource parameter format supported by the first API gateway. After receiving the first API request, the first API gateway queries the first correspondence based on the identifier of the second API gateway to obtain the resource parameter format supported by the second API gateway; and based on the resource parameter format supported by the second API gateway, The first resource parameter data included in the first API request is escaped to obtain the second resource parameter data.
该第一对应关系可以有多种表示方式。例如,该第一对应关系可以包括与多个调用操作一一对应的多个子对应关系,每个子对应关系用于记录对应的调用操作下,资源的标识、云平台的API网关支持的资源参数格式与第一API网关支持的资源参数格式的对应关系。The first correspondence can be expressed in multiple ways. For example, the first correspondence may include multiple sub-correspondences that correspond to multiple call operations one-to-one, and each sub-correspondence is used to record the resource identifier and resource parameter format supported by the API gateway of the cloud platform under the corresponding call operation. Correspondence with the resource parameter format supported by the first API gateway.
又例如,该第一对应关系可以包括与多个资源的标识一一对应的多个子对应关系,每个子对应关系用于记录对应的资源的标识下,调用操作的标识、云平台的API网关支持的资源参数格式与第一API网关支持的资源参数格式的对应关系。示例的,假设该第一对应关系包括与多个资源的标识一一对应的多个子对应关系,与某一资源的标识对应的子对应关系可以如表1所示。该表1记录有该某一资源的标识下,调用操作的标识、云平台的API网关支持的资源参数格式与第一API网关支持的资源参数格式的对应关系,其中,调用操作的标识采用调用操作的名称表示,云平台的API网关支持的资源参数格式可以采用API网关的标识与资源参数格式的标识表示。则由表1可知,多个云平台中有两个云平台部署该某一资源的标识所对应的资源,该两个云平台的API网关的标识分别为1和2,第一API网关的标识为0。对于建立操作,API网关1的资源参数格式X1与第一AP1网关0的资源参数格式M1对应;对于建立操作,API网关2的资源参数格式X2与第一AP1网关0的资源参数格式M1对应;对于删除操作,API网关1的资源参数格式Y1与第一AP1网关0的资源参数格式M2对应;对于建立操作,API网关2的资源参数格式Y2与第一AP1网关0的资源参数格式M2对应。对于其他调用操作,对应关系参考表1,本申请实施例对此不做赘述。For another example, the first correspondence may include multiple sub-correspondences corresponding to the identifiers of multiple resources one-to-one, and each sub-correspondence is used to record the identifier of the corresponding resource, the identifier of the call operation, and the API gateway of the cloud platform supports The corresponding relationship between the resource parameter format and the resource parameter format supported by the first API gateway. As an example, assuming that the first correspondence relationship includes multiple sub-correspondences corresponding to the identifiers of multiple resources one-to-one, the sub-correspondence corresponding to the identifier of a certain resource may be as shown in Table 1. Table 1 records the corresponding relationship between the call operation identifier, the resource parameter format supported by the API gateway of the cloud platform and the resource parameter format supported by the first API gateway under the identifier of the certain resource, where the call operation identifier uses the call The name of the operation indicates that the resource parameter format supported by the API gateway of the cloud platform may adopt the identifier of the API gateway and the identifier of the resource parameter format. It can be seen from Table 1 that there are two cloud platforms in the multiple cloud platforms deploying the resource corresponding to the identifier of the certain resource, the identifiers of the API gateways of the two cloud platforms are 1 and 2, respectively, and the identifier of the first API gateway Is 0. For the establishment operation, the resource parameter format X1 of the API gateway 1 corresponds to the resource parameter format M1 of the first AP1 gateway 0; for the establishment operation, the resource parameter format X2 of the API gateway 2 corresponds to the resource parameter format M1 of the first AP1 gateway 0; For the deletion operation, the resource parameter format Y1 of the API gateway 1 corresponds to the resource parameter format M2 of the first AP1 gateway 0; for the establishment operation, the resource parameter format Y2 of the API gateway 2 corresponds to the resource parameter format M2 of the first AP1 gateway 0. For other calling operations, refer to Table 1 for the corresponding relationship, which is not described in detail in the embodiment of the present application.
表1Table 1
Figure PCTCN2021075691-appb-000001
Figure PCTCN2021075691-appb-000001
再例如,该第一对应关系可以包括调用操作的标识、资源的标识、云平台的API网关支持的资源参数格式与第一API网关支持的资源参数格式的对应关系。For another example, the first correspondence may include the identity of the calling operation, the identity of the resource, and the correspondence between the resource parameter format supported by the API gateway of the cloud platform and the resource parameter format supported by the first API gateway.
在第二种可选方式中,参考S301中的第一方面,第一API网关在确定支持的API请求的资源参数格式后,基于多个云平台中每个云平台的API网关支持的资源参数格式,以及第一API网关支持的资源参数格式,建立转义模型,该转义模型用于在接收API网关的标识以及资源参数数据后,输出与接收的API网关的标识对应的资源参数数据。第一API网关在接收到第一API请求后,将第一API请求包括的第一资源参数数据以及第二API网关的标识(或目标云平台的标识)输入该转义模型,将该转义模型输出的资源参数数据确定为第二资源参数数据。In the second optional manner, referring to the first aspect in S301, after the first API gateway determines the resource parameter format of the supported API request, it is based on the resource parameters supported by the API gateway of each of the multiple cloud platforms Format, and the resource parameter format supported by the first API gateway, establish an escape model, which is used to output resource parameter data corresponding to the received API gateway identifier after receiving the API gateway identifier and resource parameter data. After receiving the first API request, the first API gateway inputs the first resource parameter data included in the first API request and the identification of the second API gateway (or the identification of the target cloud platform) into the escape model, and the escape The resource parameter data output by the model is determined to be the second resource parameter data.
参考步骤A1,若第一API网关支持的同一种资源的同一调用操作的资源参数格式为多个云平台中的同一种资源的同一调用操作所对应的资源参数格式的并 集。如此,第一资源参数格式包括第二资源参数格式,也即第二参数资源格式属于第一资源参数格式,第二资源参数数据可能包括第二API网关不需要的数据,即无效数据,这些无效数据是与第二参数资源格式不对应的数据。则在一种可选方式中,第一API网关可以将第二参数数据中的无效数据剔除,得到更新后的第二参数数据,并生成包括该更新后的第二参数数据的第二API请求。例如,第一资源参数格式为:资源参数分别为姓名、电话号码和年龄。第二资源参数格式为:资源参数分别为姓名和电话号码。由于与年龄对应的数据与第二资源参数格式不对应,则第一资源参数数据中与年龄对应的数据为无效数据。Referring to step A1, if the resource parameter format of the same calling operation of the same resource supported by the first API gateway is a union of resource parameter formats corresponding to the same calling operation of the same resource in multiple cloud platforms. In this way, the first resource parameter format includes the second resource parameter format, that is, the second parameter resource format belongs to the first resource parameter format, and the second resource parameter data may include data that is not required by the second API gateway, that is, invalid data. The data is data that does not correspond to the second parameter resource format. In an optional manner, the first API gateway may eliminate invalid data in the second parameter data, obtain updated second parameter data, and generate a second API request including the updated second parameter data . For example, the format of the first resource parameter is: the resource parameters are name, phone number, and age. The second resource parameter format is: the resource parameters are the name and the phone number respectively. Since the data corresponding to the age does not correspond to the second resource parameter format, the data corresponding to the age in the first resource parameter data is invalid data.
在另一种可选方式中,第一API网关可以生成第二API请求,该第二API请求包括第二参数数据,在第二API网关在接收到第二API请求后,将第二参数数据中的无效数据剔除,得到更新后的第二参数数据。In another optional manner, the first API gateway may generate a second API request, the second API request includes the second parameter data, after the second API gateway receives the second API request, the second parameter data The invalid data in the data is eliminated, and the updated second parameter data is obtained.
S306、第一API网关向第二API网关发送第二API请求。S306. The first API gateway sends a second API request to the second API gateway.
其中,第二API请求由第一API网关基于第二接口调用规则发送,第二接口调用规则是第二API网关支持的接口调用规则,第二接口调用规则由第一API网关基于第一API网关支持的第一接口调用规则以及第一API请求确定。第一API网关按照第二接口调用规则向第二API网关发送第二API请求,可以保证发送的第二API请求遵循第二API网关支持的接口调用规则,从而保证API接口的有效调用。Wherein, the second API request is sent by the first API gateway based on the second interface calling rule, the second interface calling rule is the interface calling rule supported by the second API gateway, and the second interface calling rule is based on the first API gateway by the first API gateway The supported first interface calling rules and the first API request are determined. The first API gateway sends the second API request to the second API gateway according to the second interface invocation rule, which can ensure that the sent second API request follows the interface invocation rule supported by the second API gateway, thereby ensuring the effective invocation of the API interface.
在本申请实施例中,第一API网关可以通过多种方式确定第二接口调用规则。示例的,请参考前述S301的第二方面,第一API网关在确定支持的API请求的接口调用规则后,建立多个云平台中每个云平台的API网关支持的接口调用规则与第一API网关支持的接口调用规则的第二对应关系。第一API网关在接收到第一API请求后,基于第二API网关的标识查询该第二对应关系得到第二API网关对应的第二接口调用规则。In the embodiment of the present application, the first API gateway may determine the second interface calling rule in multiple ways. For example, please refer to the second aspect of the aforementioned S301. After determining the interface calling rules of the supported API requests, the first API gateway establishes the interface calling rules supported by the API gateway of each cloud platform in the multiple cloud platforms and the first API. The second corresponding relationship of the interface invocation rule supported by the gateway. After receiving the first API request, the first API gateway queries the second correspondence based on the identifier of the second API gateway to obtain the second interface calling rule corresponding to the second API gateway.
该第二对应关系可以有多种表示方式。例如,该第二对应关系可以包括与多个调用操作一一对应的多个子对应关系,每个子对应关系用于记录对应的调用操作下,资源的标识、云平台的API网关支持的接口调用规则与第一API网关支持的接口调用规则的对应关系。The second correspondence can be expressed in multiple ways. For example, the second correspondence may include multiple sub-correspondences corresponding to multiple call operations one-to-one, and each sub-correspondence is used to record the resource identification and the interface call rules supported by the API gateway of the cloud platform under the corresponding call operation. Correspondence with the interface calling rules supported by the first API gateway.
又例如,该第二对应关系可以包括与多个资源的标识一一对应的多个子对应关系,每个子对应关系用于记录对应的资源的标识下,调用操作的标识、云平台的API网关支持的接口调用规则与第一API网关支持的接口调用规则的对应关系。示例的,假设该第二对应关系包括与多个资源的标识一一对应的多个子对应关系,与某一资源的标识对应的子对应关系可以如表2所示。该表2记录有该某一资源的标识下,调用操作的标识、云平台的API网关支持的接口调用规则与第一API网关支持的接口调用规则的对应关系,其中,调用操作的标识采用调用操作的名称表示,云平台的API网关支持的接口调用规则可以采用API网关的标识与接口调用规则的标识表示。则由表2可知,多个云平台中有两个云平台部署该某一资源的标识所对应的资源,该两个云平台的API网关的标识分别为1和2,第一API网关的标识为0。对于建立操作,API网关1的接口调用规则A1与第一AP1网关 0的接口调用规则E1对应;对于建立操作,API网关2的接口调用规则A2与第一AP1网关0的接口调用规则E1对应;对于删除操作,API网关1的接口调用规则B1与第一AP1网关0的接口调用规则E2对应;对于建立操作,API网关2的接口调用规则B2与第一AP1网关0的接口调用规则E2对应。对于其他调用操作,对应关系参考表2,本申请实施例对此不做赘述。For another example, the second correspondence may include multiple sub-correspondences corresponding to the identifiers of multiple resources one-to-one, and each sub-correspondence is used to record the identifier of the corresponding resource, the identifier of the call operation, and the API gateway support of the cloud platform. Correspondence between the interface calling rules of the API and the interface calling rules supported by the first API gateway. As an example, assuming that the second correspondence relationship includes multiple sub-correspondences corresponding to the identifiers of multiple resources one-to-one, the sub-correspondence corresponding to the identifier of a certain resource may be as shown in Table 2. This table 2 records the corresponding relationship between the call operation identifier, the interface call rule supported by the API gateway of the cloud platform, and the interface call rule supported by the first API gateway under the identifier of the certain resource, where the call operation identifier uses the call The name of the operation indicates that the interface call rule supported by the API gateway of the cloud platform can be expressed by the identifier of the API gateway and the identifier of the interface call rule. It can be seen from Table 2 that there are two cloud platforms in the multiple cloud platforms deploying the resource corresponding to the identifier of the certain resource, the API gateway identifiers of the two cloud platforms are 1 and 2, respectively, and the identifier of the first API gateway Is 0. For the establishment operation, the interface calling rule A1 of the API gateway 1 corresponds to the interface calling rule E1 of the first AP1 gateway 0; for the establishment operation, the interface calling rule A2 of the API gateway 2 corresponds to the interface calling rule E1 of the first AP1 gateway 0; For the deletion operation, the interface calling rule B1 of the API gateway 1 corresponds to the interface calling rule E2 of the first AP1 gateway 0; for the establishment operation, the interface calling rule B2 of the API gateway 2 corresponds to the interface calling rule E2 of the first AP1 gateway 0. For other calling operations, refer to Table 2 for the corresponding relationship, which is not described in detail in the embodiment of the present application.
表2Table 2
Figure PCTCN2021075691-appb-000002
Figure PCTCN2021075691-appb-000002
再例如,该第二对应关系可以包括调用操作的标识、资源的标识、云平台的API网关支持的接口调用规则与第一API网关支持的接口调用规则的对应关系。For another example, the second correspondence may include the identity of the calling operation, the identity of the resource, and the correspondence between the interface calling rules supported by the API gateway of the cloud platform and the interface calling rules supported by the first API gateway.
S307、第二API网关向第一API网关发送第二API响应。S307. The second API gateway sends a second API response to the first API gateway.
第二API网关接收到第二API请求后,按照第二API请求进行目标云平台中的API接口的调用,在完成与第二API请求对应的接口调用后,向第一API网关发送第二API响应。After receiving the second API request, the second API gateway calls the API interface in the target cloud platform according to the second API request, and after completing the interface call corresponding to the second API request, sends the second API to the first API gateway response.
值得说明的是,第二API网关在接收到第二API请求后,可以先对该第二API请求进行鉴权,在鉴权成功后,再执行接口调用动作。若鉴权失败,则向第一API网关发送指示鉴权失败的API响应,或者停止动作。示例的,第二API网关可以检测第二API请求所需调用的API接口是否为目标云平台中已注册的接口,若第二API请求所需调用的API接口不是已注册接口,确定鉴权失败;若第二API请求所需调用的API接口是已注册接口,确定鉴权成功。或者,第二API网关可以检测第二API请求所携带的用户账号是否具有访问第二API网关的权限(或者是否为合法账号),若第二API请求所携带的用户账号不具有访问第二API网关的权限(或者不为合法账号),确定鉴权失败;若第二API请求所携带的用户账号具有访问第二API网关的权限(或者为合法账号),确定鉴权成功。It is worth noting that after receiving the second API request, the second API gateway may first authenticate the second API request, and after the authentication succeeds, perform the interface call action. If the authentication fails, an API response indicating the authentication failure is sent to the first API gateway, or the action is stopped. For example, the second API gateway can detect whether the API interface called by the second API request is a registered interface in the target cloud platform, and if the API interface called by the second API request is not a registered interface, it is determined that the authentication fails ; If the API interface to be called by the second API request is a registered interface, it is determined that the authentication is successful. Alternatively, the second API gateway may detect whether the user account carried in the second API request has the permission to access the second API gateway (or whether it is a legal account), if the user account carried in the second API request does not have access to the second API The authority of the gateway (or not a legal account) determines that the authentication fails; if the user account carried in the second API request has the authority to access the second API gateway (or is a legal account), it is determined that the authentication is successful.
第二API网关通过对API请求鉴权,可以保证通信系统的安全性,减少不必要的操作。The second API gateway can ensure the security of the communication system and reduce unnecessary operations by authenticating the API request.
S308、第二API网关基于第二API响应,向用户设备发送第一API响应。S308. The second API gateway sends the first API response to the user equipment based on the second API response.
在本申请实施例中,第一API请求的发送端为用户设备,与前述S303对应的,第一API网关将第一API请求发送至用户设备运行的客户端,或者,发送至管理节点,由管理节点转发给用户设备。In the embodiment of the present application, the sender of the first API request is the user equipment. Corresponding to the aforementioned S303, the first API gateway sends the first API request to the client running on the user equipment, or sends the first API request to the management node. The management node forwards it to the user equipment.
请参考前述S302,由于第一API网关发布的是自身支持的API请求的格式, 因此用户通过用户设备发送的第一API请求是按照第一API网关支持的第一接口调用规则发送的,第一API网关在返回相应的API响应时,需要遵循相同的接口调用规则,即按照第一接口调用规则发送第一API响应。Please refer to the aforementioned S302. Since the first API gateway publishes the format of the API request that it supports, the first API request sent by the user through the user device is sent according to the first interface calling rule supported by the first API gateway. When the API gateway returns the corresponding API response, it needs to follow the same interface call rule, that is, send the first API response according to the first interface call rule.
参考S302的第二方面,假设多个云平台中的同一种资源的同一调用操作为第一调用操作,对于第一调用操作,第一接口调用规则所指示的接口调用次数小于或等于多个云平台的每个云平台的API网关对应的接口调用规则所指示的接口调用次数。因此,第一API请求的个数小于或等于第二API请求的个数。而每个API网关对于接收到的API请求是采用一问一答式的响应方式进行响应,也即是,在每接收到一个API请求,回复一个API响应。则S303至S308中,第一API请求的个数等于第一API响应的个数;第二API请求的个数等于第二API响应的个数。With reference to the second aspect of S302, assume that the same invocation operation of the same resource in multiple cloud platforms is the first invocation operation. For the first invocation operation, the number of interface invocations indicated by the first interface invocation rule is less than or equal to that of the multiple clouds. The number of interface calls indicated by the API gateway corresponding to each cloud platform of the platform. Therefore, the number of first API requests is less than or equal to the number of second API requests. Each API gateway responds to the received API request in a question-and-answer manner, that is, every time an API request is received, an API response is returned. Then in S303 to S308, the number of first API requests is equal to the number of first API responses; the number of second API requests is equal to the number of second API responses.
示例的,当第一接口调用规则和第二接口调用规则相同时,第一API网关在每次接收到一个第一API请求后,向第二API网关发送一个第二API请求,在每次接收第二API网关返回的一个第二API响应后,向第一API请求的发送端发送一个第一API响应。For example, when the first interface calling rule and the second interface calling rule are the same, the first API gateway sends a second API request to the second API gateway every time after receiving a first API request. After a second API response returned by the second API gateway, a first API response is sent to the sender of the first API request.
例如,第一API网关和第二API网关支持的资源2的调用操作2对应的接口调用规则均为:依次调用API接口1和API接口2。则第一API网关在接收到用于调用API接口1的第一API请求后,向第二API网关发送用于调用API接口1的第二API请求,在接收第二API网关返回的API接口1对应的第二API响应后,向第一API请求的发送端发送API接口1对应的第一API响应;第一API网关在接收到用于调用API接口2的第一API请求后,向第二API网关发送用于调用API接口2的第二API请求,在接收第二API网关返回的API接口2对应的第二API响应后,向第一API请求的发送端发送API接口2对应的第一API响应。For example, the interface calling rules corresponding to the calling operation 2 of the resource 2 supported by the first API gateway and the second API gateway are both: calling API interface 1 and API interface 2 in turn. Then, after receiving the first API request for calling API interface 1, the first API gateway sends a second API request for calling API interface 1 to the second API gateway, and then receives the API interface 1 returned by the second API gateway. After the corresponding second API response, the first API response corresponding to API interface 1 is sent to the sender of the first API request; after receiving the first API request for calling API interface 2, the first API gateway sends the second API The API gateway sends the second API request for calling API interface 2, and after receiving the second API response corresponding to API interface 2 returned by the second API gateway, sends the first API request corresponding to API interface 2 to the sender of the first API request. API response.
当第一API请求的个数小于第二API请求的个数时,第一API网关在每次接收到一个第一API请求后,按照第二接口调用规则依次执行至少两次调用流程直至获取的第二API响应能够生成与第一API请求对应的第一API响应,再按照第一接口调用规则向第一API请求的发送端发送第一API响应。其中,该调用流程包括:向第二API网关发送第二API请求,接收第二API网关发送第二API响应。When the number of the first API request is less than the number of the second API request, the first API gateway will execute at least two call processes in sequence according to the second interface call rule after receiving a first API request each time until the received The second API response can generate a first API response corresponding to the first API request, and then send the first API response to the sender of the first API request according to the first interface calling rule. Wherein, the calling process includes: sending a second API request to the second API gateway, and receiving a second API response sent by the second API gateway.
例如,第二接口调用规则为依次调用API接口1和API接口2,第一接口调用规则为采用一次API请求调用API接口1和API接口2。则第一API网关在接收到用于调用API接口1和API接口2的第一API请求后,向第二API网关发送用于调用API接口1的第二API请求,在接收第二API网关返回的API接口1对应的第二API响应后,向第二API网关发送用于调用API接口2的第二API请求,在接收第二API网关返回的API接口2对应的第二API响应后,向第一API请求的发送端发送API接口1和API接口2对应的第一API响应(即第一API请求对应的第一API响应)。For example, the second interface calling rule is to call API interface 1 and API interface 2 in sequence, and the first interface calling rule is to call API interface 1 and API interface 2 with one API request. Then, after receiving the first API request for calling API interface 1 and API interface 2, the first API gateway sends a second API request for calling API interface 1 to the second API gateway, and returns after receiving the second API gateway After receiving the second API response corresponding to API interface 1 of the second API gateway, send a second API request for calling API interface 2 to the second API gateway. After receiving the second API response corresponding to API interface 2 returned by the second API gateway, send the second API request to the second API gateway. The sender of the first API request sends the first API response corresponding to the API interface 1 and the API interface 2 (that is, the first API response corresponding to the first API request).
可选地,API响应包括资源参数数据。第二API发送的第二API响应包括的资源参数数据遵循目标云平台的API网关支持的资源参数格式。而第一API网关发布的是自身支持的API请求的格式,因此用户学习的是第一API网关支持的第一资源参数格式,若第一API网关直接将第二API响应包括的资源参数数据通过 第一API响应反馈给用户,用户还需要再学习第二API网关支持的资源参数格式,因此会增加用户的学习成本。本申请实施例中,第一API网关还可以对第二API网关发送的第二API响应中的资源参数数据进行转义,得到第一API响应中的资源参数数据,如此可以减少用户学习成本。Optionally, the API response includes resource parameter data. The resource parameter data included in the second API response sent by the second API follows the resource parameter format supported by the API gateway of the target cloud platform. The first API gateway publishes the format of the API request that it supports. Therefore, the user learns the first resource parameter format supported by the first API gateway. If the first API gateway directly passes the resource parameter data included in the second API response, The first API response is fed back to the user, and the user also needs to learn the resource parameter format supported by the second API gateway, which will increase the user's learning cost. In the embodiment of the present application, the first API gateway may also escape the resource parameter data in the second API response sent by the second API gateway to obtain the resource parameter data in the first API response, which can reduce user learning costs.
假设第一API响应包括第三资源参数数据,第二API响应包括第四资源参数数据,第三资源参数数据的格式为第一API网关支持的资源参数格式,第三资源参数数据的格式为第二API网关支持的资源参数格式,则第三资源参数数据是第一API网关将第四资源参数数据进行资源参数格式转化得到的。Assuming that the first API response includes third resource parameter data, the second API response includes fourth resource parameter data, the format of the third resource parameter data is the resource parameter format supported by the first API gateway, and the format of the third resource parameter data is the first Second, the resource parameter format supported by the API gateway, the third resource parameter data is obtained by the first API gateway converting the fourth resource parameter data into the resource parameter format.
其中,第一API网关可以通过多种方式对第四资源参数数据进行资源参数格式转化。本申请实施例以以下两种可选方式为例进行说明:Among them, the first API gateway may perform resource parameter format conversion on the fourth resource parameter data in a variety of ways. The embodiment of the present application takes the following two optional methods as examples for description:
在第一种可选方式中,参考S301中的第一方面,第一API网关在确定支持的API请求的资源参数格式后,建立多个云平台中每个云平台的API网关支持的资源参数格式与第一API网关支持的资源参数格式的第一对应关系。第一API网关在接收到第二API响应后,基于第一API网关的标识查询该第一对应关系得到第一API网关支持的资源参数格式;并基于该第一API网关支持的资源参数格式,将第二API响应包括的第四资源参数数据转义得到第三资源参数数据。In the first optional manner, referring to the first aspect in S301, the first API gateway establishes the resource parameters supported by the API gateway of each of the multiple cloud platforms after determining the resource parameter format of the supported API request The first correspondence between the format and the resource parameter format supported by the first API gateway. After receiving the second API response, the first API gateway queries the first correspondence based on the identifier of the first API gateway to obtain the resource parameter format supported by the first API gateway; and based on the resource parameter format supported by the first API gateway, The fourth resource parameter data included in the second API response is escaped to obtain the third resource parameter data.
该第一对应关系的表示方式和转义过程可以参考S305,本申请实施例对此不做赘述。For the expression mode and escaping process of the first correspondence, refer to S305, which is not described in detail in the embodiment of the present application.
在第二种可选方式中,第一API网关在确定支持的API请求的资源参数格式后,基于多个云平台中每个云平台的API网关支持的资源参数格式,以及第一API网关支持的资源参数格式,建立转义模型,该转义模型用于在接收API网关的标识以及资源参数数据后,输出与接收的API网关的标识对应的资源参数数据。第一API网关在接收到第二API响应后,将第二API响应包括的第四资源参数数据以及第一API网关的标识输入该转义模型,将该转义模型输出的资源参数数据确定为第三资源参数数据。In the second optional manner, after the first API gateway determines the resource parameter format of the supported API request, it is based on the resource parameter format supported by the API gateway of each cloud platform among the multiple cloud platforms, and the first API gateway supports An escape model is established, which is used to output resource parameter data corresponding to the received API gateway identifier and resource parameter data after receiving the API gateway identifier and resource parameter data. After receiving the second API response, the first API gateway inputs the fourth resource parameter data included in the second API response and the identification of the first API gateway into the escape model, and determines the resource parameter data output by the escape model as The third resource parameter data.
本申请实施例中,由于第一API网关在接收到第一API请求后,确定目标云平台所支持格式的第二API请求,并将该第二API请求发送至目标云平台的第二API网关,用户仅需采用第一API网关所支持格式的API请求访问API统一网关即可实现对多个云平台中的目标云平台的访问,降低了用户的操作复杂度,提高了用户设备与不同云平台的通信灵活性。In the embodiment of the present application, after receiving the first API request, the first API gateway determines the second API request in the format supported by the target cloud platform, and sends the second API request to the second API gateway of the target cloud platform , The user only needs to use the API request in the format supported by the first API gateway to access the API unified gateway to achieve access to the target cloud platform among multiple cloud platforms, which reduces the user’s operational complexity and improves user equipment and different clouds. The communication flexibility of the platform.
相关技术中,用户使用多个云平台的资源时,需要重复学习需要调用API接口的多个云平台开放的资源格式,并进行重复编码实现该多个云平台的API接口的调用。In related technologies, when users use resources of multiple cloud platforms, they need to repeatedly learn the open resource formats of multiple cloud platforms that need to call API interfaces, and perform repeated coding to implement the calls of API interfaces of the multiple cloud platforms.
而本申请实施例,由于新增了第一API网关,为多个云平台的API接口调用提供了统一的入口,因此,面向用户的是第一API网关,用户仅需按照第一API网关支持的资源格式进行编程或者通过管理节点的用户界面触发调用操作,减少了用户对于相同或相似资源(即前述的同一种资源)的重复学习和配置成本,提高了用户体验。In the embodiment of this application, since the first API gateway is newly added, a unified entry is provided for API interface calls of multiple cloud platforms. Therefore, the user-oriented API gateway is the first API gateway, and the user only needs to support according to the first API gateway. The resource format is programmed or the call operation is triggered through the user interface of the management node, which reduces the user's repeated learning and configuration costs for the same or similar resources (that is, the aforementioned same resource), and improves the user experience.
一套用户系统或一个应用可能会使用多个云平台的资源分层部署。相关技术 中,用户需要通过编程的方式在该多个云平台分别使用对应的资源,以实现用户系统或应用的分词部署。A set of user systems or an application may be deployed hierarchically using the resources of multiple cloud platforms. In related technologies, users need to use corresponding resources on the multiple cloud platforms in a programmatic manner to implement word segmentation deployment of user systems or applications.
而本申请实施例,由于第一API向用户提供了统一的资源格式,本申请实施例提供的通信方法还可以用于跨云平台的资源编排。用户在一个蓝图里编排生成统一的资源模板,用户仅需在该资源模板中设置用户系统或应用的各资源部署在哪个云平台(即前述目标云平台),即可通过运行设置好的资源模板在多个云平台部署实例,设置好目标云平台的资源模板即为前述客户端。如此能够有效减少用户的操作,提高资源部署效率。In the embodiment of the present application, since the first API provides users with a unified resource format, the communication method provided in the embodiment of the present application can also be used for resource orchestration across cloud platforms. The user arranges and generates a unified resource template in a blueprint. The user only needs to set in the resource template which cloud platform (ie the aforementioned target cloud platform) each resource of the user system or application is deployed on, and then run the set resource template Deploy instances on multiple cloud platforms, and set the resource template of the target cloud platform as the aforementioned client. This can effectively reduce user operations and improve resource deployment efficiency.
可选地,第一API网关除了前述进行API请求的格式整合功能,还支持其他功能,例如第一API网关支持服务信息的呈现功能,如图4所示,本申请实施例提供的通信方法还包括:Optionally, in addition to the aforementioned API request format integration function, the first API gateway also supports other functions. For example, the first API gateway supports the presentation function of service information. As shown in FIG. 4, the communication method provided in the embodiment of the present application also include:
S309、第一API网关获取云平台的资源的服务信息,该服务信息包括服务能力信息和服务价格中的至少一种。S309. The first API gateway obtains service information of the resources of the cloud platform, where the service information includes at least one of service capability information and service prices.
其中,服务信息为与资源所提供的服务相关的信息。服务能力信息用于反映资源提供服务的能力的大小,该服务能力信息包括一种或多种反映服务能力的参数值,或者该服务能力信息可以为服务能力指标值,该服务能力指标值可以基于前述参数值确定,也可以是预设值。例如,对于一个用于提供GPU加速服务的资源,其服务能力信息包括CPU个数、内存个数、内存大小(例如4G内存)、系统架构、内网收发能力信息和GPU指示符中的一个或多个,内网收发能力信息用于反映资源在内部网络的信息收发能力,例如该信息为每秒发包数量(page per second,PPS),假设内网收发能力信息指示内网收发包100万以上,指的是内部网络在每秒发包数量在100万以上;系统架构用于指示资源所支持的系统架构,该系统架构可以为IOS架构、安卓架构和鲲鹏架构中的至少一种,例如可以采用数值0、1和2分别表示前述三种架构;该GPU指示符用于指示对应资源是否带有GPU,或者带有的GPU个数,例如可以采用数值0、1分别表示带有GPU和不带有GPU;服务价格用于反映资源提供服务的价格。Among them, the service information is information related to the service provided by the resource. The service capability information is used to reflect the size of the resource's ability to provide services. The service capability information includes one or more parameter values that reflect the service capability, or the service capability information may be a service capability index value, which may be based on The aforementioned parameter values are determined, and can also be preset values. For example, for a resource used to provide GPU acceleration services, its service capability information includes one or one of the number of CPUs, the number of memory, the size of memory (for example, 4G memory), the system architecture, the information of the intranet transceiver capability, and the GPU indicator. There are multiple. Intranet sending and receiving capability information is used to reflect the information sending and receiving capability of resources in the internal network. For example, the information is the number of packets per second (PPS). Assuming that the intranet sending and receiving capability information indicates that the intranet sends and receives more than 1 million packets , Refers to the internal network sending more than 1 million packets per second; the system architecture is used to indicate the system architecture supported by the resource. The system architecture can be at least one of the IOS architecture, the Android architecture and the Kunpeng architecture, for example, The values 0, 1, and 2 respectively represent the aforementioned three architectures; the GPU indicator is used to indicate whether the corresponding resource has a GPU or the number of GPUs. There is a GPU; the service price is used to reflect the price of the service provided by the resource.
第一API网关具有识别各个云平台中资源的服务信息的能力。第一API网关获取服务信息的时机可以有多种情况。本申请实施例以以下三种情况为例进行说明:The first API gateway has the ability to identify service information of resources in each cloud platform. There may be multiple situations when the first API gateway obtains the service information. The embodiments of this application take the following three situations as examples for description:
在第一种情况下,第一API网关在通过用户界面接收到服务信息检索请求后,获取云平台的资源的服务信息。请参考图2,管理节点可以向用户设备提供用户界面,用户可以通过用户设备在该用户界面进行检索操作。相应的,管理节点在该用户界面接收服务信息检索请求后,将该服务信息检索请求发送至第一API网关,第一API网关基于该服务信息检索请求获取云平台的资源的服务信息。其中,服务信息检索请求包括对检索的云平台的资源要求,包括对资源的功能、资源格式和资源性能等的要求,第一API网关获取服务信息的云平台的资源需要满足该服务信息检索请求的要求,也即是与该服务信息检索请求匹配。In the first case, the first API gateway obtains the service information of the resources of the cloud platform after receiving the service information retrieval request through the user interface. Referring to Figure 2, the management node can provide a user interface to the user equipment, and the user can perform retrieval operations on the user interface through the user equipment. Correspondingly, after receiving the service information retrieval request on the user interface, the management node sends the service information retrieval request to the first API gateway, and the first API gateway obtains the service information of the resources of the cloud platform based on the service information retrieval request. Among them, the service information retrieval request includes the resource requirements of the retrieved cloud platform, including requirements on the function, resource format, and resource performance of the resource. The resources of the cloud platform from which the first API gateway obtains the service information need to meet the service information retrieval request , That is, it matches the service information retrieval request.
在一种可选示例中,管理节点提供的用户界面50可以如图5所示,该用户界 面50包括检索框501,用户可以在该检索框501中输入关键字以进行检索操作。管理节点接收该检索操作所触发的服务信息检索请求,该服务信息检索请求包括该关键字,第一API网关可以基于服务信息检索请求,获取与该关键字匹配的资源的服务信息。例如,该关键字为:“GPU加速、4核CPU”,则第一API网关获取用于提供GPU加速服务的具有4核CPU的资源的服务信息。In an optional example, the user interface 50 provided by the management node may be as shown in FIG. The management node receives the service information retrieval request triggered by the retrieval operation, the service information retrieval request includes the keyword, and the first API gateway may obtain the service information of the resource matching the keyword based on the service information retrieval request. For example, if the keyword is: "GPU acceleration, 4-core CPU", the first API gateway obtains service information of a resource with a 4-core CPU for providing GPU acceleration services.
在另一种可选示例中,管理节点提供的用户界面60可以如图6所示,该用户界面60包括一个或多个提示选项601,该一个或多个提示选项601可以包括资源类别提示选项6011,用于提示多个云平台中部署的资源的类别,该类别可以是资源提供的服务类别,如GPU加速、磁盘性能优化或网速带宽优化等;该类别也可以是资源的自身属性类别,如虚拟机或容器等。该一个或多个提示选项601还可以包括反映服务能力的参数的提示选项6012,如CPU个数选项或内存个数选项等。每个提示选项601设置一下拉按钮,用户在需要在某一提示选项601提供的提示信息中选择时,通过点击该下拉按钮来触发与该某一提示选项呈现对应的提示信息。用户在一个或多个提示选项对应的提示信息中选择后,触发检索按钮,以进行检索操作。相应的,管理节点接收该检索操作所触发的服务信息检索请求,该服务信息检索请求包括该用户选择的提示信息,第一API网关可以基于服务信息检索请求,获取与该服务信息检索请求匹配的资源的服务信息。例如,该服务信息检索请求指示:资源类别为GPU加速,CPU个数为4,内存个数为8。In another alternative example, the user interface 60 provided by the management node may be as shown in FIG. 6. The user interface 60 includes one or more prompt options 601, and the one or more prompt options 601 may include resource category prompt options. 6011, used to prompt the types of resources deployed in multiple cloud platforms. This type can be the service type provided by the resource, such as GPU acceleration, disk performance optimization, or network speed and bandwidth optimization; this type can also be the resource's own attribute type , Such as virtual machines or containers. The one or more prompt options 601 may also include prompt options 6012 reflecting parameters of the service capability, such as the number of CPU options or the number of memory options. Each prompt option 601 is provided with a pull button. When the user needs to select from the prompt information provided by a certain prompt option 601, the user clicks the pull-down button to trigger the presentation of the prompt information corresponding to the certain prompt option. After the user selects the prompt information corresponding to one or more prompt options, the search button is triggered to perform the search operation. Correspondingly, the management node receives the service information retrieval request triggered by the retrieval operation. The service information retrieval request includes the prompt information selected by the user. The first API gateway may obtain the service information retrieval request based on the service information retrieval request. Service information of the resource. For example, the service information retrieval request indicates that the resource category is GPU accelerated, the number of CPUs is 4, and the number of memory is 8.
在又一种可选示例中,管理节点可以同时在用户界面呈现检索框和一个或多个提示选项。具体的呈现方式参考前述两种可选示例。In yet another alternative example, the management node may simultaneously present a search box and one or more prompt options on the user interface. For specific presentation methods, refer to the foregoing two optional examples.
在第二种情况下,第一API网关在接收到第一API请求后,获取云平台的资源的服务信息。该云平台的资源的服务信息与该第一API请求匹配。例如,该第一API请求包括资源的标识,第一API网关获取的资源的服务信息为该资源的标识所对应的资源的服务信息。例如,该资源的标识为“GPU加速”,第一API网关获取的资源的服务信息为多个云平台中用于提供GPU加速服务的资源的服务信息。In the second case, after receiving the first API request, the first API gateway obtains the service information of the resources of the cloud platform. The service information of the resource of the cloud platform matches the first API request. For example, the first API request includes the identifier of the resource, and the service information of the resource acquired by the first API gateway is the service information of the resource corresponding to the identifier of the resource. For example, the identifier of the resource is "GPU acceleration", and the service information of the resource acquired by the first API gateway is the service information of the resource used to provide GPU acceleration services in multiple cloud platforms.
第三种情况,第一API网关周期性获取多个云平台的资源的能力信息,该多个云平台可以是第一API网关管理的所有云平台,在每次获取该多个云平台的资源的能力信息后,第一API网关将获取的云平台的资源的能力信息存储在指定存储空间4。In the third case, the first API gateway periodically obtains the capability information of the resources of multiple cloud platforms. The multiple cloud platforms may be all cloud platforms managed by the first API gateway, and each time the resources of the multiple cloud platforms are obtained After the capability information, the first API gateway stores the acquired capability information of the resources of the cloud platform in the designated storage space 4.
S310、第一API网关通过用户界面呈现云平台的资源的能力信息。S310. The first API gateway presents the capability information of the resources of the cloud platform through the user interface.
可选地,第一API网关将获取的云平台的资源的能力信息发送至管理节点,由管理节点通过用户界面呈现该云平台的资源的能力信息。Optionally, the first API gateway sends the acquired capability information of the resources of the cloud platform to the management node, and the management node presents the capability information of the resources of the cloud platform through a user interface.
可选地,当呈现的资源的能力信息包括与多个资源一一对应的多组能力信息时,每组能力信息可以以列表的方式呈现。Optionally, when the presented capability information of the resource includes multiple sets of capability information corresponding to multiple resources on a one-to-one basis, each set of capability information may be presented in the form of a list.
由S309和S310可知,第一API网关的服务信息的呈现功能,可以将云平台的资源的能力信息呈现给用户,便于用户了解资源的能力信息。It can be seen from S309 and S310 that the service information presentation function of the first API gateway can present the capability information of the resources of the cloud platform to the user, so that the user can understand the capability information of the resource.
由于多个云平台的资源能力虽然大同小异,但仍存在一定的差异化。相关技术中,用户若需了解不同云平台的资源的能力,需要通过查询操作逐个云平台查 询资源是否满足自身需求。Although the resource capabilities of multiple cloud platforms are similar, there are still some differences. In related technologies, if users need to understand the resource capabilities of different cloud platforms, they need to check whether the resources meet their own needs through query operations on each cloud platform.
本申请实施例中,对于S309的第一种情况,第一API网关在接收到服务信息检索请求后,获取云平台的资源的服务信息,并通过用户界面呈现获取的服务信息,能够实现通过用户界面进行服务信息的检索功能,从而便于用户按需检索,得到自身想要获取的服务信息。用户无需逐个云平台查询资源是否满足自身需求,减少用户的操作复杂度,提高用户体验。可选地,S309和S310可以在前述S303之前执行。则在S303中,用户可以基于检索结果,通过用户设备向第一API网关发送第一API请求。In the embodiment of the present application, for the first case of S309, after receiving the service information retrieval request, the first API gateway obtains the service information of the resources of the cloud platform, and presents the obtained service information through the user interface, which can be realized through the user The interface performs the retrieval function of service information, so that users can retrieve on demand and obtain the service information they want to obtain. Users do not need to check whether resources meet their own needs on a cloud platform one by one, reducing user operation complexity and improving user experience. Optionally, S309 and S310 may be performed before the aforementioned S303. Then in S303, the user can send the first API request to the first API gateway through the user equipment based on the search result.
对于S309的第二种情况,第一API网关在接收到第一API请求后,获取云平台的资源的服务信息,并通过用户界面呈现获取的服务信息,能够实现在用户进行接口调用时,为用户提供满足需求的资源的服务信息,从而便于用户了解资源的服务信息,从而更好地进行接口调用。可选地,S309和S310可以在前述S303之后执行。For the second case of S309, after receiving the first API request, the first API gateway obtains the service information of the resources of the cloud platform, and presents the obtained service information through the user interface, which can realize that when the user makes an interface call, The user provides the service information of the resource that meets the demand, so that the user can understand the service information of the resource and make better interface calls. Optionally, S309 and S310 may be executed after the aforementioned S303.
对于S309的第三种情况,第一API网关可以在检测到用户通过用户界面访问用于进行能力信息呈现的指定页面的操作后,在指定存储空间4获取最新的云平台的资源的能力信息,并通过该指定页面呈现最新的云平台的资源的能力信息。当呈现最新的云平台的资源的能力信息是第一API网关管理的多个云平台时,可以便于用户对第一API网关管理的云平台的资源的能力信息进行整体的了解。For the third case of S309, the first API gateway may obtain the latest capability information of the resources of the cloud platform in the designated storage space 4 after detecting that the user accesses the specified page for presentation of capability information through the user interface. And the latest cloud platform resource capability information is presented through the designated page. When the capability information of the resources of the latest cloud platform is presented as multiple cloud platforms managed by the first API gateway, it is convenient for the user to have an overall understanding of the capability information of the resources of the cloud platform managed by the first API gateway.
需要说明的是,前述能力信息可以是实时的能力信息,即该能力信息是动态可变的;该能力信息也可以是额定的能力信息,该额定的能力信息是固定的,用于反映资源的能力上限。当该能力信息是实时的能力信息时,第一API网关能够通过呈现资源的实时的能力信息,实现用户对当前的能力信息的及时准确的了解,提高用户体验。It should be noted that the aforementioned capability information may be real-time capability information, that is, the capability information is dynamically variable; the capability information may also be rated capability information, and the rated capability information is fixed and used to reflect resource Capability limit. When the capability information is real-time capability information, the first API gateway can present the real-time capability information of the resource to realize the user's timely and accurate understanding of the current capability information and improve the user experience.
可选地,前述管理节点还可以支持资源配额分配功能,管理节点呈现多个云平台的统一用户界面,用户可以在该用户界面进行资源配合分配,管理节点在接收到分配指令后,进行资源配额的分配。例如,用户需要在云平台1建立虚拟机1,在云平台2建立虚拟机2,用户通过该用户界面分配该两个虚拟机的资源配额。示例的,为虚拟机1分配4核CPU和2G内存;为虚拟机2分配8核CPU和4G内存。Optionally, the aforementioned management node may also support the resource quota allocation function. The management node presents a unified user interface of multiple cloud platforms. The user can perform resource allocation through the user interface. After receiving the allocation instruction, the management node performs resource quota Distribution. For example, the user needs to create virtual machine 1 on cloud platform 1 and virtual machine 2 on cloud platform 2, and the user allocates resource quotas for the two virtual machines through the user interface. For example, a 4-core CPU and 2G memory are allocated to virtual machine 1; an 8-core CPU and 4G memory are allocated to virtual machine 2.
可选地,前述管理节点还可以支持资源使用权限设置功能,管理节点呈现多个云平台的统一用户界面,用户可以在该用户界面进行资源使用权限的设置,管理节点在接收到权限指示指令后,进行资源使用权限的设定。例如,前述用户账号为M1的用户具有虚拟机1的使用权限;用户账号为M2的用户具有虚拟机2的使用权限。Optionally, the aforementioned management node may also support the function of setting resource usage rights. The management node presents a unified user interface of multiple cloud platforms. The user can set the resource usage rights on the user interface. After the management node receives the permission instruction instruction , Set up resource usage permissions. For example, the aforementioned user whose user account is M1 has the right to use virtual machine 1; the user whose user account is M2 has the right to use virtual machine 2.
可选地,第一API网关还支持跨云平台的资源迁移功能。如图7所示,本申请实施例提供的通信方法还包括:Optionally, the first API gateway also supports a resource migration function across cloud platforms. As shown in FIG. 7, the communication method provided by the embodiment of the present application further includes:
S311、第一API网关将待迁移资源的资源参数数据的资源参数格式转化为目的云平台的API网关支持的资源参数格式。S311. The first API gateway converts the resource parameter format of the resource parameter data of the resource to be migrated into a resource parameter format supported by the API gateway of the target cloud platform.
第一API网关在进行资源迁移时,先确定待迁移资源所属的源云平台,以及所需迁移到的目的云平台,然后在源云平台获取待迁移资源的资源参数数据,将该资源参数数据的资源参数格式转化为目的云平台的API网关支持的资源参数格式。When the first API gateway performs resource migration, it first determines the source cloud platform to which the resource to be migrated belongs and the destination cloud platform to which it needs to be migrated, and then obtains the resource parameter data of the resource to be migrated on the source cloud platform, and the resource parameter data The resource parameter format is converted into the resource parameter format supported by the API gateway of the target cloud platform.
其中,第一API网关可以通过多种方式确定源云平台和目的云平台。在一种可选示例中,第一API网关接收资源迁移请求,该资源迁移请求指示源云平台以及目的云平台;在另一种可选示例中,源云平台和目的云平台为预先设定的云平台。Among them, the first API gateway can determine the source cloud platform and the destination cloud platform in a variety of ways. In an optional example, the first API gateway receives a resource migration request, and the resource migration request indicates a source cloud platform and a destination cloud platform; in another optional example, the source cloud platform and the destination cloud platform are preset Cloud platform.
第一API网关可以通过多种方式将该资源参数数据的资源参数格式转化为目的云平台支持的资源参数格式。在第一种可选示例中,第一API网关可以先将资源参数数据的资源参数格式转化为第一API网关支持的资源参数格式,此转化过程称为第一次转化,再将转化后的资源参数数据的资源参数格式转化为目的云平台支持的资源参数格式,此转化过程称为第二次转化。参考S305,第一API网关预先建立多个云平台中每个云平台的API网关支持的资源参数格式与第一API网关支持的资源参数格式的第一对应关系,对于该待迁移资源,第一API网关基于该第一对应关系,确定第一API网关支持的资源参数格式与源云平台支持的资源参数格式的对应关系1,以及第一API网关支持的资源参数格式与目的云平台支持的资源参数格式的对应关系2。第一API网关基于对应关系1完成前述第一次转化,基于对应关系2完成前述第二次转化。The first API gateway may convert the resource parameter format of the resource parameter data into a resource parameter format supported by the target cloud platform in various ways. In the first optional example, the first API gateway may first convert the resource parameter format of the resource parameter data into the resource parameter format supported by the first API gateway. This conversion process is called the first conversion, and then the converted The resource parameter format of the resource parameter data is converted into the resource parameter format supported by the destination cloud platform. This conversion process is called the second conversion. Referring to S305, the first API gateway pre-establishes a first correspondence between the resource parameter format supported by the API gateway of each cloud platform in the multiple cloud platforms and the resource parameter format supported by the first API gateway. For the resource to be migrated, first Based on the first correspondence, the API gateway determines the correspondence between the resource parameter format supported by the first API gateway and the resource parameter format supported by the source cloud platform, as well as the resource parameter format supported by the first API gateway and the resource supported by the destination cloud platform. Correspondence of parameter format 2. The first API gateway completes the aforementioned first conversion based on the corresponding relationship 1, and completes the aforementioned second conversion based on the corresponding relationship 2.
在第二种可选示例中,第一API网关可以直接将资源参数数据的资源参数格式转化为目的云平台支持的资源参数格式。参考第一种可选示例,对于该待迁移资源,第一API网关基于该第一对应关系,确定第一API网关支持的资源参数格式与源云平台支持的资源参数格式的对应关系1,以及第一API网关支持的资源参数格式与目的云平台支持的资源参数格式的对应关系2,再基于对应关系1和对应关系2确定源云平台支持的资源参数格式与目的云平台支持的资源参数格式的对应关系3。第一API网关基于对应关系3完成将资源参数数据的资源参数格式转化为目的云平台支持的资源参数格式的过程。In the second optional example, the first API gateway may directly convert the resource parameter format of the resource parameter data into the resource parameter format supported by the target cloud platform. With reference to the first optional example, for the resource to be migrated, the first API gateway determines the correspondence between the resource parameter format supported by the first API gateway and the resource parameter format supported by the source cloud platform based on the first correspondence1, and Correspondence between the resource parameter format supported by the first API gateway and the resource parameter format supported by the target cloud platform 2, and then determine the resource parameter format supported by the source cloud platform and the resource parameter format supported by the destination cloud platform based on the corresponding relationship 1 and the corresponding relationship 2. The corresponding relationship 3. The first API gateway completes the process of converting the resource parameter format of the resource parameter data into the resource parameter format supported by the target cloud platform based on the correspondence relationship 3.
S312、第一API网关将转化后的资源参数数据发送至目的云平台的API网关。S312. The first API gateway sends the transformed resource parameter data to the API gateway of the target cloud platform.
第一API网关将转化后的资源参数数据发送至目的云平台的API网关,目的云平台的API网关基于转化后的资源参数数据建立新的资源,从而实现了资源参数数据从源云平台到目的云平台的迁移。需要说明的是,该目的云平台与前述目标云平台可以相同也可以不同,本申请实施例对此不做限定。The first API gateway sends the converted resource parameter data to the API gateway of the target cloud platform. The API gateway of the target cloud platform creates a new resource based on the transformed resource parameter data, thereby realizing the resource parameter data from the source cloud platform to the target Migration of cloud platforms. It should be noted that the target cloud platform and the foregoing target cloud platform may be the same or different, which is not limited in the embodiment of the present application.
相关技术中,用户若需要将原有的部署于平台1的资源迁移至平台2,需要先将平台1的资源删除,再通过重新编程的方式在云平台2上建立新的资源。In the related technology, if a user needs to migrate the original resources deployed on the platform 1 to the platform 2, the resources of the platform 1 need to be deleted first, and then new resources are created on the cloud platform 2 through reprogramming.
而本申请实施例中,若用户需要进行跨云平台的资源迁移,仅需要通过资源迁移请求或其他方式指定源云平台和目的云平台,第一API网关即可实现资源跨云平台的自动迁移,无需用户再重新编程,减少操作复杂度,提高用户体验。In the embodiment of this application, if a user needs to perform resource migration across cloud platforms, he only needs to specify the source cloud platform and the destination cloud platform through a resource migration request or other means, and the first API gateway can realize the automatic resource migration across cloud platforms. , No need for users to reprogram, reduce operation complexity and improve user experience.
需要说明的是,对资源进行跨云平台迁移后,源云平台中资源在提供服务时产生的业务数据,还需要用户控制源云平台发送至目的云平台,以实现资源和业 务数据的完整迁移。It should be noted that after the resources are migrated across cloud platforms, the business data generated when the resources in the source cloud platform provide services also needs to be controlled by the user to send from the source cloud platform to the destination cloud platform to realize the complete migration of resources and business data .
为了便于读者理解,本申请实施例假设以以下示例进行说明:用户X需要创建一个4核CPU、8G内存、带有GPU的虚拟机,其通过在用户设备运行管理节点对应的网页客户端来访问管理节点提供的用户界面,该用户界面可以如图5或图6所示,用户通过该用户界面进行检索操作,触发的服务信息检索请求“4核CPU、8G内存、带有GPU”。第一API网关获取满足该服务信息检索请求的要求的资源,并获取其服务信息,第一API网关获取的资源的服务信息通过管理节点的用户界面呈现。例如以表格的形成呈现资源的服务信息(该过程可以参考前述S309和S310)。用户可以基于多个资源的服务信息,确定目标云平台。可选地,用户界面中还呈现多个资源所属云平台的标识(例如云平台的名称),用户通过网页客户端在用户界面选择目标云平台,相应的,管理节点接收选择指令,并将指示目标云平台的选择指令发送给第一API网关。之后,用户设备通过客户端或者管理节点按照第一接口调用规则向第一API网关发送第一API请求,该第一API请求指示的调用操作为资源的建立操作。第一API网关接收第一API请求后将第一API请求中的第一资源数据进行资源参数格式转化,得到第二资源参数数据,并按照第二接口调用规则将包括第二参数数据的第二API请求发送至目标云平台中的第二API网关。假设第一API请求指示需要建立的资源为虚拟机,第二API网关基于该第二API请求在目标云平台中建立“4核CPU、8G内存、带有GPU”的虚拟机。第二API网关向第一API网关发送第二API响应。第一API网关在接收到第二API响应后,按照第一接口调用规则向用户设备发送第一API响应(该过程可以参考前述S303至S308)。In order to facilitate readers’ understanding, the embodiments of this application assume the following example for description: User X needs to create a virtual machine with a 4-core CPU, 8G memory, and GPU, which is accessed by running the web client corresponding to the management node on the user device The user interface provided by the management node, the user interface may be as shown in Figure 5 or Figure 6, the user performs a retrieval operation through the user interface, and triggers a service information retrieval request "4 core CPU, 8G memory, with GPU". The first API gateway obtains a resource that meets the requirements of the service information retrieval request and obtains its service information. The service information of the resource obtained by the first API gateway is presented through the user interface of the management node. For example, the service information of the resource is presented in the form of a table (refer to the aforementioned S309 and S310 for this process). Users can determine the target cloud platform based on the service information of multiple resources. Optionally, the user interface also presents the identification of the cloud platform to which multiple resources belong (for example, the name of the cloud platform), and the user selects the target cloud platform on the user interface through the web client. Accordingly, the management node receives the selection instruction and will indicate The selection instruction of the target cloud platform is sent to the first API gateway. After that, the user equipment sends a first API request to the first API gateway through the client or the management node according to the first interface calling rule, and the calling operation indicated by the first API request is a resource establishment operation. After receiving the first API request, the first API gateway converts the first resource data in the first API request into resource parameter format to obtain the second resource parameter data, and according to the second interface calling rule, converts the second parameter data including the second parameter data. The API request is sent to the second API gateway in the target cloud platform. Assuming that the first API request indicates that the resource to be established is a virtual machine, the second API gateway establishes a virtual machine with "4-core CPU, 8G memory, and GPU" in the target cloud platform based on the second API request. The second API gateway sends a second API response to the first API gateway. After receiving the second API response, the first API gateway sends the first API response to the user equipment according to the first interface calling rule (refer to the foregoing S303 to S308 for this process).
需要说明的是,本申请实施例提供的通信方法步骤的先后顺序可以进行适当调整,步骤也可以根据情况进行相应增减,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化的方法,都应涵盖在本申请的保护范围之内,因此不再赘述。It should be noted that the sequence of the steps of the communication method provided in the embodiments of this application can be adjusted appropriately, and the steps can also be increased or decreased accordingly according to the situation. Anyone skilled in the art within the technical scope disclosed in this application can Any method that can be easily thought of changes should be covered by the scope of protection of this application, so I will not repeat them.
本申请实施例提供一种通信装置70,该装置应用于第一API网关,如图8所示,该装置70包括:An embodiment of the present application provides a communication device 70, which is applied to a first API gateway. As shown in FIG. 8, the device 70 includes:
接收模块701,用于接收第一API请求;确定模块702,用于在多个云平台中确定用于响应第一API请求的目标云平台,第一API请求的格式为第一API网关支持的格式;发送模块703,用于向第二API网关发送第二API请求,第二API请求基于第一API请求确定,且第二API请求的格式为第二API网关支持的格式,第二API网关为目标云平台的API网关。The receiving module 701 is used to receive the first API request; the determining module 702 is used to determine the target cloud platform used to respond to the first API request among multiple cloud platforms, and the format of the first API request is supported by the first API gateway Format; sending module 703, used to send a second API request to the second API gateway, the second API request is determined based on the first API request, and the format of the second API request is a format supported by the second API gateway, the second API gateway It is the API gateway of the target cloud platform.
综上所述,由于在接收模块接收到第一API请求后,确定模块确定目标云平台所支持格式的第二API请求,并由发送模块将该第二API请求发送至目标云平台的第二API网关,用户仅需采用第一API网关所支持格式的API请求访问API统一网关即可实现对多个云平台中的目标云平台的访问,降低了用户的操作复杂度,提高了用户设备与不同云平台的通信灵活性。In summary, after the receiving module receives the first API request, the determining module determines the second API request in the format supported by the target cloud platform, and the sending module sends the second API request to the second API request of the target cloud platform. API gateway, the user only needs to use the API request in the format supported by the first API gateway to access the API unified gateway to achieve access to the target cloud platform among multiple cloud platforms, which reduces the complexity of user operations and improves user equipment and Communication flexibility of different cloud platforms.
可选地,第一API请求包括第一资源参数数据,第二API请求包括第二资源参数数据,第一资源参数数据的格式为第一API网关支持的资源参数格式,第一资源参数数据的格式为第二API网关支持的资源参数格式,第二资源参数数据是将第一资源参数数据进行资源参数格式转化得到的。Optionally, the first API request includes first resource parameter data, and the second API request includes second resource parameter data. The format of the first resource parameter data is the resource parameter format supported by the first API gateway. The format is a resource parameter format supported by the second API gateway, and the second resource parameter data is obtained by converting the first resource parameter data into the resource parameter format.
可选地,如图9所示,装置70还包括:整合模块704,用于将多个云平台中的同一种资源的同一调用操作所对应的资源参数格式进行整合,得到第一API网关支持的同一种资源的同一调用操作的资源参数格式。Optionally, as shown in FIG. 9, the device 70 further includes: an integration module 704, configured to integrate resource parameter formats corresponding to the same invocation operation of the same resource in multiple cloud platforms, to be supported by the first API gateway The resource parameter format of the same call operation of the same resource.
可选地,第一API网关支持的同一种资源的同一调用操作的资源参数格式为多个云平台中的同一种资源的同一调用操作所对应的资源参数格式的并集。Optionally, the resource parameter format of the same calling operation of the same resource supported by the first API gateway is a union of resource parameter formats corresponding to the same calling operation of the same resource in multiple cloud platforms.
可选地,第二API请求由第一API网关基于第二接口调用规则发送,第二接口调用规则是第二API网关支持的接口调用规则,第二接口调用规则由第一API网关基于第一API网关支持的第一接口调用规则以及第一API请求确定;接收模块701,还用于接收第二API网关发送的第二API响应;发送模块703,还用于基于第二API响应,按照第一接口调用规则向第一API请求的发送端回复第一API响应。Optionally, the second API request is sent by the first API gateway based on the second interface calling rule, the second interface calling rule is the interface calling rule supported by the second API gateway, and the second interface calling rule is based on the first API gateway. The first interface calling rule supported by the API gateway and the determination of the first API request; the receiving module 701 is also used to receive the second API response sent by the second API gateway; the sending module 703 is also used to follow the second API response based on the second API response An interface calling rule replies the first API response to the sender of the first API request.
可选地,如图10所示,装置70还包括:规则确定模块705,用于对于多个云平台中的同一种资源的同一调用操作,基于调用操作所对应的接口调用规则,确定同一种资源的同一调用操作对应的第一接口调用规则。Optionally, as shown in FIG. 10, the apparatus 70 further includes: a rule determination module 705, configured to determine the same calling operation for the same resource in multiple cloud platforms based on the interface calling rule corresponding to the calling operation The first interface calling rule corresponding to the same calling operation of the resource.
可选地,调用操作的接口调用规则用于指示调用操作对应的接口集以及接口集的调用时序;当多个云平台中的同一种资源的同一调用操作对应的接口集以及接口集的调用时序均相同,同一种资源的同一调用操作对应的第一接口调用规则为按照调用时序调用接口集中的API接口;当多个云平台中的同一种资源的同一调用操作对应的接口集相同,调用时序不同,同一种资源的同一调用操作对应的第一接口调用规则为采用一次API请求调用同一调用操作对应的接口集中的API接口;当多个云平台中的同一种资源的同一调用操作对应的接口集不同,同一种资源的同一调用操作对应的第一接口调用规则为采用一次API请求调用同一调用操作对应的接口集中的API接口。Optionally, the interface calling rules of the calling operation are used to indicate the interface set corresponding to the calling operation and the calling timing of the interface set; when the same calling operation of the same resource in multiple cloud platforms corresponds to the interface set and the calling timing of the interface set The first interface calling rule corresponding to the same calling operation of the same resource is to call the API interfaces in the interface set according to the calling sequence; when the same calling operation of the same resource in multiple cloud platforms corresponds to the same set of interfaces, the calling sequence Different, the first interface calling rule corresponding to the same calling operation of the same resource is to use one API request to call the API interface in the interface set corresponding to the same calling operation; when the same calling operation of the same resource in multiple cloud platforms corresponds to the interface The set is different. The first interface calling rule corresponding to the same calling operation of the same resource is to use one API request to call the API interface in the interface set corresponding to the same calling operation.
可选地,同一种资源为资源定义的相似度大于相似度阈值的资源。Optionally, the same resource is a resource whose similarity defined by the resource is greater than a similarity threshold.
可选地,如图11所示,装置70还包括:呈现模块706,用于通过用户界面云平台的资源的服务信息,服务信息包括服务能力信息和服务价格中的至少一种。Optionally, as shown in FIG. 11, the device 70 further includes: a presentation module 706, configured to provide service information of the resources of the cloud platform through a user interface, the service information including at least one of service capability information and service prices.
可选地,如图12所示,装置70还包括:获取模块707,用于:在通过用户界面接收到服务信息检索请求后,获取云平台的资源的服务信息;或者,在接收到第一API请求后,获取云平台的资源的服务信息。Optionally, as shown in FIG. 12, the apparatus 70 further includes: an obtaining module 707, configured to obtain service information of the resources of the cloud platform after receiving the service information retrieval request through the user interface; or, after receiving the first service information retrieval request; After the API request, the service information of the resources of the cloud platform is obtained.
可选地,目标云平台是基于管理节点发送的选择指令确定的,选择指令用于指示目标云平台,选择指令是管理节点通过用户界面接收的;或者,目标云平台是基于客户端发送的选择指令确定的,选择指令用于指示目标云平台;或者,第一API请求包括目标云平台的标识。Optionally, the target cloud platform is determined based on the selection instruction sent by the management node, the selection instruction is used to instruct the target cloud platform, and the selection instruction is received by the management node through the user interface; or, the target cloud platform is based on the selection sent by the client If the instruction is determined, the selection instruction is used to indicate the target cloud platform; or, the first API request includes the identification of the target cloud platform.
可选地,如图13所示,装置70还包括:转化模块708,用于将待迁移资源的资源参数数据的资源参数格式转化为目的云平台的API网关支持的资源参数格式; 发送模块703还用于将转化后的资源参数数据发送至目的云平台的API网关。Optionally, as shown in FIG. 13, the device 70 further includes: a conversion module 708, configured to convert the resource parameter format of the resource parameter data of the resource to be migrated into a resource parameter format supported by the API gateway of the target cloud platform; a sending module 703 It is also used to send the transformed resource parameter data to the API gateway of the target cloud platform.
可选地,第一API请求由客户端发送给第一API网关;或者,第一API请求由管理节点在用户界面接收并发送给第一API网关。Optionally, the first API request is sent by the client to the first API gateway; or, the first API request is received by the management node on the user interface and sent to the first API gateway.
可选地,第一API请求指示的调用操作包括以下任一种:资源的建立操作、资源的删除操作、资源的修改操作以及资源的查询操作。Optionally, the calling operation indicated by the first API request includes any one of the following: resource establishment operation, resource deletion operation, resource modification operation, and resource query operation.
需要说明的是:上述实施例提供的通信装置在执行该通信方法时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将通信装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。图14假设上述通信装置为第一API网关,图14示意性地提供本申请实施例提供的第一API网关的在实际应用场景中的一种可能的基本硬件架构。第一API网关101包括:API服务模块1011、权限认证模块1012、资源管理模块1013、API分析模块1014和API数据库1015。It should be noted that when the communication device provided in the above embodiment executes the communication method, only the division of the above functional modules is used as an example for illustration. In actual applications, the above functions can be allocated by different functional modules as needed. That is, the internal structure of the communication device is divided into different functional modules to complete all or part of the functions described above. FIG. 14 assumes that the above-mentioned communication device is the first API gateway, and FIG. 14 schematically provides a possible basic hardware architecture in an actual application scenario of the first API gateway provided by an embodiment of the present application. The first API gateway 101 includes: an API service module 1011, an authority authentication module 1012, a resource management module 1013, an API analysis module 1014, and an API database 1015.
API服务模块1011用于发布第一API网关支持的API请求的格式,以向用户设备提供统一的API接口,其可以实现前述S302的功能。The API service module 1011 is used to publish the API request format supported by the first API gateway to provide a unified API interface to the user equipment, which can implement the aforementioned S302 function.
权限认证模块1012用于对接收的第一API请求进行权限认证,其可以实现前述S304所述的鉴权功能。The permission authentication module 1012 is used to perform permission authentication on the received first API request, and it can implement the authentication function described in S304.
资源管理模块1013用于在接收到第一API请求后,在多个云平台中确定用于目标云平台,并基于第一API请求确定第二API请求,其可以实现前述S304和S305的功能。The resource management module 1013 is configured to determine the target cloud platform among multiple cloud platforms after receiving the first API request, and determine the second API request based on the first API request, which can implement the aforementioned functions of S304 and S305.
可选地,API服务模块1011还用于接收第一API请求,调用权限认证模块1012对第一API请求鉴权后,将鉴权成功的第一API请求透传至资源管理模块1013。Optionally, the API service module 1011 is further configured to receive the first API request, call the authority authentication module 1012 to authenticate the first API request, and transparently transmit the first API request that is successfully authenticated to the resource management module 1013.
API分析模块1014用于确定API请求的格式,其可以实现前述S301的功能。The API analysis module 1014 is used to determine the format of the API request, which can implement the aforementioned function of S301.
API数据库1015用于存储多个云平台的资源定义、多个云平台的资源格式和多个云平台的资源的能力信息中的至少一者,其可以实现前述指定存储空间1至指定存储空间4中至少一者的功能。The API database 1015 is used to store at least one of resource definitions of multiple cloud platforms, resource formats of multiple cloud platforms, and capability information of resources of multiple cloud platforms, which can implement the aforementioned designated storage space 1 to designated storage space 4 The function of at least one of them.
图14中的第一API网关101之外的环境仅是示意性的环境,相关解释可以参考前述图1和图2中的对应解释。The environment outside the first API gateway 101 in FIG. 14 is only a schematic environment, and for related explanations, reference may be made to the corresponding explanations in FIGS. 1 and 2 described above.
值得说明的是,前述API服务模块1011的功能可以由接收模块701实现;权限认证模块1012和API分析模块1014可以由确定模块702实现;资源管理模块1013的功能可以由发送模块703实现。图14仅提供一种根据需要而将上述功能分配由不同的功能模块完成的示例,并不对第一API网关中模块的划分进行限定。It is worth noting that the functions of the aforementioned API service module 1011 can be realized by the receiving module 701; the authority authentication module 1012 and the API analysis module 1014 can be realized by the determining module 702; the function of the resource management module 1013 can be realized by the sending module 703. FIG. 14 only provides an example in which the above-mentioned function allocation is completed by different function modules according to needs, and does not limit the division of modules in the first API gateway.
可选地,图15示意性地提供本申请实施例提供的计算机设备的一种可能的基本硬件架构。Optionally, FIG. 15 schematically provides a possible basic hardware architecture of the computer device provided in the embodiment of the present application.
参见图15,计算机设备900包括处理器901、存储器902、通信接口903和总线904。Referring to FIG. 15, the computer device 900 includes a processor 901, a memory 902, a communication interface 903, and a bus 904.
计算机设备900中,处理器901的数量可以是一个或多个,图15仅示意了其中一个处理器901。可选地,处理器901,可以是中央处理器(central processing unit, CPU)。如果计算机设备900具有多个处理器901,多个处理器901的类型可以不同,或者可以相同。可选地,计算机设备900的多个处理器901还可以集成为多核处理器。In the computer device 900, the number of processors 901 may be one or more, and FIG. 15 only illustrates one of the processors 901. Optionally, the processor 901 may be a central processing unit (CPU). If the computer device 900 has multiple processors 901, the types of the multiple processors 901 may be different or may be the same. Optionally, multiple processors 901 of the computer device 900 may also be integrated into a multi-core processor.
存储器902存储计算机指令和数据;存储器902可以存储实现本申请提供的通信方法所需的计算机指令和数据,例如,存储器902存储用于实现通信方法的步骤的指令。存储器902可以是以下存储介质的任一种或任一种组合:非易失性存储器(例如只读存储器(ROM)、固态硬盘(SSD)、硬盘(HDD)、光盘),易失性存储器。The memory 902 stores computer instructions and data; the memory 902 may store computer instructions and data required to implement the communication method provided in the present application. For example, the memory 902 stores instructions for implementing the steps of the communication method. The memory 902 may be any one or any combination of the following storage media: non-volatile memory (for example, read only memory (ROM), solid state drive (SSD), hard disk (HDD), optical disc), volatile memory.
通信接口903可以是以下器件的任一种或任一种组合:网络接口(例如以太网接口)、无线网卡等具有网络接入功能的器件。The communication interface 903 may be any one or any combination of the following devices: a network interface (for example, an Ethernet interface), a wireless network card, and other devices with a network access function.
通信接口903用于计算机设备900与其它计算机设备或者终端进行数据通信。The communication interface 903 is used for data communication between the computer device 900 and other computer devices or terminals.
总线904可以将处理器901与存储器902和通信接口903连接。这样,通过总线904,处理器901可以访问存储器902,还可以利用通信接口903与其它计算机设备或者终端进行数据交互。The bus 904 can connect the processor 901 with the memory 902 and the communication interface 903. In this way, through the bus 904, the processor 901 can access the memory 902, and can also use the communication interface 903 to interact with other computer devices or terminals.
在本申请中,计算机设备900执行存储器902中的计算机指令,使得计算机设备900实现本申请提供的通信方法,或者使得计算机设备900部署通信系统。In this application, the computer device 900 executes the computer instructions in the memory 902, so that the computer device 900 implements the communication method provided in this application, or causes the computer device 900 to deploy a communication system.
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器,上述指令可由服务器的处理器执行以完成本申请各个实施例所示的通信方法。例如,该非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, there is also provided a non-transitory computer-readable storage medium including instructions, such as a memory including instructions, which can be executed by a processor of a server to complete the communication methods shown in the various embodiments of the present application. . For example, the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
本申请实施例提供一种通信系统,包括:第一API网关和多个云平台,每个云平台包括一个API网关,所述第一API网关包括本申请实施例提供的任一所述的通信装置,例如通信装置70。可选地,该通信系统的结构可以参考前述图1、图2和图14中的结构。An embodiment of the present application provides a communication system, including: a first API gateway and multiple cloud platforms, each cloud platform includes an API gateway, and the first API gateway includes any one of the communications provided in the embodiments of the present application A device, such as a communication device 70. Optionally, the structure of the communication system may refer to the structures in FIG. 1, FIG. 2 and FIG. 14.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现,所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机的可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质,或者半导体介质(例如固态硬盘)等。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it may be implemented in the form of a computer program product in whole or in part, and the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data. The center transmits to another website, computer, server, or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrated with one or more available media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium, or a semiconductor medium (for example, a solid state hard disk).
在本申请中,术语“第一”、“第二”和“第三”仅用于描述目的,而不能 理解为指示或暗示相对重要性。术语“至少一个”表示1个或多个,术语“多个”指两个或两个以上,除非另有明确的限定。A参考B,指的是A与B相同或者A为B的简单变形。In this application, the terms "first", "second" and "third" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance. The term "at least one" means one or more, and the term "plurality" means two or more, unless specifically defined otherwise. A refers to B, which means that A is the same as B or A is a simple modification of B.
需要说明的是:上述实施例提供的通信装置或通信系统在执行该通信方法时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的通信装置、通信系统与通信方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that when the communication device or communication system provided in the above-mentioned embodiment executes the communication method, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be allocated to different functions according to needs. Module completion, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the communication device, the communication system, and the communication method embodiments provided in the foregoing embodiments belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.
以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above are only optional embodiments of this application and are not intended to limit this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included in the protection of this application. Within range.

Claims (31)

  1. 一种通信方法,其特征在于,所述方法包括:A communication method, characterized in that the method includes:
    第一应用程序接口API网关接收第一API请求;The first application program interface API gateway receives the first API request;
    第一API网关在多个云平台中确定用于响应所述第一API请求的目标云平台,所述第一API请求的格式为所述第一API网关支持的格式;The first API gateway determines a target cloud platform for responding to the first API request among multiple cloud platforms, and the format of the first API request is a format supported by the first API gateway;
    所述第一API网关向第二API网关发送第二API请求,所述第二API请求基于所述第一API请求确定,且所述第二API请求的格式为所述第二API网关支持的格式,所述第二API网关为所述目标云平台的API网关。The first API gateway sends a second API request to the second API gateway, the second API request is determined based on the first API request, and the format of the second API request is supported by the second API gateway Format, the second API gateway is the API gateway of the target cloud platform.
  2. 根据权利要求1所述的方法,其特征在于,所述第一API请求包括第一资源参数数据,所述第二API请求包括第二资源参数数据,所述第一资源参数数据的格式为所述第一API网关支持的资源参数格式,所述第一资源参数数据的格式为所述第二API网关支持的资源参数格式,所述第二资源参数数据是将所述第一资源参数数据进行资源参数格式转化得到的。The method according to claim 1, wherein the first API request includes first resource parameter data, the second API request includes second resource parameter data, and the format of the first resource parameter data is The resource parameter format supported by the first API gateway, the first resource parameter data format is the resource parameter format supported by the second API gateway, and the second resource parameter data is a combination of the first resource parameter data The resource parameter format is converted.
  3. 根据权利要求2所述的方法,其特征在于,所述方法还包括:The method according to claim 2, wherein the method further comprises:
    所述第一API网关将所述多个云平台中的同一种资源的同一调用操作所对应的资源参数格式进行整合,得到所述第一API网关支持的所述同一种资源的同一调用操作的资源参数格式。The first API gateway integrates resource parameter formats corresponding to the same call operation of the same resource in the multiple cloud platforms to obtain the same call operation of the same resource supported by the first API gateway Resource parameter format.
  4. 根据权利要求3所述的方法,其特征在于,所述第一API网关支持的同一种资源的同一调用操作的资源参数格式为所述多个云平台中的同一种资源的同一调用操作所对应的资源参数格式的并集。The method according to claim 3, wherein the resource parameter format of the same call operation of the same resource supported by the first API gateway corresponds to the same call operation of the same resource in the multiple cloud platforms The union of resource parameter formats.
  5. 根据权利要求1至4任一所述的方法,其特征在于,所述第二API请求由所述第一API网关基于第二接口调用规则发送,所述第二接口调用规则是所述第二API网关支持的接口调用规则,所述第二接口调用规则由所述第一API网关基于所述第一API网关支持的第一接口调用规则以及所述第一API请求确定;所述方法还包括:The method according to any one of claims 1 to 4, wherein the second API request is sent by the first API gateway based on a second interface calling rule, and the second interface calling rule is the second The interface call rule supported by the API gateway, the second interface call rule is determined by the first API gateway based on the first interface call rule supported by the first API gateway and the first API request; the method further includes :
    所述第一API网关接收所述第二API网关发送的第二API响应;Receiving, by the first API gateway, a second API response sent by the second API gateway;
    所述第一API网关基于所述第二API响应,按照所述第一接口调用规则向所述第一API请求的发送端回复第一API响应。Based on the second API response, the first API gateway replies a first API response to the sender of the first API request according to the first interface calling rule.
  6. 根据权利要求5所述的方法,其特征在于,所述方法还包括:The method according to claim 5, wherein the method further comprises:
    对于所述多个云平台中的同一种资源的同一调用操作,所述第一API网关基于所述调用操作所对应的接口调用规则,确定所述同一种资源的同一调用操作对应的第一接口调用规则。For the same calling operation of the same resource in the multiple cloud platforms, the first API gateway determines the first interface corresponding to the same calling operation of the same resource based on the interface calling rule corresponding to the calling operation Call rules.
  7. 根据权利要求6所述的方法,其特征在于,所述调用操作的接口调用规则用于指示所述调用操作对应的接口集以及接口集的调用时序;The method according to claim 6, wherein the interface invoking rule of the invoking operation is used to indicate the interface set corresponding to the invoking operation and the invoking timing of the interface set;
    当所述多个云平台中的同一种资源的同一调用操作对应的接口集以及接口集的调用时序均相同,所述同一种资源的同一调用操作对应的第一接口调用规则为按照所述调用时序调用所述接口集中的API接口;When the interface set corresponding to the same calling operation of the same resource in the multiple cloud platforms and the calling sequence of the interface set are the same, the first interface calling rule corresponding to the same calling operation of the same resource is according to the calling Call the API interface in the interface set in time sequence;
    当所述多个云平台中的同一种资源的同一调用操作对应的接口集相同,调用时序不同,所述同一种资源的同一调用操作对应的第一接口调用规则为采用一次API请求调用所述同一调用操作对应的接口集中的API接口;When the interface sets corresponding to the same calling operation of the same resource in the multiple cloud platforms are the same, and the calling sequence is different, the first interface calling rule corresponding to the same calling operation of the same resource is to use one API request to call the API interface in the interface set corresponding to the same call operation;
    当所述多个云平台中的同一种资源的同一调用操作对应的接口集不同,所述同一种资源的同一调用操作对应的第一接口调用规则为采用一次API请求调用所述同一调用操作对应的接口集中的API接口。When the interface sets corresponding to the same calling operation of the same resource in the multiple cloud platforms are different, the first interface calling rule corresponding to the same calling operation of the same resource is to use one API request to call the same calling operation corresponding Centralized API interface.
  8. 根据权利要求3、4、6或7所述的方法,其特征在于,所述同一种资源为资源定义的相似度大于相似度阈值的资源。The method according to claim 3, 4, 6 or 7, wherein the same resource is a resource whose similarity defined by the resource is greater than a similarity threshold.
  9. 根据权利要求1至8任一所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 8, wherein the method further comprises:
    所述第一API网关通过用户界面云平台的资源的服务信息,所述服务信息包括服务能力信息和服务价格中的至少一种。The service information of the resource of the first API gateway through the user interface cloud platform, the service information includes at least one of service capability information and service price.
  10. 根据权利要求9所述的方法,其特征在于,所述方法还包括:The method according to claim 9, wherein the method further comprises:
    在通过所述用户界面接收到服务信息检索请求后,所述第一API网关获取所述云平台的资源的服务信息;After receiving the service information retrieval request through the user interface, the first API gateway obtains the service information of the resource of the cloud platform;
    或者,在接收到所述第一API请求后,所述第一API网关获取所述云平台的资源的服务信息。Alternatively, after receiving the first API request, the first API gateway obtains the service information of the resource of the cloud platform.
  11. 根据权利要求1至10任一所述的方法,其特征在于,所述目标云平台是基于管理节点发送的选择指令确定的,所述选择指令用于指示所述目标云平台,所述选择指令是所述管理节点通过用户界面接收的;The method according to any one of claims 1 to 10, wherein the target cloud platform is determined based on a selection instruction sent by a management node, and the selection instruction is used to instruct the target cloud platform, and the selection instruction Is received by the management node through the user interface;
    或者,所述目标云平台是基于客户端发送的选择指令确定的,所述选择指令用于指示所述目标云平台;Alternatively, the target cloud platform is determined based on a selection instruction sent by the client, and the selection instruction is used to instruct the target cloud platform;
    或者,所述第一API请求包括所述目标云平台的标识。Alternatively, the first API request includes the identifier of the target cloud platform.
  12. 根据权利要求1至11任一所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 11, wherein the method further comprises:
    所述第一API网关将待迁移资源的资源参数数据的资源参数格式转化为目的云平台的API网关支持的资源参数格式;The first API gateway converts the resource parameter format of the resource parameter data of the resource to be migrated into the resource parameter format supported by the API gateway of the target cloud platform;
    所述第一API网关将转化后的所述资源参数数据发送至所述目的云平台的API网关。The first API gateway sends the transformed resource parameter data to the API gateway of the target cloud platform.
  13. 根据权利要求1至12任一所述的方法,其特征在于,所述第一API请求由客户端发送给所述第一API网关;The method according to any one of claims 1 to 12, wherein the first API request is sent by the client to the first API gateway;
    或者,所述第一API请求由管理节点在用户界面接收并发送给所述第一API网关。Alternatively, the first API request is received by the management node on the user interface and sent to the first API gateway.
  14. 根据权利要求1至13任一所述的方法,其特征在于,所述第一API请求指示的调用操作包括以下任一种:The method according to any one of claims 1 to 13, wherein the calling operation indicated by the first API request includes any one of the following:
    资源的建立操作、资源的删除操作、资源的修改操作以及资源的查询操作。Resource creation operations, resource deletion operations, resource modification operations, and resource query operations.
  15. 一种通信装置,其特征在于,所述装置应用于第一应用程序接口API网关,所述装置包括:A communication device, characterized in that the device is applied to a first application program interface API gateway, and the device includes:
    接收模块,用于接收第一API请求;The receiving module is used to receive the first API request;
    确定模块,用于在多个云平台中确定用于响应所述第一API请求的目标云平台,所述第一API请求的格式为所述第一API网关支持的格式;A determining module, configured to determine a target cloud platform used to respond to the first API request among multiple cloud platforms, and the format of the first API request is a format supported by the first API gateway;
    发送模块,用于向第二API网关发送第二API请求,所述第二API请求基于所述第一API请求确定,且所述第二API请求的格式为所述第二API网关支持的格式,所述第二API网关为所述目标云平台的API网关。The sending module is configured to send a second API request to the second API gateway, the second API request is determined based on the first API request, and the format of the second API request is a format supported by the second API gateway , The second API gateway is an API gateway of the target cloud platform.
  16. 根据权利要求15所述的装置,其特征在于,所述第一API请求包括第一资源参数数据,所述第二API请求包括第二资源参数数据,所述第一资源参数数据的格式为所述第一API网关支持的资源参数格式,所述第一资源参数数据的格式为所述第二API网关支持的资源参数格式,所述第二资源参数数据是将所述第一资源参数数据进行资源参数格式转化得到的。The device according to claim 15, wherein the first API request includes first resource parameter data, the second API request includes second resource parameter data, and the format of the first resource parameter data is The resource parameter format supported by the first API gateway, the first resource parameter data format is the resource parameter format supported by the second API gateway, and the second resource parameter data is a combination of the first resource parameter data The resource parameter format is converted.
  17. 根据权利要求16所述的装置,其特征在于,所述装置还包括:The device according to claim 16, wherein the device further comprises:
    整合模块,用于将所述多个云平台中的同一种资源的同一调用操作所对应的资源参数格式进行整合,得到所述第一API网关支持的所述同一种资源的同一调用操作的资源参数格式。The integration module is used to integrate the resource parameter format corresponding to the same call operation of the same resource in the multiple cloud platforms to obtain the resource of the same call operation of the same resource supported by the first API gateway Parameter format.
  18. 根据权利要求17所述的装置,其特征在于,所述第一API网关支持的同一种资源的同一调用操作的资源参数格式为所述多个云平台中的同一种资源的同一调用操作所对应的资源参数格式的并集。The device according to claim 17, wherein the resource parameter format of the same calling operation of the same resource supported by the first API gateway corresponds to the same calling operation of the same resource in the multiple cloud platforms The union of resource parameter formats.
  19. 根据权利要求15至18任一所述的装置,其特征在于,所述第二API请求由所述第一API网关基于第二接口调用规则发送,所述第二接口调用规则是所述第二API网关支持的接口调用规则,所述第二接口调用规则由所述第一API网关基于所述第一API网关支持的第一接口调用规则以及所述第一API请求确定;The apparatus according to any one of claims 15 to 18, wherein the second API request is sent by the first API gateway based on a second interface invocation rule, and the second interface invocation rule is the second An interface call rule supported by the API gateway, the second interface call rule is determined by the first API gateway based on the first interface call rule supported by the first API gateway and the first API request;
    所述接收模块,还用于接收所述第二API网关发送的第二API响应;The receiving module is further configured to receive a second API response sent by the second API gateway;
    所述发送模块,还用于基于所述第二API响应,按照所述第一接口调用规则向所述第一API请求的发送端回复第一API响应。The sending module is further configured to reply a first API response to the sender of the first API request according to the first interface calling rule based on the second API response.
  20. 根据权利要求19所述的装置,其特征在于,所述装置还包括:The device according to claim 19, wherein the device further comprises:
    规则确定模块,用于对于所述多个云平台中的同一种资源的同一调用操作,基于所述调用操作所对应的接口调用规则,确定所述同一种资源的同一调用操作 对应的第一接口调用规则。The rule determination module is configured to determine the first interface corresponding to the same calling operation of the same resource based on the interface calling rule corresponding to the calling operation for the same calling operation of the same resource in the multiple cloud platforms Call rules.
  21. 根据权利要求20所述的装置,其特征在于,所述调用操作的接口调用规则用于指示所述调用操作对应的接口集以及接口集的调用时序;The device according to claim 20, wherein the interface invoking rule of the invoking operation is used to indicate the interface set corresponding to the invoking operation and the invoking timing of the interface set;
    当所述多个云平台中的同一种资源的同一调用操作对应的接口集以及接口集的调用时序均相同,所述同一种资源的同一调用操作对应的第一接口调用规则为按照所述调用时序调用所述接口集中的API接口;When the interface set corresponding to the same calling operation of the same resource in the multiple cloud platforms and the calling sequence of the interface set are the same, the first interface calling rule corresponding to the same calling operation of the same resource is according to the calling Call the API interface in the interface set in time sequence;
    当所述多个云平台中的同一种资源的同一调用操作对应的接口集相同,调用时序不同,所述同一种资源的同一调用操作对应的第一接口调用规则为采用一次API请求调用所述同一调用操作对应的接口集中的API接口;When the interface sets corresponding to the same calling operation of the same resource in the multiple cloud platforms are the same, and the calling sequence is different, the first interface calling rule corresponding to the same calling operation of the same resource is to use one API request to call the API interface in the interface set corresponding to the same call operation;
    当所述多个云平台中的同一种资源的同一调用操作对应的接口集不同,所述同一种资源的同一调用操作对应的第一接口调用规则为采用一次API请求调用所述同一调用操作对应的接口集中的API接口。When the interface sets corresponding to the same calling operation of the same resource in the multiple cloud platforms are different, the first interface calling rule corresponding to the same calling operation of the same resource is to use one API request to call the same calling operation corresponding Centralized API interface.
  22. 根据权利要求17、18、20或21所述的装置,其特征在于,所述同一种资源为资源定义的相似度大于相似度阈值的资源。The device according to claim 17, 18, 20 or 21, wherein the same resource is a resource whose similarity defined by the resource is greater than a similarity threshold.
  23. 根据权利要求15至22任一所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 15 to 22, wherein the device further comprises:
    呈现模块,用于通过用户界面云平台的资源的服务信息,所述服务信息包括服务能力信息和服务价格中的至少一种。The presentation module is used for service information of the resources of the cloud platform through the user interface, the service information includes at least one of service capability information and service price.
  24. 根据权利要求23所述的装置,其特征在于,所述装置还包括:The device according to claim 23, wherein the device further comprises:
    获取模块,用于:Obtain modules for:
    在通过所述用户界面接收到服务信息检索请求后,获取所述云平台的资源的服务信息;After receiving the service information retrieval request through the user interface, acquiring the service information of the resources of the cloud platform;
    或者,在接收到所述第一API请求后,获取所述云平台的资源的服务信息。Or, after receiving the first API request, the service information of the resource of the cloud platform is acquired.
  25. 根据权利要求15至24任一所述的装置,其特征在于,所述目标云平台是基于管理节点发送的选择指令确定的,所述选择指令用于指示所述目标云平台,所述选择指令是所述管理节点通过用户界面接收的;The device according to any one of claims 15 to 24, wherein the target cloud platform is determined based on a selection instruction sent by a management node, the selection instruction is used to instruct the target cloud platform, the selection instruction Is received by the management node through the user interface;
    或者,所述目标云平台是基于客户端发送的选择指令确定的,所述选择指令用于指示所述目标云平台;Alternatively, the target cloud platform is determined based on a selection instruction sent by the client, and the selection instruction is used to instruct the target cloud platform;
    或者,所述第一API请求包括所述目标云平台的标识。Alternatively, the first API request includes the identifier of the target cloud platform.
  26. 根据权利要求15至25任一所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 15 to 25, wherein the device further comprises:
    转化模块,用于将待迁移资源的资源参数数据的资源参数格式转化为目的云平台的API网关支持的资源参数格式;The conversion module is used to convert the resource parameter format of the resource parameter data of the resource to be migrated into the resource parameter format supported by the API gateway of the target cloud platform;
    所述发送模块还用于将转化后的所述资源参数数据发送至所述目的云平台的API网关。The sending module is also used to send the transformed resource parameter data to the API gateway of the target cloud platform.
  27. 根据权利要求15至26任一所述的装置,其特征在于,所述第一API请求由客户端发送给所述第一API网关;The device according to any one of claims 15 to 26, wherein the first API request is sent by the client to the first API gateway;
    或者,所述第一API请求由管理节点在用户界面接收并发送给所述第一API网关。Alternatively, the first API request is received by the management node on the user interface and sent to the first API gateway.
  28. 根据权利要求15至27任一所述的装置,其特征在于,所述第一API请求指示的调用操作包括以下任一种:The device according to any one of claims 15 to 27, wherein the calling operation indicated by the first API request includes any one of the following:
    资源的建立操作、资源的删除操作、资源的修改操作以及资源的查询操作。Resource creation operations, resource deletion operations, resource modification operations, and resource query operations.
  29. 一种计算机设备,其特征在于,包括:A computer device, characterized in that it comprises:
    处理器和存储器;Processor and memory;
    所述存储器,用于存储计算机指令;The memory is used to store computer instructions;
    所述处理器,用于执行所述存储器存储的计算机指令,使得所述计算机设备执行权利要求1至14任一所述的通信方法。The processor is configured to execute computer instructions stored in the memory, so that the computer device executes the communication method according to any one of claims 1 to 14.
  30. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括计算机指令,所述计算机指令指示计算机设备执行权利要求1至14任一所述的通信方法。A computer-readable storage medium, wherein the computer-readable storage medium includes computer instructions that instruct a computer device to execute the communication method according to any one of claims 1 to 14.
  31. 一种通信系统,其特征在于,包括:第一API网关和多个云平台,每个云平台包括一个API网关,所述第一API网关包括权利要求15至28任一所述的通信装置。A communication system, characterized by comprising: a first API gateway and a plurality of cloud platforms, each cloud platform comprising an API gateway, and the first API gateway comprising the communication device according to any one of claims 15 to 28.
PCT/CN2021/075691 2020-05-18 2021-02-06 Communication method, apparatus and system WO2021232860A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202010421087 2020-05-18
CN202010421087.5 2020-05-18
CN202010470931.3 2020-05-28
CN202010470931.3A CN113691575A (en) 2020-05-18 2020-05-28 Communication method, device and system

Publications (1)

Publication Number Publication Date
WO2021232860A1 true WO2021232860A1 (en) 2021-11-25

Family

ID=78576227

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/075691 WO2021232860A1 (en) 2020-05-18 2021-02-06 Communication method, apparatus and system

Country Status (2)

Country Link
CN (1) CN113691575A (en)
WO (1) WO2021232860A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023103331A1 (en) * 2021-12-10 2023-06-15 西安广和通无线通信有限公司 Cloud platform connection method and apparatus, and device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108667865A (en) * 2017-03-29 2018-10-16 贵州白山云科技有限公司 A kind of API request processing method and processing device
CN108667866A (en) * 2017-03-29 2018-10-16 贵州白山云科技有限公司 A kind of request processing method and device based on API intelligent adaptations
US10289538B1 (en) * 2018-07-02 2019-05-14 Capital One Services, Llc Systems and methods for failure detection with orchestration layer
CN110557433A (en) * 2019-07-26 2019-12-10 华云超融合科技有限公司 Resource management method, platform, cloud gateway, system and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108667865A (en) * 2017-03-29 2018-10-16 贵州白山云科技有限公司 A kind of API request processing method and processing device
CN108667866A (en) * 2017-03-29 2018-10-16 贵州白山云科技有限公司 A kind of request processing method and device based on API intelligent adaptations
US10289538B1 (en) * 2018-07-02 2019-05-14 Capital One Services, Llc Systems and methods for failure detection with orchestration layer
CN110557433A (en) * 2019-07-26 2019-12-10 华云超融合科技有限公司 Resource management method, platform, cloud gateway, system and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023103331A1 (en) * 2021-12-10 2023-06-15 西安广和通无线通信有限公司 Cloud platform connection method and apparatus, and device and storage medium

Also Published As

Publication number Publication date
CN113691575A (en) 2021-11-23

Similar Documents

Publication Publication Date Title
KR102209276B1 (en) Messaging protocol communication management
EP3176697B1 (en) Type-to-type analysis for cloud computing technical components
US9729612B2 (en) Distributed stream processing
US20190068690A1 (en) Automated management of resource attributes across network-based services
JP2018088293A (en) Database system providing single tenant environment and a plurality of tenant environments
US20160261693A1 (en) Cloud-based data backup and operation method and system
US10891569B1 (en) Dynamic task discovery for workflow tasks
US20210097476A1 (en) Container Management Method, Apparatus, and Device
US8660996B2 (en) Monitoring files in cloud-based networks
US11924210B2 (en) Protected resource authorization using autogenerated aliases
US20180131678A1 (en) Managing Idempotent Operations while Interacting with a System of Record
WO2022111313A1 (en) Request processing method and micro-service system
US20230055511A1 (en) Optimizing clustered filesystem lock ordering in multi-gateway supported hybrid cloud environment
WO2021232860A1 (en) Communication method, apparatus and system
WO2021051569A1 (en) Data isolation method and apparatus, computer device and storage medium
US20230016241A1 (en) Highly flexible, scalable multi blockchain, hierarchical data sharing and data storing system and method thereof
US11757976B2 (en) Unified application management for heterogeneous application delivery
US20230114321A1 (en) Cloud Data Ingestion System
US11556608B2 (en) Caching for single page web applications
US10911371B1 (en) Policy-based allocation of provider network resources
US20210256600A1 (en) Connector leasing for long-running software operations
JP6205013B1 (en) Application usage system
US20170364293A1 (en) Method and apparatus for data processing
CN107818122A (en) A kind of Agent components, search management method and search management system
CN112181401A (en) Application construction method and application construction platform

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21808499

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21808499

Country of ref document: EP

Kind code of ref document: A1