Cloud function calling method and device, cloud function platform and storage medium

By obtaining the resource amount of the scheduling request in the cloud function platform and determining the available function instances, the problem of service anomalies caused by insufficient resources is solved, ensuring that the function instances have sufficient resources to process the requests, and improving service stability.

CN118631902APending Publication Date: 2024-09-10GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310236360.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-10
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Existing cloud function platforms cannot effectively perceive the actual load of function instances and may distribute scheduling requests to function instances with insufficient resources, resulting in service anomalies.

Method used

By obtaining the amount of resources required by the scheduling request, determine the function instance whose available resources are greater than or equal to the amount of resources, and use them to process the scheduling request, or obtain resources from the unrunning function instance pool and transfer them to running Instance pool to ensure sufficient resources.

Benefits of technology

It effectively solves the service abnormality problem caused by function instance resource overload, ensures that scheduling requests are allocated to function instances with sufficient resources, and improves service stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118631902A
    Figure CN118631902A
Patent Text Reader

Abstract

The embodiment of the invention discloses a cloud function calling method and device, a cloud function platform and a storage medium, and the cloud function calling method can comprise the steps: obtaining a first resource amount required by a first scheduling request when the first scheduling request used for calling a first cloud function is received; a first function instance is determined according to the first resource quantity, the available resource quantity of the first function instance is larger than or equal to the first resource quantity, and the first function instance runs or does not run the first cloud function; and calling the first function instance to process the first scheduling request. By implementing the method, the problem of service abnormity caused by overload of function instance resources can be effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing technology, and in particular to a cloud function calling method, device, cloud function platform and storage medium. Background Art

[0002] The service granularity of the cloud function platform is the function instance, which is a code function block. When there is a scheduling request for a function, the cloud function platform can trigger the corresponding function instance to process the scheduling request. In the prior art, the request traffic of the current function instance is randomly distributed through the API gateway, which cannot perceive the actual load of the function instance and may distribute the scheduling request to the function instance with insufficient resources, resulting in service anomalies. Summary of the invention

[0003] The embodiments of the present application provide a cloud function calling method, device, cloud function platform and storage medium, which can effectively solve the service abnormality problem caused by overload of function instance resources.

[0004] A first aspect of an embodiment of the present application provides a cloud function calling method, including:

[0005] Upon receiving a first scheduling request for invoking a first cloud function, obtaining a first amount of resources required by the first scheduling request;

[0006] Determine a first function instance according to the first resource amount, the available resource amount of the first function instance is greater than or equal to the first resource amount, and the first function instance has run or has not run the first cloud function;

[0007] The first function instance is called to process the first scheduling request.

[0008] As an optional implementation manner, in the first aspect of the embodiment of the present application, determining the first function instance according to the first resource amount includes:

[0009] Determine, according to the resource status information of the first instance pool, whether there is a function instance in the first instance pool whose available resource amount is greater than or equal to the first resource amount; wherein the function instance in the first instance pool has run the first cloud function, and the resource status information includes the available resource amount of each function instance in the first instance pool;

[0010] If so, the function instance in the first instance pool whose available resource amount is greater than or equal to the first resource amount is used as the first function instance.

[0011] As an optional implementation manner, in the first aspect of the embodiment of the present application, the method further includes:

[0012] If there is no function instance in the first instance pool whose available resource amount is greater than or equal to the first resource amount, any function instance in the second instance pool is used as the first function instance; wherein none of the function instances in the second instance pool is running any cloud function.

[0013] As an optional implementation manner, in the first aspect of the embodiment of the present application, after taking the function instance in the first instance pool whose available resource amount is greater than or equal to the first resource amount as the first function instance, the method further includes:

[0014] Obtain a second function instance from a second instance pool, where the function instances in the second instance pool do not run any cloud function;

[0015] Using the second function instance to run the first cloud function to obtain a third function instance;

[0016] The third function instance is stored in the first instance pool.

[0017] As an optional implementation manner, in the first aspect of the embodiment of the present application, obtaining the second function instance from the second instance pool includes:

[0018] When the number of function instances in the first instance pool is less than the number threshold, obtaining a second function instance from the second instance pool;

[0019] or,

[0020] When the amount of resources corresponding to the first instance pool is less than a resource amount threshold, a second function instance is obtained from a second instance pool.

[0021] As an optional implementation manner, in the first aspect of the embodiment of the present application, determining, according to the resource status information of the first instance pool, whether there is a function instance in the first instance pool whose available resource amount is greater than or equal to the first resource amount includes:

[0022] Through the first scheduler corresponding to the first cloud function, according to the resource status information of the first instance pool, it is determined whether there is a function instance in the first instance pool with an available resource amount greater than or equal to the first resource amount.

[0023] As an optional implementation manner, in the first aspect of the embodiment of the present application, after taking the function instance whose available resource amount in the first instance pool is greater than or equal to the first resource amount as the first function instance, the method further includes:

[0024] Through the first scheduler, the resource status information is updated, and the updated resource status information is sent to other schedulers corresponding to the first cloud function.

[0025] As an optional implementation manner, in the first aspect of the embodiment of the present application, the method further includes:

[0026] When receiving a second scheduling request for calling a first cloud function, obtaining a second resource amount required by the second scheduling request through a second scheduler corresponding to the first cloud function, and determining whether there is a function instance in the first instance pool whose available resource amount is greater than or equal to the second resource amount according to the resource status information of the first instance pool; wherein the first scheduler and the second scheduler are different;

[0027] If so, using the second scheduler to use the function instance in the first instance pool whose available resource amount is greater than or equal to the second resource amount as the fourth function instance;

[0028] The fourth function instance is called to process the second scheduling request.

[0029] A second aspect of an embodiment of the present application provides a cloud function calling device, including:

[0030] an information acquisition unit, configured to, upon receiving a first scheduling request for invoking a first cloud function, acquire a first amount of resources required by the first scheduling request;

[0031] an instance search unit, configured to determine a first function instance according to the first resource amount, wherein the available resource amount of the first function instance is greater than or equal to the first resource amount, and the first function instance has run or has not run the first cloud function;

[0032] A request processing unit is used to call the first function instance to process the first scheduling request.

[0033] A third aspect of the embodiments of the present application provides a cloud function platform, including:

[0034] A memory storing executable program code;

[0035] and a processor coupled to the memory;

[0036] The processor calls the executable program code stored in the memory, and when the executable program code is executed by the processor, the processor implements the method described in the first aspect of the embodiment of the present application.

[0037] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium having executable program code stored thereon. When the executable program code is executed by a processor, the method described in the first aspect of the embodiment of the present application is implemented.

[0038] A fifth aspect of the embodiments of the present application discloses a computer program product. When the computer program product runs on a computer, the computer executes any one of the methods disclosed in the first aspect of the embodiments of the present application.

[0039] A sixth aspect of an embodiment of the present application discloses an application publishing platform, which is used to publish a computer program product. When the computer program product runs on a computer, the computer executes any one of the methods disclosed in the first aspect of the embodiment of the present application.

[0040] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0041] In an embodiment of the present application, when a first scheduling request for calling a first cloud function is received, a first resource amount required for the first scheduling request is obtained; a first function instance is determined based on the first resource amount, the available resource amount of the first function instance is greater than or equal to the first resource amount, and the first function instance has run or not run the first cloud function; and the first function instance is called to process the first scheduling request.

[0042] By implementing this method, a function instance with available resources greater than the first resource amount required by the first scheduling request can be found, and then the first scheduling request can be processed using the function instance. In this way, the scheduling request can be allocated to a function instance with sufficient available resources for processing, effectively solving the problem of service abnormalities caused by function instance resource overload. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments and the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and other drawings can be obtained based on these drawings.

[0044] Figure 1A It is a scenario diagram of the cloud function calling method disclosed in the embodiment of the present application;

[0045] Figure 1B It is a structural diagram of the cloud function platform 10 disclosed in the embodiment of the present application;

[0046] Figure 2 It is a flowchart of the cloud function calling method disclosed in the embodiment of the present application;

[0047] Figure 3 It is a structural diagram of the function instance a disclosed in the embodiment of the present application;

[0048] Figure 4 It is another structural diagram of the cloud function platform 10 disclosed in the embodiment of the present application;

[0049] Figure 5 It is another flowchart of the cloud function calling method disclosed in the embodiment of the present application;

[0050] Figure 6 It is another structural diagram of the cloud function platform 10 disclosed in the embodiment of the present application;

[0051] Figure 7 It is a structural diagram of the cloud function calling device disclosed in the embodiment of the present application;

[0052] Figure 8 It is a structural diagram of the cloud function platform disclosed in the embodiment of this application. DETAILED DESCRIPTION

[0053] The embodiments of the present application provide a cloud function calling method, device, cloud function platform and storage medium, which can effectively solve the service abnormality problem caused by overload of function instance resources.

[0054] In order to make the technical personnel in the technical field better understand the scheme of the present application, the technical scheme in the embodiment of the present application will be described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, not all of the embodiments. Based on the embodiments in the present application, they should all fall within the scope of protection of the present application.

[0055] See also Figure 1A , Figure 1A This is a scenario diagram of the cloud function calling method disclosed in the embodiment of this application. Figure 1A The scene diagram shown includes a cloud function platform 10 and a client 20. The service granularity of the cloud function platform 10 is a function instance, which is a code function block. In addition, the cloud function platform 10 can also provide an interface for accessing scheduling requests, through which the client 20 can send a scheduling request to the cloud function platform 10. When the cloud function platform 10 receives the scheduling request, it can directly allocate a function instance to the scheduling request to process the scheduling request.

[0056] The request and response structure of the interface is as follows:

[0057] Interface request structure:

[0058]

[0059] The interface returns the structure:

[0060]

[0061]

[0062] See also Figure 1B, Figure 1B 1 is a structural diagram of the cloud function platform 10 disclosed in the embodiment of the present application. Figure 1B The cloud function platform 10 shown may include an API gateway 101 and a first function instance module 102 corresponding to a first cloud function. The API gateway 101 may be used to receive a scheduling request sent by a client 20, and the first function instance module 102 includes function instance 1, function instance 2, ... function instance n corresponding to the first cloud function. The first cloud function is any cloud function in the cloud function platform.

[0063] In the prior art, when the API gateway 101 receives the first scheduling request sent by the client 20 for calling the first cloud function, it mostly randomly distributes the first scheduling request to the function instance of the first cloud function (function instance 1, function instance 2... or function instance n). This may distribute the first scheduling request to a function instance with insufficient resources, thereby causing service abnormalities.

[0064] In the present application scheme, the cloud function platform 10 can find a function instance with sufficient resources based on the amount of resources required for the first scheduling request sent by the client 20, and use the function instance with sufficient resources to process the first scheduling request, thereby effectively solving the problem of service abnormalities caused by function instance resource overload.

[0065] See also Figure 2 , Figure 2 This is a flowchart of the cloud function calling method disclosed in the embodiment of this application. Figure 2 The cloud function calling method shown may include the following steps:

[0066] 201. When a first scheduling request for calling a first cloud function is received, obtain a first amount of resources required for the first scheduling request.

[0067] The first resource amount may include CPU usage (Central Processing Unit / Processor) and / or memory usage, etc., which is not limited in the embodiment of the present application.

[0068] In some embodiments, the cloud function platform may store a resource quantity list, which may include request identifiers of multiple scheduling requests and resource quantities corresponding to each request identifier. The request identifier is used to uniquely identify a scheduling request, and the request identifier may be composed of at least one of the following: numbers, letters, special characters, etc.

[0069] Furthermore, obtaining the first resource amount required for the first scheduling request may include: searching for the resource amount corresponding to the request identifier of the first scheduling request in the resource amount list, and using the resource amount as the first resource amount.

[0070] In some embodiments, the first amount of resources required for the first scheduling request may also be sent by the client to the cloud function platform when the client sends the first scheduling request to the cloud function platform.

[0071] 202. Determine a first function instance according to the first resource amount, the available resource amount of the first function instance is greater than or equal to the first resource amount, and the first function instance has run or has not run the first cloud function.

[0072] It is understandable that each function instance is allocated certain resources when it is created, and the function instance will use some or all of the resources when processing a scheduling request. Exemplarily, if the function instance only supports processing one scheduling request, the function instance will use all resources when processing a scheduling request, and the available resources of the function instance are 0. If the function instance supports processing multiple scheduling requests, the function instance will use some resources when processing a scheduling request, and the available resources of the function instance are not 0.

[0073] The function instance that has run the first cloud function may refer to a function instance for which preliminary preparations are ready or a function instance that is processing a scheduling request.

[0074] In some embodiments, the first function instance is determined based on the first resource amount by first searching from function instances of the first cloud function that have been running based on the first resource amount. If not found, searching from function instances of the first cloud function that have not been running.

[0075] In some embodiments, the function instances of the running or not running first cloud function may be in the same or different instance pools, which is not limited in the embodiments of the present application.

[0076] In the case where the function instances that have run or have not run the first cloud function are in different instance pools, the function instances that have run the first cloud function may be in the first instance pool, and the function instances that have not run the first cloud function may be in the second instance pool. The second instance pool may correspond to at least one cloud function.

[0077] In some embodiments, the cloud function platform may maintain resource status information about the first instance pool, and the resource status information may include the available resource amount of each function instance in the first instance pool. Exemplarily, the first instance pool may include function instance a, function instance b... and function instance c, then the resource status information of the first instance pool includes the available resource amount of instance function a, the available resource amount of instance function b... and the available resource amount of instance function c.

[0078] Optionally, determining the first function instance according to the first resource amount may include: determining whether there is a function instance in the first instance pool whose available resource amount is greater than or equal to the first resource amount according to the resource status information of the first instance pool; if so, taking the function instance in the first instance pool whose available resource amount is greater than or equal to the first resource amount as the first function instance. If there is no function instance in the first instance pool whose available resource amount is greater than or equal to the first resource amount, taking any function instance in the second instance pool as the first function instance.

[0079] In some embodiments, taking a function instance in the first instance pool whose available resource amount is greater than or equal to the first resource amount as the first function instance may include:

[0080] If there are multiple function instances in the first instance pool whose available resource amount is greater than or equal to the first resource amount, any one of them can be used as the first function instance;

[0081] or,

[0082] If there are multiple function instances in the first instance pool whose available resource amount is greater than or equal to the first resource amount, the function instance with the least available resource may be used as the first function instance;

[0083] or,

[0084] If there are multiple function instances in the first instance pool whose available resource amount is greater than or equal to the first resource amount, the function instance with the largest available resource may be used as the first function instance.

[0085] In some embodiments, the function instances in the first instance pool may include a resource detection module Serverless-Node-Agent and a Function Runtime service module, wherein the Serverless-Node-Agent is used to detect whether the current instance resources are sufficient to meet the resources required for the scheduling request. If so, the scheduling request is forwarded to the Function Runtime, and the Function Runtime processes the scheduling request. If the Serverless-Node-Agent sidecar detects that the current instance resources cannot meet the resources required for the scheduling request, an exception is returned and the service is rejected.

[0086] For example, see Figure 3 , Figure 3 It is a structural diagram of the function instance a disclosed in the embodiment of the present application. Figure 3 As shown, function instance a includes a resource detection module 301 and a service module 302 .

[0087] By implementing this method, the function instance of the first instance pool is equipped with a resource detection module, which can further detect the resource status of the function instance, which is conducive to further ensuring the service effect.

[0088] In some embodiments, after taking the function instance in the first instance pool whose available resource amount is greater than or equal to the first resource amount as the first function instance, the method may further include:

[0089] Obtain a second function instance from the second instance pool, where no cloud function is running on any function instance in the second instance pool.

[0090] Running the first cloud function using the second function instance to obtain a third function instance;

[0091] The third function instance is stored in the first instance pool.

[0092] By implementing this method, after the function instance in the first instance pool is called, a new function instance can be taken from the second instance pool to supplement the first instance pool, thereby ensuring that there are sufficient function instances in the first instance pool for calling.

[0093] In some embodiments, obtaining the second function instance from the second instance pool may include:

[0094] When the number of function instances in the first instance pool is less than the number threshold, obtaining a second function instance from the second instance pool;

[0095] or,

[0096] When the amount of resources corresponding to the first instance pool is less than the resource amount threshold, a second function instance is obtained from the second instance pool.

[0097] Among them, the number threshold and the resource amount threshold can both be related to the number of historical calls of the first cloud function within a specified time length. The more historical calls, the larger the number threshold and the resource amount threshold. Conversely, the smaller the historical call times, the smaller the number threshold and the resource amount threshold.

[0098] By implementing this method, when the number of function instances in the first instance pool is too small or the amount of resources of function instances in the first instance pool is small, new function instances can be added to the first instance pool, which is conducive to further improving service efficiency.

[0099] By implementing this method, the cloud function platform can preferentially call the function instance that has run the first cloud function to process the first scheduling request, which is conducive to improving service efficiency. In addition, separating the function instances that have run the first cloud function and those that have not run the first function into different instance pools can effectively improve search efficiency.

[0100] 203. Call the first function instance to process the first scheduling request.

[0101] By implementing the above method, a function instance with available resources greater than the first resource amount required by the first scheduling request can be found, and then the first scheduling request can be processed using the function instance. In this way, the scheduling request can be allocated to a function instance with sufficient available resources for processing, effectively solving the problem of service abnormality caused by function instance resource overload.

[0102] See also Figure 4 , Figure 4 1 is another structural diagram of the cloud function platform 10 disclosed in the embodiment of the present application. Figure 4 The cloud function platform shown may include a scheduler module 103 and a second function instance module 104. The scheduler module 103 may include a scheduler 1 corresponding to the first cloud function. The second function instance module 104 may include a first instance pool 1041 and a second instance pool 1042.

[0103] In the technical solution of the present application, the scheduler 1 can receive a first scheduling request for calling a first cloud function, determine the first resource amount required for the first scheduling request, and, based on the first resource amount, search for a first function instance with a resource amount greater than the first resource amount from the second function instance module 104 (first search for a function instance with an available resource amount greater than or equal to the first resource amount from the first instance pool 1041, and use the found function instance as the first function instance; if not found, use any function instance in the second instance pool 1042 as the first function instance), and process the first scheduling request through the first function instance.

[0104] See also Figure 5 , Figure 5 This is another flowchart of the cloud function calling method disclosed in the embodiment of the present application. Figure 5 The cloud function calling method shown can be applied to Figure 4 The cloud function platform shown can include the following steps:

[0105] 501. When a first scheduling request for calling a first cloud function is received, a first amount of resources required for the first scheduling request is obtained through a first scheduler.

[0106] The first scheduler is any one of the at least one scheduler corresponding to the first cloud function. It is understandable that the first scheduler may have access to the first instance pool and the second instance pool. For the method of obtaining the first resource amount required for the first scheduling request, please refer to the above description, which will not be repeated here.

[0107] 502. Determine, through the first scheduler, whether there is a function instance in the first instance pool whose available resource amount is greater than or equal to the first resource amount according to the resource status information of the first instance pool. If so, continue to execute steps 503 and 505; if not, execute steps 504 and 505.

[0108] The function instance in the first instance pool has run the first cloud function, and the resource status information includes the available resource amount of each function instance in the first instance pool;

[0109] 503. Use the first scheduler to use a function instance in the first instance pool whose available resource amount is greater than or equal to the first resource amount as a first function instance.

[0110] Based on the above description, it can be known that the first scheduler can be used to maintain resource status information corresponding to the first instance pool. After step 503, the resource status information corresponding to the first instance pool can also be updated through the first scheduler.

[0111] 504. Use any function instance in the second instance pool as the first function instance through the first scheduler.

[0112] 505. Call the first function instance to process the first scheduling request.

[0113] In some embodiments, when there are multiple schedulers corresponding to the first cloud function, the multiple schedulers corresponding to the first cloud function can share the function instances in the first instance pool. After updating the resource status information corresponding to the first instance pool through the first scheduler, the updated resource status information can also be sent to other schedulers corresponding to the first cloud function, so that other schedulers can update the resource status information of the first instance pool in time.

[0114] In some embodiments, upon receiving a second scheduling request for invoking the first cloud function, a second resource amount required for the second scheduling request may be obtained through a second scheduler corresponding to the first cloud function, and based on the resource status information of the first instance pool, it may be determined whether there is a function instance in the first instance pool whose available resource amount is greater than or equal to the second resource amount; wherein the first scheduler and the second scheduler are different;

[0115] If so, the second scheduler uses the function instance in the first instance pool whose available resource amount is greater than or equal to the second resource amount as the fourth function instance;

[0116] The fourth function instance is called to process the second scheduling request.

[0117] It should be noted that if there is no function instance in the first instance pool whose available resource amount is greater than or equal to the second resource amount, any function instance in the second instance pool is used as the fourth function instance. By implementing this method, the first cloud function corresponds to multiple schedulers, and multiple schedulers can work in parallel, which is conducive to increasing the query rate per second QPS of the scheduling service and ensuring the maximization of resource utilization.

[0118] See also Figure 6 , Figure 6 This is another structural diagram of the cloud function platform 10 disclosed in the embodiment of the present application. Figure 6 The cloud function platform shown may include a scheduler module 103 and a function instance module 104. The scheduler module 103 may include n schedulers 1 corresponding to the first cloud function, and the second function instance module 104 may include a first instance pool 1041 and a second instance pool 1042.

[0119] By implementing the above method, a function instance with available resources greater than the first resource amount can be found according to the first resource amount required by the first scheduling request, and then the first scheduling request can be processed using the function instance. In this way, the scheduling request can be assigned to a function instance with sufficient available resources for processing, effectively solving the problem of service abnormality caused by overload of function instance resources. In addition, the access to the function no longer goes through the API gateway, but directly accesses the scheduler, which is conducive to simplifying the service process.

[0120] See also Figure 7 , Figure 7 This is a structural diagram of the cloud function calling device disclosed in the embodiment of this application. Figure 7 The cloud function calling device shown may include an information acquisition unit 701, an instance search unit 702, and a request processing unit 703; wherein:

[0121] The information acquisition unit 701 is used to acquire a first resource amount required by the first scheduling request when receiving the first scheduling request for calling the first cloud function;

[0122] An instance search unit 702 is used to determine a first function instance according to the first resource amount, the available resource amount of the first function instance is greater than or equal to the first resource amount, and the first function instance has run or has not run the first cloud function;

[0123] The request processing unit 703 is used to call the first function instance to process the first scheduling request.

[0124] In some embodiments, the method in which the instance search unit 702 is used to determine the first function instance based on the first resource amount may specifically include: the instance search unit 702 is used to determine whether there is a function instance in the first instance pool with available resources greater than or equal to the first resource amount based on the resource status information of the first instance pool; wherein the function instance in the first instance pool has run the first cloud function, and the resource status information includes the available resources of each function instance in the first instance pool; if so, the function instance in the first instance pool with available resources greater than or equal to the first resource amount is used as the first function instance.

[0125] In some embodiments, the instance search unit 702 is also used to use any function instance in the second instance pool as the first function instance if there is no function instance in the first instance pool whose available resources are greater than or equal to the first resource amount; wherein none of the function instances in the second instance pool are running any cloud functions.

[0126] In some embodiments, the instance search unit 702 is also used to take the function instance in the first instance pool whose available resource amount is greater than or equal to the first resource amount as the first function instance, and then obtain the second function instance from the second instance pool, wherein none of the function instances in the second instance pool is running any cloud function; use the second function instance to run the first cloud function to obtain a third function instance; and store the third function instance in the first instance pool.

[0127] In some embodiments, the instance search unit 702 is used to obtain the second function instance from the second instance pool, which may specifically include: the instance search unit 702 is used to obtain the second function instance from the second instance pool when the number of function instances in the first instance pool is less than a number threshold; or to obtain the second function instance from the second instance pool when the amount of resources corresponding to the first instance pool is less than a resource amount threshold.

[0128] In some embodiments, the instance search unit 702 is used to determine whether there is a function instance in the first instance pool with an available resource amount greater than or equal to the first resource amount based on the resource status information of the first instance pool. Specifically, the instance search unit 702 is used to determine whether there is a function instance in the first instance pool with an available resource amount greater than or equal to the first resource amount based on the resource status information of the first instance pool through the first scheduler corresponding to the first cloud function.

[0129] In some embodiments, the instance search unit 702 is also used to update the resource status information of the function instance whose available resource amount in the first instance pool is greater than or equal to the first resource amount as the first function instance, through the first scheduler, and send the updated resource status information to other schedulers corresponding to the first cloud function.

[0130] In some embodiments, the information acquisition unit 701 is further configured to, upon receiving a second scheduling request for invoking the first cloud function, acquire, through a second scheduler corresponding to the first cloud function, a second amount of resources required for the second scheduling request;

[0131] The instance acquisition unit 602 is further configured to determine, through the second scheduler according to the resource status information of the first instance pool, whether there is a function instance in the first instance pool whose available resource amount is greater than or equal to the second resource amount, and if there is, use the function instance in the first instance pool whose available resource amount is greater than or equal to the second resource amount as the fourth function instance; wherein the first scheduler and the second scheduler are different;

[0132] The request processing unit 703 is further configured to call the fourth function instance to process the second scheduling request.

[0133] See also Figure 8 , Figure 8 This is a structural diagram of the cloud function platform disclosed in the embodiment of this application. Figure 8 The cloud function platform shown may include a memory 801 storing executable program code, and a processor 802 coupled to the memory 801; wherein:

[0134] In the embodiment of the present application, the processor 802 also has the following functions:

[0135] Upon receiving a first scheduling request for invoking a first cloud function, obtaining a first amount of resources required by the first scheduling request;

[0136] Determine a first function instance according to the first resource amount, the available resource amount of the first function instance is greater than or equal to the first resource amount, and the first function instance has run or has not run the first cloud function;

[0137] The first function instance is called to process the first scheduling request.

[0138] In the embodiment of the present application, the processor 802 also has the following functions:

[0139] Determine, based on the resource status information of the first instance pool, whether there is a function instance in the first instance pool whose available resource amount is greater than or equal to the first resource amount; wherein the function instance in the first instance pool has run the first cloud function, and the resource status information includes the available resource amount of each function instance in the first instance pool;

[0140] If so, the function instance in the first instance pool whose available resource amount is greater than or equal to the first resource amount is taken as the first function instance.

[0141] In the embodiment of the present application, the processor 802 also has the following functions:

[0142] If there is no function instance in the first instance pool whose available resource amount is greater than or equal to the first resource amount, any function instance in the second instance pool is used as the first function instance; wherein none of the function instances in the second instance pool is running any cloud function.

[0143] In the embodiment of the present application, the processor 802 also has the following functions:

[0144] Obtain a second function instance from the second instance pool, where no cloud function is running on any function instance in the second instance pool.

[0145] Running the first cloud function using the second function instance to obtain a third function instance;

[0146] The third function instance is stored in the first instance pool.

[0147] In the embodiment of the present application, the processor 802 also has the following functions:

[0148] When the number of function instances in the first instance pool is less than the number threshold, obtaining a second function instance from the second instance pool;

[0149] or,

[0150] When the amount of resources corresponding to the first instance pool is less than the resource amount threshold, a second function instance is obtained from the second instance pool.

[0151] In the embodiment of the present application, the processor 802 also has the following functions:

[0152] Through the first scheduler corresponding to the first cloud function, according to the resource status information of the first instance pool, it is determined whether there is a function instance in the first instance pool with an available resource amount greater than or equal to the first resource amount.

[0153] In the embodiment of the present application, the processor 802 also has the following functions:

[0154] Through the first scheduler, the resource status information is updated, and the updated resource status information is sent to other schedulers corresponding to the first cloud function.

[0155] In the embodiment of the present application, the processor 802 also has the following functions:

[0156] Upon receiving a second scheduling request for invoking the first cloud function, obtaining, through a second scheduler corresponding to the first cloud function, a second amount of resources required for the second scheduling request, and determining, based on resource status information of the first instance pool, whether there is a function instance in the first instance pool whose available amount of resources is greater than or equal to the second amount of resources; wherein the first scheduler and the second scheduler are different;

[0157] If so, the second scheduler uses the function instance in the first instance pool whose available resource amount is greater than or equal to the second resource amount as the fourth function instance;

[0158] The fourth function instance is called to process the second scheduling request.

[0159] The embodiment of the present application discloses a computer-readable storage medium on which an executable program code is stored. When the executable program code is executed by a processor, the method described in the embodiment of the present application is implemented.

[0160] The embodiment of the present application discloses a computer program product. When the computer program product is executed on a computer, the computer is enabled to implement the method described in the embodiment of the present application.

[0161] An embodiment of the present application discloses an application publishing platform, which is used to publish a computer program product. When the computer program product runs on a computer, the computer implements the method described in the embodiment of the present application.

[0162] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium, storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0163] It should be understood that "one embodiment" or "an embodiment" or "some embodiments" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in one embodiment" or "in some embodiments" appearing throughout the specification may not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application. The above-mentioned sequence numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments. The above description of each embodiment tends to emphasize the differences between the various embodiments, and the same or similar aspects can be referenced to each other. For the sake of brevity, this article will not repeat them.

[0164] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, object A and / or object B can represent three situations: object A exists alone, object A and object B exist at the same time, and object B exists alone.

[0165] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0166] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as: multiple modules or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or modules can be electrical, mechanical or other forms.

[0167] The modules described above as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules; they may be located in one place or distributed on multiple network units; some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.

[0168] In addition, all functional modules in the embodiments of the present application may be integrated into one processing unit, or each module may be a separate unit, or two or more modules may be integrated into one unit; the above-mentioned integrated modules may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0169] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, etc., various media that can store program codes.

[0170] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling an electronic device to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0171] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0172] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0173] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0174] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A cloud function calling method, characterized in that: include: Upon receiving a first scheduling request for invoking a first cloud function, obtaining a first amount of resources required by the first scheduling request; Determine a first function instance according to the first resource amount, the available resource amount of the first function instance is greater than or equal to the first resource amount, and the first function instance has run or has not run the first cloud function; The first function instance is called to process the first scheduling request.

2. The method according to claim 1, characterized in that The determining a first function instance according to the first resource amount includes: Determine, according to the resource status information of the first instance pool, whether there is a function instance in the first instance pool whose available resource amount is greater than or equal to the first resource amount; wherein the function instance in the first instance pool has run the first cloud function, and the resource status information includes the available resource amount of each function instance in the first instance pool; If so, the function instance in the first instance pool whose available resource amount is greater than or equal to the first resource amount is used as the first function instance.

3. The method according to claim 2, characterized in that The method further comprises: If there is no function instance in the first instance pool whose available resource amount is greater than or equal to the first resource amount, any function instance in the second instance pool is used as the first function instance; wherein the function instance in the second instance pool does not run any cloud function.

4. The method according to claim 2, characterized in that: After taking the function instance in the first instance pool whose available resource amount is greater than or equal to the first resource amount as the first function instance, the method further includes: Obtain a second function instance from a second instance pool, wherein none of the function instances in the second instance pool runs any cloud function; Using the second function instance to run the first cloud function to obtain a third function instance; The third function instance is stored in the first instance pool.

5. The method according to claim 4, characterized in that The obtaining the second function instance from the second instance pool includes: When the number of function instances in the first instance pool is less than the number threshold, obtaining a second function instance from the second instance pool; or, When the amount of resources corresponding to the first instance pool is less than a resource amount threshold, a second function instance is obtained from a second instance pool.

6. The method according to claim 2, characterized in that The determining, according to the resource status information of the first instance pool, whether there is a function instance in the first instance pool whose available resource amount is greater than or equal to the first resource amount includes: Through the first scheduler corresponding to the first cloud function, according to the resource status information of the first instance pool, it is determined whether there is a function instance in the first instance pool with an available resource amount greater than or equal to the first resource amount.

7. The method according to claim 6, characterized in that After taking the function instance in the first instance pool whose available resource amount is greater than or equal to the first resource amount as the first function instance, the method further includes: Through the first scheduler, the resource status information is updated, and the updated resource status information is sent to other schedulers corresponding to the first cloud function.

8. The method according to claim 6, characterized in that The method further comprises: When receiving a second scheduling request for calling the first cloud function, obtaining a second resource amount required by the second scheduling request through a second scheduler corresponding to the first cloud function, and determining whether there is a function instance in the first instance pool whose available resource amount is greater than or equal to the second resource amount according to the resource status information of the first instance pool; wherein the first scheduler and the second scheduler are different; If so, using the second scheduler to use the function instance in the first instance pool whose available resource amount is greater than or equal to the second resource amount as the fourth function instance; The fourth function instance is called to process the second scheduling request.

9. A cloud function calling device, characterized in that: include: an information acquisition unit, configured to, upon receiving a first scheduling request for invoking a first cloud function, acquire a first amount of resources required by the first scheduling request; an instance search unit, configured to determine a first function instance according to the first resource amount, wherein the available resource amount of the first function instance is greater than or equal to the first resource amount, and the first function instance has run or has not run the first cloud function; A request processing unit is used to call the first function instance to process the first scheduling request.

10. A cloud function platform, characterized in that: include: A memory storing executable program code; and a processor coupled to the memory; The processor calls the executable program code stored in the memory, and when the executable program code is executed by the processor, the processor implements the method according to any one of claims 1 to 8.

11. A computer-readable storage medium having executable program code stored thereon, characterized in that: When the executable program code is executed by a processor, the method according to any one of claims 1 to 8 is implemented.