Function cold start optimization method of service perception-free computing system

By building a load prediction model and optimizing the preheating and keeping strategy, the cold start problem of function in the service-free computing system is solved, and the prediction accuracy and system performance are improved.

CN119440666AActive Publication Date: 2025-02-14HUAZHONG UNIV OF SCI & TECH

Patent Information

Application Number
CN202411552021.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-01
Publication Date
2025-02-14
Estimated Expiration
2044-11-01

AI Technical Summary

Technical Problem

The cold start problem of functions in service-unaware computing systems results in startup delays, especially for functions that are not often called, and existing warm-up and keep-alive strategies are difficult to effectively solve.

Method used

By building a load prediction model, data augmentation and multi-round sampling techniques are used to improve the prediction accuracy of function call information, and combined with scoring, cost and release models, function preheating and keep-alive strategies are optimized.

Benefits of technology

Improve the accuracy of function call prediction, reduce the number of function cold starts, and improve system performance and user satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119440666A_ABST
    Figure CN119440666A_ABST
Patent Text Reader

Abstract

The invention belongs to the related technical field of service perception-free computing systems, and particularly relates to a function cold start optimization method of a service perception-free computing system, which comprises the following steps of: acquiring calling information of functions, and dividing the functions into sparse functions and frequent functions according to calling frequencies of the functions in a specific time window; and performing multi-round sampling on the sparse function preprocessing result and the frequent function call data, and inputting the sampling result into a gating cycle unit to generate a plurality of candidate prediction results. And inputting the candidate prediction results into the causal convolutional neural network to obtain a final prediction result of each function. The results represent calling information of the function in the future time. And preheating the function in advance based on the prediction results. The invention further provides a preheating and keep-alive strategy based on the function score and the release cost. In general, the prediction precision of the function call information can be improved, and the cold start problem of the service perception-free computing system is optimized.
Need to check novelty before this filing date? Find Prior Art

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, as a form of cloud computing, supports programmers in providing 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 that is much longer than its execution time because the execution of the target function requires the preparation of an isolated function container and the configuration files required by the function. This situation is called the cold start problem.

[0003] To solve this problem, the initial environment preparation strategies before function execution are usually divided into two categories: preheating and keep-alive. The preheating-based approach is usually implemented by predicting the function's call information and preparing the required service-agnostic computing system resources in advance. The keep-alive-based approach determines the lifetime of the function container by considering the function's call information and the available service-agnostic computing system resources.

[0004] It is worth noting that the functions of service-agnostic computing systems usually have two characteristics: first, most functions are called relatively infrequently, and each function corresponds to a function owner; second, the cumulative number of calls to these low-frequency functions constitutes a non-negligible part of the overall call. Therefore, reducing the number of cold starts of infrequently called functions can not only improve the performance of the target system, but also improve the satisfaction of function owners.

[0005] Taking Microsoft's production environment based on the real service-agnostic computing platform as an example, before a function is executed, it is necessary to ensure that its code, including user code and related library files, are loaded into the memory. Therefore, if these codes and files are loaded into the memory, the function will start quickly. On the contrary, if the function needs to be loaded from persistent storage, it will take a long time to load and start. This situation is called the cold start problem.

[0006] On the other hand, the functions and service load Azure functions provided by Microsoft have the following characteristics: more than 50% and 90% of the functions are called no more than 31 and 1554 times per day on average, respectively. Therefore, if all the related codes and library files of all functions are loaded into memory, a lot of resources will be wasted.

[0007] In order to balance the resource overhead of the service-aware computing system with user satisfaction and alleviate the cold start problem, the industry and academia mainly use statistics-based or traditional machine learning techniques to develop warm-up plans or use and improve cache replacement algorithms to develop function container keep-alive strategies. However, infrequently called functions generate very little call data over a long period of time, resulting in weak learning capabilities of existing models, which brings challenges to developing appropriate warm-up and keep-alive strategies for such 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 object, 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. 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 frequency of each function being called in each time period; the load prediction model includes:

[0011] A data enhancement unit is used to determine the average time interval between each call of each function in a corresponding historical time window according to the actual call information of each function, and record the function with a time interval less than a first threshold as a frequent function, and vice versa as a sparse function; the actual call information of each sparse function is probabilistically filled in the following manner: according to the non-zero value that is adjacent to each zero value and is within the first threshold in time, the zero value is probabilistically filled in a preset manner, and the filling value is not greater than the non-zero value. When there are two adjacent non-zero values, the smaller one is taken 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 manner 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 used 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 the prediction call information of the function in multiple consecutive equal step time periods in the future;

[0014] S2. Preheating the functions in advance based on the predicted call information of each function.

[0015] Further, 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 whose release costs are 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 values ​​from small to large until a container set is released to support the service-unaware computing system resources to meet the preheating of 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, which is 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 calling 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 service-unaware computing system's function set F.

[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 in the historical time window j .fre and its keep alive time 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 keep-alive duration of all functions currently in the keep-alive state.

[0023] Further, the release model RF(lf) is:

[0024]

[0025] Among them, RF(lf) represents the release value of the container set lf to be released, γ is a parameter with a value of 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] Further, 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 in the Poisson distribution, 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 zero values ​​of the next h time periods, 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 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.

[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 according to the actual calling information of each function of the service-aware computing system within the fixed time interval, and the trained model is used to update the predicted calling 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, wherein 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 execute the steps of the method described above.

[0032] In general, compared with the prior art, the above technical solution conceived by the present invention has the following beneficial effects:

[0033] 1. The cold start optimization method for the service-aware computing system proposed in the present invention uses a probability filling method to perform data enhancement on functions, especially sparse functions, taking into account the high proportion of infrequently called 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, 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.

[0034] 2. The present invention also proposes that the service-unaware computing system uses a scoring model to calculate the score of each function to be preheated. Then, according to the current remaining CPU and memory resources of the service-unaware computing system, the functions with high scores are preheated first, until the remaining service-unaware computing system resources are insufficient to preheat the functions. In the case of limited resources of the service-unaware computing system, the scoring function is used to selectively preheat some functions, which can not only avoid a large number of cold start problems of high-frequency functions, but also avoid the problem that sparse functions cannot be responded for a long time. 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 keep-alive state in the system, the cost model is used to calculate the cost of releasing each function container currently in the keep-alive state of the service-unaware computing system. Function containers with a release cost less than the second threshold are listed as releasable function containers. All releasable function containers are non-empty fully combined to obtain multiple container sets; the release value of each container set is calculated using the release model, and the container set is to be released in the order of the release value from small to large until a certain container set is released to support the service-unaware computing system resources to meet the needs of 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 It is an overall flow chart of another service-unaware computing system function cold start optimization method provided by an embodiment of the present invention;

[0037] Figure 3 yes Figure 2 A corresponding schematic diagram of the cold start optimization model structure of a service-aware computing system function;

[0038] Figure 4 is a schematic diagram of a probability filling method provided by an embodiment of the present invention;

[0039] Figure 5 A schematic diagram of another probability filling method provided by an embodiment of the present invention;

[0040] Figure 6 A schematic diagram of a first round of 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 a third round of data sampling and preliminary prediction method provided by an embodiment of the present invention;

[0043] Fig. 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 purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain 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 can be combined with each other as long as they do not conflict with each other.

[0045] Embodiment 1

[0046] A function cold start optimization method for service-agnostic 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 above-mentioned actual call information is the time series of the frequency of each function being called in each time period; the load prediction model includes:

[0048] A data enhancement unit is used to determine the average time interval between each call of each function in a corresponding historical time window according to the actual call information of each function, and record the function with a time interval less than a first threshold as a frequent function, and vice versa as a sparse function; the actual call information of each sparse function is probabilistically filled in the following manner: according to the non-zero value that is adjacent to each zero value and is within the first threshold in time, the zero value is probabilistically filled in a preset manner, and the filling value is not greater than the non-zero value. When there are two adjacent non-zero values, the smaller one is taken 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 manner 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 used 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 the prediction call information of the function in multiple consecutive equal step time periods in the future;

[0051] S2. Preheating 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 a function in a service-aware computing system. A service-aware computing system organizes services at the function level, and each function provides 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 the preparation time is usually much longer than the execution time of the function itself, this problem is called the cold start problem.

[0053] The service-aware computing system cold start optimization method 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 calling 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 has zero calls in each time period within the range of the first threshold 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 directly taking a 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, select the smaller one for probability filling.

[0055] Since the effective call data of sparse functions accounts for a relatively low proportion of the total call data, the use of probability filling technology can increase the proportion of effective call data and improve the model's ability to identify the regularity of effective call data of sparse functions. Limiting the adjacent zero call time periods of each non-zero call time period to the first threshold time range is 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 regularity of the original function call data.

[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 in the Poisson distribution, 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 zero values ​​of the next h time periods, 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. Therefore, the filling value of the past h time periods is The product of the non-zero call value. Similarly, the filling value for 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 of each function in multiple consecutive time periods in the future, a preheating and keep-alive strategy is formulated for each function. The preheating strategy refers to calling the function in advance by preparing the resources required for the function call before the function is actually called; the keep-alive strategy refers to retaining the function-related resources for a period of time after the function was last called and executed. By using the preheating and keep-alive strategies, the relevant resources can be used directly when the function is actually called, avoiding the time overhead caused by cold start.

[0061] As a further preferred embodiment, Figure 2-Figure 3 As shown, the above S2 is implemented in the following way:

[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 of the service-aware computing system, and the function containers whose release costs are less than a second threshold are listed as releasable function containers. All releasable function containers are non-empty fully combined 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 values ​​from small to large until a certain container set is released to support the service-aware computing system resources to meet the preheating of 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 implementation adopts a cost model to calculate the cost of releasing each function container that is currently being kept alive in the service-unaware computing system. Further, function containers whose release costs are less than a second threshold are listed as releasable function containers. The preferred implementation 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, which can avoid a large number of cold start problems for high-frequency functions and the problem of sparse functions not being responded to for a long time.

[0065] Preferably, the scoring model is 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, which is 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 calling 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 service-unaware computing system's function set F.

[0068] As a preferred option, 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 in the historical time window j .fre and its keep alive time 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 keep-alive duration of all functions currently in the keep-alive state.

[0071] Preferably, the release model RF(lf) is designed as:

[0072]

[0073] Among them, RF(lf) represents the release value of the container set lf to be released, γ is a parameter with a value of 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 first threshold mentioned above 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 the embodiment of the present invention, the current output of each function by the gated loop unit depends on the sampling result at the current moment and the output of the gated loop unit at the previous moment. Specifically, the gated loop 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, and the expansion rates can be set to 1, 2 and 4 respectively to expand the receptive field. The output result of the output layer of the causal convolutional neural network is composed of the best result among the 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.

[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 in each preset time window. The causal convolutional neural network model can be expressed by the following formula:

[0081]

[0082] Where g is a filter function of size k, h is a time series input, t is an element of the sequence, d is a dilation 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, 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-aware 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 described below with reference to specific examples.

[0088] After obtaining the actual call data of multiple consecutive time periods with equal steps in a historical time window, calculate the average call time interval of the function. If the average call time interval of a function is 15 minutes, and the first threshold (i.e., the default container keep-alive time of the serverless computing system) is 10 minutes, then the function is a sparse function. Therefore, it is necessary to perform probability filling in the data preprocessing stage.

[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), both time period (t-10) to (t-1) and time period (t+1) to (t+10) need to be filled with probability. 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 h=1,…,H, where H represents the number of time periods between the current zero value to be filled and its adjacent non-zero value. k = λ + h, substituting λ = 12 into the above formula, we can get the specific probability values ​​of the time period from (t-10) to (t-1) and the time period from (t+1) to (t+10). For example, the probability values ​​of the time period from (t-2) to (t-1) and the time period from (t+1) to (t+2) are 0.096, 0.102, 0.096 and 0.085 respectively.

[0090] like Figure 5 As shown in , when the function has non-zero calls in both the (t-2) time period and the (t+1) time period but is not called in the (t-1) time period and the t time period, it is necessary to fill the probability of the (t-1) time period and the t time period. 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 of the two candidate probability values ​​(ie, 0.096) 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 sampling is done twice. The first sampling starts from the first data of the preprocessing result, and the sampling is done every other data; while the second sampling starts from the second data of the preprocessing result, and the sampling is done every other 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 Figure 8 As shown, sampling is performed three times in total. The first sampling starts from the first data of the preprocessing result, and the sampling is performed at intervals of two data; the second sampling starts from the second data of the preprocessing result, and the sampling is performed at intervals of two data; the third sampling starts from the third data of the preprocessing result, and the sampling is performed at intervals of two data. Therefore, three sampling results can be obtained for the third round of sampling of each function.

[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 get 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 get a merged result, so three rounds of sampling for each function can get 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. Fig. 9 As shown in FIG. 1 , 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. Fig. 9 The prediction result that is closest to the true result among all the candidate prediction results within the two time steps shown in .

[0094] Embodiment 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, an internal memory, a plug-in hard disk, a smart media card (SMC), a 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 devices.

[0097] The relevant technical solutions are the same as above and will not be described again here.

[0098] In general, the present invention is a function cold start optimization method for a service-unaware computing system, comprising: obtaining function call information, and dividing the function into sparse functions and frequent functions according to the calling frequency of the function in a specific time window. Perform multiple rounds of sampling on the sparse function call data enhancement results and the frequent function call data, and input the sampling results 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 the final prediction result of each function. These results represent the call information of the function in the future. Further, based on these prediction results, the present invention proposes to use a scoring model to calculate the priority of each function to be preheated. Then, according to the state of the service-unaware computing system, preheat the function with a high priority. Since the resources of the service-unaware computing system are limited, it is necessary to release some function containers in a keep-alive state. By calculating the release cost of all keep-alive containers and the decision scores of all containers to be released, a keep-alive container release strategy is implemented. The present invention can improve the prediction accuracy of the function, enhance the coupling between the prediction result and the target system, and optimize the cold start problem of the service-unaware 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 only 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 protection scope of the present invention.

Claims

1. A function cold start optimization method for a service-unaware computing system, characterized in that: include: 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 frequency of each function being called in each time period; the load prediction model includes: A data enhancement unit is used to determine the average time interval between each call of each function in a corresponding historical time window according to the actual call information of each function, and record the function with a time interval less than a first threshold as a frequent function, and vice versa as a sparse function; the actual call information of each sparse function is probabilistically filled in the following manner: according to the non-zero value that is adjacent to each zero value and is within the first threshold in time, the zero value is probabilistically filled in a preset manner, and the filling value is not greater than the non-zero value. When there are two adjacent non-zero values, the smaller one is taken 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 manner 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 used 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 the prediction call information of the function in multiple consecutive equal step time periods in the future; S2. Preheating 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 whose release costs are 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 values ​​from small to large until a container set is released to support the service-unaware computing system resources to meet the preheating of 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, which is 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 calling 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 service-unaware computing system's function set F.

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 in the historical time window j .fre and its keep alive time 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 keep-alive duration of all functions currently in the keep-alive state.

5. The function cold start optimization method according to claim 2, characterized in that: The release model RF(lf) is: Among them, RF(lf) represents the release value of the container set lf to be released, γ is a parameter with a value of 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 in the Poisson distribution, 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 zero values ​​of the next h time periods, 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-aware 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

  • Transparent request tracking and sampling method and device for Java architecture micro-service system

    CN117130870A

  • Request scheduling and container preheating joint optimization method and system without server computing

    CN117311965A

  • Load prediction method and system based on improved Transform

    CN118295888A

  • Efficient serverless resource allocation method and system based on reinforcement learning

    WO2024192952A1

Cited By

  • Method for optimizing cold start of container in service-free computing environment

    CN119645520A

  • Cloud function calling method, first platform, storage medium and computer program product

    CN121901000A