Strategy determination method and device

By optimizing the resource allocation and cold start strategy of the Serverless platform through a multi-objective evolutionary algorithm, the problems of cold start latency and low resource allocation efficiency are solved, and low-latency and low-cost resource management is achieved.

CN121530852APending Publication Date: 2026-02-13NEUSOFT CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511821819.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-04
Publication Date
2026-02-13

AI Technical Summary

Technical Problem

Serverless platforms face challenges such as long cold start latency for functions and low resource allocation efficiency. Existing strategies struggle to simultaneously reduce cold start latency and improve resource allocation efficiency.

Method used

A multi-objective evolutionary algorithm is used to process multiple objective optimization functions. By simulating the biological evolution process, the population is optimized, and the objective combination strategy is screened out. Combined with real-time indicator data and predicted load, the combination of resource allocation and cold start strategy is determined to meet the requirements of low latency and low resource cost of cold start.

Benefits of technology

This approach achieves the goal of reducing function resource costs, improving resource allocation efficiency, and avoiding increased cold start latency while ensuring low latency during cold starts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121530852A_ABST
    Figure CN121530852A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a strategy determination method and device. The method comprises the following steps: acquiring real-time index data and a real-time prediction load of a Serverless function; determining a plurality of target optimization functions according to the real-time index data and the real-time prediction load; the multiple target optimization functions comprise a first target function and a second target function, the first target function is used for minimizing the cold start delay of the function, and the second target function is used for minimizing the resource cost of the function; the candidate solution of each target optimization function indicates a combined strategy of a resource allocation strategy and a cold start strategy; a plurality of target optimization functions are processed by utilizing a multi-target evolutionary algorithm, and a target combination strategy is screened out from numerous candidate solutions by simulating the principle of survival of victims and inferior and continuous optimization of populations in a biological evolution process, so that the resource cost of the functions is reduced on the basis of ensuring cold start low delay of the functions; and the resource allocation efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud computing technology, and in particular to a strategy determination method and apparatus. Background Technology

[0002] Serverless functions are functions in a cloud computing service model that offer features such as pay-as-you-go billing and autoscaling, and are widely used in various scenarios. Currently, platforms running serverless functions (referred to as serverless platforms) often face issues such as long function cold start latency and low resource allocation efficiency.

[0003] To reduce function cold start latency, serverless platforms need to maintain more idle instances; however, this inevitably increases resource costs. Idle instances refer to function instances that are ready but not currently executing tasks. To improve resource allocation efficiency, the number of reserved instances is reduced, which inevitably exacerbates cold start latency. Therefore, providing a strategy for serverless platforms that reduces function cold start latency and achieves high resource allocation efficiency is a key technical problem to be solved. Summary of the Invention

[0004] This application provides a strategy determination method and apparatus for determining a strategy that has reduced function cold start latency and higher resource allocation efficiency.

[0005] In a first aspect, embodiments of this application provide a strategy determination method, the method comprising:

[0006] Obtain real-time metric data and real-time predicted load for serverless functions; the real-time metric data includes real-time resource metric data and call metric data;

[0007] Based on the real-time indicator data and the real-time predicted load, multiple objective optimization functions are determined;

[0008] The plurality of objective optimization functions include a first objective function and a second objective function, wherein the first objective function is used to minimize the cold start latency of the Serverless function, and the second objective function is used to minimize the resource cost of the Serverless function; the candidate solution of each objective optimization function indicates a combination strategy of resource allocation strategy and cold start strategy;

[0009] A multi-objective evolutionary algorithm is used to process multiple objective optimization functions to determine an objective combination strategy; the multi-objective evolutionary algorithm is used to solve the Pareto optimal solution set of multiple objective optimization functions, and the objective combination strategy is one of the Pareto optimal solution sets.

[0010] Optionally, the step of determining multiple objective optimization functions based on the real-time indicator data and the real-time predicted load includes:

[0011] Based on the real-time metric data, determine the cold start rate and average cold start latency of the Serverless function;

[0012] The first objective function is determined based on the cold start rate and the average cold start delay; the function value of the first objective function is positively correlated with the cold start rate and positively correlated with the average cold start delay.

[0013] Based on the real-time metric data, determine the computational cost, memory cost, and storage cost of the Serverless function;

[0014] The second objective function is determined based on the computation cost, the memory cost, and the storage cost; the function value of the second objective function is positively correlated with the computation cost, the memory cost, and the storage cost.

[0015] Optionally, the plurality of objective optimization functions further include a third objective function, wherein the third objective function is a function that maximizes the execution success rate of the Serverless function, and the method further includes:

[0016] Based on the real-time metric data, the timeout rate and error rate of executing the Serverless function are determined; based on the timeout rate and the error rate, the third objective function is determined; the function value of the third objective function is negatively correlated with the timeout rate and negatively correlated with the error rate.

[0017] Optionally, the multi-objective evolutionary algorithm is used to solve the Pareto optimal solution set of multiple objective optimization functions through an adaptive crossover probability mechanism; the adaptive crossover probability mechanism is used to dynamically adjust the crossover probability according to the non-dominated level of the candidate solution, and the crossover probability is negatively correlated with the level.

[0018] Optionally, the method for obtaining the real-time predicted load includes:

[0019] Based on the real-time call metric data, determine the operating mode of the Serverless function;

[0020] Based on the operating mode of the Serverless function, a corresponding prediction model is determined; the prediction model corresponds to the operating mode of the Serverless function.

[0021] Based on the corresponding prediction model, the real-time call indicator data is processed to obtain the real-time prediction load.

[0022] Optionally, the serverless function's operating mode includes at least one of the following: stable function operating mode, periodic function operating mode, burst function operating mode, and intermittent function operating mode;

[0023] The stable function running mode indicates that the load of the serverless function is less than a preset threshold; the periodic function running mode indicates that the load of the serverless function has a time periodic characteristic; the burst function running mode indicates that the load of the serverless function has a peak characteristic; the intermittent function running mode indicates that the function call interval of the serverless function is greater than a preset interval threshold.

[0024] The step of determining the corresponding prediction model based on the operating mode of the Serverless function includes:

[0025] If the Serverless function operates in a stable function mode, the prediction model is the first model; the first model indicates a model for processing stationary time series data.

[0026] If the Serverless function operates in a periodic function mode, the prediction model is a second model; the second model indicates a model that can identify and determine multi-level periodic patterns.

[0027] If the Serverless function operates in bursty mode, the prediction model is the third model; the third model indicates that the model for determining the real-time predicted load of the Serverless function is determined by combining the exponential smoothing algorithm and the real-time threshold detection mechanism, using weighted historical indicator data and the real-time indicator data.

[0028] If the Serverless function operates in an intermittent mode, the prediction model is the fourth model; the fourth model is a probability distribution model based on historical call intervals.

[0029] Optionally, the real-time call metric data includes the number of calls and call intervals within a preset time period, as statistically analyzed in real time, wherein the number of calls indicates the number of calls counted according to a preset call window;

[0030] Determining the operating mode of the Serverless function based on the real-time call metric data includes:

[0031] The coefficient of variation of the Serverless function is determined based on the number of calls within the preset time period; the coefficient of variation is the ratio of the standard deviation to the mean of the number of calls within the preset time period.

[0032] Based on the coefficient of variation, determine whether the Serverless function operates in a stable function operating mode;

[0033] Based on the number of calls within the preset time period, determine the daily, weekly, and / or monthly autocorrelation coefficients of the Serverless function.

[0034] Based on the intraday periodic autocorrelation coefficient, weekly periodic autocorrelation coefficient, and / or monthly periodic autocorrelation coefficient of the Serverless function, determine whether the operating mode of the Serverless function is the periodic function operating mode.

[0035] The peak ratio of the Serverless function is determined based on the number of calls within the preset time period; the peak ratio indicates the ratio of the maximum number of calls to the baseline number of calls within the preset time period; the baseline number of calls indicates the average number of calls within the preset time period.

[0036] Based on the peak ratio, determine whether the Serverless function is in bursty function mode.

[0037] Determine the function call interval of multiple Serverless functions within the preset time period;

[0038] Based on the function call interval, determine whether the Serverless function is an intermittent function execution mode.

[0039] Optionally, after obtaining the real-time predicted load, the method further includes:

[0040] Based on historical forecast data, determine the confidence level of the real-time forecast load;

[0041] The step of determining multiple objective optimization functions based on the real-time indicator data and the real-time predicted load includes:

[0042] If the confidence level is a high confidence level, multiple objective optimization functions are determined based on the real-time indicator data and the real-time predicted load;

[0043] If the confidence level is medium confidence level, the real-time prediction load is adjusted according to the preset safety redundancy; multiple objective optimization functions are determined based on the real-time indicator data and the adjusted real-time prediction load; the prediction accuracy of the high confidence level is higher than that of the medium confidence level.

[0044] Optionally, the method further includes:

[0045] If the confidence level is low, the conservative resource allocation strategy is determined as the target combination strategy; the prediction accuracy of the medium confidence level is higher than that of the low confidence level.

[0046] Secondly, embodiments of this application also provide a strategy determination apparatus, the apparatus comprising:

[0047] The acquisition unit is used to acquire real-time indicator data and real-time predicted load of serverless functions; the real-time indicator data includes real-time resource indicator data and call indicator data.

[0048] The first determining unit is configured to determine multiple objective optimization functions based on the real-time indicator data and the real-time predicted load; wherein the multiple objective optimization functions include a first objective function and a second objective function, the first objective function is used to minimize the cold start latency of the Serverless function, and the second objective function is used to minimize the resource cost of the Serverless function; the candidate solution of each objective optimization function indicates a combination strategy of resource allocation strategy and cold start strategy;

[0049] The second determining unit is used to process multiple objective optimization functions using a multi-objective evolutionary algorithm to determine an objective combination strategy; the multi-objective evolutionary algorithm is used to solve the Pareto optimal solution set of multiple objective optimization functions, and the objective combination strategy is one of the Pareto optimal solution sets.

[0050] Thirdly, embodiments of this application provide a computer program that, when run on a computer, causes the computer to perform the method in any of the possible implementations of any of the above aspects.

[0051] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program (also referred to as code or instructions) that, when run on a computer, causes the computer to perform the method in any of the possible implementations of any of the above aspects.

[0052] Fifthly, embodiments of this application provide a chip system including one or more processors for calling and executing instructions stored in memory, causing the methods in any of the above aspects or possible implementations to be executed. The chip system may be composed of chips or may include chips and other discrete devices.

[0053] This application provides a strategy determination method and apparatus. When executing the method, firstly, real-time indicator data and real-time predicted load of the Serverless function are acquired; the real-time indicator data includes real-time resource indicator data and call indicator data; based on the real-time indicator data and real-time predicted load, multiple objective optimization functions are determined; the multiple objective optimization functions include a first objective function and a second objective function, the first objective function being used to minimize the cold start latency of the Serverless function, and the second objective function being used to minimize the resource cost of the Serverless function; the candidate solution of each objective optimization function indicates a combination strategy of resource allocation strategy and cold start strategy; a multi-objective evolutionary algorithm is used to process the multiple objective optimization functions to determine the objective combination strategy; the multi-objective evolutionary algorithm is used to solve the Pareto optimal solution set of the multiple objective optimization functions, and the objective combination strategy is one of the Pareto optimal solutions.

[0054] In other words, this application's embodiments utilize a multi-objective evolutionary algorithm to process multiple objective optimization functions. By simulating the principle of survival of the fittest and continuous optimization of the population during biological evolution, it achieves the selection of objective combination strategies from numerous candidate solutions. Each candidate solution indicates a combination of a resource allocation strategy and a cold start strategy. This objective combination strategy can simultaneously satisfy the requirements of low latency and low resource cost for the cold start of the Serverless function. Without increasing the cold start latency of the Serverless function, it is impossible to further reduce the resource cost of the Serverless function. Therefore, based on this objective combination strategy, it is achieved to reduce the resource cost of the function and improve resource allocation efficiency while ensuring low latency for the cold start of the function. Attached Figure Description

[0055] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0056] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of this application;

[0057] Figure 2A flowchart of a strategy determination method provided in an embodiment of this application;

[0058] Figure 3 A schematic diagram of an NSGA-II multi-objective evolutionary algorithm is provided for an embodiment of this application;

[0059] Figure 4 This is a schematic diagram of the structure of a strategy determination device provided in an embodiment of this application. Detailed Implementation

[0060] To enable those skilled in the art to better understand the present application, the technical solutions in this embodiment will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0061] As mentioned earlier, serverless platforms currently often face problems such as function cold start latency and low resource allocation efficiency.

[0062] When a serverless function (hereinafter referred to as a function) is triggered for the first time after a long period of inactivity, or when an increase in concurrent requests necessitates the startup of a new instance, the serverless platform needs to perform initialization, including downloading code, starting the runtime environment, and initializing connections. This process is known as a function cold start. Function cold starts introduce latency, and excessive latency can negatively impact the user experience and overall performance of the application.

[0063] It should be noted that when a serverless platform needs to execute a function, it needs to run in an isolated and secure runtime environment, which is called an instance or execution environment.

[0064] Serverless platforms typically require developers to pre-configure static resources for functions, such as a fixed amount of memory or a proportional allocation of Central Progress Unit (CPU) resources. These static resources are difficult to adapt to the actual needs of function execution.

[0065] Currently, to reduce function cold start latency, serverless platforms may need to maintain more idle instances, which increases resource consumption. Idle instances refer to function instances that are ready but not currently executing tasks. To conserve resources, the number of reserved instances may be reduced, potentially exacerbating cold start latency. Reserved instances refer to instances that developers require the serverless platform to maintain a certain number of idle instances for functions over a long period. Therefore, providing a strategy for serverless platforms that reduces function cold start latency and has high resource allocation efficiency has become a technical problem to be solved.

[0066] In view of this, embodiments of this application provide a strategy determination method that utilizes a multi-objective evolutionary algorithm to process multiple objective optimization functions. By simulating the principle of survival of the fittest and continuous optimization of the population during biological evolution, it achieves the selection of objective combination strategies from numerous candidate solutions. Each candidate solution indicates a combination of a resource allocation strategy and a cold start strategy. This objective combination strategy can simultaneously satisfy the requirements of low latency and low resource cost for the cold start of serverless functions, and without increasing the cold start latency of serverless functions, it is impossible to further reduce the resource cost of serverless functions. Therefore, based on this objective combination strategy, it is possible to reduce the resource cost of functions and improve resource allocation efficiency while ensuring low latency for cold start.

[0067] The strategy determination method provided in the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0068] First, we will introduce the application scenarios of the embodiments of this application.

[0069] For example, Appendix Figure 1 This is a schematic diagram illustrating an application scenario provided by an embodiment of this application. For example... Figure 1 As shown, the application scenario includes a serverless platform 101 and a policy system 102 that communicates with the serverless platform 101.

[0070] In this embodiment, the Serverless platform 101 includes an Application Programming Interface (API) gateway and / or triggers (hereinafter referred to as trigger modules), a platform scheduler, and a function instance pool. The trigger modules respond to receiving user requests and send invocation requests to the platform scheduler. The platform scheduler is used to start or allocate instances from the function instance pool to execute the function corresponding to the user request.

[0071] An instance in the startup function instance pool refers to an instance that has been transformed from a non-running state to a ready state capable of handling requests, thus enabling the instance to execute functions. Instances in the startup function instance pool include, but are not limited to, cold instance startups, warm instance activations, and hot instance reuses.

[0072] Allocating an instance from the function instance pool means matching a ready instance with a user request. Instances in the function instance pool are typically matched with functions. For example, such as... Figure 1 As shown, the functions corresponding to user requests are function A and function B. An instance running function A can only handle requests for function A, and an instance running function B can only handle requests for function B. When the user request is for function A, the platform scheduler will select all instances bound to function A from the function instance pool; when the user request is for function B, the platform scheduler will select all instances bound to function B from the function instances pool and schedule the specific instance according to the scheduling policy sent by policy system 102.

[0073] The function instance pool includes hot instances, warm instances, and cold instances. A cold instance is an instance that is completely uninitialized or has not yet loaded any function code. A warm instance is a function instance that has been created but is currently idle. A hot instance is a function instance that is currently running or has recently completed one or more consecutive calls; hot instances continuously consume resources.

[0074] In this embodiment, the platform scheduler is further configured to receive scheduling policies sent by the policy system 102, and to use these policies to start or allocate instances in the function instance pool. For example, if the scheduling policy sent by the policy system 102 is: preheating instance count w=4, memory configuration m=768MB, and instance retention time t=15min, the platform scheduler will create and initialize four function instances before the user request arrives, ensuring these four function instances are in a state where they can immediately receive requests. Simultaneously, the instances in the function pool are configured to occupy 768MB of memory, and the instance retention time is set to 15 minutes. The instances will maintain their current state for 15 minutes; after this time, their state will be adjusted according to system rules.

[0075] Furthermore, the Serverless platform 101 can also adjust the ratio of hot, warm, and cold instances in the function instance pool based on the scheduling strategy of the policy system 102. For example, if it is predicted that the number of user requests will increase significantly in the future, the proportion of hot and warm instances will be increased, and the number of cold instances will be reduced, so that the response will be faster when user requests arrive.

[0076] In this embodiment, the strategy system 102 performs the following operations: acquiring real-time indicator data and real-time predicted load for functions. The real-time indicator data includes real-time resource indicator data and call indicator data. Based on the real-time indicator data and real-time predicted load, multiple objective optimization functions are determined. These multiple objective optimization functions include a first objective function and a second objective function. The first objective function is used to quantify and minimize the cold start latency of the function, and the second objective function is used to quantify and minimize the resource cost of the function. Then, a multi-objective evolutionary algorithm is used to process the multiple objective optimization functions to determine an objective combination strategy. The multi-objective evolutionary algorithm is used to solve for the Pareto optimal solution set of the multiple objective optimization functions, and the objective combination strategy is one of the Pareto optimal solutions. The strategy system 102 sends the scheduling strategy, the objective combination strategy, to the serverless platform 101.

[0077] It should be noted that the application scenarios provided in this application embodiment can also be other application scenarios, and this application embodiment is not specifically limited.

[0078] The strategy determination method provided in the embodiments of this application is described below. To facilitate a better understanding of the embodiments of this application by those skilled in the art, the following detailed description uses a strategy system as the execution subject.

[0079] Appendix Figure 2 A flowchart of a strategy determination method provided in this application embodiment is shown. The method includes the following:

[0080] S210, obtain real-time metric data and real-time predicted load for Serverless functions; real-time metric data includes real-time resource metric data and call metric data.

[0081] The call metrics data are used to indicate the call status of functions, including but not limited to function call frequency, number of calls, concurrent calls, execution time, number of cold starts, and average cold start time. Resource metrics data are used to indicate the real-time status of resources, including but not limited to real-time memory utilization and real-time CPU utilization.

[0082] These real-time metrics can fully reflect the function call status and current resource status. Using these metrics to generate scheduling strategies helps to make the scheduling strategies more in line with the actual needs of the Serverless platform, that is, it helps to improve the accuracy of the generated scheduling strategies.

[0083] In one specific implementation, the strategy system can obtain real-time function call metrics by monitoring the platform scheduler. The strategy system can also obtain real-time resource metrics by monitoring the function instance pool.

[0084] The real-time predicted load of a function refers to the function load predicted in real time for a future preset time period (e.g., the next 2 hours), including but not limited to the number of function call requests, resource consumption, and execution time.

[0085] In this embodiment, the strategy system can utilize a prediction model to process real-time function call index data to obtain real-time prediction load. The prediction model can be a time series model, such as a Long Short-Term Memory network model, or a machine learning model, such as a random forest model, etc., which is not specifically limited in this embodiment.

[0086] Furthermore, different functions have different operating modes. For example, some functions exhibit obvious periodic load characteristics, while others show obvious peak call characteristics. To improve the accuracy of prediction, the strategy system sets different prediction models for functions with different operating modes. Specifically, the strategy system first determines the function's operating mode based on real-time call indicator data; then, based on the function's operating mode, it determines the corresponding prediction model; and finally, based on the corresponding prediction model, it processes the real-time call indicator data to obtain the real-time predicted load.

[0087] In one specific implementation, the strategy system classifies the function's operating mode into four types: stable function operating mode, periodic function operating mode, burst function operating mode, and intermittent function operating mode.

[0088] A stable function execution mode indicates that the load on the function is less than a preset threshold. In one specific implementation, the strategy system can first determine the coefficient of variation of the function based on multiple call parameters within a preset time period; wherein, the number of mutations of the function is the ratio of the standard deviation to the average value of the call parameters within the preset time period; based on the coefficient of variation, it is determined whether the function's execution mode is a stable function execution mode. In this embodiment, the call parameters can be the number of calls counted within a preset call window, or the call frequency.

[0089] For example, function A is called in 5-minute windows over a 30-minute period, resulting in call counts for multiple windows: 10, 11, 9, 12, 11, 10. The average call count is 10.5, the standard deviation is 1.048, and the coefficient of variation is 0.10. If the coefficient of variation is less than a preset threshold (e.g., 0.3), the function is determined to be in a stable function execution mode. That is, function A is currently in a stable function execution mode.

[0090] A periodic function execution mode indicates that the function's load has a time-periodic characteristic. In one specific implementation, the strategy system can determine the function's intraday, weekly, and / or monthly autocorrelation coefficients based on multiple call parameters within a preset time period; and determine whether the function's execution mode is a periodic function execution mode based on these coefficients.

[0091] For example, the strategy system can employ a multi-level autocorrelation analysis method to calculate the autocorrelation coefficients for intraday, weekly, and monthly periods, respectively. The specific calculation method is shown in formula (1):

[0092] (1)

[0093] Where k is the time lag parameter, Let i be the number of times the function is called within the preset time period, specifically in the i-th time window, where i is a positive integer. This is the average number of times all preset call windows are invoked within a preset time period. The value can be any one of the following: intraday periodic autocorrelation coefficient, weekly periodic autocorrelation coefficient, or monthly periodic autocorrelation coefficient. By comparing the autocorrelation coefficients of different periods with a preset coefficient threshold (e.g., 0.6), it is determined whether the function conforms to periodic characteristics.

[0094] For example, if the preset coefficient threshold is 0.6, the number of times function F is called per hour in the past week is as follows: 15, 20, 20, 18, 18, 17, 16, ..., 15, 20, 20, 18, 18, 17, 16. Among them, the number of calls at 6 am on Monday is 15, the number of calls at 7 am on Monday is 20, ..., and the number of calls at 11 pm on Sunday is 16. The average number of calls is calculated as μ = 17.5, and the autocorrelation coefficient of the daily period R_daily(k) is calculated. Taking k=1 as an example, the correlation between the number of calls in adjacent hours is detected, and the result is R(1) = 0.5. R(1) is less than 0.6, indicating that there is no strong periodic dependence of function calls in adjacent hours. Taking k=4 as an example, the correlation between the number of calls in adjacent 4 hours is detected, and the result is R(4) = 0.8, which is greater than 0.6, indicating that there is a strong periodic dependence of function calls in adjacent 4 hours.

[0095] A bursty function execution mode indicates that the load has peak call characteristics. In one specific implementation, the strategy system determines the peak ratio of the function based on call parameters within a preset time period. For example, the peak ratio indicates the ratio of the maximum number of calls to the baseline number of calls within the preset time period; the baseline number of calls indicates the average number of calls within the preset time period. Based on the peak ratio, it is determined whether the function's execution mode is a bursty function execution mode. Here, the maximum number of calls is the highest number of calls experienced within the preset time period, representing the peak of the function load. The baseline number of calls is the average or stable number of calls to the function within the preset time period, without considering peak values.

[0096] Intermittent function execution mode indicates that the function call interval is greater than a preset interval threshold (e.g., 30 minutes). In one specific implementation, the strategy system determines the function call interval within a preset time period; based on the function call interval, it determines whether the function's execution mode is intermittent.

[0097] In this embodiment, after the strategy system determines the function's operating mode, it can determine the function's real-time predicted load based on the prediction model corresponding to the function's operating mode. Specifically, if the function's operating mode is a stable function operating mode, a first model is used to determine the function's real-time predicted load. If the function's operating mode is a periodic function operating mode, a second model is used to determine the function's real-time predicted load. If the function's operating mode is a bursty function operating mode, a third model is used to determine the function's real-time predicted load. If the function's operating mode is an intermittent function operating mode, a fourth model is used to determine the function's real-time predicted load.

[0098] The first model refers to the model that processes stationary time series data, such as the Autoregressive Integrated Moving Average (ARIMA) model.

[0099] The second model is capable of identifying and predicting multi-level cyclical patterns, including intraday cycles, interday cycles, weekly cycles, and annual seasonal variations. For example, the second model is the Prophet time series forecasting model.

[0100] The third model combines the exponential smoothing algorithm and the real-time threshold detection mechanism, using a combination of weighted historical data and real-time monitoring to determine the predictive load of the function.

[0101] For example, the strategy system first uses an exponential smoothing algorithm to weight historical call counts (e.g., hourly call counts over the past week: 80, 90, 85, 100, 95, 110, 105), with higher weights for call counts closer to the current time (e.g., 110 and 105 in the 6th and 7th hours). This calculates the base prediction value. Simultaneously, based on real-time resource metrics such as CPU utilization and memory usage, the base prediction value is adjusted to obtain the real-time predicted load. For instance, if real-time detection indicates that CPU utilization suddenly exceeds a threshold (e.g., 80%), it suggests a high load and potential traffic spikes. In this case, the predicted load can be appropriately increased based on the exponential smoothing prediction. For example, if the exponential smoothing prediction for the next hour is 115 calls, it might be adjusted to 130 calls due to a real-time threshold trigger, allowing for resource preparation in advance.

[0102] The fourth model is a probability distribution model based on historical call intervals. The fourth model uses statistical methods to predict the time window of the next call, which can improve the accuracy of the prediction.

[0103] For example, the strategy system can construct a probability distribution model based on historical call interval data. For instance, the time intervals could be 1 hour, 1.5 hours, 2 hours, 1.2 hours, 1.8 hours, etc. Based on this historical call interval data, a normal distribution or Poisson distribution can be constructed. Statistical analysis reveals that the call intervals roughly conform to a normal distribution with a mean of 1.5 hours and a standard deviation of 0.3 hours. If the function was last called at 10:00 AM, to predict the time window for the next call, the probability distribution model can calculate that the probability of a call is higher between 11:00 AM and 12:00 PM. This allows the system to predict that the next call might occur within this time window, enabling it to prepare instances in advance and ensure a rapid response when a call occurs.

[0104] Furthermore, after obtaining the real-time predicted load of the function, the strategy system determines the confidence level of the real-time predicted load based on historical prediction data, and adjusts the real-time predicted load according to the confidence level, using the adjusted real-time predicted load as the real-time predicted load for subsequent processing.

[0105] Specifically, in this embodiment, if the confidence level is high, the prediction load output by the prediction model is used as the real-time prediction load; if the confidence level is medium, the prediction load output by the prediction model is adjusted according to a preset safety redundancy, and the adjusted prediction load is used as the real-time prediction load. For example, if the real-time prediction load of the function is medium confidence, a safety redundancy can be added to the prediction result output by the prediction model to improve prediction accuracy. For example, the safety redundancy can be any value between 10% and 20%.

[0106] Furthermore, if the confidence level is low, a conservative resource allocation strategy is determined as the target combination strategy. This conservative resource allocation strategy refers to an over-provisioning approach that reserves more resources to account for predictive uncertainty, ensuring the system remains stable even in extreme conditions. For example, if the prediction indicates a potential 100 concurrent requests, a conservative resource allocation strategy might allocate resources based on a scale of 150-200 concurrent requests.

[0107] Specifically, the prediction accuracy of a high confidence level is higher than that of a medium confidence level, and the prediction accuracy of a medium confidence level is higher than that of a low confidence level. For example, a high confidence level indicates a prediction accuracy of ≥85%, a medium confidence level indicates a prediction accuracy of ≤85% and ≥60%, and a low confidence level indicates a prediction accuracy of ≤60%.

[0108] In addition, the strategy system can determine the confidence level by constructing a confidence interval formula, which can be found in formula (2):

[0109] (2)

[0110] in, The confidence interval represents the range of confidence for the prediction result at time t. For predicted values, Let z be the standard deviation of the prediction error, and z be the confidence coefficient, corresponding to the statistical critical value for different confidence levels. For example, for a predicted value P(t), say, 100 calls will be made in the next hour. The strategy system statistically analyzes past prediction errors and calculates the standard deviation of the prediction error. Among them, standard deviation The larger the value, the worse the prediction accuracy. A confidence level is determined, for example, 90% or 95%. The confidence coefficient z corresponds to this confidence level; for example, z is 1.64 for a confidence level of 90% and 1.96 for a confidence level of 95%. Using formula (2), the confidence interval [70, 130] is obtained. This means that, based on the historical error rule, there is a 90% to 95% probability that the true value falls within this range.

[0111] As an example, the strategy system first acquires historical prediction data. For instance, the historical prediction data might be: prediction time 09:00; predicted value 100 times / hour; actual value 95 times / hour; prediction error... Data is collected continuously for N periods, where N is a positive integer. The strategy system calculates the hit rate of historical predictions. For example, if the actual value falls within the confidence interval 87 times out of the past 100 predictions, the confidence level is 87%.

[0112] S220 determines multiple objective optimization functions based on real-time indicator data and real-time predicted load.

[0113] The multiple objective optimization functions include a first objective function and a second objective function. The first objective function is used to minimize the cold start latency of the Serverless function, and the second objective function is used to minimize the resource cost of the Serverless function. The candidate solutions of each objective optimization function indicate a combination strategy of resource allocation strategy and cold start strategy.

[0114] In this embodiment, the strategy system is used to determine multiple objective optimization functions based on real-time indicator data and real-time predicted load. Specifically, the strategy system determines the cold start rate and average cold start latency of the function based on the real-time indicator data; and determines a first objective function based on the cold start rate and average cold start latency; the function value of the first objective function is positively correlated with the cold start rate and positively correlated with the average cold start latency.

[0115] In one specific implementation, the function value of the first objective function is shown in formula (3):

[0116] (3)

[0117] in, Let X be the function value of the first objective function corresponding to the candidate solution X, indicating the cold start delay time of the candidate solution X. Let CS_latency be the cold start rate of the function in candidate solution X, and CS_latency be the average cold start latency of the function in candidate solution X. As the first weight value, The second weight value indicates the impact of the cold start rate and the average cold start latency of the function, respectively. Where X = [w, m, t], w is the number of warmed-up instances, m is the memory configuration, and t is the instance hold-up time.

[0118] For example, , (That is, 20% of requests encounter a cold start). .

[0119] The strategy system determines the computational cost, memory cost, and storage cost of the function based on real-time indicator data; based on the computational cost, memory cost, and storage cost, it determines the second objective function; the second objective function is positively correlated with the computational cost, memory cost, and storage cost.

[0120] In one specific implementation, the function value of the second objective function is shown in formula (4):

[0121] (4)

[0122] in, This represents the function value of the second objective function corresponding to candidate solution X, indicating the total resources consumed. C_compute is the computational cost of the function under candidate solution X, C_memory is the memory cost of the function under candidate solution X, and C_storage is the storage cost of the function under candidate solution X. As the third weight value, It is the fourth weight value. This is the fifth weight value. In one example, to improve computational accuracy, computational cost, storage cost, and memory cost all need to be standardized.

[0123] Example calculation: (Computational cost of preheating 3 instances). , , ,but .

[0124] In addition, the multiple objective optimization functions also include a third objective function, which is to maximize the success rate of the Serverless function. Specifically, the policy system determines the timeout rate and error rate of executing the Serverless function based on real-time metric data; based on the timeout rate and error rate, it determines the third objective function; the third objective function is negatively correlated with both the timeout rate and the error rate.

[0125] In one specific implementation, the third objective function is shown in formula (5):

[0126] (5)

[0127] This represents the function value of the third objective function corresponding to candidate solution X, indicating the success rate of candidate solution X. Timeout_rate is the timeout rate of the function on candidate solution X. Let X be the error rate of the function in the candidate solution X. It is the sixth weight. It is assigned the seventh weight. To improve calculation accuracy, the timeout rate and error rate are standardized.

[0128] For example, , .

[0129] By considering a third objective function, we can ensure that the acquired strategy reduces function timeouts and execution errors, thus guaranteeing service stability.

[0130] Multiple objective optimization functions may also include minimizing reserved instance data, minimizing resource configuration, etc., which are not specifically limited in the embodiments of this application.

[0131] S230 utilizes a multi-objective evolutionary algorithm to process multiple objective optimization functions and determine the objective combination strategy.

[0132] Multi-objective evolutionary algorithms are used to find Pareto optimal solutions for multiple objective optimization functions, where the objective combination strategy is one of the Pareto optimal solutions.

[0133] In one specific implementation, a multi-objective evolutionary algorithm is used to find the Pareto optimal solution set of multiple objective optimization functions through an adaptive crossover probability mechanism. This adaptive crossover probability mechanism dynamically adjusts the crossover probability based on the non-dominated level of candidate solutions, with the crossover probability negatively correlated with the level. By using this mechanism, lower crossover probabilities can be applied to solutions to preserve their characteristics, while higher crossover probabilities can be applied to ordinary solutions to explore improvement potential. This approach helps to obtain strategies that better meet the actual needs of the platform.

[0134] In one example, the multi-objective evolutionary algorithm can be a genetic algorithm (NSGA-II) multi-objective evolutionary algorithm. For example, the following section, in conjunction with the appendix... Figure 3 Introducing the NSGA-II multi-objective evolutionary algorithm.

[0135] Appendix Figure 3 This diagram illustrates an NSGA-II multi-objective evolutionary algorithm provided in an embodiment of this application. Figure 3 As shown, it specifically includes:

[0136] S3100, initialize population P(0).

[0137] In this embodiment, the strategy system first generates N candidate solutions X as an initial population P(0). These candidate solutions X represent combined strategies with different cold-start strategies and resource allocation combinations. Each candidate solution is a decision vector. .

[0138] For example, the candidate solutions generated during population initialization include three solutions: solution A, solution B, solution C, solution D, solution E, solution F, solution H, solution F ... Solution B And solve C, .

[0139] S3101, iterative evolution process.

[0140] The iterative evolution process specifically includes:

[0141] S3101-1: Calculate the objective function value for each candidate solution. Specifically, for each candidate solution in the current population, calculate the corresponding function value according to the set multi-objective optimization function.

[0142] For example, continuing with the above embodiment, the objective function values ​​of solution A can be calculated as follows: as well as The objective function value of solution B is as well as The objective function value of solution C is as well as .

[0143] S3101-2: Non-dominated sorting, obtaining each level (Front).

[0144] Specifically, a non-dominated ranking is performed based on the objective function value of each candidate solution. This non-dominated ranking determines whether a candidate solution is dominated by other candidate solutions. If a candidate solution is no worse than another candidate solution on all objectives and is better than another candidate solution on at least one objective, then this candidate solution dominates the other candidate solution. Through comparison, the candidate solutions in the population are divided into different levels, with the candidate solutions in the first level being the non-dominated candidate solutions.

[0145] For example, continuing with the above embodiment, through non-dominated sorting, it is found that solutions A, B and C are all located in the first layer, that is, they do not dominate each other.

[0146] S3101-3: Calculate crowding distance.

[0147] Specifically, for each candidate solution in a layer, the crowding distance is determined by calculating the distance between the candidate solution and its neighboring candidate solutions in the same layer at each objective function value. Simply put, in a certain layer, if the candidate solutions around a candidate solution are relatively sparse, its crowding distance is large, meaning that it contributes more to the diversity of this group; conversely, if the surrounding solutions are very dense, the crowding distance is small.

[0148] S3101-4: Construct a mating pool.

[0149] Specifically, based on the previously obtained non-dominated ranking results and crowding distance, a subset of solutions is selected from the current population to construct a mating pool. In this embodiment, candidate solutions at lower levels (i.e., higher quality levels) can be selected because they are relatively better in multi-objectives; for candidate solutions at the same level, those with larger crowding distances are preferred to ensure diversity.

[0150] S3101-5: An adaptive crossover probability mechanism that adjusts the crossover probability based on the hierarchy of candidate solutions.

[0151] Specifically, based on the non-dominated level where the candidate solution is located. To dynamically adjust its probability of participating in crossover operations The specific calculation formula is shown in formula (6):

[0152] (6)

[0153] For example, if a minimum crossover probability is set... (Used to protect excellent solutions from excessive crossover that could destroy desirable features), maximum crossover probability (This encourages ordinary solutions to have more opportunities to participate in cross-referencing, exploring room for improvement) and adjusting parameters. (Controlling the rate of increase of probability with each level). Then the probability of an individual in level 1 participating in the crossover operation... The probability of individuals in the second layer participating in the crossover operation The probability of individuals in the third layer participating in the crossover operation. The probability of individuals in the 4th layer participating in the crossover operation .

[0154] This means that individuals at lower levels (such as level 1) participate in crossover with a lower probability, retaining their superior characteristics; while for individuals at higher levels (such as level 4), the crossover probability increases to approximately 0.85, giving them more opportunities to improve themselves through crossover. In other words, this ensures that while maintaining excellent solutions, better combinations of function configurations are continuously explored.

[0155] S3101-6: Perform a constraint-aware mutation operation to generate the offspring population Q(t).

[0156] The mutation operation involves randomly altering some genes (configuration parameters such as w, m, and t) of the "parent" individual to generate new "offspring" individuals. However, this mutation operation must ensure that the generated offspring solutions meet constraints such as platform resource limitations, budget constraints, and service level requirements. For example, if the platform specifies an upper limit for memory configuration m, the new m value generated during mutation cannot exceed this upper limit to avoid generating invalid solutions that do not meet practical requirements. Through this constraint-aware mutation, the offspring population Q(t) is generated.

[0157] S3101-7: Merge the parent and offspring generations to obtain a new population R(t).

[0158] Right now, S3101-8: Select the N optimal solutions from R(t) as P(t+1).

[0159] Specifically, the merged population R(t) is processed again based on non-dominated sorting and crowding distance, and N (the initially set population size) optimal solutions are selected as the next generation population P(t+1). Similarly, solutions at lower levels with larger crowding distances are preferred, thus ensuring that the population continuously evolves towards the Pareto optimal solution set while maintaining the stability of the population size.

[0160] S3101-9: Check convergence conditions.

[0161] Specifically, it is determined whether the preset convergence condition is met. If it is met, the solutions in the final population P(t) constitute the Pareto optimal solution set. That is, under the trade-off of multiple objective functions, there is no solution set that is better than other solutions in all objectives.

[0162] The convergence condition can be reaching the set maximum number of iterations, or the solution in the population showing no significant improvement over several consecutive generations. If the convergence condition is met, the iteration stops; otherwise, the next round of iterative evolution continues.

[0163] Furthermore, since the Pareto optimal solution set can include multiple candidate solutions, the policy system can obtain a target combination policy from these candidate solutions based on preset preferences. These preset preferences may include prioritizing low latency or prioritizing resource cost control.

[0164] In this embodiment of the application, after the policy system obtains the target combination policy, it converts the policy into Serverless platform operation instructions. For example, it may adjust the function's pre-configured concurrency or preheat the instance pool size, call the platform API to dynamically adjust the function's memory configuration, or adjust the instance reclamation policy (e.g., extend the lifespan of idle instances). The Serverless platform executes the corresponding actions based on these operation instructions.

[0165] To enable those skilled in the art to better understand the embodiments of this application, the following uses the order processing function of an e-commerce platform as an example, specifically illustrating the order processing function of an e-commerce platform during the Double Eleven period.

[0166] Step 1: The strategy system monitors real-time indicator data.

[0167] In this embodiment of the application, the real-time indicator data includes historical call data for 7 days: 100 calls per hour on normal days, reaching 500 calls per hour from 10 am to 12 pm; cold start rate: currently 25%, with an average cold start latency of 1200ms; resource usage: average memory usage of 400MB, CPU utilization of 60%; error rate: 2% (mainly timeout errors).

[0168] Step 2: Determine the function's execution mode.

[0169] The coefficient of variation (coefficient of variation = standard deviation / mean) is calculated to be 150 / 250 = 0.6, which is greater than 0.3. Therefore, the function's operating model is determined to be an unstable function operating mode. The peak value ratio (peak value / baseline value) is calculated to be 500 / 100 = 5, which determines that the function's operating mode is a bursty function operating mode.

[0170] Step 3: Determine the real-time predicted load of the function.

[0171] The strategy system uses an exponential smoothing algorithm and real-time threshold detection to determine the function's load for the next two hours: 600 calls are expected in the first hour and 800 calls in the second hour. The prediction confidence level is set at 78% (medium confidence). Since a 78% confidence level falls within the medium confidence prediction range (60%-85%), a 10-20% safety redundancy needs to be added to the prediction. The adjusted prediction is: 600 × (1 + 15%) = 690 calls in the first hour; 800 × (1 + 15%) = 920 calls in the second hour.

[0172] Step 4: The strategy system determines the target resource allocation strategy based on real-time indicator data and real-time predicted load, combined with a multi-objective optimization algorithm.

[0173] For example, based on the three objective functions (as shown in Equations (3) to (5)), and based on the current configuration Calculate the objective function value. (Cold starts have a significant impact) (Lower cost) (Success rate is acceptable).

[0174] Step 5: Using the NSGA-II multi-objective optimization algorithm, after multiple generations of evolution, a Pareto optimal solution set is generated, where: solution A is... The corresponding objective function values ​​are as follows: (Impact of low-temperature start-up) (Medium cost) (High success rate); Solution B is Its corresponding objective function value is (Lower cold start impact) (Lower cost) (Very high success rate); Solution C is , (Extremely low cold start impact) (High cost) (Extremely high success rate).

[0175] Step 6, determine business priorities. Currently, it's two hours before Double Eleven, a critical business period. User experience is a high priority; therefore, minimizing cold starts is more important than controlling costs. Weighting: W (Latency) = 0.5, W (Cost) = 0.2, W (Performance) = 0.3.

[0176] Step 7: Determine the score of each candidate solution according to the business priority, and determine the target combination strategy based on the score of each candidate solution.

[0177] The score for each candidate solution is a quantitative indicator that comprehensively reflects the overall merits of each candidate solution under the current business priority. It is based on pre-defined different objectives (such as latency, cost, and performance), each corresponding to a specific function. The results are calculated based on the weights assigned to these objectives.

[0178] In this embodiment of the application, the score of each candidate solution can be obtained using formula (7):

[0179] (7)

[0180] For example, continuing with the above embodiment, solution A scores 0.839, solution B scores 0.854, and solution C scores 0.784. Therefore, solution B can be selected as the target combination strategy. That is, the serverless platform can call the platform API gateway to preheat four function instances, adjust the memory configuration from 512MB to 768MB, set the instance hold time to 15 minutes, and start real-time monitoring to prepare for peak loads.

[0181] Results have verified that, based on the strategy provided in this application, starting or allocating instances from the function instance pool can reduce the cold start rate, average response time and resource cost, as well as the timeout error rate.

[0182] In summary, this application's embodiments utilize a multi-objective evolutionary algorithm to process multiple objective optimization functions, simulating the principle of survival of the fittest and continuous optimization of the population during biological evolution. This achieves the effect of selecting a combination strategy from numerous candidate solutions. Each candidate solution indicates a combination of a resource allocation strategy and a cold start strategy. This objective combination strategy can simultaneously satisfy the requirements of low latency and low resource cost for the cold start of the Serverless function. Without increasing the cold start latency of the Serverless function, it is impossible to further reduce the resource cost. Therefore, based on this objective combination strategy, it is possible to reduce the resource cost of the function and improve resource allocation efficiency while ensuring low latency for the cold start.

[0183] Furthermore, embodiments of this application also provide a strategy determination apparatus. (Appendix) Figure 4 This application provides a schematic diagram of a strategy determination device according to an embodiment of the present application. The device 400 includes:

[0184] The acquisition unit 401 is used to acquire real-time indicator data and real-time predicted load of the serverless function; the real-time indicator data includes real-time resource indicator data and call indicator data.

[0185] The first determining unit 402 is used to determine multiple objective optimization functions based on real-time indicator data and real-time predicted load; wherein, the multiple objective optimization functions include a first objective function and a second objective function, the first objective function is used to minimize the cold start latency of the Serverless function, and the second objective function is used to minimize the resource cost function of the Serverless function; the candidate solution of each objective optimization function indicates a combination strategy of resource allocation strategy and cold start strategy;

[0186] The second determining unit 403 is used to process multiple objective optimization functions using a multi-objective evolutionary algorithm to determine the objective combination strategy; the multi-objective evolutionary algorithm is used to solve the Pareto optimal solution set of multiple objective optimization functions, and one of the Pareto optimal solution sets of the objective combination strategy.

[0187] Optionally, the first determining unit 402 is specifically used to: determine the cold start rate of the Serverless function and the average cold start latency of the Serverless function based on real-time indicator data; determine a first objective function based on the cold start rate and the average cold start latency; the function value of the first objective function is positively correlated with the cold start rate and positively correlated with the average cold start latency;

[0188] Based on real-time metric data, determine the computational cost, memory cost, and storage cost of the Serverless function; based on the computational cost, memory cost, and storage cost, determine the second objective function; the function value of the second objective function is positively correlated with the computational cost, memory cost, and storage cost.

[0189] Optionally, the multiple objective optimization functions also include a third objective function, which is a function that maximizes the execution success rate of the Serverless function. The first determining unit 402 is further used for:

[0190] Based on real-time metric data, determine the timeout rate and error rate of executing Serverless functions; based on the timeout rate and error rate, determine the third objective function; the function value of the third objective function is negatively correlated with the timeout rate and negatively correlated with the error rate.

[0191] Optionally, the multi-objective evolutionary algorithm is used to solve the Pareto optimal solution set of multiple objective optimization functions through an adaptive crossover probability mechanism; the adaptive crossover probability mechanism is used to dynamically adjust the crossover probability according to the non-dominated level of the candidate solution, and the crossover probability is negatively correlated with the level.

[0192] Optionally, the acquisition unit 401 is specifically used for:

[0193] Determine the operating mode of the Serverless function based on real-time call metric data;

[0194] Based on the operating mode of the Serverless function, determine the corresponding prediction model; the prediction model corresponds to the operating mode of the Serverless function.

[0195] Based on the corresponding prediction model, the real-time call indicator data is processed to obtain the real-time prediction load.

[0196] Optionally, the serverless function's operating mode includes at least one of the following: stable function operating mode, periodic function operating mode, burst function operating mode, and intermittent function operating mode;

[0197] Stable function execution mode indicates that the load on the serverless function is less than a preset threshold; periodic function execution mode indicates that the load on the serverless function has a time periodic characteristic; bursty function execution mode indicates that the load on the serverless function has a peak characteristic; intermittent function execution mode indicates that the function call interval of the serverless function is greater than a preset interval threshold.

[0198] The second determining unit 403 is also used for:

[0199] If the Serverless function operates in a stable mode, the prediction model is the first model; the first model indicates the model for processing stationary time series data.

[0200] If the Serverless function operates in a periodic function mode, the prediction model is the second model; the second model indicates a model that can identify and determine multi-level periodic patterns.

[0201] If the Serverless function operates in bursty mode, the prediction model is the third model. The third model refers to the model that determines the real-time predicted load of the Serverless function by combining the exponential smoothing algorithm and the real-time threshold detection mechanism, using weighted historical and real-time indicator data.

[0202] If the Serverless function operates in an intermittent mode, the prediction model is the fourth model; the fourth model is a probability distribution model based on historical call intervals.

[0203] Optionally, the real-time call metric data includes the number of calls and call intervals within a preset time period, with the call count indicating the number of calls counted according to a preset call window;

[0204] Based on real-time call metric data, determine the operating mode of the Serverless function, including:

[0205] The coefficient of variation of the Serverless function is determined based on the number of calls within a preset time period; the coefficient of variation is the ratio of the standard deviation to the mean of the number of calls within the preset time period.

[0206] Based on the coefficient of variation, determine whether the Serverless function operates in a stable function mode.

[0207] Based on the number of calls within a preset time period, determine the daily, weekly, and / or monthly autocorrelation coefficients of the Serverless function.

[0208] Based on the intraday, weekly, and / or monthly autocorrelation coefficients of the Serverless function, determine whether the Serverless function operates in a periodic function mode.

[0209] The peak ratio of the Serverless function is determined based on the number of calls within a preset time period; the peak ratio indicates the ratio of the maximum number of calls to the baseline number of calls within the preset time period; the baseline number of calls indicates the average number of calls within the preset time period.

[0210] Based on the peak ratio, determine whether the Serverless function is running in bursty mode.

[0211] Determine the function call interval for multiple Serverless functions within a preset time period;

[0212] Based on the function call interval, determine whether the Serverless function runs in an intermittent function running mode.

[0213] Optionally, the device 400 further includes a confidence determination unit for:

[0214] Based on historical forecast data, determine the confidence level of the real-time forecast load;

[0215] Based on real-time metric data and real-time predicted load, several objective optimization functions are determined, including:

[0216] If the confidence level is high, multiple objective optimization functions are determined based on real-time indicator data and the adjusted real-time predicted load;

[0217] If the confidence level is medium confidence level, the real-time prediction load is adjusted according to the preset safety redundancy; multiple objective optimization functions are determined based on real-time indicator data and the adjusted real-time prediction load; the prediction accuracy of the high confidence level is higher than that of the medium confidence level.

[0218] Optionally, the second determining unit 402 is further configured to:

[0219] If the confidence level is low, the conservative resource allocation strategy will be determined as the target combination strategy; the prediction accuracy of the medium confidence level is higher than that of the low confidence level.

[0220] In summary, the apparatus provided in this application can process multiple objective optimization functions using a multi-objective evolutionary algorithm, simulating the principle of survival of the fittest and continuous optimization of the population during biological evolution, thus achieving the effect of selecting a target combination strategy from numerous candidate solutions. Each candidate solution indicates a combination strategy of resource allocation and cold start. This target combination strategy can simultaneously satisfy the requirements of low latency and low resource cost for the cold start of the Serverless function, and without increasing the cold start latency, it is impossible to further reduce the resource cost of the Serverless function. Therefore, based on this target combination strategy, it is possible to reduce the resource cost of the function and improve resource allocation efficiency while ensuring low latency for the cold start.

[0221] According to the method provided in the embodiments of this application, this application also provides a chip system, which includes one or more processors for calling and executing instructions stored in memory, thereby causing the method described in the embodiments of this application to be executed. The chip system may be composed of chips or may include chips and other discrete devices.

[0222] The chip system may include input circuits or interfaces for transmitting information or data, and output circuits or interfaces for receiving information or data.

[0223] According to the method provided in the embodiments of this application, this application also provides a computer program product, which includes: computer program code, which, when run on a computer, causes the computer to execute the various steps or processes executed by the network device or terminal device in any of the foregoing method embodiments.

[0224] According to the method provided in the embodiments of this application, this application also provides a computer-readable storage medium storing program code, which, when run on a computer, causes the computer to execute the various steps or processes executed by the network device or terminal device in any of the foregoing method embodiments.

[0225] The computer-readable storage medium may be the aforementioned volatile memory or non-volatile memory, or it may include both volatile memory and non-volatile memory.

[0226] In the embodiments of this application, the terms and English abbreviations are exemplary examples given for ease of description and should not be construed as limiting the application in any way. This application does not preclude the possibility of defining other terms that can achieve the same or similar functions in existing or future agreements.

[0227] In the embodiments of this application, the terms and English abbreviations are exemplary examples given for ease of description and should not be construed as limiting the application in any way. This application does not preclude the possibility of defining other terms that can achieve the same or similar functions in existing or future agreements.

[0228] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When these computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated.

[0229] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

Claims

1. A strategy determination method, characterized in that, The method includes: Obtain real-time metric data and real-time predicted load for serverless functions; the real-time metric data includes real-time resource metric data and call metric data; Based on the real-time indicator data and the real-time predicted load, multiple objective optimization functions are determined; The plurality of objective optimization functions include a first objective function and a second objective function, wherein the first objective function is used to minimize the cold start latency of the Serverless function, and the second objective function is used to minimize the resource cost of the Serverless function; the candidate solution of each objective optimization function indicates a combination strategy of resource allocation strategy and cold start strategy; A multi-objective evolutionary algorithm is used to process multiple objective optimization functions to determine an objective combination strategy; the multi-objective evolutionary algorithm is used to solve the Pareto optimal solution set of multiple objective optimization functions, and the objective combination strategy is one of the Pareto optimal solution sets.

2. The determination method according to claim 1, characterized in that, The step of determining multiple objective optimization functions based on the real-time indicator data and the real-time predicted load includes: Based on the real-time metric data, determine the cold start rate and average cold start latency of the Serverless function; The first objective function is determined based on the cold start rate and the average cold start delay; the function value of the first objective function is positively correlated with the cold start rate and positively correlated with the average cold start delay. Based on the real-time metric data, determine the computational cost, memory cost, and storage cost of the Serverless function; The second objective function is determined based on the computation cost, the memory cost, and the storage cost; the function value of the second objective function is positively correlated with the computation cost, the memory cost, and the storage cost.

3. The determination method according to claim 2, characterized in that, The multiple objective optimization functions also include a third objective function, which is a function that maximizes the execution success rate of the Serverless function. The method further includes: Based on the real-time metric data, the timeout rate and error rate of executing the Serverless function are determined; based on the timeout rate and the error rate, the third objective function is determined; the function value of the third objective function is negatively correlated with the timeout rate and negatively correlated with the error rate.

4. The determination method according to claim 1, characterized in that, The multi-objective evolutionary algorithm is used to solve the Pareto optimal solution set of multiple objective optimization functions through an adaptive crossover probability mechanism; the adaptive crossover probability mechanism is used to dynamically adjust the crossover probability according to the non-dominated level of the candidate solution, and the crossover probability is negatively correlated with the level.

5. The determination method according to claim 1, characterized in that, The method for obtaining the real-time predicted load includes: Based on the real-time call metric data, determine the operating mode of the Serverless function; Based on the operating mode of the Serverless function, a corresponding prediction model is determined; the prediction model corresponds to the operating mode of the Serverless function. Based on the corresponding prediction model, the real-time call indicator data is processed to obtain the real-time prediction load.

6. The determination method according to claim 5, characterized in that, The serverless function's operating modes include at least one of the following: stable function operating mode, periodic function operating mode, burst function operating mode, and intermittent function operating mode; The stable function running mode indicates that the load of the serverless function is less than a preset threshold; the periodic function running mode indicates that the load of the serverless function has a time periodic characteristic; the burst function running mode indicates that the load of the serverless function has a peak characteristic; the intermittent function running mode indicates that the function call interval of the serverless function is greater than a preset interval threshold. The step of determining the corresponding prediction model based on the operating mode of the Serverless function includes: If the Serverless function operates in a stable function mode, the prediction model is the first model; the first model indicates a model for processing stationary time series data. If the Serverless function operates in a periodic function mode, the prediction model is a second model; the second model indicates a model that can identify and determine multi-level periodic patterns. If the Serverless function operates in bursty mode, the prediction model is the third model; the third model indicates that the model for determining the real-time predicted load of the Serverless function is determined by combining the exponential smoothing algorithm and the real-time threshold detection mechanism, using weighted historical indicator data and the real-time indicator data. If the Serverless function operates in an intermittent mode, the prediction model is the fourth model; the fourth model is a probability distribution model based on historical call intervals.

7. The determination method according to claim 6, characterized in that, The real-time call metric data includes the number of calls and call intervals within a preset time period, which are statistically analyzed in real time. The number of calls indicates the number of calls counted according to a preset call window. Determining the operating mode of the Serverless function based on the real-time call metric data includes: The coefficient of variation of the Serverless function is determined based on the number of calls within the preset time period; the coefficient of variation is the ratio of the standard deviation to the mean of the number of calls within the preset time period. Based on the coefficient of variation, determine whether the Serverless function operates in a stable function operating mode; Based on the number of calls within the preset time period, determine the daily, weekly, and / or monthly autocorrelation coefficients of the Serverless function. Based on the intraday periodic autocorrelation coefficient, weekly periodic autocorrelation coefficient, and / or monthly periodic autocorrelation coefficient of the Serverless function, determine whether the operating mode of the Serverless function is the periodic function operating mode. The peak ratio of the Serverless function is determined based on the number of calls within the preset time period; the peak ratio indicates the ratio of the maximum number of calls to the baseline number of calls within the preset time period; the baseline number of calls indicates the average number of calls within the preset time period. Based on the peak ratio, determine whether the Serverless function is in bursty function mode. Determine the function call interval of multiple Serverless functions within the preset time period; Based on the function call interval, determine whether the Serverless function is an intermittent function execution mode.

8. The determination method according to claim 4, characterized in that, After obtaining the real-time predicted load, the method further includes: Based on historical forecast data, determine the confidence level of the real-time forecast load; The step of determining multiple objective optimization functions based on the real-time indicator data and the real-time predicted load includes: If the confidence level is a high confidence level, multiple objective optimization functions are determined based on the real-time indicator data and the real-time predicted load; If the confidence level is medium confidence level, the real-time prediction load is adjusted according to the preset safety redundancy; multiple objective optimization functions are determined based on the real-time indicator data and the adjusted real-time prediction load; the prediction accuracy of the high confidence level is higher than that of the medium confidence level.

9. The determining method according to claim 8, characterized in that, The method further includes: If the confidence level is low, the conservative resource allocation strategy is determined as the target combination strategy; the prediction accuracy of the medium confidence level is higher than that of the low confidence level.

10. A strategy determination device, characterized in that, The device includes: The acquisition unit is used to acquire real-time indicator data and real-time predicted load of serverless functions; the real-time indicator data includes real-time resource indicator data and call indicator data. The first determining unit is configured to determine multiple objective optimization functions based on the real-time indicator data and the real-time predicted load; wherein the multiple objective optimization functions include a first objective function and a second objective function, the first objective function is used to minimize the cold start latency of the Serverless function, and the second objective function is used to minimize the resource cost of the Serverless function; the candidate solution of each objective optimization function indicates a combination strategy of resource allocation strategy and cold start strategy; The second determining unit is used to process multiple objective optimization functions using a multi-objective evolutionary algorithm to determine an objective combination strategy; the multi-objective evolutionary algorithm is used to solve the Pareto optimal solution set of multiple objective optimization functions, and the objective combination strategy is one of the Pareto optimal solution sets.