A container preheating and keep-alive method and device for edge devices and a storage medium
By establishing time series models and deep learning models in edge devices, and dynamically adjusting container warm-up and keep-alive strategies, the problem of cold start latency in edge devices is solved, improving resource utilization and system performance.
Patent Information
- Application Number
- CN202410094633.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-23
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2044-01-23
AI Technical Summary
The cold start latency of functions in edge devices is a serious problem. Traditional warm-up and keep-alive strategies have limitations in edge devices with limited resources. Existing reinforcement learning algorithms cannot effectively solve the problem of state space and action space explosion.
By acquiring the functions called by edge devices and their time series data, a time series model is built to predict future function calls. Based on deep learning, a container warm-up and keep-alive model is built, and reinforcement learning is used to train the optimal strategy to dynamically adjust the container warm-up and keep-alive.
It effectively reduces the cold start latency of edge devices, improves resource utilization and system performance, and achieves more efficient function scheduling.
Smart Images

Figure CN117742833B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of serverless computing, and in particular to a container pre-warming and keep-alive method and device for edge devices and a storage medium. BACKGROUND
[0002] Under the current technological development background, edge computing has become a widely used computing mode. Edge computing deploys computing resources at the edge of the network, which can effectively solve the delay problem caused by long-distance data transmission and provide fast response capability. However, the traditional edge computing platform provides resources such as virtual machines and containers to users, and developers need to take care of the scheduling and management of resources such as virtual machines and containers while processing business logic, which increases the complexity of the business and leads to a decrease in the efficiency of developers. Serverless computing is a new function-centered cloud computing paradigm that decouples the underlying cloud platform and business logic to reduce management overhead, allowing users to focus on writing business logic without worrying about the underlying server infrastructure, greatly improving the efficiency of developers. In addition, serverless computing also has the advantages of on-demand resource allocation, pay-per-use, automatic scaling, etc. The emergence of serverless computing has also brought new opportunities for the development of edge computing, which can better manage resources for edge computing and effectively support the development of Internet of Things applications.
[0003] Although serverless computing brings many benefits in the rapid development process, it also faces some serious challenges, one of which is the cold start of functions. The cold start of functions refers to the process of creating a container for the function when a request arrives at the serverless function, and pulling the dependencies required for the function to run, since the function has not been running or has been destroyed. Cold start will consume a lot of time, research shows that the delay caused by cold start is not negligible, it accounts for 50% of the function life cycle, and when the complexity of the function increases, some large external dependencies are loaded (such as machine learning models, etc.) and high concurrency calls are generated, as the number of containers increases, the cold start time will far exceed the execution time of the function. Even worse, due to the heterogeneity of edge devices and the limited resources, serverless computing will have a more serious function "cold start" problem. Therefore, how to reduce the cold start delay has become a key challenge for applying serverless computing to edge devices.
[0004] The most effective and direct method to reduce the cold start delay should be to avoid the occurrence of cold start, and the usual way to avoid the occurrence of cold start is preheating and keep-alive. From the perspective of preheating, the author Govindan proposes a serverless deep learning (DLS) framework that initializes and sets the container before the function execution request arrives, rather than initializing the container when or after the function execution request arrives. However, if the load decreases rapidly after the preheating is completed, many containers may waste resources. From the perspective of keep-alive, the Round Robin algorithm allows the containers of the same function to be cached on multiple servers by increasing the memory, so that when the function is called again, it can be hot-started on multiple servers, and the cold start time can be quickly reduced. But such a way wastes memory resources, and from the overall perspective of the system, it still shows poor performance.
[0005] An important reason why traditional methods cannot solve the cold start problem of edge devices is that a single preheating or keep-alive strategy has great limitations in resource-limited edge devices. Secondly, the selection of container keep-alive, preheating, and the number of function instances are all highly dynamic. Therefore, a reinforcement learning-based scheme is proposed. Agarwal et al. use the Q-learning algorithm to dynamically determine the number of function instances. However, this algorithm still only considers the preheating of containers and needs to discretize continuous values to represent states, which cannot estimate optimal action information and has the risk of state space and action space explosion. Therefore, how to find a strategy to solve the serious cold start phenomenon in edge devices is a technical problem that those skilled in the art urgently need to solve. SUMMARY
[0006] In order to solve the problem of serious cold start phenomenon in edge devices, the present application provides a container preheating and keep-alive method, device and storage medium for edge devices; a container preheating and keep-alive method for edge devices mainly includes the following steps:
[0007] S1, acquiring the function called by the edge device and its time series data;
[0008] S2, establishing a time series model, training the model from the function time series data, and predicting the calling situation of the function in the future confidence period;
[0009] S3, establishing a container preheating and keep-alive model based on deep learning;
[0010] S4, training and learning the container preheating and keep-alive model using the scheduling situation of the function in the future confidence period, obtaining the best function preheating and keep-alive strategy, and then realizing the container preheating and keep-alive of the edge device.
[0011] Further, step S2 is specifically:
[0012] S21, arrange the function time series data as (t i , y i );
[0013] wherein t i is a timestamp, and y i is the corresponding number of function calls;
[0014] S22, establish a time series model based on linear regression, train the model using function time series data, and predict the scheduling of the function in the future confidence time period.
[0015] wherein the function time series data is the time series data of the trend and change of the function historical call situation.
[0016] Further, the result of the time series model prediction is represented as , which represents the probability of function f being called in time slot t; t represents the time slot, is the confidence time period of the time series model predicting the future call situation of the function; f represents the function, f∈F, and F is the function set.
[0017] The scheduling of the function in the future time period is represented as a binary variable , which represents the call situation of the function in time slot t, and the variable value is determined according to .
[0018] Further, at the beginning of each time slot, a series of function requests are delivered to the serverless edge device platform according to the predicted call situation of the function in the future confidence time period, and the framework of the container preheating and keep-alive model based on deep learning is established as follows:
[0019] The serverless edge device platform is the environment;
[0020] The server of the edge device is the agent;
[0021] The state of the model is the keep-alive state of the function in the container:
[0022] is the keep-alive container situation of the edge device for function f in time slot t, , which represents the keep-alive situation of server n for function f in time slot t; let S represent the state set, and the keep-alive state of the function in time slot t is defined as s t , then s t ∈S, and
[0023] The actions of the model include: deploying the function, creating the container for the function, and keeping the container alive for the function:
[0024] Let a t ∈ A, a t denotes the action taken in time slot t, A denotes the action set, then a t can be written as: where,
[0025] (1) denotes the deployment action of function f, denotes that server k deploys function f in time slot t, denotes not to deploy;
[0026] (2) denotes the keep-alive container action on the server, denotes that server k keeps alive the container of function f in time slot t, denotes no longer to keep alive;
[0027] (3) denotes the container creation action for the function on the server, denotes that server k creates a container for function f in time slot t, denotes not to create;
[0028] The incentive of the model is the average start-up latency, and the constraint condition is set to punish abnormal policy taking.
[0029] Further, the calculation formula of the incentive is:
[0030]
[0031] r t denotes the incentive of reinforcement learning in time slot t; k1, k2 are preset large positive real numbers; n denotes a server, n ∈ N, is the set of servers in the serverless platform; and respectively denote the remaining memory resource and the remaining computing resource of server n in time slot t, which are used as constraint conditions:
[0032]
[0033]
[0034] where, M n is the memory resource of device n, C n is the computing resource of device n, s f is the memory size occupied by the container of function f, s’ f is the warm-up container size of function f, c f is the computing resource required for calling function f; represents the deployment decision of function f container in time slot t; represents the keep-alive decision of function f container in time slot t; represents the creation decision of function f container in time slot t;
[0035] T t represents the time of function f startup in time slot t, whose formalized calculation steps are as follows:
[0036] (1) Each server, the calculation capability of the function run carried by the server in each time slot shall not exceed the upper limit of the calculation capability of the server:
[0037]
[0038] (2) The sum of the storage space sizes of the containers contained by each server in any time slot shall not exceed the upper limit of the memory of the server:
[0039]
[0040] (3) For variable The function f is scheduled to be deployed to the server only when t, and the scheduled function must and can only be deployed to one server, so:
[0041]
[0042] (4) In terms of container preheating and keep-alive, if the container has been kept alive in the last time slot, a new container will not be created in the current time slot, so we have:
[0043]
[0044] (5) The next time slot can keep alive only after the previous time slot keeps alive, or the previous time slot does not keep alive, but the current time slot creates the container, to decide whether to keep alive:
[0045]
[0046] (6) The time of function startup in a time slot is calculated:
[0047]
[0048] Wherein, represents the request rate of function f in time slot t; T f represents the time of cold startup of function f; σ f represents the time required for creating a container for function f.
[0049] Further, the algorithm steps used by the container preheating and keep-alive model established based on deep learning are as follows:
[0050] S31, set the number of rounds of training period episode, initialize the model memory pool D, and initialize the state-action value function Q and the target state-action value function Q using the grid parameter θ.
[0051] The grid parameter θ is used to represent the prediction probability. Because we cannot guarantee 100% accuracy of the prediction, the longer the prediction time, the lower the prediction accuracy, which will actually have a certain impact on our strategy. When the prediction accuracy is low, even if the cold start time of the function is long, but if it is not called, the preheating or keep-alive decision made will also waste memory space. Therefore, the prediction probability is also an essential factor in the model; the Q function is specifically expanded as Q(s t ,a t ; θ); Specifically expanded as a', θ - is the target state-action value function The selected action and the grid parameter are used to distinguish the parameters of the learned state-action value function Q.
[0052] S32, judge the training of episode and take countermeasures:
[0053] If there is an untrained episode, initialize the environment and the state, start the next round of training, otherwise terminate the training;
[0054] S33, take a strategy according to the terminal state of the time slot:
[0055] If the training reaches the terminal state of the time slot, select And return to step S32; if it does not reach the terminal state, use the ∈-greedy algorithm to train the model and learn in a loop, and reinitialize the environment and state after each learning until the training reaches the terminal state, and return to step S32;
[0056] S34, the training is completed, the function keep-alive strategy is obtained, and the container preheating and keep-alive of the edge device are realized.
[0057] Further, the specific process of training the model by the ∈-greedy algorithm is as follows:
[0058] S331, randomly select an action a t in the environment and execute it to obtain a state s t+1 , and obtain an incentive r t ;
[0059] S332, update the state (s t ,at r t s t+1 ) into the memory pool D; wherein s t is the state when the action is not performed;
[0060] S333, randomly draw a state (s j ,a j ,r j ,s j+1 ) from the memory pool D, and make a decision based on this;
[0061]
[0062] y j is the value score in training, i.e., the incentive; max’ a is the maximum function;
[0063] S334, perform a gradient descent step on (y i -Q(s j ,a j ; θ)) 2 for the grid parameters θ.
[0064] Further, experience replay is used in the process of training learning, correlation is eliminated, so that the data satisfies independent and identically distributed, the variance of parameter update is reduced, the convergence speed is improved, the utilization rate of data is improved, and a C value is set, the grid parameters and Q values are updated every C rounds of training in the training process.
[0065] A storage medium stores instructions and data for implementing a container preheating and keep-alive method of an edge device.
[0066] A computer device comprises a processor and the storage medium; the processor loads and executes the instructions and data in the storage medium to implement a container preheating and keep-alive method of an edge device.
[0067] The technical scheme provided by the application has the beneficial effects that: the application obtains the function called by the edge device and the time series data thereof, establishes a time series model, trains the function from the function time series data, predicts the calling condition of the function in the future confidence time period, establishes a container preheating and keep-alive model based on deep learning, trains and learns the container preheating and keep-alive model by using the scheduling condition of the function in the future confidence time period, and optimizes the function preheating and keep-alive strategy, thereby realizing the container preheating and keep-alive of the edge device and solving the serious cold start problem in the edge device. BRIEF DESCRIPTION OF DRAWINGS
[0068] The application will be further described below with reference to the drawings and embodiments, and the drawings show:
[0069] Figure 1 is a flow chart of a container preheating and keep-alive method of an edge device in an embodiment of the present application;
[0070] Figure 2 is a schematic diagram of an algorithm used by a container preheating and keep-alive model established based on deep learning in an embodiment of the present application;
[0071] Figure 3 is a schematic diagram of a model training convergence graph in an embodiment of the present application;
[0072] Figure 4 is a schematic diagram of an average startup time graph comparison in an embodiment of the present application;
[0073] Figure 5 is a schematic diagram of an average cold startup time graph comparison in an embodiment of the present application;
[0074] Figure 6 is a schematic diagram of hardware device operation in an embodiment of the present application. DETAILED DESCRIPTION
[0075] In order to have a clearer understanding of the technical features, objectives and effects of the present application, the specific embodiments of the present application will be described in detail with reference to the accompanying drawings.
[0076] Embodiments of the present application provide a container preheating and keep-alive method of an edge device, a device and a storage medium.
[0077] Please refer to Figure 1 , Figure 1 is a flow chart of a container preheating and keep-alive method of an edge device in an embodiment of the present application, which specifically includes the following steps:
[0078] Step 1, obtain the function called by the edge device and its time series data.
[0079] This embodiment is performed on an edge server with an average value of 200MB as preheating and keep-alive memory and a processing capacity of 1.4GHz processing capacity. The data used is 20 functions of Microsoft Azure Function with relatively high call frequency in July 2019.
[0080] Step 2, establish a time series model, train the model from the function time series data, and predict the calling situation of the function in the future confidence period.
[0081] Step 1, organize the function time series data and represent it as (t i ,y i );
[0082] wherein t i is a timestamp, yi This represents the number of times the corresponding function was called.
[0083] Step 2: Establish a time series model based on linear regression, train the model using time series data of historical function calls, and predict the scheduling of the function in future confidence periods.
[0084] Among them, the function time series data is the time-series data of the trend and changes in the historical function calls.
[0085] Predicting which functions will be called in the next moment allows for successful warm-up and keep-alive mechanisms. We use a time series model to predict function calls, specifically as follows: Figure 2 As shown, after training with historical data, the number of function calls within the next 100 minutes is predicted, achieving a relatively accurate value compared to the original data. Once we have the function call information, we can perform function scheduling, container warm-up, and keep-alive operations.
[0086] The third step is to establish a container preheating and keep-alive model based on deep learning.
[0087] Due to the limited and heterogeneous resources of edge devices, serverless computing function scheduling can no longer rely on simple scheduling algorithms. Only a reasonable scheduling scheme can ensure that all functions can be executed, or even executed with minimal latency.
[0088] Based on the above, we consider using a reinforcement learning model. First, function scheduling needs to be dynamically adjusted based on real-time system state and workload, while reinforcement learning models can learn and adjust strategies in real time to adapt to constantly changing situations. It can adjust function scheduling based on trends and changes in time-series data, achieving better dynamic adaptability. Second, the function scheduling problem typically involves multiple decision variables, including when to call the function, how to allocate resources, and task priorities. Reinforcement learning models can handle this high-dimensional, discrete, and continuous mixed decision space, finding the optimal strategy. By predicting function time series data through reinforcement learning, containers can be more rationally warmed up or kept alive, improving dynamic adaptability, handling complex decision problems, making function scheduling more intelligent, efficient, and adaptive, and contributing to improved overall system performance and resource utilization.
[0089] Therefore, the above problem can be transformed into a reinforcement learning framework, and then solved using reinforcement learning algorithms. First, we need to model it according to the reinforcement learning framework.
[0090] First, at the beginning of each time slot, the serverless platform will receive a series of function requests, and at the beginning of each time slot, the server of the entire system has some still alive containers, the serverless platform can take action to continue to keep alive these containers for use, or close these containers to recycle resources to create new containers. We use the call situation according to the predicted function future confidence time period obtained in the second step to deliver a series of function requests to the serverless edge device platform.
[0091] The framework for establishing a container preheating and alive model based on deep learning is as follows:
[0092] The serverless edge device platform is the environment.
[0093] The server of the edge device is the agent.
[0094] The state of the model is the alive state of the function in the container:
[0095] For the case of the edge device keeping alive the container of the function f in the time slot t, Indicates the alive state of the function f in the time slot t, let S represent the state set, and the alive state of the function in the time slot t is defined as s t Then s t ∈S, and
[0096] The actions of the model include: deploying the function, creating the container for the function, and keeping alive the container for the function:
[0097] Let a t ∈A, a t Indicates the action taken in the time slot t, A represents the action set, and a t Can be written as: Wherein,
[0098] (1) Indicates the deployment action of the function f, Indicates that the server k deploys the function f in the time slot t, Indicates not to deploy;
[0099] (2) Indicates the alive container action on the server, Indicates that the server k continues to keep alive the container of the function f in the time slot t, Indicates no longer alive;
[0100] (3) Indicates the container creation action of the server for the function, Indicates that the server k creates the function f in the time slot t, is not created.
[0101] The incentive of the model is the average start-up latency, and constraints are set to punish abnormal strategy taking.
[0102] The formula of the incentive is:
[0103]
[0104] r t denotes the incentive of reinforcement learning in time slot t; k1, k2 are preset large positive real numbers; n denotes a server, n e N, is the set of servers in the serverless platform; R is the incentive function of reinforcement learning, which is T t is assigned.
[0105] and respectively denote the remaining memory resources and the remaining computing resources of server n in time slot t, which are used as constraints:
[0106]
[0107]
[0108] where M n is the memory resource of device n, C n is the computing resource of device n, s f is the memory size occupied by the container of function f, s’ f is the warm-up container size of function f, c f is the computing resource required by the invocation of function f; denotes the deployment decision of the container of function f in time slot t; denotes the keep-alive decision of the container of function f in time slot t; denotes the creation decision of the container of function f in time slot t.
[0109] T t denotes the time of function start-up in time slot t, and its formalized calculation steps are as follows:
[0110] (1) Each server, the computing capability of the function running carried by the server in each time slot must not exceed the upper limit of the computing capability of the server:
[0111]
[0112] (2) The sum of the storage space sizes of the containers contained by each server in any time slot must not exceed the upper limit of the memory of the server:
[0113]
[0114] (3) For the variable The function f can only be deployed on the server after it is scheduled at time t, and the scheduled function must and can only be deployed to one server, so:
[0115]
[0116] (4) In terms of container preheating and keep-alive, if the last time slot has kept the container alive, a new container will not be created in this time slot, so we have:
[0117]
[0118] (5) The next time slot can only be kept alive after the previous time slot is kept alive, or the previous time slot is not kept alive, but the current time slot creates the container, to decide whether to keep alive:
[0119]
[0120] (6) Calculate the time of function startup in a time slot:
[0121]
[0122] where, represents the request rate of function f in time slot t; T f represents the cold start time of function f; σ f represents the time required to create a container for function f; represents the container used to keep function f alive in the previous time slot.
[0123] After defining the system state, action and incentive, we need to give a value function to calculate the Q value. We use Q π (S,a) to represent the expected reward value obtained by taking action a in state S according to the given policy π, and thus define a state-action value function, usually denoted as Q(s,a), which measures the expected cumulative reward that the agent can obtain by taking action a in a given state s.
[0124] Specifically, for a certain state-action pair (s,a), the state-action value function Q(s,a) is defined as the sum of the expected cumulative rewards obtained by starting from state s, taking action a, and following a certain policy of the agent. The optimal Q value function is established in the form of:
[0125]
[0126] where α is the learning rate. The optimal policy is to take the action that maximizes the Q value function at each step.
[0127] In the traditional Q-learning algorithm, the state-action is maintained in a Q table, and the table is updated by continuous learning, so as to train better results. However, due to the high complexity of real problems, usually our state and action are not low-dimensional, for example, in our problem, the state and action space are very large, so it is not possible to maintain a table according to the traditional Q-learning method. Fortunately, existing methods have improved the traditional Q-learning method by integrating a deep neural network (DNN) into Q-learning, obtaining Q values through a neural network without incurring huge memory costs to maintain a table, thereby overcoming the problem of high problem dimension. This method is called DQN. We can use this method to solve our problem.
[0128] Fourthly, the scheduling situation of the function future confidence time period is used to train and learn the container preheating and keep-alive model, so as to obtain the best function preheating and keep-alive strategy, and then realize the container preheating and keep-alive of the edge device.
[0129] Based on DQN, we propose a function scheduling and container preheating and keep-alive algorithm based on reinforcement learning, and the specific process of the algorithm is as shown in Figure 2 In this algorithm, we use the ∈-greedy algorithm to randomly select actions with a probability of ∈, and select the action with the maximum Q(S, a; θ) value with a probability of 1-∈. When the number of training increases, the value of ∈ should be smaller and smaller. And in the learning process, experience replay is used to eliminate correlation, so that the data satisfies independent and identically distributed, reduces the variance of parameter update, improves the convergence speed, and improves the utilization of data. The specific steps of the algorithm are as follows:
[0130] Step one, set the number of training cycles episode, initialize the model memory pool D, and use the grid parameter θ to initialize the state-action value function Q and the target state-action value function Q
[0131] Here, the grid parameter θ is used to represent the prediction probability; the Q function is specifically expanded as Q(s t ,A t ; θ); Specifically expanded as a’、θ - is the target state-action value function The selected action and the grid parameter are used to distinguish the parameters of the learning state-action value function Q.
[0132] Step two, judge the training situation of episode and take countermeasures:
[0133] There are untrained episodes, initialize the environment and state, start the next round of training, otherwise terminate the training.
[0134] Step three, according to the terminal situation of the time slot, adopt the strategy:
[0135] Training the terminal state of the time slot And return to step S32; not to the terminal state, use the e-greedy algorithm to train the model loop learning, reinitialize the environment and state after each learning, until the training to the terminal state, return to step two.
[0136] Step four, after the training is terminated, the function keep-alive strategy is obtained, and the container preheating and keep-alive of the edge device are realized.
[0137] Wherein, the specific process of training the model by e-greedy algorithm is:
[0138] (1) randomly select an action a in the environment t And execute, get state s t+1 , and get the incentive r t ;
[0139] (2) store the state (s t , a t , r t , s t+1 ) in the memory pool D; wherein s t is the state before the action is executed;
[0140] (3) randomly extract the state (s j , a j , rj j , s j+1 ) from the memory pool D, and make a decision on this basis:
[0141]
[0142] y j is the value score in training, i.e. the incentive; max’ a is the maximum value function;
[0143] (4) perform gradient descent steps on (y i -Q(s j , a j ; θ)) 2 on the grid parameters θ.
[0144] In addition, experience replay is used in the process of training learning, correlation is eliminated, data meets independent and identical distribution, variance of parameter update is reduced, convergence speed is improved, data utilization is improved, and a C value is set, and grid parameters and Q values are updated every C training rounds in the training process.
[0145] The specific algorithm is as shown in the figure, in the two-layer neural network of the DNN in the embodiment, 200 and 256 neurons are respectively set. ReLU is used as an activation function in each neuron. In addition, a target network is used for error calculation, and the parameters of the target network are replaced with the parameters of the estimation network after every 100 iterations. The experience replay memory is set to 20,000, the size of the mini-batch is set to 128, and alpha is set to 0.9.
[0146] The final training convergence of the DRL is as shown in Figure 3 It can be seen that when the training rounds reach 220 rounds, the model has begun to converge. This is because in order to accelerate the convergence of the model, the parameters k1 and k2 in the incentive function are set to a value that decreases over time, and when the agent gives an unreasonable action (memory and computing resources exceed the upper limit), the current training is immediately terminated. Therefore, in one round of training, although the agent may give an action that violates our resource constraints at a certain time, we still need to reward the correct actions at the previous time.
[0147] In order to prove the effectiveness of the invention, in the embodiment, we compare the same environment and the currently popular container preheating or keep-alive algorithms Round Robin and FnSched, and the final effect is as shown in Figure 4 and Figure 5 The experimental results show that when the memory capacity is less than 200MB, the average startup time of the algorithm is 45.71% and 22.45% faster than Round Robin and FnSched, and the average cold startup time is 41.18% and 13.04% faster than Round Robin and FnSched; when the memory capacity is less than 100MB, the average startup time of the algorithm is 41.84% and 22.97% faster than Round Robin and FnSched, and the average cold startup time is 36.96% and 9.38% faster than Round Robin and FnSched, thus showing good performance.
[0148] Please refer to Figure 6 , Figure 6 is a hardware device working schematic diagram of an embodiment of the application, and the hardware device specifically comprises: a computer device 401, a processor 402 and a storage medium 403.
[0149] A computer device 401: the computer device 401 implements the container preheating and keep-alive method of the edge device.
[0150] A processor 402: the processor 402 loads and executes instructions and data in the storage medium 403 for implementing the container preheating and keep-alive method of the edge device.
[0151] A storage medium 403: the storage medium 403 stores instructions and data; the storage medium 403 is used to implement the container preheating and keep-alive method of the edge device.
[0152] The technical key point of the present application is:
[0153] 1. Adjust the scheduling of the function according to the trend and change in the time series data. At the beginning of each time slot, the serverless platform will receive a series of function requests, and at the beginning of each time slot, the servers of the entire system have some containers that are still alive. The serverless platform can take action to continue to keep the containers alive for use, or close the containers to recycle resources and create new containers.
[0154] 2. Get rewards by stimulating functions. At each time slot, when the agent makes a corresponding action, we can determine And In order not to exceed the computing power and memory space of the server, we define the amount after the agent makes an action as: (1) Represents the remaining memory resources of server n at time slot t; (2) Represents the remaining computing resources of server n at time slot t. Then our incentive can be written as: Where k1 and k2 are positive real numbers and are set large enough.
[0155] The beneficial effects of the present application are: the present application obtains the function called by the edge device and the time series data thereof, establishes a time series model, trains the function from the function time series data, predicts the calling situation of the function in the future confidence time period, establishes a container preheating and keep-alive model based on deep learning, trains and learns the container preheating and keep-alive model using the scheduling situation of the function in the future confidence time period, and optimizes the function preheating and keep-alive strategy, thereby realizing the container preheating and keep-alive of the edge device and solving the serious cold start problem in the edge device.
[0156] It should be pointed out finally that the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit the same; and although the present application has been described in detail with reference to the foregoing embodiments, it should be appreciated by those skilled in the art that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features thereof can be replaced equivalently; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Citation Information
Patent Citations
Container management method and device in server-free computing
CN117093330A
Hybrid strategy optimization method and system based on Serverless cold start problem
CN117331621A