Edge-end service-free computing response scheduling method oriented to cloud-edge collaborative scene

By dynamically allocating function requests and optimizing resource usage in cloud-edge collaboration scenarios, the problem of low edge-end serverless computing response scheduling efficiency is solved, and faster response times and higher request throughput are achieved.

CN119356842APending Publication Date: 2025-01-24CHINA IND INTERNET RES INST
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411234581.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

In the cloud-edge collaboration scenario, the efficiency of service-free computing response scheduling in the edge-end is low, resulting in too long response time and reduced request response throughput. Unreasonable scheduling strategies may lead to request blockage problems.

Method used

Proposal to the side -endless service calculation response scheduling method facing the collaborative scene of the cloud. Through the dynamic distribution function request instruction to the edge or cloud response, the response ratio is determined according to the capacity of the resource pool and the number of requests, and the resources are limited on the edge of the edge. Time -priority replace the function instance with the longest execution time to improve the response efficiency.

Benefits of technology

Through dynamic allocation and resource optimization, the efficiency of the response scheduling of no service computing response is significantly improved, the response time is reduced, the request response throughput is improved, and the problem of request blockage is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119356842A_ABST
    Figure CN119356842A_ABST
Patent Text Reader

Abstract

The invention provides an edge-end service-free computing response scheduling method oriented to a cloud-edge collaborative scene, and the method comprises the steps: determining a target function according to a function call request instruction; judging whether the target function request waiting queue is empty or not and whether an idle function instance corresponding to the target function exists or not; if yes, sending the function call request instruction to a target function request waiting queue; if not, when the resource pool capacity of the side end is smaller than the number of function instances corresponding to the target function and does not exceed the preset threshold value, dynamically allocating the function request instruction to the side end or the cloud end for response; when the preset threshold value is exceeded, the function call request instruction is sent to the cloud for response; when the resource pool capacity of the side end is larger than the number of function instances corresponding to the target function, the function call request instruction is responded according to the function cold start delay, the function execution time and the target function request waiting queue, and the system response scheduling efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This article belongs to the field of serverless computing, and specifically involves a response scheduling method for edge serverless computing in cloud-edge collaboration scenarios. Background Art

[0002] In the serverless computing scenario, the execution of applications is fully managed by the cloud service provider, and developers only need to focus on writing code without having to worry about the operation and maintenance of the underlying infrastructure. Traditional serverless frameworks queue all requests in a central queue and process them in the order of arrival. In this case, function requests that take a short time and respond quickly often wait for a long time to be changed.

[0003] With the development of software and hardware technologies, serverless computing frameworks later collected requests for each function separately. If a function has multiple continuous requests, the function’s resources will not be reclaimed, and the function will continue to run before all requests are completed. However, functions with shorter execution cycles will still be blocked in the execution queue by functions with longer execution periods, resulting in long response times.

[0004] In cloud-edge collaboration scenarios, serverless computing is a flexible and efficient computing model. Users do not need to manage underlying server resources. They only need to focus on running the code and implementing the business logic, allocating resources to the function called by the request, initializing it as a function instance, and letting the function instance handle the response to the request. In cloud-edge collaboration scenarios, due to cost and scenario restrictions, the resource pool at the edge cannot maintain a large number of function instances, and it takes a certain amount of time to complete the initialization of the function instance, that is, the function cold start, which will lead to significant response delays, resulting in a longer system response time and reduced request response throughput.

[0005] In addition, since serverless computing resources are dynamically allocated, unreasonable scheduling strategies may cause request congestion. When the system receives a large number of requests, it is necessary to allocate computing resources in a timely and effective manner according to the scheduling strategy to process the pending requests to avoid some requests waiting in the queue for a long time or even timeout failure, which affects the availability and stability of the service.

[0006] In the cloud scenario, there are relatively sufficient resources to respond to requests that the edge system cannot handle in time. However, there are uncertainties in the network communication between the cloud and the edge. It is not reasonable for the cloud to handle requests under all conditions. Therefore, a new technical solution is urgently needed to improve the efficiency of edge serverless computing response scheduling in cloud-edge collaboration scenarios. Summary of the invention

[0007] In response to the above-mentioned problems in the prior art, the purpose of this article is to provide an edge-side serverless computing response scheduling method for cloud-edge collaboration scenarios, which can improve the efficiency of edge-side serverless computing response scheduling.

[0008] In order to solve the above technical problems, the specific technical solutions of this article are as follows:

[0009] On the one hand, this paper provides an edge-side serverless computing response scheduling method for a cloud-edge collaborative scenario, which is applied to a serverless computing response scheduling system for edge-cloud collaborative work. The method includes:

[0010] Determine the target function according to the function call request instruction;

[0011] Determine whether the target function request waiting queue is empty and whether there is an idle function instance corresponding to the target function;

[0012] If yes, the function call request instruction is sent to the target function request waiting queue to complete the function creation process;

[0013] If not, when the resource pool capacity of the edge is less than the number of function instances corresponding to the target function and does not exceed the preset threshold, the function request instruction is dynamically allocated to the edge or cloud response according to the resource pool capacity and the number of requests received;

[0014] When the resource pool capacity of the edge is less than the number of function instances corresponding to the target function and exceeds a preset threshold, the function call request instruction is sent to the cloud for response;

[0015] When the resource pool capacity of the edge is greater than the number of function instances corresponding to the target function, the function call request instruction is responded to according to the function cold start delay, function execution time and the target function request waiting queue.

[0016] Furthermore, when the resource pool capacity of the edge is less than the number of function instances corresponding to the target function and does not exceed a preset threshold, the function request instruction is dynamically allocated to the edge or cloud response according to the resource pool capacity and the number of received requests, including:

[0017] According to the resource pool capacity and the number of received requests, the proportion of requests to be responded to by the cloud is determined according to a dynamic allocation formula, wherein the dynamic allocation formula is:

[0018] Where C is the resource pool capacity, n is the number of requests that need to be responded to by the serverless computing scheduling system in the current state, threshold is the preset threshold, which indicates the threshold value of the number of additional response requests that are not completely handed over to the cloud for processing after exceeding C, and ratio cloudIt indicates the percentage of pending requests exceeding C that need to be handled by the cloud when the number of pending requests is n.

[0019] Determine the requests to be responded to and processed by the edge based on the determined proportion of requests to be responded to by the cloud;

[0020] According to the request processed by the edge response and the function instance set corresponding to the target function, the function instance with the longest average execution time in the function instance set is replaced with the target function corresponding to the request to be responded.

[0021] Further, according to the request processed by the edge response and the function instance set corresponding to the target function, the function instance with the longest average execution time in the function instance set is replaced with the target function corresponding to the request to be responded to, including:

[0022] Determine the number of pending requests after the function is updated after cold starting a new function instance and recycling the existing function instance, expressed as: in, is the updated number of pending requests. is the average cold start delay, is the average post-idle recycling time, is the average execution time, To obtain the request r i After function f i The number of pending requests;

[0023] When the updated number of pending requests is greater than zero and there is a set of function instances of idle state instances, the average execution times in the set of function instances are sorted, and the function instance with the largest average execution time is initialized for creating function instances of the updated pending requests.

[0024] Further, when the resource pool capacity of the edge is greater than the number of function instances corresponding to the target function, the function call request instruction is responded to according to the function cold start delay, the function execution time and the target function request waiting queue, including:

[0025] Determine the number of requests to be responded to after the cold start according to the function cold start delay, the function execution time and the target function request waiting queue;

[0026] When the number of pending requests after a cold start is greater than zero, a new function instance is initialized to create a function instance for the pending requests;

[0027] When the number of requests to be responded to after the cold start is less than or equal to zero, the function call request instruction is added to the target function request waiting queue.

[0028] Furthermore, the number of pending requests after a cold start is expressed by the following formula:

[0029] in, is the number of requests to be responded to after a cold start, |A i | is the function f i The set of existing instances A i The number of instances contained in is the average cold start delay, is the average execution time, To obtain the request r i After function f i The number of pending requests.

[0030] Furthermore, the method further comprises:

[0031] After the function instance completes the response, the weight of the function instance that has completed the response and the weight of each function instance in the request to be responded to are calculated respectively;

[0032] The weight of the function instance that has completed the response is determined as the first weight, and the minimum value among the weights of the function instances in the request to be responded to is determined as the second weight;

[0033] When the first weight is greater than the second weight, the function instance corresponding to the second weight is recycled to create a new function instance;

[0034] When the first weight is not greater than the second weight, it is determined whether there are any requests to be responded to in the function instance that has completed the response;

[0035] If it exists, the pending request is assigned to the function instance that completes the response for processing;

[0036] If it does not exist, then if there is redundancy in the resource pool, the function instance that has completed the response will be converted to an idle state to wait for requests, or the function instance that has completed the response will be recycled.

[0037] Furthermore, the weight of the function instance that completes the response is expressed by the following formula:

[0038]

[0039] The weight of each function instance in the pending request is expressed by the following formula:

[0040]

[0041] Furthermore, the resource pool capacity of the edge is the capacity corresponding to the resource pool of the same edge.

[0042] On the other hand, this article also provides an edge-side service-free computing response scheduling system for a cloud-edge collaboration scenario, the system comprising: an edge, a cloud and a scheduling module, and the scheduling module is used to execute the steps of the method described above.

[0043] Finally, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.

[0044] By adopting the above technical scheme, an edge-side serverless computing response scheduling method for a cloud-edge collaboration scenario described in this article is applied to a serverless computing response scheduling system for edge-cloud collaboration, and the method includes: determining a target function according to a function call request instruction; judging whether a target function request waiting queue is empty and whether there is an idle function instance corresponding to the target function; if so, sending the function call request instruction to the target function request waiting queue to complete the function creation process; if not, when the resource pool capacity of the edge is less than the number of function instances corresponding to the target function and does not exceed a preset threshold, dynamically allocating the function request instruction to the edge or cloud response according to the resource pool capacity and the number of received requests; when the resource pool capacity of the edge is less than the number of function instances corresponding to the target function and exceeds the preset threshold, sending the function call request instruction to the cloud response; when the resource pool capacity of the edge is greater than the number of function instances corresponding to the target function, responding to the function call request instruction according to the function cold start delay, the function execution time and the target function request waiting queue. This paper dynamically allocates the response execution of request functions according to the system resource situation, realizes efficient function instance initialization, avoids the long service-free computing response time caused by the cold start of function instances and unreasonable execution arrangement, and thus improves the efficiency of system response scheduling.

[0045] In order to make the above and other purposes, features and advantages of this article more obvious and easy to understand, the following specifically cites preferred embodiments and describes them in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of this article or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of this article. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0047] Figure 1 A schematic diagram of the steps of a method for scheduling edge-end serverless computing responses in a cloud-edge collaboration scenario provided by an embodiment of this document is shown;

[0048] Figure 2 A schematic diagram of the structure of an edge serverless computing response scheduling system for a cloud-edge collaboration scenario provided by an embodiment of this document is shown;

[0049] Figure 3 A schematic diagram of a strategy for uploading function responses to the cloud in an embodiment of this article is shown;

[0050] Figure 4 A flow chart of the function instance initialization strategy in the embodiment of this article is shown;

[0051] Figure 5 A flow chart of a function instance recycling strategy in an embodiment of this invention is shown;

[0052] Figure 6 A schematic diagram of the structure of a computer device provided in an embodiment of this invention is shown.

[0053] Description of the accompanying symbols:

[0054] 100. Scheduling system; 10. Edge; 20. Cloud; 30. Scheduling module. DETAILED DESCRIPTION

[0055] The following will be combined with the drawings in the embodiments of this article to clearly and completely describe the technical solutions in the embodiments of this article. Obviously, the described embodiments are only part of the embodiments of this article, not all of the embodiments. Based on the embodiments of this article, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this article.

[0056] It should be noted that the terms "first", "second", etc. in the specification and claims of this article and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of this article described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0057] Regarding the response scheduling problem in serverless computing scenarios, due to cost and scenario restrictions, the resource pool at the edge cannot maintain a large number of function instances, and it takes a certain amount of time to complete the initialization of the function instance, namely the function cold start, which will lead to obvious response delays, resulting in a longer response time for the system and a lower request response throughput.

[0058] In order to solve the above problems, the embodiments of this article provide an edge-side serverless computing response scheduling method for a cloud-edge collaboration scenario, which can improve the efficiency of edge-side serverless computing response scheduling. Figure 1 It is a step diagram of a method for scheduling edge-end serviceless computing response in a cloud-edge collaboration scenario provided in an embodiment of this article. This specification provides method operation steps as described in the embodiment or flowchart, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the steps among many orders and does not represent the only order of execution. When the actual system or device product is executed, it can be executed in the order of the method shown in the embodiment or the accompanying drawings or in parallel.

[0059] like Figure 2 As shown, an edge-side service-free computing response scheduling system for a cloud-edge collaboration scenario, referred to as a scheduling system 100, is used to run the above method. The scheduling system 100 includes an edge 10, a cloud 20 and a scheduling module 30, and the scheduling module is used to execute the above method.

[0060] The edge is a specific business end that can receive user demand input and feed back output results to the user.

[0061] The cloud end may be a cloud server, such as a distributed server.

[0062] Specific as Figure 1 As shown, the method may include:

[0063] S101: Determine a target function according to a function call request instruction;

[0064] S102: Determine whether the target function request waiting queue is empty and whether there is an idle function instance corresponding to the target function;

[0065] S103: If yes, sending the function call request instruction to the target function request waiting queue to complete the function creation process;

[0066] S104: If not, when the resource pool capacity of the edge is less than the number of function instances corresponding to the target function and does not exceed a preset threshold, the function request instruction is dynamically allocated to the edge or cloud response according to the resource pool capacity and the number of received requests;

[0067] S105: When the resource pool capacity of the edge is less than the number of function instances corresponding to the target function and exceeds a preset threshold, the function call request instruction is sent to the cloud for response;

[0068] S106: When the resource pool capacity of the edge is greater than the number of function instances corresponding to the target function, the function call request instruction is responded to according to the function cold start delay, the function execution time and the target function request waiting queue.

[0069] It can be understood that the above method mainly involves the process of initialization and response of the function. This article dynamically allocates the response execution of the request function according to the system resource situation, realizes efficient function instance initialization, avoids the long service-free computing response time caused by the cold start of the function instance and unreasonable execution arrangement, thereby improving the efficiency of the system response scheduling.

[0070] Furthermore, when the resource pool capacity of the edge is less than the number of function instances corresponding to the target function and does not exceed a preset threshold, the function request instruction is dynamically allocated to the edge or cloud response according to the resource pool capacity and the number of received requests, including:

[0071] According to the resource pool capacity and the number of received requests, the proportion of requests to be responded to by the cloud is determined according to a dynamic allocation formula, wherein the dynamic allocation formula is:

[0072]

[0073] Where C is the resource pool capacity, n is the number of requests that need to be responded to by the serverless computing scheduling system in the current state, threshold is the preset threshold, which indicates the threshold value of the number of additional response requests that are not completely handed over to the cloud for processing after exceeding C, and ratio cloud It indicates the percentage of pending requests exceeding C that need to be handled by the cloud when the number of pending requests is n.

[0074] Determine the requests to be responded to and processed by the edge based on the determined proportion of requests to be responded to by the cloud;

[0075] According to the request processed by the edge response and the function instance set corresponding to the target function, the function instance with the longest average execution time in the function instance set is replaced with the target function corresponding to the request to be responded.

[0076] It can be understood that this article will take into account the processing capabilities of the edge itself, combined with factors such as the time it takes for the edge to execute functions, and can set a preset threshold for edge processing. The preset threshold is the limit value at which the number of functions in the function request queue exceeds the capacity of the edge's resource pool. When this limit is exceeded, there will be an obvious problem of slow response, affecting the user experience. When the number of functions in the function request queue exceeds the capacity of the edge's resource pool and the overflow is lower than the limit, the cloud and edge can be allocated to execute functions in corresponding proportions, so that the edge itself responds to a certain number of overflow functions, thereby reducing the burden on the cloud and reducing the response time.

[0077] In the cloud-edge collaboration scenario, the resource pool available to the serverless computing system at the edge is relatively limited. For requests that exceed the processing capacity, there are only two options: waiting or handing over to the serverless computing system at the cloud for processing. Considering the uncertainty of data and instruction transmission between cloud and edge systems in reality, if all requests that cannot be processed by the edge are handed over to the cloud for processing and response in all scenarios, it may lead to a long response time.

[0078] Therefore, it is necessary to formulate a strategy for whether function responses need to be uploaded to the cloud, and dynamically allocate whether function responses need to be transferred to the cloud for processing based on the situation of the edge resource pool and the number of requests received.

[0079] When the number of requests C that the edge resource pool can process simultaneously is still greater than the current demand for the number of function instances, all requests are processed at the edge, corresponding to Figure 3 In the a stage.

[0080] When C is less than the current number of function instances required, but the number of function instances required does not exceed a certain threshold (the threshold is determined based on the actual resource configuration of the edge and cloud), some requests will be handed over to the cloud for response to reduce the pressure on the edge, which corresponds to stage b in the figure. The proportion of handover is evaluated according to formula (1).

[0081] The preset threshold size needs to be set according to the actual resource allocation and network conditions of the edge and cloud, to avoid the threshold being too small to play a buffering role, or too large to cause network pressure and transmission delays.

[0082] When the demand for function instances is greater than C and exceeds a certain threshold, it is considered that there will be a large number of requests that need to be responded to under the current circumstances. The demands that exceed the edge processing capacity will be gradually and completely transferred to the cloud for response. The edge will only process requests that do not exceed C, corresponding to stage c in the figure. As the number of requests increases, it will eventually transition to stage c.

[0083] The strategy for migrating functions to the cloud can be expressed mathematically as follows:

[0084]

[0085] In an embodiment of the present specification, according to the request processed by the edge response and the function instance set corresponding to the target function, replacing the function instance with the longest average execution time in the function instance set with the target function corresponding to the request to be responded to includes:

[0086] Determine the number of pending requests after the function is updated after cold starting a new function instance and recycling the existing function instance, expressed as:

[0087]

[0088] in, is the updated number of pending requests. is the average cold start delay, is the average post-idle recycling time, is the average execution time, To obtain the request r i After function f i The number of pending requests;

[0089] When the updated number of pending requests is greater than zero and there is a set of function instances of idle state instances, the average execution times in the set of function instances are sorted, and the function instance with the largest average execution time is initialized for creating function instances of the updated pending requests.

[0090] It can be understood that when the resource pool capacity is less than the number of all function instances, but the gap does not exceed the overflow threshold, in addition to adding the request to the waiting queue, it is also possible to compare whether other function instances can be replaced based on the average execution time and give priority to the waiting requests.

[0091] The method for selecting replacement is to select the function instance S whose average execution time is 100 from the function instances S that still have requests to be responded to and have idle instances after the scheduling system continuously maintains a new cold start function instance and reclaims the function instance resources. The longest function instance is replaced by the function corresponding to the waiting request and executed first.

[0092] The instance set S contains different types of function instances, each of which satisfies the number of pending requests after recycling existing function instances and cold starting to create new function instances in the function category to which it belongs. Greater than 0, and the instance set A of this type of function i There are idle function instances in .

[0093] The mathematical expression of the set S of function instances that still have requests to be responded to and have idle instances after cold starting a new function instance and reclaiming the function instance resources is:

[0094]

[0095] in, Representation function A set of instances of i The jth instance in .

[0096] After completing the update of the function instance set S, for the function instances in the set that belong to the function f i All function instances are calculated based on the average execution time Sort and take the function instance with the largest value The occupied resources are recycled and used to create function instances for new requests. The mathematical expression of the selection method is:

[0097]

[0098] Replace the function instance with the longest average execution time in the function instance set S with the function of the request to be responded to, and give priority to initializing and executing the function corresponding to the request to be responded to, so as to avoid the function instance with shorter execution time being blocked by the function instance with longer execution time, thereby speeding up the request processing.

[0099] Further, when the resource pool capacity of the edge is greater than the number of function instances corresponding to the target function, the function call request instruction is responded to according to the function cold start delay, the function execution time and the target function request waiting queue, including:

[0100] Determine the number of requests to be responded to after the cold start according to the function cold start delay, the function execution time and the target function request waiting queue;

[0101] When the number of pending requests after a cold start is greater than zero, a new function instance is initialized to create a function instance for the pending requests;

[0102] When the number of requests to be responded to after the cold start is less than or equal to zero, the function call request instruction is added to the target function request waiting queue.

[0103] Furthermore, the number of pending requests after a cold start is expressed by the following formula:

[0104]

[0105] in, is the number of requests to be responded to after a cold start, |A i| is the function f i The set of existing instances A i The number of instances contained in is the average cold start delay, is the average execution time, To obtain the request r i After function f i The number of pending requests.

[0106] It can be understood that, Figure 4 As shown, when the request r of the calling function i After it appears, the function initialization module first completes the function f i Updates to related information, including the average cold start latency of the called function Average post-idle recycling time Average execution time Function f i The set of existing instances A i 、Get request i After function f i The number of pending requests wait.

[0107] If the number of pending requests for a function is 0, and the instance set A i If there is an idle instance in the , the idle instance that has completed initialization will respond to the request r directly i If the conditions are not met, the handling method needs to be determined based on the current usage of the serverless computing framework resource pool.

[0108] In the serverless scheduling framework of cloud-edge collaboration, the edge is often limited by various circumstances and can only call relatively limited resources. It can hand over unprocessed requests to the cloud for processing. Considering the complexity of cloud-edge collaboration, network data transmission and cloud task allocation also consume time costs, and the cloud cannot process edge overflow requests in real time. Therefore, an edge processing capacity overflow threshold is set. When the resource pool can process requests less than the function instance requirement and exceeds the overflow threshold, the request will be forwarded to the cloud for response and processing. The overflow threshold will be discussed in detail in the subsequent sections.

[0109] When the resource pool capacity is greater than the total number of function instances, the function will be delayed after the cold start. The number of pending requests that remain after this time Calculate, |A i | represents the function f i The set of existing instances A i The number of instances contained in is calculated by subtracting the function f during the cold start response time from the number of pending requests and the current pending requests.i How many requests can be processed and how many response requests are still expected after the new function instance is cold started.

[0110] If a new function instance is cold started, the number of requests to be responded to If the number of pending requests is less than or equal to 0, it means that the existing function instance can complete the processing of all pending requests before the new instance is initialized. There is no need to initialize a new function instance. Just add the request to the pending queue. If it is greater than 0, a new function instance needs to be initialized through a cold start to complete the request response as quickly as possible.

[0111] like Figure 5 As shown in the figure, after the function instance completes the response, it should be determined whether the instance resources need to be recycled. If the function instance resources that have completed the response task are recycled frequently, it may cause the function instance to be frequently cold-started for initialization. If the function instance resource recycling is not performed for a long time, it may cause too many pending requests to be processed efficiently.

[0112] The function instance recycling strategy compares the weights of function instances calculated based on the average execution time and the average recycling time. When edge resources are limited, it releases instance resources with lower weights and replaces them with function instances with higher weights, thereby improving resource utilization efficiency.

[0113] Specifically, the method further includes:

[0114] After the function instance completes the response, the weight of the function instance that has completed the response and the weight of each function instance in the request to be responded to are calculated respectively;

[0115] Determine the weight of the function instance that has completed the response as the first weight, and determine the minimum value among the weights of the function instances in the request to be responded to as the second weight;

[0116] When the first weight is greater than the second weight, the function instance corresponding to the second weight is recycled to create a new function instance;

[0117] When the first weight is not greater than the second weight, it is determined whether there are any requests to be responded to in the function instance that has completed the response;

[0118] If it exists, the pending request is assigned to the function instance that completes the response for processing;

[0119] If it does not exist, then if there is redundancy in the resource pool, the function instance that has completed the response will be converted to an idle state to wait for requests, or the function instance that has completed the response will be recycled.

[0120] The weight of the function instance that completes the response is expressed by the following formula:

[0121]

[0122] The weight of each function instance in the pending request is expressed by the following formula:

[0123]

[0124] For example, for the function f i Instance of a completed task i Weight w i , for the set of function instances that are still waiting to respond to requests Calculate each function instance Weight The function instance a of the completed task i The weight w i and the function instance that is still waiting to respond to the request Medium Weight The minimum value is compared. If the function instance with smaller weight is Then Resource recovery. When the response function instance a is completed i The weight w i When the minimum is reached, it is necessary to i Are there still pending requests and is there enough redundancy in the resource pool to evaluate? i You can continue to process other pending requests, or if the resource pool has redundant resources, turn to an idle state to wait for requests, or complete resource recycling.

[0125] The embodiments of this specification can improve the utilization efficiency of the resource pool of the serverless scheduling system, improve system availability, and shorten the response delay time of new requests by formulating a resource recovery strategy for function instances that have completed responses.

[0126] The embodiments of this specification are scheduling that occurs within the same edge resource pool, and do not expand on the discussion of splitting the functions corresponding to the same request into multiple resource pools for parallel computing. Therefore, the function instance is regarded as being able to process only a single request at the same time, and the instance will not interrupt execution.

[0127] Therefore, in the cloud-edge collaborative working scenario mentioned in the embodiments of this specification, the serverless computing function instance response scheduling strategy under the condition of limited edge resources consists of three parts:

[0128] 1) Function instance initialization strategy: When receiving a request, different methods are selected to create function instances to handle pending requests based on factors such as the matching degree between the average response time of the function and the average cold start function creation time.

[0129] 2) Function instance recycling strategy: Based on the weights calculated based on information such as function execution time and average recycling time and the urgency of scheduling, determine how to recycle resources for function instances that have completed response tasks to avoid blocking pending requests and extending response time due to waiting.

[0130] 3) Function response cloud migration strategy: Thresholds are set based on the cloud-edge resource ratio and network conditions. Requests that exceed and fall below the threshold values ​​are processed by the cloud and edge, respectively. For requests within the threshold range, the processing party is dynamically adjusted according to the rules.

[0131] This embodiment provides a computer device, whose internal structure diagram can be shown as follows: Figure 6 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection.

[0132] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0133] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0134] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0135] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0136] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0137] It should also be understood that in the embodiments of this article, the term "and / or" is only a description of the association relationship of the associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0138] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this article.

[0139] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0140] In the several embodiments provided herein, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or can be electrical, mechanical or other forms of connection.

[0141] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of this article.

[0142] Specific embodiments are used in this article to illustrate the principles and implementation methods of this article. The description of the above embodiments is only used to help understand the methods and core ideas of this article. At the same time, for general technicians in this field, according to the ideas of this article, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on this article.

Claims

1. A method for scheduling edge serverless computing responses in a cloud-edge collaboration scenario, characterized in that: A serverless computing response scheduling system for edge-cloud collaborative work, the method comprising: Determine the target function according to the function call request instruction; Determine whether the target function request waiting queue is empty and whether there is an idle function instance corresponding to the target function; If yes, the function call request instruction is sent to the target function request waiting queue to complete the function creation process; If not, when the resource pool capacity of the edge is less than the number of function instances corresponding to the target function and does not exceed the preset threshold, the function request instruction is dynamically allocated to the edge or cloud response according to the resource pool capacity and the number of requests received; When the resource pool capacity of the edge is less than the number of function instances corresponding to the target function and exceeds a preset threshold, the function call request instruction is sent to the cloud for response; When the resource pool capacity of the edge is greater than the number of function instances corresponding to the target function, the function call request instruction is responded to according to the function cold start delay, function execution time and the target function request waiting queue.

2. The method according to claim 1, characterized in that When the resource pool capacity of the edge is less than the number of function instances corresponding to the target function and does not exceed the preset threshold, the function request instruction is dynamically allocated to the edge or cloud response according to the resource pool capacity and the number of received requests, including: According to the resource pool capacity and the number of received requests, the proportion of requests to be responded to by the cloud is determined according to a dynamic allocation formula, wherein the dynamic allocation formula is: Where C is the resource pool capacity, n is the number of requests that need to be responded to by the serverless computing scheduling system in the current state, threshold is the preset threshold, which indicates the threshold value of the number of additional response requests that are not completely handed over to the cloud for processing after exceeding C, and ratio cloud It indicates the percentage of pending requests exceeding C that need to be handled by the cloud when the number of pending requests is n. Determine the requests to be responded to and processed by the edge based on the determined proportion of requests to be responded to by the cloud; According to the request processed by the edge response and the function instance set corresponding to the target function, the function instance with the longest average execution time in the function instance set is replaced with the target function corresponding to the request to be responded.

3. The method according to claim 2, characterized in that According to the request processed by the edge response and the function instance set corresponding to the target function, the function instance with the longest average execution time in the function instance set is replaced with the target function corresponding to the request to be responded, including: Determine the number of pending requests after the function is updated after cold starting a new function instance and recycling the existing function instance, expressed as: in, is the updated number of pending requests. is the average cold start delay, is the average post-idle recycling time, is the average execution time, To obtain the request r i After function f i The number of pending requests; When the updated number of pending requests is greater than zero and there is a set of function instances of idle state instances, the average execution times in the set of function instances are sorted, and the function instance with the largest average execution time is initialized for creating function instances of the updated pending requests.

4. The method according to claim 1, characterized in that: When the resource pool capacity of the edge is greater than the number of function instances corresponding to the target function, the function call request instruction is responded to according to the function cold start delay, the function execution time and the target function request waiting queue, including: Determine the number of requests to be responded to after the cold start according to the function cold start delay, the function execution time and the target function request waiting queue; When the number of pending requests after a cold start is greater than zero, a new function instance is initialized to create a function instance for the pending requests; When the number of requests to be responded to after the cold start is less than or equal to zero, the function call request instruction is added to the target function request waiting queue.

5. The method according to claim 1, characterized in that The number of pending requests after a cold start is expressed as follows: in, is the number of requests to be responded to after a cold start, |A i | is the function f i The set of existing instances A i The number of instances contained in is the average cold start delay, is the average execution time, To obtain the request r i After function f i The number of pending requests.

6. The method according to claim 1, characterized in that The method further comprises: After the function instance completes the response, the weight of the function instance that has completed the response and the weight of each function instance in the request to be responded to are calculated respectively; The weight of the function instance that has completed the response is determined as the first weight, and the minimum value among the weights of the function instances in the request to be responded to is determined as the second weight; When the first weight is greater than the second weight, the function instance corresponding to the second weight is recycled to create a new function instance; When the first weight is not greater than the second weight, it is determined whether there are any requests to be responded to in the function instance that has completed the response; If it exists, the pending request is assigned to the function instance that completes the response for processing; If it does not exist, then if there is redundancy in the resource pool, the function instance that has completed the response will be converted to an idle state to wait for requests, or the function instance that has completed the response will be recycled.

7. The method according to claim 6, characterized in that The weight of the function instance that completes the response is expressed as follows: The weight of each function instance in the pending request is expressed by the following formula:

8. The method according to claim 1, characterized in that The resource pool capacity of the edge is the capacity corresponding to the resource pool of the same edge.

9. An edge-end serverless computing response scheduling system for cloud-edge collaboration scenarios, characterized in that: The system includes: an edge, a cloud, and a scheduling module, and the scheduling module is used to execute the steps of the method as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Data processing method and device

    CN107526623A

  • Function calling method and system

    CN114816713A

  • Task function processing method and device, equipment, storage medium and program product

    CN115061791A