A function cold start optimization method for service-unaware computing systems
By optimizing the cold start of cloud computing system functions through load prediction models and causal convolutional neural networks, the problems of insufficient prediction accuracy and resource waste of low-frequency functions are solved, a more accurate preheating and keep-alive strategy is implemented, the number of cold starts is reduced, and user satisfaction is improved.
Patent Information
- Application Number
- CN202411552021.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2044-11-01
AI Technical Summary
The cold start problem of functions in cloud computing systems causes startup delays and resource waste, especially the insufficient prediction accuracy of functions called at low frequencies, resulting in weak learning ability of existing models and difficulty in formulating appropriate warm-up and keep-alive strategies.
Data enhancement and expansion are performed through the load prediction model, and causal convolutional neural networks are used for prediction. The scoring model and cost model are combined to optimize the function preheating and keep-alive strategies. Function preheating and container release are selectively performed to improve prediction accuracy and resource utilization efficiency.
Reduce the number of function cold starts, improve the satisfaction of function owners, optimize resource utilization, avoid high-frequency function cold starts and sparse functions that remain unresponsive for a long time, and improve system performance and user satisfaction.
Smart Images

Figure CN119440666B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field related to service-unaware computing systems, and more specifically, relates to a function cold start optimization method for service-unaware computing systems. Background Art
[0002] Cloud computing provides users with the illusion of infinitely scalable remote servers. Service-agnostic computing, a form of cloud computing, allows programmers to provide services to users through customized cloud functions. These cloud functions are used to execute cloud tasks initiated by users through cloud applications. However, limited cloud system resources only support the concurrent execution of some cloud functions. When a function on a service-agnostic platform is called for the first time or after a period of inactivity, it may experience a startup delay significantly longer than its execution time because executing the target function requires preparing an isolated function container and the required configuration files. This situation is known as the cold start problem.
[0003] To address this issue, strategies for initial environment preparation before function execution are generally categorized into two types: preheating and keepalive. Preheating-based approaches typically predict function call information and prepare the required service-agnostic computing system resources in advance. Keepalive-based approaches determine the lifetime of a function container by considering function call information and available service-agnostic computing system resources.
[0004] It's worth noting that functions in service-agnostic computing systems typically share two characteristics: first, most functions are called relatively infrequently, yet each function has a corresponding owner; second, the cumulative number of calls to these infrequent functions constitutes a significant portion of the overall call volume. Therefore, reducing the number of cold starts for infrequently called functions can not only improve the performance of the target system but also increase the satisfaction of function owners.
[0005] Taking Microsoft's production environment based on a real-world, service-agnostic computing platform as an example, before a function executes, its code, including user code and related library files, must be loaded into memory. Therefore, if all this code and files are already loaded into memory, the function will start quickly. Conversely, if the function needs to be loaded from persistent storage, it will take a long time to load and start. This situation is known as the cold start problem.
[0006] On the other hand, Azure Functions, the functions and service workloads provided by Microsoft, have the following characteristics: over 50% and 90% of the functions are called no more than 31 and 1,554 times per day, respectively. Therefore, loading all the related code and library files of all functions into memory would result in a significant waste of resources.
[0007] To balance the resource overhead of service-agnostic computing systems with user satisfaction and alleviate cold start issues, industry and academia primarily develop warm-up plans based on statistics or traditional machine learning techniques, or develop keep-alive strategies for function containers using and improving cache replacement algorithms. However, infrequently called functions generate little call data over long periods of time, resulting in weak learning capabilities for existing models. This poses a challenge in developing appropriate warm-up and keep-alive strategies for these infrequently called functions. Summary of the Invention
[0008] In response to the above defects or improvement needs of the prior art, the present invention provides a function cold start optimization method for a service-unaware computing system, which aims to improve the prediction accuracy of function calls, thereby alleviating the cold start problem of the service-unaware computing system.
[0009] To achieve the above objectives, according to one aspect of the present invention, a function cold start optimization method for a service-unaware computing system is provided, comprising:
[0010] S1. Inputting actual call information of each function in the service-aware computing system in the past multiple consecutive equal-step time periods into a trained load prediction model to obtain predicted call information of each function in the future multiple consecutive equal-step time periods; wherein the actual call information is a time series of the call frequency of each function in each time period; the load prediction model includes:
[0011] A data enhancement unit is configured to determine, based on the actual call information of each function, an average time interval between each call of each function within a corresponding historical time window, and record functions with a time interval less than a first threshold as frequent functions, and vice versa as sparse functions; and perform probabilistic filling on the actual call information of each sparse function in the following manner: based on non-zero values adjacent to each zero value that are within a first threshold distance in time, probabilistically fill the zero value in a preset manner, with the filling value being no greater than the non-zero value; and when there are two adjacent non-zero values, the smaller one is used for probabilistic filling;
[0012] The data expansion unit is used to perform m rounds of sampling on the actual call information of each frequent function and the actual call information of each sparse function after probability filling in the following way to obtain Sampling results: Each round is performed m times. The j-th sampling result of the i-th round of the function is obtained by copying the data starting from the j-th data of the actual call information of the function and at intervals of (i-1) data.
[0013] A prediction unit is configured to input the m sampling results of each function in each round into the first time series prediction model to obtain m outputs, merge the m outputs according to the inverse operation of sampling to obtain a candidate prediction result, and simultaneously input the m candidate prediction results of each function into the second time series prediction model to obtain prediction call information of the function in multiple consecutive equal-step time periods in the future;
[0014] S2. Preheat the functions in advance based on the predicted call information of each function.
[0015] Furthermore, the implementation of S2 is as follows:
[0016] Based on the service-unaware computing system, a scoring model is used to calculate the score of each function to be preheated, and functions with high scores are preheated first until the remaining service-unaware computing system resources are insufficient to preheat the functions; if there are function containers in the service-unaware computing system that are in a keep-alive state at this time, a cost model is used to calculate the cost of releasing each function container that is currently in a keep-alive state in the service-unaware computing system, and the function containers with a release cost less than a second threshold are listed as releasable function containers; a non-empty full combination of all releasable function containers is performed to obtain multiple container sets; a release model is used to calculate the release value of each container set, and container sets are planned to be released in order of release value from small to large until a container set is released to support the service-unaware computing system resources to preheat all functions to be preheated, wherein the release value represents the importance of the sum of the number of all function containers in a container set and the release cost of each function container in the container set.
[0017] Furthermore, the scoring model is:
[0018]
[0019] Among them, S(f i ) represents the function to be preheated f i score; α is a parameter with a value between 0 and 1, used to adjust the function f i The prediction accuracy f i .acc and its required services are not aware of computing system resources f i Importance of .S;f i .fre is the average call frequency of the function in the historical time window; MAX(|FS|) is the maximum value of the service-unaware computing system resources required by all functions in the set F of all functions of the service-unaware computing system.
[0020] Furthermore, the cost model Cost(f i )for:
[0021]
[0022] Among them, Cost(f j ) represents the release function f j The cost of the container; β is a parameter with a value between 0 and 1, which is used to adjust the function f j The average call frequency f within the historical time window j .fre and its keep-alive duration T kp Importance of (fj); MAX c (f) represents the maximum value of the average call frequency of all functions currently in the keep-alive state within the historical time window; MAX(T kp ) is the maximum keepalive duration of all functions currently in the keepalive state.
[0023] Furthermore, the release model RF(lf) is:
[0024]
[0025] Where RF(lf) represents the release value of the container set lf to be released, γ is a parameter ranging from 0 to 1, which is used to adjust the importance of the number of function containers in the container set to be released and the sum of the release costs of each function container in the container set; |lf| is the number of function containers in lf.
[0026] Furthermore, the first threshold is the keep-alive duration of the service-unaware computing system function container.
[0027] Furthermore, the preset method is:
[0028] Assign the average time interval between each call of the function to be filled in the historical time window to the Poisson distribution formula Parameter λ in the Poisson distribution; let k = λ-h, and we get according to Fill the zero values in the past h time periods; let k = λ + h in the Poisson distribution, and we get according to Fill the next h time periods with zero values, where h = 1, ..., H, and H represents the number of time periods between the current zero value to be filled and its adjacent non-zero value.
[0029] Furthermore, the first time series prediction model is a gated recurrent unit; the second time series prediction model is a causal convolutional neural network, wherein the causal convolutional neural network includes two hidden layers, and the output result of the causal convolutional neural network output layer is composed of the best results of m candidate prediction results corresponding to multiple preset time windows in the input data, and the multiple preset time windows are obtained by equally dividing the time windows corresponding to the input data, and each preset time window is an integer multiple of a single time period.
[0030] Furthermore, the prediction unit in the load prediction model is obtained through training samples, and at fixed time intervals, the load prediction model is retrained based on the actual call information of each function of the service-unaware computing system within the fixed time interval, and the trained model is used to update the predicted call information of each function in multiple consecutive equal-step time periods in the future to guide the preheating strategy of each function.
[0031] According to another aspect of the present invention, a computer-readable storage medium is provided, which includes a stored computer program, wherein when the computer program is executed by a processor, the device where the storage medium is located is controlled to execute the steps of the above-mentioned method.
[0032] In general, the above technical solutions conceived by the present invention have the following beneficial effects compared with the prior art:
[0033] 1. The cold start optimization method for the service-aware computing system proposed in the present invention takes into account the high proportion of infrequently called functions, uses a probabilistic filling method to perform data enhancement on functions, especially sparse functions, and performs multiple rounds of sampling on the enhanced results to achieve the purpose of data expansion, thereby helping to improve the prediction accuracy of function call information. The sampling results are respectively used in two time series prediction models to obtain the prediction results of each function in the future. The prediction results characterize the calling frequency of each function in each time period in the future. Based on more accurate predicted call information of each function, the preheating and keep-alive strategies are more accurately implemented for each function, rather than inaccurately implementing the preheating strategy or fixing the keep-alive time of each function, which can reduce the number of cold starts of the function and improve the satisfaction of the function owner.
[0034] 2. The present invention also proposes a service-aware computing system that uses a scoring model to calculate a score for each function to be preheated. Based on the currently available CPU and memory resources of the service-aware computing system, functions with high scores are prioritized for preheating until the remaining service-aware computing system resources are insufficient to preheat functions. When resources are limited in the service-aware computing system, the scoring function is used to selectively preheat some functions, preventing both the frequent cold starts of high-frequency functions and the prolonged unresponsiveness of sparse functions. When the remaining resources of the service-aware computing system are insufficient to preheat all functions and function containers are currently being kept alive, a cost model is used to calculate the cost of releasing each function container currently being kept alive in the service-aware computing system. Function containers with release costs less than a second threshold are classified as releasable function containers. A non-empty full combination of all releasable function containers is performed to obtain multiple container sets. The release model is used to calculate the release value of each container set, and container sets are subsequently released in ascending order of release value until a container set is released that satisfies the service-aware computing system's resource requirements for preheating all functions to be preheated. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 This is a flow chart of a function cold start optimization method for a service-unaware computing system provided by an embodiment of the present invention;
[0036] Figure 2 This is an overall flow chart of another service-aware computing system function cold start optimization method provided by an embodiment of the present invention;
[0037] Figure 3 yes Figure 2 A corresponding diagram of the cold start optimization model structure of a service-aware computing system function;
[0038] Figure 4 Schematic diagram of a probabilistic filling method provided by an embodiment of the present invention;
[0039] Figure 5 A schematic diagram of another probabilistic filling method provided by an embodiment of the present invention;
[0040] Figure 6 A schematic diagram of a first-round data sampling and preliminary prediction method provided by an embodiment of the present invention;
[0041] Figure 7 A schematic diagram of a second round of data sampling and preliminary prediction method provided by an embodiment of the present invention;
[0042] Figure 8 A schematic diagram of the third round of data sampling and preliminary prediction method provided by an embodiment of the present invention;
[0043] Figure 9A schematic diagram of a load prediction method based on a causal convolutional neural network provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
[0045] Example 1
[0046] A function cold start optimization method for service-aware computing systems, such as Figure 1 As shown, including:
[0047] S1. Input the actual call information of each function in the service-aware computing system in the past multiple consecutive equal-step time periods into the trained load prediction model to obtain the predicted call information of each function in the future multiple consecutive equal-step time periods; wherein the actual call information is a time series of the call frequency of each function in each time period; the load prediction model includes:
[0048] A data enhancement unit is configured to determine, based on the actual call information of each function, an average time interval between each call of each function within a corresponding historical time window, and record functions with a time interval less than a first threshold as frequent functions, and vice versa as sparse functions; and perform probabilistic filling on the actual call information of each sparse function in the following manner: based on non-zero values adjacent to each zero value that are within a first threshold distance in time, probabilistically fill the zero value in a preset manner, with the filling value being no greater than the non-zero value; and when there are two adjacent non-zero values, the smaller one is used for probabilistic filling;
[0049] The data expansion unit is used to perform m rounds of sampling on the actual call information of each frequent function and the actual call information of each sparse function after probability filling in the following way to obtain Sampling results: Each round is performed m times. The j-th sampling result of the i-th round of the function is obtained by copying the data starting from the j-th data of the actual call information of the function and at intervals of (i-1) data.
[0050] A prediction unit is configured to input the m sampling results of each function in each round into the first time series prediction model to obtain m outputs, merge the m outputs according to the inverse operation of sampling to obtain a candidate prediction result, and simultaneously input the m candidate prediction results of each function into the second time series prediction model to obtain prediction call information of the function in multiple consecutive equal-step time periods in the future;
[0051] S2. Preheat the functions in advance based on the predicted call information of each function.
[0052] This embodiment relates to a method for optimizing cold start of functions in a service-aware computing system. A service-aware computing system organizes services at the granularity of functions, with each function providing services to users in a specific container. When a function is called, if there is no warm container for the function, the service-aware computing system will re-prepare the resources required to execute the function. Since this preparation time is usually much longer than the execution time of the function itself, this problem is called the cold start problem.
[0053] The cold start optimization method for the service-aware computing system proposed in this embodiment takes into account the high proportion of infrequently called functions, uses a probabilistic filling method to perform data enhancement on functions, especially sparse functions, and performs multiple rounds of sampling on the enhanced results to achieve the purpose of data expansion, thereby helping to improve the prediction accuracy of function call information. The sampling results are respectively used in two time series prediction models to obtain the prediction results of each function in the future. The prediction results characterize the call frequency of each function in each time period in the future. Based on more accurate predicted call information of each function, a more accurate preheating and keep-alive strategy is implemented for each function, rather than inaccurately implementing a preheating strategy or fixing the keep-alive time of each function, which can reduce the number of cold starts of the function and improve the satisfaction of the function owner.
[0054] Among them, regarding the data enhancement unit, it is equivalent to using different probability filling methods to process sparse functions and frequent functions. For frequent functions, the processing result is the original function call data itself (actual call information); for infrequent functions, the following rules must be met: First, when a function has non-zero calls in a certain time period but there are zero calls in each time period within the first threshold range in the past or future two time dimensions, these zero call data need to be probability filled; second, the value of the zero call time period that needs to be probability filled depends on its adjacent non-zero call data. The specific assignment method can be in accordance with a certain distribution or function law, or it can be a direct random value, but the probability filling value cannot exceed the non-zero call value; third, if there are two candidate probability values for a zero call time period, the smaller one is selected for probability filling.
[0055] Since the proportion of effective call data in sparse functions is relatively low, the use of probabilistic filling technology can increase the proportion of effective call data and improve the model's ability to identify the patterns of sparse function effective call data. Limiting the adjacent zero call time periods of each non-zero call time period to within the first threshold time range is intended to achieve a balance between enhancing the regularity of sparse function call information and increasing the proportion of effective call data. The reason why the probability value of each zero call time period is not higher than the call value of its nearest non-zero call time period is also to ensure that the filling operation does not destroy the original call data pattern of the function.
[0056] As a preferred implementation, the preset method for probability filling is:
[0057] Assign the average time interval between each call of the function to be filled in the historical time window to the Poisson distribution formula Parameter λ in the Poisson distribution; let k = λ-h, and we get according to Fill the zero values in the past h time periods; let k = λ + h in the Poisson distribution, and we get according to Fill the next h time periods with zero values, where h = 1, ..., H, and H represents the number of time periods between the current zero value to be filled and its adjacent non-zero value.
[0058] According to the above Poisson distribution formula, when k = λ, The value of is the largest. Considering that the probability filling of the adjacent zero call time period of each non-zero call time period requires setting the non-zero call value to the local maximum, the non-zero call time period is set to k. Thus, the filling value of the past h time periods is The product of the non-zero call value. Similarly, the filling value of the next h time periods is In addition, considering that the mathematical expectation of the Poisson distribution formula is λ, λ is assigned as the first threshold here.
[0059] Regarding the data expansion unit, it achieves the purpose of data expansion by performing multiple rounds of sampling on the data enhancement results.
[0060] Based on the predicted call information for each function over multiple consecutive time periods in the future, a warmup and keepalive strategy is developed for each function. A warmup strategy involves preemptively preparing the required resources before the function is actually called; a keepalive strategy involves retaining the relevant resources for a period of time after the function was last called and executed. By using these warmup and keepalive strategies, the relevant resources can be used directly when the function is actually called, avoiding the time overhead associated with cold starts.
[0061] As a further preferred embodiment, Figure 2-Figure 3 As shown, the above S2 is implemented in the following ways:
[0062] Based on the service-aware computing system, a scoring model is used to calculate the score of each function to be preheated. According to the current remaining CPU and memory resources of the service-aware computing system, functions with high scores are preheated first until the remaining service-aware computing system resources are insufficient to preheat the functions. If there are function containers in the service-aware computing system that are in a keep-alive state at this time, a cost model is used to calculate the cost of releasing each function container that is currently in a keep-alive state in the service-aware computing system, and function containers with a release cost less than a second threshold are listed as releasable function containers. A non-empty full combination is performed on all releasable function containers to obtain multiple container sets. A release model is used to calculate the release value of each container set, and container sets are planned to be released in order of release value from small to large until a container set is released to support the service-aware computing system resources to preheat all functions to be preheated, wherein the release value represents the importance of the sum of the number of all function containers in a container set and the release cost of each function container in the container set.
[0063] That is, when the remaining resources of the service-unaware computing system are insufficient to meet the needs of preheating all functions and there are function containers in the system that are being kept alive, the preferred embodiment adopts a cost model to separately calculate the cost of releasing each function container that is currently being kept alive in the service-unaware computing system. Furthermore, function containers whose release costs are less than a second threshold are listed as releasable function containers. The preferred embodiment also performs a non-empty full combination of all releasable function containers to obtain multiple container sets; the release value of each container set is calculated using a release model, and the container sets are arranged in ascending order according to their release values, and the container sets are to be released in sequence until a container set is released to support the service-unaware computing system resources to meet the needs of preheating all functions to be triggered.
[0064] When the service-aware computing system has limited resources, the scoring function is used to selectively preheat the functions predicted to be called. This can avoid a large number of cold start problems for high-frequency functions and the problem of sparse functions not getting a response for a long time.
[0065] As an optimal method, the scoring model can be designed as follows:
[0066]
[0067] Among them, S(f i ) represents the function to be preheated f i score; α is a parameter with a value between 0 and 1, used to adjust the function f i The prediction accuracy f i.acc and its required services are not aware of computing system resources f i Importance of .S;f i .fre is the average call frequency of the function in the historical time window; MAX(|Fs|) is the maximum value of the service-unaware computing system resources required by all functions in the set F of all functions of the service-unaware computing system.
[0068] As an optimal method, the cost model Cost(f i ) is designed as:
[0069]
[0070] Among them, Cost(f j ) represents the release function f j The cost of the container; β is a parameter with a value between 0 and 1, which is used to adjust the function f j The average call frequency f within the historical time window j .fre and its keep-alive duration T kp (f j )’s importance; MAX c (f) represents the maximum value of the average call frequency of all functions currently in the keep-alive state within the historical time window; MAX(T kp ) is the maximum keepalive duration of all functions currently in the keepalive state.
[0071] Preferably, the release model RF(lf) is designed as:
[0072]
[0073] Where RF(lf) represents the release value of the container set lf to be released, γ is a parameter ranging from 0 to 1, which is used to adjust the importance of the number of function containers in the container set to be released and the sum of the release costs of each function container in the container set; |lf| is the number of function containers in lf.
[0074] As a preferred implementation, the above-mentioned first threshold is the default keep-alive duration of the service-unaware computing system function container.
[0075] As a preferred implementation, the first time series prediction model is a gated recurrent unit; and the second time series prediction model is a causal convolutional neural network.
[0076] In an embodiment of the present invention, the current output of each function by the gated recurrent unit depends on the sampling result at the current moment and the output of the gated recurrent unit at the previous moment. Specifically, the gated recurrent unit can be expressed as follows:
[0077]
[0078] Among them, h t-1 and h t Represent the output of the gated recurrent unit at the previous moment and the current moment respectively; u t and r t They are the update gate and forget gate of the gated recurrent unit respectively; W u 、W r and W c u t 、r t 、c t The corresponding weight matrix, b u 、b r and b c is the corresponding bias term, p t is the sampling result of the function at the current moment.
[0079] The causal convolutional neural network includes two hidden layers, whose expansion rates can be set to 1, 2, and 4, respectively, to expand the receptive field. The output result of the causal convolutional neural network output layer is composed of the best result among m candidate prediction results corresponding to multiple preset time windows in the input data. The multiple preset time windows are obtained by equally dividing the time window corresponding to the input data, and each preset time window is an integer multiple of a single time period.
[0080] Therefore, the causal convolutional neural network model is used to match the prediction result that is closest to the true result among all candidate prediction results within each preset time window. The causal convolutional neural network model can be expressed as follows:
[0081]
[0082] Where g is a filter function of size k, h is the time series input, t is the element of the sequence, d is the expansion rate parameter, and td·i is a certain time period in the past. d g is denoted as the dilated convolution operator or d as the dilated convolution operator to distinguish it from the normal convolution operation.
[0083] In order to obtain accurate prediction results, it is necessary to train the model and update the parameter (weight) matrix. The corresponding loss function is as follows:
[0084]
[0085] Among them, h t and Represents the actual number of calls and predicted number of calls of the function in each time period, λL reg is a regularization term to avoid overfitting, and λ is a hyperparameter.
[0086] As a preferred implementation method, the prediction unit in the above-mentioned load prediction model is obtained through training samples, and at fixed time intervals, the load prediction model is retrained according to the actual call information of each function of the service-unaware computing system within the fixed time interval, and the trained model is used to update the predicted call information of each function in multiple consecutive equal-step time periods in the future, so as to maintain good prediction accuracy and guide the preheating strategy of each function.
[0087] The prediction method of the present invention is further illustrated below with reference to specific examples.
[0088] After obtaining actual function call data for multiple consecutive time periods of equal step length within a historical time window, calculate the average time interval between function calls. If the average time interval between function calls is 15 minutes, and the first threshold (i.e., the default container keepalive period for serverless computing systems) is 10 minutes, then the function is sparse. Therefore, probabilistic imputation is required during data preprocessing.
[0089] This example uses Poisson distribution as an example to explain how to perform probability filling. Figure 4 As shown in the figure, when the function is called once in time period t and is not called in time period (t-10) to (t-1) or time period (t+1) to (t+10), the time period (t-10) to (t-1) and time period (t+1) to (t+10) need to be filled with probabilities. In this example, k and λ of the Poisson distribution are both set to 15. Therefore, the probability values of time period (t-10) to (t-1) and time period (t+1) to (t+10) are respectively h=1,…,H, where H represents the number of time intervals between the current zero value to be filled and its adjacent non-zero value. Substituting λ = 12 into the above equation yields the specific probabilities for the time periods (t-10) to (t-1) and (t+1) to (t+10). For example, the probabilities for the time periods (t-2) to (t-1) and (t+1) to (t+2) are 0.096, 0.102, 0.096, and 0.085, respectively.
[0090] like Figure 5 As shown, when the function has non-zero calls in both the (t-2) and (t+1) time periods but is not called in the (t-1) and t time periods, it is necessary to fill the probability of the (t-1) and t time periods. For the (t-1) time period, affected by the call data of the (t-2) time period, it has a candidate probability value of Affected by the call data in the (t+1) time period, it has another candidate probability value Finally, the probability filling value of the (t-2) time period selects the smaller one (ie, 0.096) of the two candidate probability values as the final filling value for probability filling.
[0091] After all function probabilities are filled, multiple rounds of sampling are required to expand the data. Take three rounds of sampling as an example to explain how to perform multiple rounds of sampling. For the preprocessing result of a function, the first round of sampling is as follows: Figure 6 As shown in , the sampling result is the preprocessing result itself. Figure 7 As shown in the figure, two samplings are performed. The first sampling starts from the first data of the preprocessing result and is performed at intervals of one data. The second sampling starts from the second data of the preprocessing result and is also performed at intervals of one data. Therefore, two sampling results can be obtained for the second round of sampling of each function. The third round of sampling is shown in the figure. Figure 8 As shown, sampling is performed three times. The first sampling starts from the first data point of the preprocessing result, with sampling intervals of two data points. The second sampling starts from the second data point of the preprocessing result, with sampling intervals of two data points. The third sampling starts from the third data point of the preprocessing result, with sampling intervals of two data points. Therefore, three sampling results are obtained for each function in the third round of sampling.
[0092] Input each sampling result of each round into the gated recurrent unit to obtain multiple output results. Then these output results are merged according to the sampling method to generate multiple candidate prediction results. Figure 7 For example, the second round of sampling of a function can obtain two sampling results. After inputting these sampling results into the gated recurrent unit, two sets of outputs can be obtained. According to the sampling method, the merging operation is to take one data from each of the two output results and arrange them in sequence until all the output result data are taken. Each round of sampling can obtain a merged result, so the three rounds of sampling for each function can obtain three candidate prediction results.
[0093] By inputting multiple candidate prediction results of the function into the causal convolutional neural network, the final prediction result can be obtained. Figure 9 As shown in FIG, the output of the output layer is composed of input data of multiple fixed time windows. The present invention sets the fixed time window to two time steps. For each time window in the output layer of the causal convolutional neural network model, its output data is the best match among the prediction results of multiple candidates in the corresponding time window of its input layer. Therefore, the causal convolutional neural network model is used to match each preset time window (i.e. Figure 9 The prediction that is closest to the true result among all candidate predictions within the two time steps shown in .
[0094] Example 2
[0095] A computer-readable storage medium stores a computer program, which implements the steps of the above method when executed by a processor.
[0096] Specifically, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage device.
[0097] The relevant technical solutions are the same as above and will not be repeated here.
[0098] In summary, the present invention provides a function cold start optimization method for a service-aware computing system. The method comprises: obtaining function call information and classifying functions into sparse and frequent functions based on their call frequency within a specific time window. Multiple rounds of sampling are performed on the enhanced results of the sparse function call data and the frequent function call data. The sampling results are input into a first time series prediction model to generate multiple candidate prediction results. The candidate prediction results are input into a second time series prediction model to obtain a final prediction result for each function. These results represent the function's call information in the future. Furthermore, based on these prediction results, the present invention proposes using a scoring model to calculate the priority of each function to be prewarmed. Then, based on the status of the service-aware computing system, functions with high priority are prewarmed. Due to the limited resources of the service-aware computing system, some function containers in a keepalive state need to be released. A keepalive container release strategy is implemented by calculating the release costs of all keepalive containers and the decision scores of all containers to be released. The present invention improves function prediction accuracy, enhances the coupling between the prediction results and the target system, and optimizes the cold start problem of the service-aware computing system.
[0099] The service-unaware computing system cold start optimization method of the present invention can better adapt to the increasingly complex service-unaware computing system, reduce the number of cold starts of functions, and achieve high user satisfaction.
[0100] It will be easily understood by those skilled in the art that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A function cold start optimization method for a service-unaware computing system, characterized in that: include: S1. Inputting actual call information of each function in the service-aware computing system in the past multiple consecutive equal-step time periods into a trained load prediction model to obtain predicted call information of each function in the future multiple consecutive equal-step time periods; wherein the actual call information is a time series of the call frequency of each function in each time period; the load prediction model includes: A data enhancement unit is configured to determine, based on the actual call information of each function, an average time interval between each call of each function within a corresponding historical time window, and record functions with a time interval less than a first threshold as frequent functions, and vice versa as sparse functions; and perform probabilistic filling on the actual call information of each sparse function in the following manner: based on non-zero values adjacent to each zero value that are within a first threshold distance in time, probabilistically fill the zero value in a preset manner, with the filling value being no greater than the non-zero value; and when there are two adjacent non-zero values, the smaller one is used for probabilistic filling; The data expansion unit is used to perform m rounds of sampling on the actual call information of each frequent function and the actual call information of each sparse function after probability filling in the following way to obtain Sampling results: Each round is performed m times. The j-th sampling result of the i-th round of the function is obtained by copying the data starting from the j-th data of the actual call information of the function and at intervals of i-1 data. A prediction unit is configured to input the m sampling results of each function in each round into the first time series prediction model to obtain m outputs, merge the m outputs according to the inverse operation of sampling to obtain a candidate prediction result, and simultaneously input the m candidate prediction results of each function into the second time series prediction model to obtain prediction call information of the function in multiple consecutive equal-step time periods in the future; S2. Preheat the functions in advance based on the predicted call information of each function.
2. The function cold start optimization method according to claim 1, characterized in that: The implementation of S2 is as follows: Based on the service-unaware computing system, a scoring model is used to calculate the score of each function to be preheated, and functions with high scores are preheated first until the remaining service-unaware computing system resources are insufficient to preheat the functions; if there are function containers in the service-unaware computing system that are in a keep-alive state at this time, a cost model is used to calculate the cost of releasing each function container that is currently in a keep-alive state in the service-unaware computing system, and the function containers with a release cost less than a second threshold are listed as releasable function containers; a non-empty full combination of all releasable function containers is performed to obtain multiple container sets; a release model is used to calculate the release value of each container set, and container sets are planned to be released in order of release value from small to large until a container set is released to support the service-unaware computing system resources to preheat all functions to be preheated, wherein the release value represents the importance of the sum of the number of all function containers in a container set and the release cost of each function container in the container set.
3. The function cold start optimization method according to claim 2, characterized in that: The scoring model is: Among them, S(f i ) represents the function to be preheated f i score; α is a parameter with a value between 0 and 1, used to adjust the function f i The prediction accuracy f i .acc and its required services are not aware of computing system resources f i Importance of .S;f i .fre is the average call frequency of the function in the historical time window; MAX(|FS|) is the maximum value of the service-unaware computing system resources required by all functions in the set F of all functions of the service-unaware computing system.
4. The function cold start optimization method according to claim 2, characterized in that: The cost model Cost(f i )for: Among them, Cost(f j ) represents the release function f j The cost of the container; β is a parameter with a value between 0 and 1, which is used to adjust the function f j The average call frequency f within the historical time window j .fre and its keep-alive duration T kp (f j )’s importance; MAX c (f) represents the maximum value of the average call frequency of all functions currently in the keep-alive state within the historical time window; MAX(T kp ) is the maximum keepalive duration of all functions currently in the keepalive state.
5. The function cold start optimization method according to claim 2, characterized in that: The release model RF(lf) is: Where RF(lf) represents the release value of the container set lf to be released, γ is a parameter ranging from 0 to 1, which is used to adjust the importance of the number of function containers in the container set to be released and the sum of the release costs of each function container in the container set; |lf| is the number of function containers in lf.
6. The function cold start optimization method according to any one of claims 1 to 5, characterized in that: The first threshold is the default keep-alive duration of the service-unaware computing system function container.
7. The function cold start optimization method according to any one of claims 1 to 5, characterized in that: The preset method is: Assign the average time interval between each call of the function to be filled in the historical time window to the Poisson distribution formula Parameter λ in the Poisson distribution; let k = λ-h, and we get according to Fill the zero values in the past h time periods; let k = λ + h in the Poisson distribution, and we get according to Fill the next h time periods with zero values, where h = 1, ..., H, and H represents the number of time periods between the current zero value to be filled and its adjacent non-zero value.
8. The function cold start optimization method according to any one of claims 1 to 5, characterized in that: The first time series prediction model is a gated recurrent unit; the second time series prediction model is a causal convolutional neural network, wherein the causal convolutional neural network includes two hidden layers, and the output result of the causal convolutional neural network output layer is composed of the best result of m candidate prediction results corresponding to multiple preset time windows in the input data, and the multiple preset time windows are obtained by equally dividing the time windows corresponding to the input data, and each preset time window is an integer multiple of a single time period.
9. The function cold start optimization method according to any one of claims 1 to 5, characterized in that: The prediction unit in the load prediction model is obtained through training samples, and at fixed time intervals, the load prediction model is retrained according to the actual call information of each function of the service-unaware computing system within the fixed time interval, and the trained model is used to update the predicted call information of each function in multiple consecutive equal-step time periods in the future to guide the preheating strategy of each function.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed by a processor, the device where the storage medium is located is controlled to perform the steps of the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Cold start optimization method based on time domain convolutional network in server-free computing environment
CN114489940A
Load prediction method and system based on improved Transform
CN118295888A