Cloud service calling method and device, computer equipment and storage medium
By pre-configuring the cloud interface information and authentication information of the target gateway interface, the problem of high complexity in cloud service calls is solved, and a simplified cloud service call process and efficient call operations are achieved.
Patent Information
- Application Number
- CN202410366494.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-28
- Publication Date
- 2025-09-30
AI Technical Summary
In the existing technology, cloud service calls require developers to write code to interact with the cloud platform, which leads to high complexity for users to call, especially limiting users with low programming skills.
By pre-configuring the cloud interface information of the target gateway interface, receiving the calling gateway input parameters, filtering the target cloud interface and authentication information, and building the target cloud authentication information, the cloud service call is realized.
It simplifies the cloud service calling process, lowers the professional threshold, improves the calling efficiency, and enables cloud service calling to be completed by simply entering parameters through the target gateway interface.
Smart Images

Figure CN120729928A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to a cloud service calling method and apparatus, computer equipment, and storage medium. Background Art
[0002] In related technologies, users need to configure the cloud platform's API and then call the corresponding cloud service through the configured API. However, developers need to write code to interact with the cloud platform to implement API configuration, which not only limits the usability of users with limited programming skills but also increases the complexity of calling cloud services. Therefore, how to more easily complete cloud service calls has become a pressing technical problem. Summary of the Invention
[0003] The main purpose of the embodiments of the present application is to propose a cloud service calling method and apparatus, computer equipment and storage medium, aiming to simplify the cloud service calling process.
[0004] To achieve the above objectives, a first aspect of an embodiment of the present application provides a cloud service invocation method, the method comprising:
[0005] Receive an interface configuration request; wherein the interface configuration request includes: newly added cloud interface information of the target gateway interface;
[0006] Perform cloud interface configuration on the target gateway interface using the newly added cloud interface information to obtain candidate cloud interface information;
[0007] Receive a gateway calling input parameter of the target gateway interface;
[0008] Filter target cloud interface information from the candidate cloud interface information according to the calling gateway input parameter;
[0009] Constructing target cloud authentication information according to the target cloud interface information and preset candidate cloud authentication information;
[0010] The cloud service call is performed according to the target cloud interface information, the target cloud authentication information and the preset candidate cloud platform interface.
[0011] In some embodiments, constructing the target cloud authentication information according to the target cloud interface information and preset candidate cloud authentication information includes:
[0012] Extracting cloud platform account information from the target cloud interface information;
[0013] The target cloud authentication information is filtered out from the candidate cloud authentication information according to the cloud platform account information and the candidate cloud authentication information; or the target cloud authentication information is generated according to the cloud platform account information and the candidate cloud authentication information.
[0014] In some embodiments, filtering the target cloud authentication information from the candidate cloud authentication information based on the cloud platform account information and the candidate cloud authentication information; or generating the target cloud authentication information based on the cloud platform account information and the candidate cloud authentication information, includes:
[0015] Matching the candidate cloud authentication information with the cloud platform account information to obtain an information matching result;
[0016] If the information matching result indicates that the selected cloud authentication information of the candidate cloud authentication information matches the cloud platform account information, the selected cloud authentication information is used as the target cloud authentication information;
[0017] If the information matching result indicates that the selected cloud authentication information of the candidate cloud authentication information does not match the cloud platform account information, the target cloud authentication information is generated according to a preset cloud authentication information interface and the cloud platform account information.
[0018] In some embodiments, after using the selected cloud authentication information as the target cloud authentication information if the information matching result indicates that the selected cloud authentication information of the candidate cloud authentication information matches the cloud platform account information, the method further includes:
[0019] Obtain the remaining validity period of the selected cloud authentication information;
[0020] If the remaining valid time is less than the preset time, the selected cloud authentication information is updated according to the cloud authentication information interface and the cloud platform account information.
[0021] In some embodiments, calling a cloud service based on the target cloud interface information, the target cloud authentication information, and a preset candidate cloud platform interface includes:
[0022] Perform configuration processing on the candidate cloud platform interface according to the target cloud interface information to obtain the target cloud platform interface;
[0023] Cloud service calls are made through the target cloud platform interface and the target cloud authentication information.
[0024] In some embodiments, the candidate cloud platform interface is provided with candidate request parameters and a candidate domain name; and configuring the candidate cloud platform interface according to the target cloud interface information to obtain the target cloud platform interface includes:
[0025] Parsing the target cloud interface information to obtain cloud request parameters and cloud domain name;
[0026] Replace the candidate request parameters according to the cloud request parameters to obtain target request parameters;
[0027] Replace the candidate domain name according to the cloud domain name to obtain the target domain name;
[0028] The candidate cloud platform interface is configured and processed according to the target request parameters and the target domain name to obtain the target cloud platform interface.
[0029] In some embodiments, receiving an interface configuration request includes:
[0030] Obtain new gateway service information and new cloud service information;
[0031] Perform gateway configuration processing according to the newly added gateway service information to obtain newly added gateway input parameters;
[0032] Configuring the preset candidate gateway interface according to the newly added gateway input parameters to obtain the target gateway interface;
[0033] The target gateway interface is configured and processed according to the newly added cloud service information to obtain the newly added cloud interface information.
[0034] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a cloud service invoking device, the device comprising:
[0035] A request receiving module, configured to receive an interface configuration request; wherein the interface configuration request includes: newly added cloud interface information of the target gateway interface;
[0036] An interface screening module is used to configure the target gateway interface with the newly added cloud interface information to obtain candidate cloud interface information;
[0037] A parameter receiving module, configured to receive input parameters of a calling gateway of the target gateway interface;
[0038] An information screening module, configured to screen target cloud interface information from the candidate cloud interface information according to the calling gateway input parameter;
[0039] An authentication building module, configured to build target cloud authentication information based on the target cloud interface information and preset candidate cloud authentication information;
[0040] The cloud service calling module is used to call the cloud service according to the target cloud interface information, the target cloud authentication information and the preset candidate cloud platform interface.
[0041] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the method described in the first aspect when executing the computer program.
[0042] To achieve the above-mentioned purpose, the fourth aspect of the embodiments of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the method described in the first aspect.
[0043] The cloud service calling method and apparatus, computer equipment and storage medium proposed in this application pre-configure the cloud interface information of the target gateway interface. When the target gateway interface inputs the calling gateway input parameters, the corresponding cloud interface information can be determined, so that the target cloud authentication information is determined by the cloud interface information and the candidate cloud authentication information, and the cloud service call is completed by the target cloud authentication information and the cloud interface information. The cloud service call can be completed by only inputting parameters in the target gateway interface, making the cloud service call operation simpler and improving the efficiency of cloud service call. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 This is a flow chart of the cloud service calling method provided by an embodiment of the present application;
[0045] Figure 2 yes Figure 1 Flowchart of step S101 in FIG.
[0046] Figure 3 yes Figure 1 Flowchart of step S105 in FIG.
[0047] Figure 4 yes Figure 3 Flowchart of step S303 in FIG.
[0048] Figure 5 This is a flowchart of a cloud service calling method provided by another embodiment of the present application;
[0049] Figure 6 This is a flow chart of cloud authentication information construction and calling in the cloud service calling method provided in an embodiment of the present application;
[0050] Figure 7 yes Figure 1 Flowchart of step S106 in FIG.
[0051] Figure 8 yes Figure 7 Flowchart of step S701 in FIG.
[0052] Figure 9This is a flowchart of a cloud service calling method provided by an embodiment of the present application;
[0053] Figure 10 This is a schematic diagram of the structure of the cloud service calling device provided in an embodiment of the present application;
[0054] Figure 11 This is a schematic diagram of the hardware structure of the computer device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0056] It should be noted that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and so on, in the specification, claims, and drawings, are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.
[0057] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.
[0058] First, let’s analyze some of the terms used in this application:
[0059] An Application Program Interface (API) is an interface provided by the operating system to application programs. Applications call the operating system's API to enable the operating system to execute their commands. A basic introduction to an API is a set of definitions, procedures, and protocols.
[0060] Cloud services are a service model that provides computing resources, storage space, and applications to users via the internet. Cloud services allow users to access and use computing resources provided by remote servers over the internet without having to purchase, configure, and maintain their own hardware. Cloud services can include computing power, storage capacity, database management, application development platforms, and other services.
[0061] Request protocol: This refers to the rules or protocols used to transmit request messages between the client and the server. Common request protocols include the following: HTTP, FTP, SMTP, and DNS.
[0062] Request Method: Used to specify the type of operation on server resources. Common HTTP request methods include the following: GET, POST, PUT, DELETE, etc.
[0063] The request path refers to the location of the resource requested by the client on the server. Typically, the request path consists of two parts: Path: This refers to the path to the resource on the server, which can be relative or absolute. Query parameters: These are used to pass additional parameter information to the server, typically in the form of key-value pairs, with multiple parameters separated by the & symbol.
[0064] Traditional calls to cloud services require developers to write code to directly call the cloud service platform's interface. This calling process is not only complicated, but also requires detailed configuration and management of the cloud service interface, which not only increases the complexity of the interface call, but also increases the developer's workload.
[0065] Based on this, the embodiments of the present application provide a cloud service calling method and apparatus, computer equipment, and storage medium, which are designed to pre-configure the cloud interface of the gateway interface to obtain candidate cloud interface information. When the cloud service interface needs to be called, it is only necessary to determine the input parameters of the calling gateway to determine the corresponding cloud service interface information to call the corresponding cloud service. Therefore, for developers, it is only necessary to configure the corresponding cloud interface for the gateway interface in advance. When calling the cloud service, it is only necessary to determine the input parameters of the gateway interface to complete the cloud service call, making the cloud service call operation simple, lowering the professional threshold for cloud service calls, and improving the efficiency of cloud service calls.
[0066] The cloud service calling method and apparatus, computer equipment, and storage medium provided in the embodiments of the present application are specifically illustrated through the following embodiments. First, the cloud service calling method in the embodiments of the present application is described.
[0067] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results.
[0068] Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0069] The cloud service calling method provided in the embodiment of the present application relates to the field of cloud computing technology. The cloud service calling method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or as a server cluster or distributed system composed of multiple physical servers, or as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the cloud service calling method, etc., but is not limited to the above forms.
[0070] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer computer devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0071] It should be noted that in each specific embodiment of the present application, when it comes to the need to perform relevant processing based on data related to the user's identity or characteristics, such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of such data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0072] Figure 1 This is an optional flowchart of the cloud service calling method provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S106.
[0073] Step S101: receiving an interface configuration request; wherein the interface configuration request includes: newly added cloud interface information of the target gateway interface;
[0074] Step S102: Perform cloud interface configuration on the target gateway interface according to the newly added cloud interface information to obtain candidate cloud interface information;
[0075] Step S103, receiving the calling gateway input parameters of the target gateway interface;
[0076] Step S104, filtering target cloud interface information from candidate cloud interface information according to the gateway calling input parameters;
[0077] Step S105: constructing target cloud authentication information based on the target cloud interface information and preset candidate cloud authentication information;
[0078] Step S106: Calling a cloud service based on the target cloud interface information, the target cloud authentication information, and the preset candidate cloud platform interface.
[0079] In the steps S101 to S106 shown in the embodiment of the present application, the target gateway interface is configured with a cloud interface in advance according to the newly added cloud interface information, and the information of the configured cloud interface is determined to be the candidate cloud interface information. When a cloud service needs to be called, it is only necessary to adjust the gateway input parameters of the target gateway interface to obtain the calling gateway input parameters, so as to filter out the target cloud interface information from the candidate cloud interface information according to the calling gateway input parameters, and determine the target cloud authentication information of the cloud service. The call of the cloud service is completed by calling the cloud and the candidate cloud platform interface through the target cloud authentication information and the target cloud interface information, so that the cloud service call only needs to be completed by inputting parameters in the target gateway interface, making the cloud service call easier.
[0080] Optionally, the target gateway interface's gateway input parameters can be generated synchronously when the target gateway interface is configured for cloud interface according to the newly added cloud interface information and candidate cloud interface information is obtained. Therefore, the target gateway interface's gateway input parameters can be received only after the candidate cloud interface information is obtained.
[0081] It should be noted that the input parameters in the target gateway interface can be manually entered to complete the cloud service call, or the execution subject (terminal or server) can automatically enter the parameters to achieve fully automated cloud service call.
[0082] See also Figure 2 In some embodiments, before step S101, the cloud service calling method may further include but is not limited to steps S201 to S204:
[0083] Step S201, obtaining newly added gateway service information and newly added cloud service information;
[0084] Step S202: performing gateway configuration processing according to the newly added gateway service information to obtain the newly added gateway input parameters;
[0085] Step S203, configuring the preset candidate gateway interface according to the newly added gateway input parameters to obtain the target gateway interface;
[0086] Step S204: configure the target gateway interface according to the newly added cloud service information to obtain the newly added cloud interface information.
[0087] In step S201 of some embodiments, when the target gateway interface needs to be configured, new gateway service information and new cloud service information are received from the user. It should be noted that the new gateway service information is service information that requires a new gateway interface, and the new gateway interface is used to manage internal definitions of the system and directly call the gateway interface using internal system functions. The new cloud service information represents the service information of the cloud interface provided by the target cloud platform, and the cloud interface is the interface published by the target cloud platform. It should be further explained that the new gateway service information is obtained by filtering the preset candidate gateway service information based on the new gateway service identification information, and the new gateway service identification information is the new gateway service KEY1, which is a unique keyword for each candidate gateway service information. Similarly, the new cloud service information is obtained by filtering the preset candidate cloud service information based on the new cloud service identification information, and the new cloud service identification information is the new cloud service KEY2, which is a unique keyword for the candidate cloud service information. Therefore, when it is necessary to configure a cloud interface for the gateway interface, only the new service KEY needs to be entered to find the corresponding service information, making the cloud interface configuration operation of the gateway interface more simplified.
[0088] In step S202 of some embodiments, the configuration process characterizes which parameters are required for the gateway interface configuration. The newly added gateway service information can be used to determine which parameters are required for the gateway service interface configuration, thereby determining the newly added gateway input parameters. It should be noted that the basic interface configuration is the configuration of various attributes in the HTTP protocol, including: request protocol, request method, request path, path parameters, API parameter configuration, etc., to determine the newly added gateway input parameters.
[0089] In step S203 of some embodiments, the candidate gateway interface is configured according to the newly added gateway input parameters to construct a target gateway interface. It should be noted that the target gateway interface is an interface with pre-defined gateway configuration parameters, so different functions can be achieved by only switching the pre-configured gateway configuration parameters of the gateway interface.
[0090] In step S204 of some embodiments, in order to switch the input parameters of the target gateway interface to implement different functions and switch to different cloud services, it is necessary to configure the newly added cloud service information to the target gateway interface and determine which cloud interface information configuration is required for the target gateway interface. It should be noted that after the newly added cloud interface information is constructed, an interface configuration request is generated based on the newly added cloud reception information, and the following cloud service call method is executed based on the interface configuration request.
[0091] In steps S201 to S204 shown in this embodiment, by receiving the newly added gateway service information and the newly added cloud service information from the user end, the input parameters that can be configured by the target gateway interface are first configured based on the newly added gateway service information to obtain the newly added gateway input parameters, and then the candidate gateway interface is configured as the target gateway interface based on the newly added gateway input parameters, thereby completing the flexible configuration of the target gateway interface. Finally, the target gateway interface is configured based on the newly added cloud service information to determine which cloud interface information needs to be newly added to the target gateway interface. Therefore, the user end only needs to input the newly added gateway service information and the newly added cloud service information to automatically determine the cloud interface information that needs to be newly added to the target gateway interface, so that the operation of the target gateway interface determining the newly added cloud interface information is automated, and there is no need for professionals to fill in the cloud interface information, making the cloud interface information setting of the gateway easier.
[0092] In step S102 of some embodiments, after determining the new cloud interface information that needs to be configured for the target gateway interface, it is necessary to perform cloud interface configuration on the target gateway interface to establish a mapping relationship between the input parameters of the target gateway interface and the new cloud interface information, and define the mapped new cloud interface information as candidate cloud interface information.
[0093] In some embodiments, when the target gateway interface is configured with newly added cloud interface information, in order to further determine whether the cloud interface information configured by the target gateway interface is correct, an interface mapping relationship table is established with the newly added cloud interface information and the newly added gateway input parameters of the target gateway interface, and the interface mapping relationship table is sent to the audit end for manual review and feedback of the audit result through the audit end. If the audit result indicates that the interface mapping relationship table has passed the review, and the passed review indicates that the manual inspection interface mapping relationship table meets the pre-set mapping requirements, then the newly added cloud interface information can be used when the cloud service is called, and the newly added cloud interface information that has passed the review is defined as candidate cloud interface information. It is further explained that only the newly added interface information that has passed the review is put online as candidate cloud interface information, so that when calling the cloud service, the interface information corresponding to the cloud service can be filtered out from the candidate cloud interface information to achieve accurate calling of the cloud service. It should be noted that when calling the cloud service through the candidate cloud interface information, it is necessary to configure the cloud region, the available area of the cloud service, the domain name, etc. according to the candidate cloud interface information to achieve accurate calling of the cloud service. It is further explained that in the process of putting the candidate cloud interface information online, the cloud interface information on the target cloud platform will be obtained according to the preset time period to obtain real-time cloud interface information, and the candidate cloud interface information will be updated according to the real-time cloud interface information to ensure that the online candidate cloud interface information can call the cloud service of the target cloud platform, thereby reducing the failure of cloud service calls.
[0094] In step S103 of some embodiments, when the user needs to call a cloud service, the parameters required by the target gateway interface are pre-assembled to obtain the gateway input parameters. It should be noted that the cloud service call method is applied to the asynchronous communication plug-in server, and the configuration of the target gateway interface is also implemented by the asynchronous communication plug-in server. The asynchronous communication plug-in server also stores an interface mapping table between the input parameters of each gateway interface and the cloud interface information. Therefore, the asynchronous communication plug-in server can quickly call cloud services.
[0095] Specifically, in order to facilitate subsequent inspections of cloud service calls, after receiving the call gateway input parameters, a call record will be generated based on the call gateway input parameters and the corresponding cloud service call process, and the call will be recorded in the log data. A log identifier will be set for the log data, and all log data of this cloud service call will be connected in series through a unique log identifier for subsequent review.
[0096] In step S104 of some embodiments, the asynchronous communication plug-in server stores an interface mapping relationship table between the input parameters of each gateway interface and the cloud interface information, so the candidate cloud interface information is screened according to the input calling gateway input parameters, that is, the candidate cloud interface information corresponding to the calling gateway input parameters in the interface mapping relationship table is used as the target cloud interface information.
[0097] It should be noted that when determining the target cloud interface information, the legitimacy of the target gateway interface is checked first, and the legitimacy check includes checking whether the target gateway interface exists, or whether the gateway status is online. If the target gateway interface does not exist, or the gateway status of the target gateway interface is offline, it means that the cloud service call cannot be completed through the target gateway interface, and an error message is output to the user end.
[0098] See also Figure 3 In some embodiments, step S105 may include but is not limited to steps S301 to S303:
[0099] Step S301: extracting cloud platform account information from the target cloud interface information;
[0100] Step S302: Match the candidate cloud authentication information with the cloud platform account information to obtain an information matching result;
[0101] Step S303: construct target cloud authentication information based on the information matching result, candidate cloud authentication information and cloud platform account information.
[0102] In step S301 of some embodiments, the cloud platform account information represents the account information of the user terminal on the target cloud platform, and the target cloud platform will configure the corresponding cloud authentication information for the user terminal corresponding to each cloud platform account information, so that the user terminal can use the cloud services on the target cloud platform. It should be noted that the asynchronous communication plug-in server will poll the cloud platform account information on the target cloud platform according to a preset period, and cache the candidate cloud authentication information corresponding to the cloud platform account information. In this embodiment, the preset period is 1 minute, that is, the cloud platform account information is polled every 1 minute, and it is determined whether to cache the candidate cloud authentication information corresponding to the cloud platform account information, so that the target cloud authentication information can be quickly determined from the cached candidate cloud authentication information when constructing.
[0103] In some embodiments, step S302 matches the cloud platform account information with the candidate cloud authentication information. Specifically, a determination is made as to whether the asynchronous communication plug-in server stores the candidate cloud authentication information corresponding to the cloud platform account information, thereby obtaining an information matching result. It should be noted that the information matching result also refers to whether the asynchronous communication plug-in server caches the token corresponding to the cloud platform account information.
[0104] In step S303 of some embodiments, if the asynchronous communication plug-in server pre-stores candidate cloud authentication information corresponding to the cloud platform account information, the target cloud authentication information is directly filtered out from the candidate cloud authentication information. If the asynchronous communication plug-in server does not cache the candidate cloud authentication information corresponding to the cloud platform account information, it is necessary to regenerate the cloud authentication information corresponding to the cloud platform account information to ensure that the cloud service of the target cloud platform can be accurately called. Therefore, according to the information matching result, it is indicated whether the candidate cloud authentication information corresponding to the cloud platform account information is stored, and then the target cloud authentication information is constructed based on the information matching result, the candidate cloud authentication information and the cloud platform account information, so that the construction of the target cloud authentication information is more accurate.
[0105] It should be noted that the cloud authentication information is a TOKEN, and a TOKEN is an identity credential that can be used to verify and authorize access to the target cloud platform.
[0106] In steps S301 to S303 shown in this embodiment, the cloud platform account information of the target gateway interface in the target cloud platform is first determined, and based on whether the asynchronous communication plug-in server stores candidate cloud platform information corresponding to the cloud platform account information, it is determined whether to directly determine the target cloud authentication information from the candidate cloud platform information or to regenerate the target cloud authentication information, so as to ensure that the target cloud authentication information is constructed and the effective calling of the cloud service is realized.
[0107] See also Figure 4 In some embodiments, step S303 may include but is not limited to steps S401 to S402:
[0108] Step S401: If the information matching result indicates that the selected cloud authentication information of the candidate cloud authentication information matches the cloud platform account information, the selected cloud authentication information is used as the target cloud authentication information;
[0109] Step S402 : If the information matching result indicates that the selected cloud authentication information of the candidate cloud authentication information does not match the cloud platform account information, target cloud authentication information is generated according to a preset cloud authentication information interface and the cloud platform account information.
[0110] In step S401 of some embodiments, cloud authentication information is selected as candidate cloud authentication information corresponding to the cloud platform account information. If the information matching result indicates that the selected cloud authentication information exists and matches the cloud platform account information, then the selected cloud authentication information is used as the target cloud authentication information. It should be noted that the target cloud authentication information is a pass token for invoking cloud services on the target cloud platform. Therefore, once the target cloud authentication information is determined, the corresponding cloud service on the target cloud platform can be invoked through the cloud interface.
[0111] In step S402 of some embodiments, if the information matching result indicates that the cloud platform account information does not match the selected cloud authentication information, that is, the asynchronous communication plug-in server does not cache the TOKEN corresponding to the cloud platform account information, it is necessary to generate a new cloud authentication information as the target cloud authentication information through the cloud authentication information interface and the cloud platform account information.
[0112] In steps S401 to S402 shown in this embodiment, it is determined whether there is candidate cloud authentication information that matches the cloud platform account information. If so, the candidate cloud authentication information corresponding to the cloud platform account is directly used as the target cloud authentication information; if not, it is necessary to call the cloud authentication information interface and the cloud platform account information to generate the target cloud authentication information to ensure that the target cloud authentication information can be accurately constructed so that it can be effectively called by the cloud service.
[0113] It should be noted that although the asynchronous communication plug-in server pre-stores the selected cloud authentication information that matches the cloud platform account information, the selected cloud authentication information has a validity period. If the validity period expires, the selected cloud authentication information cannot be used as the communication credential of the target cloud platform.
[0114] See also Figure 5 In some embodiments, after step S402, the cloud service calling method may further include but is not limited to steps S501 to S502:
[0115] Step S501, obtaining the remaining validity period of the selected cloud authentication information;
[0116] Step S502: If the remaining valid time is less than the preset time, the selected cloud authentication information is updated according to the cloud authentication information interface and the cloud platform account information.
[0117] In step S501 of some embodiments, the remaining valid duration is the remaining duration during which the selected cloud authentication information can be used, so as to determine whether it is necessary to obtain new cloud authentication information to replace the selected cloud authentication information based on the remaining valid duration.
[0118] In some embodiments, in step S502, the preset duration is a preset minimum remaining duration. If the remaining valid duration is less than the preset duration, it indicates that the selected cloud authentication information is about to expire, and it is necessary to generate updated cloud authentication information through the cloud authentication information interface and cloud platform account information to update the selected cloud authentication information. It should be noted that if the remaining valid duration is greater than the preset duration, there is no need to update the selected cloud authentication information.
[0119] For example, if the total validity period of each selected cloud authentication information is 1 hour, the remaining validity period for obtaining the selected cloud authentication information is 9 minutes, and the preset time is 10 minutes, it means that the selected cloud authentication information is about to expire, and a new TOKEN needs to be regenerated through the cloud authentication information interface and cloud platform account information and stored in the asynchronous communication plug-in server, so that the cloud service can be called effectively and the situation of rapid interruption of cloud service calls can be reduced.
[0120] Please refer to Figure 6 Cloud interface calls need to carry the target cloud authentication information. To adapt to concurrent call scenarios and improve the efficiency of cloud service calls, candidate cloud authentication information needs to be generated in advance. When a cloud service is called, the candidate cloud authentication information can be directly read from the asynchronous communication plug-in server to improve the efficiency of cloud service calls.
[0121] The asynchronous communication plug-in server polls the cloud platform account information every minute and determines whether there is a corresponding candidate cloud authentication information cached. If not, it directly calls the cloud authentication information interface and the cloud platform account information to generate a new candidate cloud authentication information and stores it in the asynchronous communication plug-in server's cache space. It should be noted that because each candidate cloud authentication information is valid for 1 hour, if the remaining validity period of the candidate cloud authentication information is less than 10 minutes, it is necessary to forcibly generate a new candidate cloud authentication information through the cloud authentication information interface and the cloud platform account information.
[0122] When calling a cloud service, the selected cloud authentication information corresponding to the cloud platform account information is first read from the asynchronous communication plug-in server's cache. If the selected cloud authentication information does not exist in the cache, a new one is generated using the cloud authentication information interface and the cloud platform account information. If the selected cloud authentication information exists in the cache, it is directly read as the target cloud authentication information.
[0123] See also Figure 7 In some embodiments, step S106 includes but is not limited to steps S701 to S702:
[0124] Step S701: Configure the candidate cloud platform interface according to the target cloud interface information to obtain the target cloud platform interface;
[0125] Step S702: Call the cloud service through the target cloud platform interface and the target cloud authentication information.
[0126] In some embodiments, in step S701, the cloud service call of the target cloud platform is to call the cloud platform interface. Therefore, it is necessary to first configure the target cloud platform interface, and then use the target cloud interface information to configure the candidate cloud platform interface to build an interface that can call the cloud service on the target cloud platform.
[0127] In step S702 of some embodiments, the cloud service call is to call the cloud service on the target cloud platform, so the corresponding cloud service on the target cloud platform is called according to the target cloud platform interface and the target cloud authentication information to achieve accurate calling of the cloud service.
[0128] In steps S701 to S702 shown in this embodiment, by configuring the cloud platform interface to the target cloud platform interface, the cloud service is called through the target cloud platform interface and the target cloud authentication information, making the cloud service call more accurate.
[0129] In some embodiments, the candidate cloud platform interface is provided with candidate request parameters and candidate domain names, the candidate request parameters represent the request parameters pre-set by the candidate cloud platform interface, and the candidate request parameters include: candidate request method, candidate request path and candidate request input parameters, the candidate request method represents the HTTP method used by the user end to send a request to the target cloud platform in advance, the candidate request path is the resource path specified by the user end to send a request to the target cloud platform in advance, the candidate request input parameters represent the data passed when the user end sends a request to the target cloud platform in advance, and the candidate request input parameters can be query parameters, path parameters, request body parameters, etc., and the candidate domain name represents the identifier of the service on the predetermined target cloud platform.
[0130] See also Figure 8 In some embodiments, step S701 may include but is not limited to steps S801 to S804:
[0131] Step S801: parse the target cloud interface information to obtain cloud request parameters and cloud domain name;
[0132] Step S802: Replace the candidate request parameters according to the cloud request parameters to obtain the target request parameters;
[0133] Step S803: Replace the candidate domain name with the cloud domain name to obtain the target domain name;
[0134] Step S804 : configuring the candidate cloud platform interface according to the target request parameters and the target domain name to obtain the target cloud platform interface.
[0135] In step S801 of some embodiments, the cloud request parameters represent the parameters that the user terminal needs to configure when sending a request to the target cloud platform. The cloud domain name is the identifier of the cloud service that the user terminal needs to call. The cloud request parameters include: a cloud request method, a cloud request path, and cloud request input parameters. The cloud request method is the HTTP method used by the user terminal to call the cloud service. The cloud request path is the path specified by the user terminal to call the cloud service. The cloud request input parameters are the data passed by the user terminal to the cloud service.
[0136] In step S802 of some embodiments, the candidate request parameters are replaced according to the cloud request parameters, that is, the cloud request parameters are used as the request parameters of the candidate cloud platform interface to obtain the target request parameters. Specifically, the cloud request parameters include: cloud request method, cloud request path and cloud request input parameters, so the cloud request method replaces the candidate request method to obtain the target request method, the cloud request path replaces the candidate request path to obtain the target request path, and the cloud request input parameters replace the candidate input parameters to obtain the target request input parameters. It should be noted that the cloud request method represents the HTTP method used by the user terminal to the target cloud platform, the cloud request path represents the resource path that the user terminal needs to specify to send to the target cloud platform, and the cloud request input parameters are the gateway parameters input by the user terminal to the target cloud platform.
[0137] In step S803 of some embodiments, the cloud domain name replaces the candidate domain name. Specifically, the corresponding cloud domain name is obtained from the interface mapping relationship table according to the cloud service identifier, and the candidate domain name of the candidate cloud platform interface is replaced with the cloud domain name to obtain the target domain name.
[0138] In step S804 of some embodiments, the candidate cloud platform interface is configured, that is, the configuration information of the candidate cloud platform interface is set according to the target request method, target request path, target request input parameters, and target domain name to obtain the target cloud platform interface. Therefore, cloud services on the target cloud platform can be called through the target cloud platform interface, making cloud service calling operations simple.
[0139] It should be noted that when calling a cloud service, the data processing request is forwarded to the proxy server through the target cloud platform interface, and then forwarded by the proxy server to the target cloud platform to use the cloud service on the target cloud platform to process the data. When the target cloud platform completes data processing, it will feedback the cloud output parameter to the asynchronous communication plug-in server. If the cloud service call is successful, the asynchronous communication plug-in server will map the cloud output parameter to the interface relationship mapping table to determine the mapping relationship between each interface input parameter, cloud interface information and cloud output parameter, so as to determine the configuration information of the target cloud platform, so as to perform subsequent logical processing based on the configuration information fed back by the target cloud platform and complete the call of the entire cloud service.
[0140] In steps S801 to S804 shown in this embodiment, the candidate request parameters pre-set for the candidate cloud platform interface are replaced by cloud request parameters, and then the candidate domain name pre-set for the candidate cloud platform interface is replaced according to the cloud domain name to construct the target cloud platform interface, so that the target cloud platform interface construction operation is simple, and the efficient call of the cloud service can be completed through the target cloud platform interface and the target cloud authentication information.
[0141] Please refer to Figure 9In the embodiment of the present application, when interface configuration is required, a new gateway service KEY1 and a new cloud service KEY2 are received, and the new gateway service information is filtered out from the preset candidate gateway service information according to the new gateway service KEY1, and the new cloud service information is filtered out from the candidate cloud service information according to the new cloud service KEY2. According to the new gateway service information, it can be determined which parameters the gateway service interface needs to be configured to determine the new gateway input parameters, and the candidate gateway interface is configured according to the new gateway input parameters to build the target gateway interface. The new cloud service information is configured to the target gateway interface, and it is determined which cloud interface information configurations the target gateway interface needs to make, and the new cloud interface information is obtained. An interface mapping relationship table is established for the new cloud interface information and the new gateway input parameters of the target gateway interface, and the interface mapping relationship table is sent to the audit end, and the audit result is fed back through the audit end after manual review. If the audit result indicates that the interface mapping relationship table meets the requirements, then the new cloud interface information can be used when the cloud service is called, and the new cloud interface information that has passed the review is defined as candidate cloud interface information.
[0142] When it is necessary to call a cloud service, the parameters required by the target gateway interface are assembled in advance to obtain the calling gateway input parameters. According to the input calling gateway input parameters, the candidate cloud interface information is filtered to obtain the target cloud interface information, and the target cloud interface information is parsed to obtain the cloud request method, cloud request path, cloud request input parameters and cloud domain name. According to the cloud request method, cloud request path, cloud request input parameters and cloud domain name, the candidate cloud platform interface is configured to obtain the target cloud platform interface, and the target authentication information corresponding to the target cloud interface information is retrieved from the cache space. The cloud service is called according to the target cloud platform interface and the target authentication information, making the cloud service call operation simple. At the same time, because the target authentication information is pre-stored in the cache space, when a high-concurrency cloud service call occurs, the cloud service call can be completed quickly, improving the concurrent processing capability.
[0143] See also Figure 10 The present application also provides a cloud service invocation device that can implement the above-mentioned cloud service invocation method. The device includes:
[0144] The request receiving module 1001 is configured to receive an interface configuration request, wherein the interface configuration request includes: newly added cloud interface information of the target gateway interface;
[0145] The interface screening module 1002 is used to configure the target gateway interface with a cloud interface according to the newly added cloud interface information to obtain candidate cloud interface information;
[0146] Parameter receiving module 1003, used to receive the calling gateway input parameters of the target gateway interface;
[0147] An information screening module 1004 is configured to screen target cloud interface information from candidate cloud interface information based on gateway invocation input parameters;
[0148] The authentication construction module 1005 is used to construct the target cloud authentication information according to the target cloud interface information and the preset candidate cloud authentication information;
[0149] The cloud service calling module 1006 is used to call the cloud service according to the target cloud interface information, the target cloud authentication information and the preset candidate cloud platform interface.
[0150] The specific implementation of the cloud service calling device is basically the same as the specific embodiment of the above-mentioned cloud service calling method, and will not be repeated here.
[0151] The present application also provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-mentioned cloud service invocation method. The computer device can be any smart terminal including a tablet computer, an in-vehicle computer, or the like.
[0152] See also Figure 11 , Figure 11 The hardware structure of a computer device according to another embodiment is shown. The computer device includes:
[0153] The processor 1101 may be implemented using a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is configured to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.
[0154] The memory 1102 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1102 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1102, and the processor 1101 calls and executes the cloud service calling method of the embodiments of this application;
[0155] Input / output interface 1103, used to implement information input and output;
[0156] Communication interface 1104, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, Wi-Fi, Bluetooth, etc.);
[0157] Bus 1105 , which transmits information between various components of the device (e.g., processor 1101 , memory 1102 , input / output interface 1103 , and communication interface 1104 );
[0158] The processor 1101 , the memory 1102 , the input / output interface 1103 and the communication interface 1104 are connected to each other in communication within the device via a bus 1105 .
[0159] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned cloud service calling method is implemented.
[0160] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0161] The cloud service calling method and apparatus, computer equipment, and storage medium provided in the embodiments of the present application pre-configure the cloud interface information of the target gateway interface. When the target gateway interface inputs the calling gateway input parameters, the corresponding cloud interface information can be determined, so that the target cloud authentication information is determined through the cloud interface information and the candidate cloud authentication information, and the cloud service call is completed through the target cloud authentication information and the cloud interface information. The cloud service call can be completed by only inputting parameters in the target gateway interface, making the cloud service call operation simpler and improving the efficiency of the cloud service call.
[0162] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0163] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0164] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.
[0165] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.
[0166] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0167] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0168] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0169] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0170] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0171] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store programs.
[0172] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.
Claims
1. A cloud service calling method, characterized in that: The method comprises: Receive an interface configuration request; wherein the interface configuration request includes: newly added cloud interface information of the target gateway interface; Perform cloud interface configuration on the target gateway interface according to the newly added cloud interface information to obtain candidate cloud interface information; Receive a gateway calling input parameter of the target gateway interface; Filter target cloud interface information from the candidate cloud interface information according to the calling gateway input parameter; Constructing target cloud authentication information according to the target cloud interface information and preset candidate cloud authentication information; The cloud service call is performed according to the target cloud interface information, the target cloud authentication information and the preset candidate cloud platform interface.
2. The method according to claim 1, characterized in that The constructing target cloud authentication information according to the target cloud interface information and preset candidate cloud authentication information includes: Extracting cloud platform account information from the target cloud interface information; Matching the candidate cloud authentication information with the cloud platform account information to obtain an information matching result; The target cloud authentication information is constructed according to the information matching result, the candidate cloud authentication information and the cloud platform account information.
3. The method according to claim 2, characterized in that The constructing the target cloud authentication information according to the information matching result, the candidate cloud authentication information, and the cloud platform account information includes: If the information matching result indicates that the selected cloud authentication information of the candidate cloud authentication information matches the cloud platform account information, the selected cloud authentication information is used as the target cloud authentication information; If the information matching result indicates that the selected cloud authentication information of the candidate cloud authentication information does not match the cloud platform account information, the target cloud authentication information is generated according to a preset cloud authentication information interface and the cloud platform account information.
4. The method according to claim 3, characterized in that If the information matching result indicates that the selected cloud authentication information of the candidate cloud authentication information matches the cloud platform account information, after using the selected cloud authentication information as the target cloud authentication information, the method further includes: Obtain the remaining validity period of the selected cloud authentication information; If the remaining valid time is less than the preset time, the selected cloud authentication information is updated according to the cloud authentication information interface and the cloud platform account information.
5. The method according to any one of claims 1 to 4, characterized in that The calling of a cloud service according to the target cloud interface information, the target cloud authentication information and the preset candidate cloud platform interface includes: Perform configuration processing on the candidate cloud platform interface according to the target cloud interface information to obtain the target cloud platform interface; Cloud service calls are made through the target cloud platform interface and the target cloud authentication information.
6. The method according to claim 5, characterized in that The candidate cloud platform interface is provided with candidate request parameters and candidate domain names; and the configuration processing of the candidate cloud platform interface according to the target cloud interface information to obtain the target cloud platform interface includes: Parsing the target cloud interface information to obtain cloud request parameters and cloud domain name; Replace the candidate request parameters according to the cloud request parameters to obtain target request parameters; Replace the candidate domain name according to the cloud domain name to obtain the target domain name; The candidate cloud platform interface is configured and processed according to the target request parameters and the target domain name to obtain the target cloud platform interface.
7. The method according to any one of claims 1 to 4, characterized in that Before receiving the interface configuration request, the method further includes: Obtain new gateway service information and new cloud service information; Perform gateway configuration processing according to the newly added gateway service information to obtain newly added gateway input parameters; Configuring the preset candidate gateway interface according to the newly added gateway input parameters to obtain the target gateway interface; The target gateway interface is configured and processed according to the newly added cloud service information to obtain the newly added cloud interface information.
8. A cloud service calling device, characterized in that: The device comprises: A request receiving module, configured to receive an interface configuration request; wherein the interface configuration request includes: newly added cloud interface information of the target gateway interface; An interface screening module is used to perform cloud interface configuration on the target gateway interface according to the newly added cloud interface information to obtain candidate cloud interface information; A parameter receiving module, configured to receive input parameters of a calling gateway of the target gateway interface; An information screening module, configured to screen target cloud interface information from the candidate cloud interface information according to the calling gateway input parameter; An authentication building module, configured to build target cloud authentication information based on the target cloud interface information and preset candidate cloud authentication information; The cloud service calling module is used to call the cloud service according to the target cloud interface information, the target cloud authentication information and the preset candidate cloud platform interface.
9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the cloud service calling method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the cloud service calling method according to any one of claims 1 to 7 is implemented.