Function calculation system and method
By filtering the optimal function calculation cluster in the function computing system and performing resource scheduling, the problems of cluster selection and resource matching are solved, and efficient creation and scaling of function computing instances are realized.
Patent Information
- Application Number
- CN202411224807.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-12-27
AI Technical Summary
In a functional computing system, how to effectively select the appropriate cluster to run function computing tasks, especially in multiple cluster environments, to ensure the matching of resource utilization and task requirements.
A function computing system is designed, including a main function computing cluster and multiple slave function computing clusters. When the main gateway and function computing controller receive user access requests, they filter out the optimal function computing cluster and control it through resource scheduling. The device creates instances and scales, combines registered cluster information and preset policies to ensure resource matching.
It realizes the selection of optimal function computing clusters based on the user's access request needs, ensuring the smooth creation and scaling of function computing instances, and improving resource utilization and task matching.
Smart Images

Figure CN119201434A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cluster technology, and in particular to a function computing system and method. Background Art
[0002] Function computing is a way to implement serverless architecture. Serverless architecture means that developers do not need to worry about the management and operation of the underlying servers, but only need to write and deploy code. Cloud service providers are responsible for automatically scaling and managing the infrastructure, which simplifies the development and operation process. However, for providers, most function computing services are provided in the form of clusters. Since there are multiple clusters, how to choose a cluster to run functions is a problem that needs to be solved. Summary of the invention
[0003] In order to solve at least one of the above technical problems, an embodiment of the present invention provides a function calculation system and method.
[0004] In a first aspect, a function computing system provided by an embodiment of the present invention includes a master function computing cluster and multiple slave function computing clusters, wherein the master function computing cluster includes a master gateway, a function computing controller, and a resource scheduling controller, and each slave function computing cluster includes a secondary gateway and a resource scheduling controller; wherein:
[0005] The main gateway is used to: upon receiving a user access request, send a first notification message to the function computing controller; upon receiving the optimal function computing cluster returned by the function computing controller, if it is determined that the optimal function computing cluster is a slave function computing cluster, forward the user access request to the secondary gateway of the optimal function computing cluster;
[0006] The function computing controller is used to: when receiving the first notification information, screen out the optimal function computing cluster according to the cluster information of each function computing cluster registered with the function computing controller and the preset function configuration policy, and return the optimal function computing cluster to the master gateway; wherein the function computing controller records the cluster information of each slave function computing cluster registered with the function computing controller;
[0007] The secondary gateway of the optimal function computing cluster is used to: when receiving the user access request sent by the main gateway, send a second notification message to the resource scheduling controller of the optimal function computing cluster, so that the resource scheduling controller of the optimal function computing cluster can create and / or scale up or down function computing instances.
[0008] In one embodiment, the function computing system further includes an object storage system and an image warehouse; the object storage system is used to store the implementation logic code of the computing function uploaded by the user, and to notify the cache middleware in each function computing cluster to update the code; the image warehouse is used to store the image required by the computing function;
[0009] Correspondingly, each function computing cluster also includes a cache middleware, which is used to synchronize the implementation logic code in the object storage system to the local when receiving a code update request, and synchronize the image in the image repository to the local, so that the resource scheduling controller belonging to the same function computing cluster can create and / or scale function computing instances according to the implementation logic code and the image synchronized to the local when receiving the second notification message.
[0010] In one embodiment, the resource scheduling control in the unregistered slave function computing cluster is further used to: after the secondary gateway, the resource scheduling controller and the cache middleware are installed in the slave function computing cluster, collect the cluster information of the slave function computing cluster and send it to the function computing controller to register the slave function computing cluster with the function computing controller;
[0011] The function computing controller is also used to: when receiving cluster information sent by a resource scheduling control, notify the cache middleware in the function computing cluster where the resource scheduling controller is located to pull the implementation logic code of the corresponding cluster architecture from the object storage system and pull the image from the image repository.
[0012] In one embodiment, each slave function computing cluster registered in the function computing controller is a function computing cluster not built by the user, and the cluster information of the function computing cluster not built by the user includes the resource usage, cluster architecture and available time of the function computing cluster.
[0013] In one embodiment, the function computing controller is specifically used to: select, from each function computing cluster, a first function computing cluster that meets the function usage time corresponding to the user access request based on the available time of each registered function computing cluster; select, based on the remaining resources of each first function computing cluster and the resources required for the operation of the function corresponding to the user access request, a second function computing cluster that can meet the operation resource requirements of the function corresponding to the user access request, and select, from each second function computing cluster, a function computing cluster with the largest remaining resources as the optimal function computing cluster.
[0014] In one embodiment, the various slave function computing clusters registered in the function computing controller include user-built function computing clusters in addition to non-user-built function computing clusters. The cluster information of the user-built function computing cluster includes the resource usage, cluster architecture, available time and user-configured function whitelist of the function computing cluster. The function whitelist includes a list of functions that can be run by the function computing cluster.
[0015] In one embodiment, the user-built function computing cluster is used to: after installing the secondary gateway, resource scheduling controller and cache middleware, register with the function computing controller and pull the implementation logic code and the image, and after creating and / or scaling the function computing instance in its own resource scheduling controller, directly receive access requests from the user through its own secondary gateway.
[0016] In one embodiment, the function computing controller is specifically used to: determine whether the function corresponding to the user access request is a function in the function whitelist of the function computing cluster built by the user;
[0017] If not, based on the available time of each registered non-user-built function computing cluster, select a third function computing cluster that meets the function usage time corresponding to the user access request from each non-user-built function computing cluster; based on the remaining resources of each third function computing cluster and the resources required for the operation of the function corresponding to the user access request, select a fourth function computing cluster that can meet the operation resource requirements of the function corresponding to the user access request, and select the function computing cluster with the largest remaining resources from each fourth function computing cluster as the optimal function computing cluster.
[0018] If so, and the user access request comes from a user corresponding to the user-built function computing cluster, the user-built function computing cluster is used as the optimal function computing cluster.
[0019] In one embodiment, the main gateway is further used to: if the optimal function computing cluster is the main function computing cluster, notify the resource scheduling controller of the main function computing cluster to create and / or scale up / down function computing instances.
[0020] According to a second aspect, a function calculation method provided by an embodiment of the present invention is implemented based on the function calculation system provided by the first aspect, and the method includes:
[0021] When receiving a user access request, the main gateway sends a first notification message to the function computing controller;
[0022] When the function computing controller receives the first notification information, it selects the optimal function computing cluster according to the cluster information of each function computing cluster registered with the function computing controller and the preset function configuration strategy, and returns the optimal function computing cluster to the master gateway; wherein the function computing controller records the cluster information of each slave function computing cluster registered with the function computing controller;
[0023] When receiving the optimal function computing cluster returned by the function computing controller, if it is determined that the optimal function computing cluster is a slave function computing cluster, the primary gateway forwards the user access request to the secondary gateway of the optimal function computing cluster;
[0024] When the secondary gateway of the optimal function computing cluster receives the user access request sent by the main gateway, it sends a second notification message to the resource scheduling controller of the optimal function computing cluster, so that the resource scheduling controller of the optimal function computing cluster can create and / or scale up or down function computing instances.
[0025] The function calculation system and method provided by the embodiments of the present invention have the following beneficial effects:
[0026] The user sends a user access request to the main gateway. When the main gateway receives the user access request, it notifies the function computing controller. In this way, the function computing controller can select the optimal function computing cluster based on the cluster information of each registered function computing cluster and the preset function configuration policy, and then return the identification information of the optimal function computing cluster to the main gateway. After receiving the return information, the main gateway determines whether the optimal function computing cluster is the main function computing cluster. If it is a slave function computing cluster, it will forward the user access request to the sub-gateway of the optimal function computing cluster. Then, the sub-gateway of the optimal function computing cluster will notify the resource scheduling controller of the function computing cluster where it is located, so that the resource scheduling controller will create and / or scale up and down the function computing instance. It can be seen that when the function computing controller selects the optimal function computing cluster, it will combine the cluster information of each registered function computing cluster and the preset function configuration policy, so as to ensure that the selected optimal function computing cluster can meet the needs of the function corresponding to the user access request, and ensure the smooth creation and / or scaling of the function computing instance. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 A schematic diagram of the structure of a function computing system in one embodiment of the present invention;
[0028] Figure 2 The figure is a flowchart of a function calculation method in one embodiment of the present invention. DETAILED DESCRIPTION
[0029] In a first aspect, an embodiment of the present invention provides a function computing system, the function computing system comprising a master function computing cluster and multiple slave function computing clusters, the master function computing cluster comprising a master gateway, a function computing controller and a resource scheduling controller, each slave function computing cluster comprising a secondary gateway and a resource scheduling controller; wherein:
[0030] The main gateway is used to: upon receiving a user access request, send a first notification message to the function computing controller; upon receiving the optimal function computing cluster returned by the function computing controller, if it is determined that the optimal function computing cluster is a slave function computing cluster, forward the user access request to the secondary gateway of the optimal function computing cluster;
[0031] The function computing controller is used to: when receiving the first notification information, screen out the optimal function computing cluster according to the cluster information of each function computing cluster registered with the function computing controller and the preset function configuration policy, and return the optimal function computing cluster to the master gateway; wherein the function computing controller records the cluster information of each slave function computing cluster registered with the function computing controller;
[0032] The secondary gateway of the optimal function computing cluster is used to: when receiving the user access request sent by the main gateway, send a second notification message to the resource scheduling controller of the optimal function computing cluster, so that the resource scheduling controller of the optimal function computing cluster can create and / or scale up or down function computing instances.
[0033] It can be seen that the function computing system includes a master function computing cluster and multiple slave function computing clusters. Both the master function computing cluster and the slave function computing cluster include a gateway and a resource scheduling controller, and the master function computing cluster also includes a function computing controller.
[0034] Among them, the main gateway is the gateway service integrated in the main function computing cluster.
[0035] Among them, the secondary gateway is a gateway service integrated in the slave function computing cluster.
[0036] Among them, the function computing controller is a kind of middleware, which is used to record the cluster information of each function computing cluster and determine the optimal function computing cluster based on the preset function configuration strategy.
[0037] The resource scheduling controller is a middleware that is used to create, expand, or shrink function computing instances. Of course, the resource scheduling controller also has the function of collecting cluster information of its own cluster and registering it with the function computing controller.
[0038] The working process of the above-mentioned function computing system is as follows: the user sends a user access request to the main gateway, and when the main gateway receives the user access request, it notifies the function computing controller. In this way, the function computing controller can select the optimal function computing cluster based on the cluster information of each registered function computing cluster and in combination with the preset function configuration policy, and then return the identification information of the optimal function computing cluster to the main gateway. After receiving the return information, the main gateway determines whether the optimal function computing cluster is the main function computing cluster. If it is a slave function computing cluster, it will forward the user access request to the secondary gateway of the optimal function computing cluster. Next, the secondary gateway of the optimal function computing cluster will notify the resource scheduling controller of the function computing cluster to which it is located, so that the resource scheduling controller will create and / or scale up and down the function computing instance.
[0039] It is understandable that after creation and / or scaling, users can access the secondary gateway of the optimal function computing cluster through the primary gateway to access the created and / or scaled function computing instance. A function computing instance is a running function used to provide services to users.
[0040] In one embodiment, the function computing system further includes an object storage system and an image warehouse; the object storage system is used to store the implementation logic code of the computing function uploaded by the user, and to notify the cache middleware in each function computing cluster to update the code; the image warehouse is used to store the image required by the computing function;
[0041] Correspondingly, each function computing cluster also includes a cache middleware, which is used to synchronize the implementation logic code in the object storage system to the local when receiving a code update request, and synchronize the image in the image repository to the local, so that the resource scheduling controller belonging to the same function computing cluster can create and / or scale function computing instances according to the implementation logic code and the image synchronized to the local when receiving the second notification message.
[0042] Among them, the object storage system and image repository are public and can be used by all function computing clusters to pull and implement logic codes and images.
[0043] Among them, the main function computing cluster and each slave function computing cluster have cache middleware, the role of the cache middleware is to pull the implementation logic code from the object storage system and pull the image from the image warehouse. When the implementation logic code of the function is updated, the user will upload the new implementation logic code to the object storage system and the new image required for the computing function to the image warehouse. Then the object storage system will notify the cache middleware and image of each function computing cluster to pull the code, and then update the local cache of the function computing cluster. Logic code and image.
[0044] Among them, when the resource scheduling controller creates and / or scales up and down function computing instances, it relies on the locally cached implementation logic code and the image.
[0045] In one embodiment, the resource scheduling control in the unregistered slave function computing cluster is further used to: after the secondary gateway, the resource scheduling controller and the cache middleware are installed in the slave function computing cluster, collect the cluster information of the slave function computing cluster and send it to the function computing controller to register the slave function computing cluster with the function computing controller;
[0046] The function computing controller is also used to: when receiving cluster information sent by a resource scheduling control, notify the cache middleware in the function computing cluster where the resource scheduling controller is located to pull the implementation logic code of the corresponding cluster architecture from the object storage system and pull the image from the image repository.
[0047] It can be seen that the process of registering a slave function computing cluster that has not yet been registered is as follows: after installing the secondary gateway, resource scheduling controller and cache middleware in the function computing cluster, the resource scheduling controller collects the cluster information of the slave function computing cluster where it is located, and then reports the cluster information to the function computing controller, so that the function computing controller will record the cluster information of the slave function computing cluster to achieve registration. After completing the registration of a slave function computing cluster, since the slave function computing cluster has not yet cached the implementation logic code and image, the function computing controller will notify the cache middleware in the newly registered slave function computing cluster to pull the implementation logic code corresponding to the cluster architecture of the slave function computing cluster from the object storage system, and pull the image from the image warehouse to achieve the local cache of the implementation logic code and image in this slave function computing cluster. The registered slave function computing cluster can participate in the subsequent screening process of the optimal function computing cluster.
[0048] When users upload the implementation logic code to the object storage system, they can trigger the webhook of the object storage system, which in turn notifies the cache middleware of each function computing cluster to pull the implementation logic code. Webhook is a network hook.
[0049] In one embodiment, each slave function computing cluster registered in the function computing controller is a function computing cluster not built by the user, and the cluster information of the function computing cluster not built by the user includes the resource usage, cluster architecture and available time of the function computing cluster.
[0050] In actual scenarios, usually, all slave function computing clusters registered in the function computing controller are non-user-built function computing clusters. Non-user-built function computing clusters refer to function computing clusters built by cloud service providers, not user-built function computing clusters. Non-user-built function computing clusters can generally create and / or scale function computing instances of various functions, that is, they will not set a function whitelist.
[0051] The cluster information of the non-user-built function computing cluster may include the resource usage, cluster architecture, and available time of the function computing cluster. Based on the resource usage, it is possible to know how many remaining resources there are. Different function computing clusters can be implemented using different cluster architectures. Only within the available time of the function computing cluster can function computing instances be created, scaled, or accessed.
[0052] Furthermore, the function computing controller can be specifically used to: select from each function computing cluster a first function computing cluster that meets the function usage time corresponding to the user access request based on the available time of each registered function computing cluster; select from each function computing cluster a second function computing cluster that can meet the running resource requirements of the function corresponding to the user access request based on the remaining resources of each first function computing cluster and the resources required for the running of the function corresponding to the user access request, and select from each second function computing cluster a function computing cluster with the largest remaining resources as the optimal function computing cluster.
[0053] That is to say, if all slave function computing clusters registered in the function computing controller are function computing clusters that are not built by the user, then the function computing controller will first screen out the function computing cluster that meets the function usage time corresponding to the user access request, that is, the first function computing cluster, based on the available time of each registered function computing cluster. Then, based on whether the remaining resources of each first function computing cluster meet the running resource requirements of the function corresponding to the user access request, the second function computing cluster is screened out from each first function computing cluster. Then, the function computing cluster with the largest remaining resources is selected from each second function computing cluster as the optimal function computing cluster. It can be seen that the factors considered in the entire screening process are: available time and remaining resources, so as to ensure the availability of the optimal function computing cluster.
[0054] In one embodiment, the various slave function computing clusters registered in the function computing controller include user-built function computing clusters in addition to non-user-built function computing clusters. The cluster information of the user-built function computing cluster includes the resource usage, cluster architecture, available time and user-configured function whitelist of the function computing cluster. The function whitelist includes a list of functions that can be run by the function computing cluster.
[0055] That is to say, the registered slave function computing clusters include non-user-built function computing clusters and user-built function computing clusters. In addition to the resource usage, cluster architecture, and available time of the computing cluster, the cluster information of the user-built function computing cluster also includes a function whitelist, which records the functions that the user-built function computing cluster can run.
[0056] Among them, managing the user-built function computing cluster into the function computing system can make full use of the user's idle resources, reduce cloud service costs, improve the efficiency of user access to resources, and meet personalized function usage needs.
[0057] Furthermore, the user-built function computing cluster is used to: after installing the secondary gateway, resource scheduling controller and cache middleware, register with the function computing controller and pull the implementation logic code and the image, and after creating and / or scaling the function computing instance in its own resource scheduling controller, directly receive access requests from the user through its own secondary gateway.
[0058] That is to say, the process of installing the secondary gateway, resource scheduling controller and cache middleware, registering with the function computing controller and pulling the implementation logic code and the image, and creating and / or scaling the function computing instance through the resource scheduling controller is the same for the function computing cluster built by the user and the function computing cluster not built by the user. However, if the user wants to access the function computing cluster not built by the user, he does not need to go through the main gateway, but can directly access the secondary gateway of the function computing cluster not built by the user, thereby achieving efficient access to the function computing instance.
[0059] Further, the function computing controller may be specifically used to: determine whether the function corresponding to the user access request is a function in the function whitelist of the function computing cluster built by the user;
[0060] If not, based on the available time of each registered non-user-built function computing cluster, select a third function computing cluster that meets the function usage time corresponding to the user access request from each non-user-built function computing cluster; based on the remaining resources of each third function computing cluster and the resources required for the operation of the function corresponding to the user access request, select a fourth function computing cluster that can meet the operation resource requirements of the function corresponding to the user access request, and select the function computing cluster with the largest remaining resources from each fourth function computing cluster as the optimal function computing cluster.
[0061] If so, and the user access request comes from a user corresponding to the user-built function computing cluster, the user-built function computing cluster is used as the optimal function computing cluster.
[0062] It can be seen that when the registered slave function computing clusters include function computing clusters that are not built by users and function computing clusters built by users, the function whitelist factor needs to be considered when selecting the optimal function computing cluster.
[0063] Case 1: If the function corresponding to the user's access request is not a function in the function whitelist of the user-built function computing cluster, that is, the function computing instance corresponding to the user's access request can only be created in the non-user-built function computing cluster, then you only need to filter in the non-user-built function computing cluster according to the available time and remaining resources, which is consistent with the screening process mentioned above.
[0064] Case 2: If the function corresponding to the user access request is a function in the function whitelist of the user-built function computing cluster, the function computing instance corresponding to the user access request can be created in a non-user-built function computing cluster or in a user-built function computing cluster. If the user access request comes from a user corresponding to a user-built function computing cluster, for example, a user access request sent by user a, a function computing instance can be created in the function computing cluster built by user a. If the user access request does not come from a user corresponding to a user-built function computing cluster, it is necessary to select the optimal function computing cluster based on available time and remaining resources in the non-user-built function computing cluster and the user-built function computing cluster that can run the function corresponding to the user access request.
[0065] In one embodiment, the main gateway is further used to: if the optimal function computing cluster is the main function computing cluster, notify the resource scheduling controller of the main function computing cluster to create and / or scale up / down function computing instances.
[0066] That is to say, if the optimal function computing cluster is the primary function computing cluster, the resource scheduling controller of the primary function computing cluster will be notified to create and / or scale up / down function computing instances, and subsequent users will also access the function computing instances created by the resource scheduling controller through the primary gateway.
[0067] In actual scenarios, cloud service providers can register concentrated container clusters to the function computing controller based on regional distribution. When resource utilization is low or not used for a period of time, concentrated container clusters can be used as backup clusters to achieve resource reuse and make full use of the cloud service provider's clusters.
[0068] It can be seen that the embodiments of the present invention can improve the utilization rate of low-utilization clusters, and also support the use of various self-built clusters to meet specific needs. It can make full use of the computing power of nearby clusters and even self-built clusters to provide function computing services to meet the diverse needs of customers.
[0069] In a second aspect, an embodiment of the present invention provides a function calculation method, which is implemented based on the function calculation system provided in the first aspect, see Figure 2 , the method comprising:
[0070] S110, when receiving a user access request, sending first notification information to the function computing controller through the main gateway;
[0071] S120. When the function computing controller receives the first notification information, it selects the optimal function computing cluster according to the cluster information of each function computing cluster registered with the function computing controller and the preset function configuration policy, and returns the optimal function computing cluster to the master gateway; wherein the function computing controller records the cluster information of each slave function computing cluster registered with the function computing controller;
[0072] S130: When receiving the optimal function computing cluster returned by the function computing controller, if it is determined that the optimal function computing cluster is a slave function computing cluster, forwarding the user access request to the secondary gateway of the optimal function computing cluster;
[0073] S140. When the secondary gateway of the optimal function computing cluster receives the user access request sent by the main gateway, the secondary gateway sends a second notification message to the resource scheduling controller of the optimal function computing cluster, so that the resource scheduling controller of the optimal function computing cluster creates and / or scales up or down a function computing instance.
[0074] It is understandable that the explanation of the relevant contents, specific implementation methods, beneficial effects, examples, etc. in the method provided in the embodiment of the present invention can be found in the corresponding parts of the system provided in the first aspect, and will not be repeated here.
[0075] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0076] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the present invention can be implemented by hardware, software, widgets, or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.
[0077] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.
Claims
1. A function computing system, characterized in that: It includes a main function computing cluster and multiple slave function computing clusters, wherein the main function computing cluster includes a main gateway, a function computing controller and a resource scheduling controller, and each slave function computing cluster includes a secondary gateway and a resource scheduling controller; wherein: The main gateway is used to: upon receiving a user access request, send a first notification message to the function computing controller; upon receiving the optimal function computing cluster returned by the function computing controller, if it is determined that the optimal function computing cluster is a slave function computing cluster, forward the user access request to the secondary gateway of the optimal function computing cluster; The function computing controller is used to: when receiving the first notification information, screen out the optimal function computing cluster according to the cluster information of each function computing cluster registered with the function computing controller and the preset function configuration policy, and return the optimal function computing cluster to the master gateway; wherein the function computing controller records the cluster information of each slave function computing cluster registered with the function computing controller; The secondary gateway of the optimal function computing cluster is used to: when receiving the user access request sent by the main gateway, send a second notification message to the resource scheduling controller of the optimal function computing cluster, so that the resource scheduling controller of the optimal function computing cluster can create and / or scale up or down function computing instances.
2. The function computing system according to claim 1, characterized in that: The function computing system also includes an object storage system and an image repository; the object storage system is used to store the implementation logic code of the computing function uploaded by the user, and to notify the cache middleware in each function computing cluster to update the code; The image warehouse is used to store the images required by the computing function; Correspondingly, each function computing cluster also includes a cache middleware, which is used to synchronize the implementation logic code in the object storage system to the local when receiving a code update request, and synchronize the image in the image repository to the local, so that the resource scheduling controller belonging to the same function computing cluster can create and / or scale function computing instances according to the implementation logic code and the image synchronized to the local when receiving the second notification message.
3. The function computing system according to claim 2, characterized in that: The resource scheduling control in the unregistered slave function computing cluster is also used to: after the secondary gateway, resource scheduling controller and cache middleware are installed in the slave function computing cluster, collect the cluster information of the slave function computing cluster and send it to the function computing controller to register the slave function computing cluster with the function computing controller; The function computing controller is also used to: when receiving cluster information sent by a resource scheduling control, notify the cache middleware in the function computing cluster where the resource scheduling controller is located to pull the implementation logic code of the corresponding cluster architecture from the object storage system and pull the image from the image repository.
4. The function computing system according to claim 1, characterized in that: Each slave function computing cluster registered in the function computing controller is a function computing cluster not built by the user, and the cluster information of the function computing cluster not built by the user includes the resource usage, cluster architecture and available time of the function computing cluster.
5. The function computing system according to claim 4, characterized in that: The function computing controller is specifically used to: select, from each function computing cluster, a first function computing cluster that meets the function usage time corresponding to the user access request based on the available time of each registered function computing cluster; select, from each first function computing cluster, a second function computing cluster that can meet the running resource requirements of the function corresponding to the user access request based on the remaining resources of each first function computing cluster and the resources required for the running of the function corresponding to the user access request, and select, from each second function computing cluster, a function computing cluster with the largest remaining resources as the optimal function computing cluster.
6. The function computing system according to claim 1, characterized in that: The various slave function computing clusters registered in the function computing controller include user-built function computing clusters in addition to non-user-built function computing clusters. The cluster information of the user-built function computing cluster includes the resource usage, cluster architecture, available time and user-configured function whitelist of the function computing cluster. The function whitelist includes a list of functions that can be run by the function computing cluster.
7. The function computing system according to claim 6, characterized in that: The user-built function computing cluster is used to: after installing the secondary gateway, resource scheduling controller and cache middleware, register with the function computing controller and pull the implementation logic code and the image, and after creating and / or scaling the function computing instance in its own resource scheduling controller, directly receive access requests from the user through its own secondary gateway.
8. The function computing system according to claim 6, characterized in that: The function computing controller is specifically used to: determine whether the function corresponding to the user access request is a function in the function whitelist of the function computing cluster built by the user; If not, based on the available time of each registered non-user-built function computing cluster, select a third function computing cluster that meets the function usage time corresponding to the user access request from each non-user-built function computing cluster; based on the remaining resources of each third function computing cluster and the resources required for the operation of the function corresponding to the user access request, select a fourth function computing cluster that can meet the operation resource requirements of the function corresponding to the user access request, and select the function computing cluster with the largest remaining resources from each fourth function computing cluster as the optimal function computing cluster. If so, and the user access request comes from a user corresponding to the user-built function computing cluster, the user-built function computing cluster is used as the optimal function computing cluster.
9. The function computing system according to claim 1, characterized in that: The main gateway is also used to: if the optimal function computing cluster is the main function computing cluster, notify the resource scheduling controller of the main function computing cluster to create and / or scale up / down function computing instances.
10. A function calculation method, characterized in that: The method is implemented based on the function computing system according to any one of claims 1 to 9, and the method comprises: When receiving a user access request, the main gateway sends a first notification message to the function computing controller; When the function computing controller receives the first notification information, it selects the optimal function computing cluster according to the cluster information of each function computing cluster registered with the function computing controller and the preset function configuration strategy, and returns the optimal function computing cluster to the master gateway; wherein the function computing controller records the cluster information of each slave function computing cluster registered with the function computing controller; When receiving the optimal function computing cluster returned by the function computing controller, if it is determined that the optimal function computing cluster is a slave function computing cluster, the primary gateway forwards the user access request to the secondary gateway of the optimal function computing cluster; When the secondary gateway of the optimal function computing cluster receives the user access request sent by the main gateway, it sends a second notification message to the resource scheduling controller of the optimal function computing cluster, so that the resource scheduling controller of the optimal function computing cluster can create and / or scale up or down function computing instances.