Container caching method and device without server edge computing, equipment and medium
By optimizing request mapping and container cache strategy in the scheduler layer and edge server layer of serverless edge computing, the problem of difficult to balance the resource utilization and startup delay in container cache is solved, and efficient edge computing resource utilization and low-latency response are achieved.
Patent Information
- Application Number
- CN202411728418.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2044-11-28
AI Technical Summary
In the prior art, the container cache of serverless edge computing is difficult to balance between resource utilization and startup delay.
In the scheduler layer, the node with the lowest cost required to process user requests is determined among multiple edge computing nodes for request mapping; in the edge server layer, the container access frequency is predicted based on the time series requested by the user, the candidate cache container is determined, and the cache container is dynamically determined based on the upper confidence bound algorithm.
It realizes the reduction of startup delays while reducing overall cost of edge servers, improves the utilization rate of edge computing resources, and achieves an effective balance between resource utilization and startup delay, and improves user experience.
Smart Images

Figure CN119743481A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of edge computing technology, and in particular to a container caching method, device, equipment and medium for serverless edge computing. Background Art
[0002] With the rapid development of the Internet of Things (IoT) and 5G technology, massive mobile terminal devices have generated a large amount of data and computing tasks. Traditional cloud computing transmits data to remote cloud data centers for processing. Although it has powerful computing capabilities, the transmission delay increases significantly due to the long physical distance between users and cloud data centers, making it difficult to meet application scenarios with high requirements for real-time performance and response speed. For this reason, edge computing came into being. It reduces transmission delay and improves task processing efficiency by performing computing tasks at the edge of the network. However, traditional edge computing architectures have problems such as low resource utilization and poor scalability, which can easily lead to insufficient server resources, especially during peak request periods.
[0003] Serverless Edge Computing is an emerging model that dynamically starts lightweight containers to execute IoT services based on event triggering mechanisms, significantly improving resource utilization efficiency. However, the container startup delay is high, especially for short-term computing task scenarios, the startup delay seriously affects the response speed. In order to optimize the startup delay, the strategy of pre-caching the container to the edge server is usually adopted, but this can easily lead to a waste of limited resources and reduce system efficiency. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a container caching method for serverless edge computing to solve the technical problem of the difficulty in balancing resource utilization and startup delay in container caching in the prior art. The method includes:
[0005] At the scheduling machine layer, for each user request, the edge computing node with the lowest cost for processing the user request is determined among multiple edge computing nodes, and the user request is mapped to the determined edge computing node for processing;
[0006] At the edge server layer, for each edge computing node mapped with a user request, the frequency at which a container of the edge computing node will be accessed by future user requests is predicted based on the time series of the user requests, and the container of the edge computing node is determined as a candidate cache container based on the frequency;
[0007] The cache container is dynamically determined among the candidate cache containers based on an upper confidence bound algorithm.
[0008] The embodiment of the present invention also provides a container cache device for serverless edge computing to solve the technical problem of the difficulty in balancing resource utilization and startup delay in container cache in the prior art. The device includes:
[0009] A request distribution module is used to determine, at the scheduling machine layer, for each user request, an edge computing node with the lowest cost for processing the user request from multiple edge computing nodes, and map the user request to the determined edge computing node for processing;
[0010] A container candidate module is used to predict, at the edge server layer, for each edge computing node mapped with a user request, the frequency at which the container of the edge computing node will be accessed by future user requests according to the time series of the user requests, and determine the container of the edge computing node as a candidate cache container according to the frequency;
[0011] The container cache module is used to dynamically determine the cached container among the candidate cache containers based on the upper confidence bound algorithm.
[0012] An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements any of the above-mentioned container caching methods for serverless edge computing to solve the technical problem in the prior art that it is difficult to balance resource utilization and startup delay in container caching.
[0013] An embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program for executing any of the above-mentioned container caching methods for serverless edge computing, so as to solve the technical problem in the prior art that it is difficult to balance resource utilization and startup delay in container caching.
[0014] Compared with the prior art, the beneficial effects that can be achieved by at least one of the above-mentioned technical solutions adopted in the embodiments of this specification include at least: it is proposed that at the scheduling machine layer, the edge computing node with the lowest cost for processing the user request is determined among multiple edge computing nodes, and the user request is mapped to the determined edge computing node for processing, thereby realizing efficient allocation of user requests; at the edge server layer, the frequency at which the container of the edge computing node will be accessed by future user requests is predicted based on the time series of user requests, and the container of the edge computing node is determined as a candidate cache container based on the frequency, and then the cached container is dynamically determined in the candidate cache container based on the upper confidence bound algorithm, thereby realizing dynamic container caching based on future access frequencies, while reducing startup delays, reducing the overall cost of edge servers, thereby improving the utilization of edge computing resources, achieving an effective balance between resource utilization and startup delays, and also helping to improve user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0016] Figure 1 It is a flow chart of a container caching method for serverless edge computing provided by an embodiment of the present invention;
[0017] Figure 2 This is an overall principle architecture diagram of a container caching method for serverless edge computing provided by an embodiment of the present invention;
[0018] Figure 3 is a schematic diagram of the architecture of an improved DQN model provided by an embodiment of the present invention;
[0019] Figure 4 This is a schematic diagram of average energy consumption comparison provided by an embodiment of the present invention;
[0020] Figure 5 This is a schematic diagram for comparing average resource utilization rates provided by an embodiment of the present invention;
[0021] Figure 6 is a schematic diagram for comparing average response times provided by an embodiment of the present invention;
[0022] Figure 7 A structural block diagram of a computer device provided by an embodiment of the present invention;
[0023] Figure 8 A structural block diagram of a container cache device for serverless edge computing provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0024] The embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0025] The following describes the implementation methods of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The present application can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that, in the absence of conflict, the following embodiments and the features in the embodiments can be combined with each other. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work belong to the scope of protection of the present application.
[0026] In an embodiment of the present invention, a container caching method for serverless edge computing is provided, such as Figure 1 As shown, the method includes:
[0027] Step S101: At the scheduling machine layer, for each user request, an edge computing node with the lowest cost for processing the user request is determined among multiple edge computing nodes, and the user request is mapped to the determined edge computing node for processing;
[0028] Step S102: At the edge server layer, for each edge computing node mapped with a user request, predict the frequency at which a container of the edge computing node will be accessed by future user requests based on the time series of the user requests, and determine the container of the edge computing node as a candidate cache container based on the frequency;
[0029] Step S103: dynamically determining a cache container from candidate cache containers based on an upper confidence bound algorithm.
[0030] Depend on Figure 1 As can be seen from the process shown, in an embodiment of the present invention, it is proposed that at the scheduling machine layer, an edge computing node with the lowest cost for processing the user request is determined among multiple edge computing nodes, and the user request is mapped to the determined edge computing node for processing, thereby realizing efficient allocation of user requests; at the edge server layer, the frequency with which the container of the edge computing node will be accessed by future user requests is predicted based on the time series of user requests, and the container of the edge computing node is determined as a candidate cache container based on the frequency, and then the cached container is dynamically determined in the candidate cache container based on the upper confidence bound algorithm, thereby realizing dynamic container caching based on future access frequencies, while reducing the startup delay and reducing the overall cost of the edge server, thereby improving the utilization rate of edge computing resources, achieving an effective balance between resource utilization and startup delay, and also helping to improve user experience.
[0031] In specific implementation, this application takes minimizing the total system overhead as the optimization goal, and implements dynamic container caching in the scenario of serverless edge computing to reduce the overall user delay and the operating cost of the edge server. In order to realize the intelligent and efficient scheduling and distribution of user requests to the appropriate (i.e., the lowest total delay and total resource cost) edge computing node (also known as edge server or edge device) for execution, such as Figure 2 As shown, in the process of distributing user requests, this embodiment proposes the following steps to determine the edge computing node with the lowest cost (i.e., the lowest total delay and total resource cost) required to process the user request among multiple edge computing nodes, for example,
[0032] Calculate the Haversine distance between the user end and multiple scheduling machines respectively;
[0033] Select the dispatcher corresponding to the minimum distance among multiple Haversine distances;
[0034] In the edge computing node cluster where the selected scheduling machine is located, an improved artificial bee colony algorithm is used to determine the edge computing node with the lowest cost to process the user request. In the improved artificial bee colony algorithm, the number of iterations of the employed bee stage and the number of iterations of the observation bee stage are adaptively controlled, and the solution is updated.
[0035] In specific implementation, the Haversine distances between the user end and multiple dispatchers can be calculated in the following way. The distance between the dispatcher and the user end is calculated based on the theory of spherical trigonometry to ensure that the node closest to the user is selected to reduce communication delay. Assume that the longitude and latitude coordinates of dispatcher i are The longitude and latitude coordinates of client j are in represents latitude, and λ represents longitude. First, convert the angle unit to radians, and then calculate the latitude difference And the longitude difference Δλ. According to the haversine formula, we can get: Then use the inverse tangent function atan2 to calculate the central angle c: Finally, the Haversine distance d between the two points is calculated: d = R·c, where R is the average radius of the earth, which is approximately 6371 km.
[0036] In a specific implementation, each dispatcher corresponds to an edge computing node cluster, which includes edge computing nodes within a preset area.
[0037] In the specific implementation, after determining the dispatcher closest to the user end, in the edge computing node cluster where the selected dispatcher is located, combined with the load of each edge computing node, it is proposed to use the improved artificial bee colony algorithm (IABC) to determine the edge computing node with the lowest cost for processing the user request. After the improved artificial bee colony algorithm (IABC) adopts the roulette selection strategy in the observation bee stage, in order to achieve a dynamic balance between exploration and utilization in different stages, adaptive control parameters α and β are introduced to control the number of iterations in the employed bee stage and the observation bee stage respectively, and realize the intelligent update of the understanding. For example,
[0038] A set of candidate solutions is randomly generated through the artificial bee colony algorithm. Each candidate solution represents a user request and is mapped to an edge computing node in the edge computing node cluster.
[0039] In the hired bee stage, each candidate solution is taken as the current candidate solution, and the neighborhood of the current candidate solution is searched to find a new solution. If the fitness value of the new solution is greater than the fitness value of the current candidate solution, the current candidate solution is updated to the new solution, wherein the number of iterations of the hired bee stage is controlled by the first adaptive control parameter;
[0040] In the observation bee stage, according to the fitness value of each candidate solution in the employed bee stage, a roulette wheel selection strategy is used to select a part of candidate solutions from the candidate solutions in the employed bee stage, and the neighborhood of each selected candidate solution is searched to find a new solution. If the fitness value of the new solution is greater than the fitness value of the selected candidate solution, the selected candidate solution is updated to the new solution, wherein the number of iterations in the observation bee stage is controlled by the second adaptive control parameter;
[0041] In the reconnaissance bee stage, a randomly generated new solution is used to replace the candidate solution that has not been improved within the preset time. Among all the current candidate solutions, the candidate solution that minimizes the objective function value of the artificial bee colony algorithm is selected, and the selected candidate solution is used as the final solution. The edge computing node in the final solution is used as the edge computing node with the lowest cost to process the user request.
[0042] In specific implementation, the roulette wheel selection strategy is a proportional selection method based on fitness value, which allocates the probability of each solution being selected according to its quality (i.e., fitness value). The higher the quality of the solution, the greater the probability of being selected, and vice versa.
[0043] In a specific implementation, the first adaptive control parameter α is:
[0044]
[0045] Among them, t is the current iteration number, T1 is the maximum iteration number of the employed bee stage, α max and αmin are the upper and lower bounds of α respectively;
[0046] The second adaptive control parameter is β:
[0047]
[0048] Among them, T2 is the maximum number of iterations in the observation bee stage, β max and β min are the upper and lower bounds of β respectively; the objective function of the artificial bee colony algorithm is:
[0049]
[0050] Among them, min F(P) represents the objective function value, Indicates user request Mapped to edge computing nodes k The total processing delay is Indicates user request Mapped to edge computing nodes k The total resource cost of the processing.
[0051] In specific implementation, α and β in the objective function of the artificial bee colony algorithm are the first adaptive control parameter and the second adaptive control parameter, respectively, which are used to balance the total delay and total resource cost in the optimization objective. The total delay of user requests mapped to the edge computing node for processing Includes communication delays for requests and results transmitted across the network and the waiting time of requests in the edge computing node Among them, the communication delay Including the latency of request transmission from regional scheduling machine to edge computing node and the latency of the results being returned from the edge computing node to the user Right now The total resource cost of edge computing nodes processing user requests It depends on the resource cost of instantiating the relevant container after the user request is mapped to the edge server. The resource types considered include CPU, GPU, memory and storage, which are represented by the set M. Mapped to edge servers (or edge computing nodes) k Total resource cost of processing The calculation formula is as follows: in, Represents a container The demand for resource res, unit_cost(res) is the unit cost of resource res.
[0052] In specific implementation, the process of using the improved artificial bee colony algorithm to determine the edge computing node with the lowest cost for processing the user request can be implemented through the following steps:
[0053] The algorithm consists of three main phases: employed bee phase, observation bee phase and scout bee phase. The workflow of each phase is as follows: In the initialization phase, the algorithm first randomly generates a set of candidate solutions. Each candidate solution represents a strategy for distributing a user request to an edge computing node (or a mapping relationship between a user request and an edge computing node for distribution). Then, the fitness value of each candidate solution is calculated. The fitness value can be measured and calculated based on indicators such as average response time and load balancing. The algorithm will continue to run until the termination condition is met. In the employed bee phase, the algorithm searches the neighborhood of each current candidate solution to find a new candidate solution that is potentially better. If the fitness value of the new candidate solution found is higher than the fitness value of the current candidate solution, the current candidate solution is updated to the new candidate solution to ensure that the algorithm always moves towards a better solution. In the observation bee phase, the algorithm selects a part of the candidate solutions using a roulette wheel selection strategy based on the fitness value of each candidate solution, and further searches the neighborhood of these candidate solutions. If a better new candidate solution is found, the current candidate solution information will also be updated. This stage speeds up the search efficiency by focusing on candidate solutions with high fitness values. In the scout bee stage, for those candidate solutions that have not been improved for a long time, the algorithm will randomly generate new solutions to replace these stagnant candidate solutions, avoid falling into the dilemma of local optimal solutions, and enhance the global search ability of the algorithm. Among all the current candidate solutions, select the candidate solution that minimizes the objective function value of the artificial bee colony algorithm, and use the candidate solution corresponding to the minimum objective function value as the final solution. The edge computing node in the final solution is used as the edge computing node with the lowest cost to process the user request, and the user request is distributed to the edge computing node with the lowest cost to process the user request, realizing the task forwarding mechanism. According to the objective function, the distribution of user requests takes into account the cloud cost (that is, the total resource cost mentioned above).
[0054] In the specific implementation, after the user request is distributed to the edge computing node, the container cache work starts to determine whether to cache the container for subsequent user request access. In order to realize the real-time analysis of the system status information to adaptively control the container cache and destruction strategy, so as to optimize resource allocation while ensuring service quality, reduce service response delay and energy consumption, such as Figure 2 As shown in FIG, the process of container caching proposes to introduce a long short-term memory network into the DQN model (i.e., deep Q network) to analyze and predict which containers may be frequently accessed in future user requests, and then determine candidate cache containers, for example,
[0055] Introducing a long short-term memory network into the DQN model, inputting the time series of the user request into the long short-term memory network, and outputting the access frequency of each container of the edge computing node in future requests, wherein the output end of the long short-term memory network is connected to the input end of the Q network of the DQN model;
[0056] Calculating the Q value of each container based on the frequency;
[0057] The container whose Q value reaches the preset threshold is determined as a candidate cache container.
[0058] In the specific implementation, in order to better model the time series characteristics, it is proposed to introduce the network structure of the DQN model into the LSTM (Long Short-Term Memory Network). Figure 3 As shown in the figure, during the container caching process, LSTM is used to analyze and predict the time series of user requests. The LSTM model is good at processing time series data, so it can effectively capture the long-term dependencies in the user request pattern, that is, LSTM outputs the frequency at which each container may be accessed in future user requests, and then calculates the Q value of each container based on this frequency, and then determines the duration of caching which containers are used as candidate cache containers based on the relationship between the Q value and the preset threshold. In this way, future user request loads can be predicted in advance, the caching strategy can be optimized, and key containers can be quickly started when needed, reducing the startup delay of tasks.
[0059] In specific implementation, LSTM is introduced into the DQN model to form an LSTM-DQN model, which can better mine the timing characteristics in container caching decisions. Specifically, Figure 3 As shown in the figure, the input end of the original Q network in the DQN model is connected to the output end of the LSTM, and the state sequence s1, s2, ..., s t Input into LSTM in sequence, and the output h of the last time step t As the feature representation of the current state, it is then mapped to the action value Q(s) through the fully connected layer t ,a). In this way, the Q value depends not only on the current state s t , which also contains information about the previous state, and can make more global and long-term decisions. In the model training phase, Stochastic Gradient Descent (SGD) is used to optimize the parameters of LSTM-DQN. The loss function corresponding to the temporal difference (TD) error is: in, is the experience replay buffer, γ is the discount factor, θ -is the target Q network parameter, whose update frequency is lower than that of the Q network parameter θ, s′ is the state at the next moment, a′ is the action at the next moment, s is the state at the current moment, a is the action at the current moment, and r is the reward value at the current moment; is the expected value of Q.
[0060] In the specific implementation, in addition to improving the Q network structure, the exploration strategy of the DQN model is also optimized. The traditional DQN mechanism has the defects of requiring manual debugging and setting hyperparameters and not considering the uncertainty and potential benefits of actions. In order to overcome these limitations, an adaptive exploration strategy based on the upper confidence bound (UCB) is proposed in the action selection and update part of the DQN model. According to the current resource status, the UCB algorithm is used to decide whether to cache the container and select the optimal cache object to ensure that the cache strategy can dynamically adapt to the system load. For example,
[0061] In the action selection part of the DQN model, each arm in the multi-armed bandit algorithm is used as each candidate cache container, and the number of times each arm is pulled is used as the number of selections of each candidate cache container. When all candidate cache containers are selected at least once, the average reward and confidence interval of each candidate cache container are calculated by the multi-armed bandit algorithm.
[0062] Based on the average reward and confidence interval, calculate the upper confidence bound of each candidate cache container;
[0063] The candidate cache container with the largest upper confidence bound value is determined as the cache container.
[0064] In specific implementation, the upper confidence bound of each candidate cache container is calculated based on the average reward and confidence interval using the following formula:
[0065]
[0066] Among them, UCB i is the upper confidence bound of candidate cache container i, S i is the cumulative reward of candidate cache container i, n i is the number of times candidate cache container i is selected, represents the average return of candidate cache container i, which reflects the known value of the candidate cache container, t is the current time step, represents the exploration reward term, which reflects the uncertainty of the candidate cache container i.
[0067] In specific implementation, the adaptive exploration algorithm based on the upper confidence bound (UCB) is mainly used to balance exploration and exploitation in the multi-armed bandit problem, and maximize the cumulative reward by dynamically selecting the optimal "arm". The core idea is to select actions that have performed well in history (exploitation) and explore actions that have not been fully tried (exploration). In the initialization phase, the algorithm initializes the number of times each arm (candidate container) (action) is pulled (number of selections) to 0, and initializes the cumulative reward of each arm to 0. Then, an iterative loop is performed, and the algorithm continues to make decisions until the termination condition is reached (a certain number of iterations or the expected reward is reached). For the case where all arms are pulled at least once, the algorithm calculates the average reward and confidence interval of each arm, and then calculates the UCB value of each arm based on these values. The UCB value is derived from the average return and exploration potential of the arm, which can ensure that both the arm with excellent performance and the arm with high uncertainty are selected. The algorithm then selects the arm with the highest UCB value to execute. For arms that have not been pulled, the algorithm will give priority to an arm that has not been pulled to ensure that all actions have been explored. In the update phase of the algorithm, once an arm is selected, the algorithm will pull the arm and observe the reward it obtains. Next, the number of pulls and cumulative rewards of the arm are updated. Finally, when the termination condition is met, the algorithm returns the arm with the highest cumulative reward as the current optimal choice. This application introduces the UCB strategy into the DQN algorithm and obtains the UCB-DQN algorithm, which uses each arm in the multi-armed slot machine algorithm as each candidate cache container, and the number of times each arm is pulled as the number of selections for each candidate cache container. At each time step, UCB-DQN is based on To calculate the UCB value of each (i.e. candidate cache container), and select the action with the largest UCB value as the current decision: Through dynamic balanced exploration and utilization, UCB-DQN can more efficiently search the state-action space and discover a better caching strategy. At the same time, the UCB strategy also reduces the dependence on ε parameter tuning and improves the algorithm's adaptability and generalization performance.
[0068] In the specific implementation, in the container cache decision module of this article, the DQN model commonly used in deep reinforcement learning is used to approximate the optimal action-state value function Q(s,a).
[0069] This application uses the LSTM neural network as the Q network with the current state sequence s t As input, output each optional action a t The Q value Q(s) in this state t ,a t ). The Q value represents the state s t Take action a tAnd the expected cumulative reward when acting according to the optimal strategy. The parameters of the Q network are recorded as θ, and are updated by minimizing the temporal difference (TD) error. The specific objective function is as follows: in, is the state s at time t t , action a at time t t , the reward r at time t t And the state s at time t+1 t+1 The expected value in the case, the target value y t Defined as: Q′(s t+1 , a; θ - ) is the state s at time t+1 t+1 and the estimated value for action a.
[0070] The target Q network has the same LSTM architecture as the Q network, but the parameters θ of the target Q network are - The update frequency is low (e.g., once every C steps) to provide a relatively stable Q value estimate and avoid oscillation and drift of the estimated target. During the training process, the parameters θ of the Q network are minimized by a gradient descent algorithm (e.g., Adam) to continuously approach the estimated value Q' of the target network. Through this dual-network architecture design, the improved DQN model can effectively approximate the optimal Q function and use the TD target as a supervisory signal for training, thereby learning a high-quality cache decision strategy. Figure 3 As shown in the figure, during the training process, after executing the action a at the current moment in the environment, the reward value r at the current moment and the state s′ at the next moment are input into the experience pool, and then the greedy strategy is learned based on a, s, r and s′. The learning results are combined with the predicted Q value, the output result of the target Q network and the output result of the loss function as the input of UCB.
[0071] In specific implementation, this application proposes a cost-optimized intelligent container caching strategy (PICSE, i.e., the container caching method for serverless edge computing mentioned above), which includes two major parts: the request distribution part RDM and the container caching part CDM, which are responsible for the scheduling of task requests to edge servers and the dynamic management of container caches, respectively. In RDM, this application designs an improved artificial bee colony algorithm IABC, introduces preset thresholds, adaptive control parameters, intelligent solution updates and other mechanisms, and improves the algorithm's search efficiency and solution quality. In CDM, this application adopts an intelligent caching decision model based on DQN, and realizes the adaptive optimization of caching strategies through deep learning and reinforcement learning techniques.
[0072] based on Figure 4 ( Figure 4Base in the table represents the average energy consumption when using random request distribution and LRU cache strategy as the baseline strategy result), 5( Figure 5 Base in the table represents the average resource utilization when random request distribution and LRU cache strategy are used as the baseline strategy result), 6( Figure 6 The Base in the figure represents the average response time when the random request distribution and LRU cache strategies are used as the baseline strategy result). It can be seen that the above-mentioned serverless edge computing container caching method (PICSE) using RDM and CDM collaborative optimization enables the system to achieve greater improvements in average energy consumption overhead, average resource utilization, average response time and other performance than the optimization using RDM alone (i.e., RDM-only) or CDM alone (i.e., CDM-only). It effectively reduces the average startup delay of tasks, improves the resource utilization of edge servers, and significantly reduces the operating cost of the system while ensuring user experience.
[0073] In this embodiment, a computer device is provided, such as Figure 7 As shown, it includes a memory 701, a processor 702, and a computer program stored in the memory and executable on the processor. The memory 701 and the processor 702 are connected to an internal bus of a computer device. When the processor executes the computer program, any of the above-mentioned serverless edge computing container caching methods is implemented.
[0074] Specifically, the computer device may be a computer terminal, a server or a similar computing device.
[0075] In this embodiment, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program for executing any of the above-mentioned container caching methods for serverless edge computing.
[0076] Specifically, computer-readable storage media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer-readable storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable storage media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0077] Based on the same inventive concept, a container caching device for serverless edge computing is also provided in an embodiment of the present invention, as described in the following embodiments. Since the principle of solving the problem by the container caching device for serverless edge computing is similar to that of the container caching method for serverless edge computing, the implementation of the container caching device for serverless edge computing can refer to the implementation of the container caching method for serverless edge computing, and the repeated parts will not be repeated. As used below, the term "unit" or "module" can be a combination of software and / or hardware that implements predetermined functions. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0078] Figure 8 is a structural block diagram of a container cache device for serverless edge computing according to an embodiment of the present invention, such as Figure 8 As shown, including:
[0079] The request distribution module 801 is used to determine, at the scheduling machine layer, for each user request, an edge computing node with the lowest cost for processing the user request from multiple edge computing nodes, and map the user request to the determined edge computing node for processing;
[0080] The container candidate module 802 is used to predict, at the edge server layer, for each edge computing node mapped with a user request, the frequency at which the container of the edge computing node will be accessed by future user requests according to the time series of the user requests, and determine the container of the edge computing node as a candidate cache container according to the frequency;
[0081] The container caching module 803 is used to dynamically determine a cached container from the candidate cache containers based on an upper confidence bound algorithm.
[0082] In one embodiment, a request distribution module is used to calculate the Haversine distances between a user terminal and multiple scheduling machines respectively; select a scheduling machine corresponding to the minimum distance value from multiple Haversine distances; and use an improved artificial bee colony algorithm to determine the edge computing node with the lowest cost for processing the user request in the edge computing node cluster where the selected scheduling machine is located, wherein the number of iterations of the employed bee stage and the number of iterations of the observation bee stage are adaptively controlled in the improved artificial bee colony algorithm, and the solution is updated.
[0083] In one embodiment, a request distribution module is used to randomly generate a set of candidate solutions through an artificial bee colony algorithm, where each candidate solution represents a user request mapped to an edge computing node in an edge computing node cluster; in the employed bee stage, each candidate solution is used as the current candidate solution, and the neighborhood of the current candidate solution is searched to find a new solution. If the fitness value of the new solution is greater than the fitness value of the current candidate solution, the current candidate solution is updated to the new solution, wherein the number of iterations of the employed bee stage is controlled by a first adaptive control parameter; in the observation bee stage, according to the fitness value of each candidate solution in the employed bee stage, a roulette wheel selection strategy is used to select the candidate solution in the employed bee stage. A part of candidate solutions is selected, and the neighborhood of each selected candidate solution is searched to find a new solution. If the fitness value of the new solution is greater than the fitness value of the selected candidate solution, the selected candidate solution is updated to a new solution, wherein the number of iterations of the observation bee stage is controlled by the second adaptive control parameter; in the reconnaissance bee stage, a randomly generated new solution is used to replace the candidate solution that has not been improved within a preset time length, and among all the current candidate solutions, the candidate solution that minimizes the objective function value of the artificial bee colony algorithm is selected, and the selected candidate solution is used as the final solution, and the edge computing node in the final solution is used as the edge computing node with the lowest cost for processing the user request.
[0084] In one embodiment, a container candidate module is used to introduce a long short-term memory network into a DQN model, input the time series of the user request into the long short-term memory network, and output the frequency of each container of the edge computing node being accessed in future requests, wherein the output end of the long short-term memory network is connected to the input end of the Q network of the DQN model; calculate the Q value of each container according to the frequency; and determine the container whose Q value reaches a preset threshold as a candidate cache container.
[0085] In one embodiment, a container cache module is used to use each arm in the multi-armed bandit algorithm as each candidate cache container in the action selection part of the DQN model, and the number of times each arm is pulled as the number of selections of each candidate cache container. When all candidate cache containers are selected at least once, the average reward and confidence interval of each candidate cache container are calculated by the multi-armed bandit algorithm; based on the average reward and confidence interval, the upper confidence bound value of each candidate cache container is calculated; and the candidate cache container with the largest upper confidence bound value is determined as the cached container.
[0086] The embodiments of the present invention achieve the following technical effects: it proposes to determine, at the scheduling machine layer, an edge computing node with the lowest cost for processing the user request among multiple edge computing nodes, map the user request to the determined edge computing node for processing, and achieve efficient allocation of user requests; at the edge server layer, predict the frequency at which the container of the edge computing node will be accessed by future user requests based on the time series of user requests, determine the container of the edge computing node as a candidate cache container based on the frequency, and then dynamically determine the cached container in the candidate cache container based on the upper confidence bound algorithm, thereby achieving dynamic container caching based on future access frequencies, while reducing startup delays, reducing the overall cost of edge servers, thereby improving the utilization of edge computing resources, achieving an effective balance between resource utilization and startup delays, and also helping to improve user experience.
[0087] Obviously, those skilled in the art should understand that the modules or steps of the above-mentioned embodiments of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the embodiments of the present invention are not limited to any specific combination of hardware and software.
[0088] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A container caching method for serverless edge computing, characterized in that: include: At the scheduling machine layer, for each user request, the edge computing node with the lowest cost for processing the user request is determined among multiple edge computing nodes, and the user request is mapped to the determined edge computing node for processing; At the edge server layer, for each edge computing node mapped with a user request, the frequency at which a container of the edge computing node will be accessed by future user requests is predicted based on the time series of the user requests, and the container of the edge computing node is determined as a candidate cache container based on the frequency; The cache container is dynamically determined among the candidate cache containers based on an upper confidence bound algorithm.
2. The container caching method for serverless edge computing according to claim 1, characterized in that: Determine the edge computing node with the lowest cost for processing the user request from multiple edge computing nodes, including: Calculate the Haversine distance between the user end and multiple scheduling machines respectively; Select the dispatcher corresponding to the minimum distance among multiple Haversine distances; In the edge computing node cluster where the selected scheduling machine is located, an improved artificial bee colony algorithm is used to determine the edge computing node with the lowest cost to process the user request. In the improved artificial bee colony algorithm, the number of iterations of the employed bee stage and the number of iterations of the observation bee stage are adaptively controlled, and the solution is updated.
3. The container caching method for serverless edge computing according to claim 2, characterized in that: In the edge computing node cluster where the selected scheduler is located, an improved artificial bee colony algorithm is used to determine the edge computing node with the lowest cost for processing the user request, wherein the number of iterations of the employed bee stage and the number of iterations of the observation bee stage are adaptively controlled in the improved artificial bee colony algorithm, and the solution is updated, including: A set of candidate solutions is randomly generated through the artificial bee colony algorithm. Each candidate solution represents a user request and is mapped to an edge computing node in the edge computing node cluster. In the hired bee stage, each candidate solution is taken as the current candidate solution, and the neighborhood of the current candidate solution is searched to find a new solution. If the fitness value of the new solution is greater than the fitness value of the current candidate solution, the current candidate solution is updated to the new solution, wherein the number of iterations of the hired bee stage is controlled by the first adaptive control parameter; In the observation bee stage, according to the fitness value of each candidate solution in the employed bee stage, a roulette wheel selection strategy is used to select a part of candidate solutions from the candidate solutions in the employed bee stage, and the neighborhood of each selected candidate solution is searched to find a new solution. If the fitness value of the new solution is greater than the fitness value of the selected candidate solution, the selected candidate solution is updated to the new solution, wherein the number of iterations in the observation bee stage is controlled by the second adaptive control parameter; In the reconnaissance bee stage, a randomly generated new solution is used to replace the candidate solution that has not been improved within the preset time. Among all the current candidate solutions, the candidate solution that minimizes the objective function value of the artificial bee colony algorithm is selected, and the selected candidate solution is used as the final solution. The edge computing node in the final solution is used as the edge computing node with the lowest cost to process the user request.
4. The container caching method for serverless edge computing according to claim 3, characterized in that: The first adaptive control parameter α is: Among them, t is the current iteration number, T1 is the maximum iteration number of the employed bee stage, α max and α min are the upper and lower bounds of α respectively; The second adaptive control parameter is β: Among them, T2 is the maximum number of iterations in the observation bee stage, β max and β min are the upper and lower bounds of β respectively; The objective function of the artificial bee colony algorithm is: Among them, minF(P) represents the objective function value, Indicates user request Mapped to edge computing node S k The total processing delay is Indicates user request Mapped to edge computing node S k The total resource cost of the processing.
5. The container caching method for serverless edge computing according to any one of claims 1 to 4, characterized in that: Predicting a frequency at which a container of the edge computing node will be accessed by future user requests according to a time series of user requests, and determining a container of the edge computing node as a candidate cache container according to the frequency, includes: Introducing a long short-term memory network into the DQN model, inputting the time series of the user request into the long short-term memory network, and outputting the access frequency of each container of the edge computing node in future requests, wherein the output end of the long short-term memory network is connected to the input end of the Q network of the DQN model; Calculating the Q value of each container based on the frequency; The container whose Q value reaches the preset threshold is determined as a candidate cache container.
6. The container caching method for serverless edge computing according to any one of claims 1 to 4, characterized in that: The cache container is dynamically determined from the candidate cache containers based on the upper confidence bound algorithm, including: In the action selection part of the DQN model, each arm in the multi-armed bandit algorithm is used as each candidate cache container, and the number of times each arm is pulled is used as the number of selections of each candidate cache container. When all candidate cache containers are selected at least once, the average reward and confidence interval of each candidate cache container are calculated by the multi-armed bandit algorithm. Based on the average reward and confidence interval, calculate the upper confidence bound of each candidate cache container; The candidate cache container with the largest upper confidence bound value is determined as the cache container.
7. The container caching method for serverless edge computing according to claim 6, characterized in that: Based on the average reward and confidence interval, calculate the upper confidence bound of each candidate cache container, including: The upper confidence bound of each candidate cache container is calculated based on the average reward and confidence interval using the following formula: Among them, UCB i is the upper confidence bound of candidate cache container i, S i is the cumulative reward of candidate cache container i, n i is the number of times candidate cache container i is selected, represents the average return of candidate cache container i, t is the current time step, Represents an exploration reward item.
8. A container cache device for serverless edge computing, characterized in that: include: A request distribution module is used to determine, at the scheduling machine layer, for each user request, an edge computing node with the lowest cost for processing the user request from multiple edge computing nodes, and map the user request to the determined edge computing node for processing; A container candidate module is used to predict, at the edge server layer, for each edge computing node mapped with a user request, the frequency at which the container of the edge computing node will be accessed by future user requests according to the time series of the user requests, and determine the container of the edge computing node as a candidate cache container according to the frequency; The container cache module is used to dynamically determine the cached container among the candidate cache containers based on the upper confidence bound algorithm.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the container caching method for serverless edge computing described in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program for executing the container caching method for serverless edge computing according to any one of claims 1 to 7.
Citation Information
Patent Citations
Online container scheduling method, system and terminal based on edge computing
CN118467184A
Dynamic weight updates for neural networks
US20220366220A1