Container caching methods, apparatus, devices and media for serverless edge computing
By using an improved artificial bee colony algorithm and deep reinforcement learning in edge computing systems, and dynamically optimizing container caching strategies, the problem of balancing resource utilization and startup latency in edge computing is solved, thereby improving resource utilization and user experience.
Patent Information
- Application Number
- CN202411728418.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-11-28
AI Technical Summary
In traditional edge computing architectures, container caching presents a challenge in balancing resource utilization and startup latency, which can easily lead to insufficient server resources, especially during peak request periods.
At the scheduler layer, the lowest-cost node is determined among multiple edge computing nodes using an improved artificial bee colony algorithm. At the edge server layer, the container caching strategy is dynamically determined based on the upper confidence bound algorithm, and deep reinforcement learning is used to predict future request frequencies to optimize container caching decisions.
It achieves an effective balance between resource utilization and startup latency, reduces the overall cost of edge servers, and improves the utilization of computing resources and user experience.
Smart Images

Figure CN119743481B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of edge computing technology, and in particular to a container caching method, apparatus, device and medium for serverless edge computing. Background Technology
[0002] With the rapid development of the Internet of Things (IoT) and 5G technologies, massive numbers of mobile terminal devices are generating huge amounts of data and computing tasks. Traditional cloud computing transmits data to remote cloud data centers for processing. While it possesses powerful computing capabilities, the physical distance between users and cloud data centers significantly increases transmission latency, making it difficult to meet the demands of applications requiring high real-time performance and response speed. Edge computing has emerged to address this issue. It reduces transmission latency and improves task processing efficiency by executing computing tasks at the network edge. However, traditional edge computing architectures suffer from low resource utilization and poor scalability, especially prone to server resource shortages during peak request periods.
[0003] Serverless edge computing, as an emerging paradigm, dynamically launches lightweight containers to execute IoT services based on an event-triggered mechanism, significantly improving resource utilization efficiency. However, container startup latency is relatively high, especially for short-duration computing tasks, where startup latency severely impacts response speed. To optimize startup latency, a common strategy is to pre-cache containers on edge servers, but this can easily lead to a waste of limited resources and reduce system efficiency. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a container caching method for serverless edge computing to solve the technical problem in the prior art where it is difficult to balance resource utilization and startup latency in container caching. The method includes:
[0005] At the scheduling layer, for each user request, the edge computing node with the lowest cost to process the user request is determined from 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 to user requests, 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.
[0007] The cache container is dynamically determined from the candidate cache containers based on the upper confidence bound algorithm.
[0008] This invention also provides a serverless edge computing container caching device to address the technical problem in existing technologies where it is difficult to balance resource utilization and startup latency in container caching. The device includes:
[0009] The request distribution module is used at the scheduling layer to determine the edge computing node with the lowest cost to process each user request from multiple edge computing nodes, and then map the user request to the determined edge computing node for processing.
[0010] The container candidate module is used at the edge server layer to predict, based on the time series of user requests, the frequency at which the container of each edge computing node will be accessed by future user requests, and to determine the container of the edge computing node as a candidate cache container based on the frequency.
[0011] The container caching module is used to dynamically determine the cache container from among the candidate cache containers based on the upper confidence bound algorithm.
[0012] This 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 the above-mentioned container caching method for any of the serverless edge computing, thereby solving the technical problem in the prior art where it is difficult to balance resource utilization and startup latency in container caching.
[0013] This invention also provides a computer-readable storage medium storing a computer program that executes any of the above-described serverless edge computing container caching methods, in order to solve the technical problem in the prior art where it is difficult to balance resource utilization and startup latency in container caching.
[0014] Compared with the prior art, the beneficial effects achieved by at least one of the above-mentioned technical solutions adopted in the embodiments of this specification include at least the following: At the scheduler layer, the edge computing node with the lowest cost required to process the user request is determined from among multiple edge computing nodes, and the user request is mapped to the determined edge computing node for processing, achieving efficient allocation of user requests; at the edge server layer, the frequency of future user requests accessing the container of the edge computing node is predicted based on the time series of the user request, 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 based on the upper confidence bound algorithm among the candidate cache containers, realizing dynamic container caching based on future access frequency. This reduces startup latency and lowers 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 latency, and also improving user experience. Attached Figure Description
[0015] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a flowchart of a container caching method for serverless edge computing provided in an embodiment of the present invention;
[0017] Figure 2 This is a schematic diagram of the overall principle architecture of the above-mentioned serverless edge computing container caching method provided by an embodiment of the present invention;
[0018] Figure 3 This is a schematic diagram of the architecture of an improved DQN model provided in an embodiment of the present invention;
[0019] Figure 4 This is a schematic diagram comparing average energy consumption costs provided by an embodiment of the present invention;
[0020] Figure 5 This is a schematic diagram illustrating the comparison of average resource utilization rates provided in an embodiment of the present invention;
[0021] Figure 6 This is a schematic diagram illustrating the comparison of average response times provided in an embodiment of the present invention;
[0022] Figure 7 A structural block diagram of a computer device provided in an embodiment of the present invention;
[0023] Figure 8 The present invention provides a structural block diagram of a serverless edge computing container caching device. Detailed Implementation
[0024] The embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0025] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. This application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0026] In this embodiment of the 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 layer, for each user request, the edge computing node with the lowest cost to process the user request is determined from 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 user requests, 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, and determine the container of the edge computing node as a candidate cache container based on the frequency.
[0029] Step S103: Dynamically determine the cache container from the candidate cache containers based on the upper confidence bound algorithm.
[0030] Depend on Figure 1 As shown in the process, in this embodiment of the invention, at the scheduler layer, the edge computing node with the lowest cost to process the user request is determined from multiple edge computing nodes, and the user request is mapped to the determined edge computing node for processing, thus achieving efficient allocation of user requests. At the edge server layer, the frequency of future user requests accessing the container of the edge computing node is predicted based on the time series of the user request, and the container of the edge computing node is determined as a candidate cache container based on the frequency. Then, the cached container is dynamically determined from the candidate cache containers based on the upper confidence bound algorithm, realizing dynamic container caching based on future access frequency. This reduces startup latency and lowers 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 latency, and also improving user experience.
[0031] In practical implementation, this application aims to minimize the total system overhead by implementing dynamic container caching in serverless edge computing scenarios to reduce overall user latency and edge server operating costs. To achieve intelligent and efficient scheduling and distribution of user requests to appropriate (i.e., those with the lowest total latency and resource costs) edge computing nodes (also known as edge servers or edge devices), 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 latency and total resource cost) among multiple edge computing nodes for processing the user request. For example,
[0032] Calculate the Haversine distances between the user terminal and multiple schedulers;
[0033] Select the scheduler with the minimum distance from multiple Haversine distances;
[0034] In the edge computing node cluster where the selected scheduler is located, the improved artificial bee colony algorithm is used to determine the edge computing node with the lowest cost required to process the user request. In the improved artificial bee colony algorithm, the number of iterations in the hired bee phase and the number of iterations in the observer bee phase are adaptively controlled, and the solution is updated.
[0035] In practice, the Haversine distances between the user terminal and multiple schedulers can be calculated using the following method: The distance between the scheduler and the user terminal is calculated based on spherical trigonometry to ensure that the node closest to the user is selected to reduce communication latency. Let the latitude and longitude coordinates of scheduler i be... The latitude and longitude coordinates of user j are: in Let λ represent latitude and λ represent longitude. First, convert the angular units to radians, then calculate the latitude difference. And the longitude difference Δλ. According to the semi-versus formula, we can obtain: Then, using the arctangent function atan2, calculate the central angle c: Finally, calculate the Haversine distance d between the two points: d = R·c, where R is the average radius of the Earth, approximately 6371 km.
[0036] In practice, each scheduling machine corresponds to an edge computing node cluster, which includes edge computing nodes within a preset area.
[0037] In practical implementation, after determining the scheduler closest to the user terminal, within the edge computing node cluster where the selected scheduler resides, and considering the load of each edge computing node, an improved Artificial Bee Colony Algorithm (IABC) is proposed to determine the edge computing node with the lowest cost required to process the user request. After employing a roulette wheel selection strategy in the observation bee phase, the improved IABC introduces adaptive control parameters α and β to achieve a dynamic balance between exploration and utilization in different phases. These parameters control the iteration count in the hired bee phase and the observation bee phase, respectively, and enable intelligent updates of the solution. For example,
[0038] A set of candidate solutions is randomly generated using the artificial bee colony algorithm. Each candidate solution represents a user request that is mapped to an edge computing node in the edge computing node cluster.
[0039] In the bee-hiring phase, each candidate solution is taken as the current candidate solution, and a new solution is found by searching the neighborhood of the current candidate 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. The number of iterations in the bee-hiring phase is controlled by the first adaptive control parameter.
[0040] During the observation bee phase, based on the fitness value of each candidate solution in the hired bee phase, a roulette wheel selection strategy is used to select a subset of candidate solutions from the candidate solutions in the hired bee phase. A search is performed on the neighborhood of each selected candidate solution 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. The number of iterations in the observation bee phase is controlled by a second adaptive control parameter.
[0041] During the reconnaissance phase, a randomly generated new solution is used to replace the candidate solution that has not been improved within a preset time period. Among all the current candidate solutions, the candidate solution that minimizes the objective function value of the artificial bee colony algorithm is selected. This selected candidate solution is taken as the final solution, and the edge computing node in the final solution is taken as the edge computing node with the lowest cost required to process the user request.
[0042] In practice, the roulette wheel selection strategy is a proportional selection method based on fitness values. It 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 it being selected, and vice versa.
[0043] In specific implementation, the first adaptive control parameter α is:
[0044]
[0045] Where t is the current iteration number, T1 is the maximum iteration number in the hired bee phase, and α max and αmin These are the upper and lower bounds of α, respectively;
[0046] The second adaptive control parameter is β:
[0047]
[0048] Where T2 is the maximum number of iterations in the observation bee phase, β max and β min Let be the upper and lower bounds of β, respectively; the objective function of the artificial bee colony algorithm is:
[0049]
[0050] Where min F(P) represents the objective function value. Indicates user request Mapped to edge computing nodes k Total processing latency Indicates user request Mapped to edge computing nodes k The total resource cost of processing.
[0051] In practical implementation, α and β in the objective function of the artificial bee colony algorithm are the first and second adaptive control parameters, respectively, used to balance the total latency and total resource cost in the optimization objective. The total latency of a user request being mapped to processing on an edge computing node is also considered. This includes communication latency in the transmission of requests and results over the network. and the queuing time for requests on edge computing nodes Among them, communication latency This includes the latency of request transmission from the regional scheduler to the edge computing node. And the latency of returning the results from the edge computing node to the user. Right now Total resource cost of edge computing nodes processing user requests This depends on the resource cost of instantiating the relevant containers after a user request is mapped to the edge server. The resource types considered include CPU, GPU, memory, and storage, denoted by the set M. User request 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, where unit_cost(res) is the unit cost of resource res.
[0052] In practice, the process of determining the edge computing node with the lowest cost to process the user request using the improved artificial bee colony algorithm can be implemented through the following steps:
[0053] The algorithm comprises three main phases: the hired bee phase, the observer bee phase, and the 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 between a user request and a distributed edge computing node). Then, the fitness value of each candidate solution is calculated, which can be measured based on metrics such as average response time and load balancing. The algorithm continues to run until a termination condition is met. In the hired bee phase, the algorithm searches the neighborhood of each current candidate solution to discover potentially better new candidate solutions. If the fitness value of a new candidate solution is higher than that of the current candidate solution, the current candidate solution is updated to the new candidate solution, ensuring that the algorithm always moves towards better solutions. In the observer bee phase, the algorithm selects a subset of candidate solutions using a roulette wheel selection strategy based on the fitness value of each candidate solution and further searches the neighborhoods of these candidate solutions. If a better new candidate solution is found, the current candidate solution information is also updated. This phase accelerates the search efficiency by focusing on candidate solutions with high fitness values. During the scout bee phase, for candidate solutions that haven't improved for a long time, the algorithm randomly generates new solutions to replace these stagnant ones, avoiding getting trapped in local optima and enhancing the algorithm's global search capability. Among all current candidate solutions, the one that minimizes the objective function value of the artificial bee colony algorithm is selected. This candidate solution with the minimum objective function value is taken as the final solution, and the edge computing nodes in the final solution are selected as the edge computing nodes with the lowest processing cost for that user request. The user request is then distributed to the edge computing nodes with the lowest processing cost, implementing a task forwarding mechanism. As can be seen from the objective function, the distribution of user requests takes into account cloud costs (i.e., the total resource cost mentioned above).
[0054] In practice, after distributing user requests to edge computing nodes, container caching begins, determining whether to cache the container for future user requests. To adaptively control container caching and destruction strategies based on real-time analysis of system status information, thereby optimizing resource allocation and reducing service response latency and energy consumption while ensuring service quality, such as... Figure 2 As shown, the container caching process proposes introducing a Long Short-Term Memory (LSTM) network into the DQN (Deep Q-Network) model to analyze and predict which containers are likely to be frequently accessed in future user requests, thereby identifying candidate cache containers. For example,
[0055] A Long Short-Term Memory (LSTM) network is introduced into the DQN model. The time series of the user request is input into the LTM network, and the frequency of each container of the edge computing node being accessed in future requests is output. The output of the LTM network is connected to the input of the Q network of the DQN model.
[0056] Calculate the Q value of each container based on the frequency;
[0057] Containers whose Q value reaches a preset threshold are identified as candidate cache containers.
[0058] In practical implementation, to better model temporal features, it is proposed to introduce the network structure of the DQN model into the LSTM (Long Short-Term Memory) network. For example... Figure 3 As shown, during container caching, LSTM is used to analyze and predict the time series of user requests. LSTM models excel at processing time series data, thus effectively capturing long-term dependencies in user request patterns. Specifically, LSTM outputs the frequency at which each container might be accessed in future user requests, and then calculates the Q-value for each container based on this frequency. The duration of caching is then determined based on the relationship between the Q-value and a preset threshold, making these containers candidate cache containers. In this way, future user request load can be predicted in advance, caching strategies can be optimized, and critical containers can be started quickly when needed, reducing task startup latency.
[0059] In practical implementation, incorporating LSTM into the DQN model to form the LSTM-DQN model can better uncover the temporal characteristics in container caching decisions. Specifically, for example... Figure 3 As shown, the input of the original Q-network in the DQN model is connected to the output of the LSTM, and the state sequence s1, s2, ..., s of the user-requested time series is converted into the output of the LSTM. t The data is sequentially input into the LSTM, and the output h of the last time step is then processed. t The features representing the current state are then mapped to the action value Q(s) through a fully connected layer. t a). Thus, the Q value depends not only on the current state s. t It also contains information from previous states, enabling more global and long-term decisions. During model training, stochastic gradient descent (SGD) is used to optimize the parameters of LSTM-DQN. The loss function corresponding to temporal difference (TD) error is: in, For experience replay buffer, γ is the discount factor, and θ is the value of the value. -Let be the target Q network parameters, whose update frequency is lower than that of the Q network parameters θ, s′ be the state at the next time step, a′ be the action at the next time step, s be the state at the current time step, a be the action at the current time step, and r be the reward value at the current time step. Let Q be the expected value.
[0060] In practical implementation, in addition to improving the Q-network structure, the exploration strategy of the DQN model was also optimized. Traditional DQN mechanisms suffer from drawbacks such as requiring manual debugging and hyperparameter setting, and failing to consider the uncertainty and potential rewards of actions. To overcome these limitations, an adaptive exploration strategy based on Upper Confidence Bound (UCB) is proposed for the action selection and update parts of the DQN model. This strategy uses the UCB algorithm to determine whether to cache containers and select the optimal cached objects based on the current resource state, ensuring that the caching 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 slot machine algorithm is used as a candidate cache container, and the number of times each arm is pulled is used as the selection number 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 slot machine algorithm.
[0062] Based on the average reward and confidence interval, calculate the upper confidence bound for each candidate cache container;
[0063] The candidate cache container with the largest upper confidence threshold is determined as the cache container.
[0064] In practice, the upper confidence bound for each candidate cache container is calculated using the following formula, based on the average reward and confidence interval:
[0065]
[0066] Among them, UCB i S is the upper confidence bound of candidate cache container i. i It is the cumulative reward of candidate cache container i, n i It is the number of times candidate cache container i is selected. represents the average return of candidate cache container i, reflecting the known value of that candidate cache container, where t is the current time step. This represents the exploration reward, which reflects the uncertainty of candidate cache container i.
[0067] In practical implementation, this adaptive exploration algorithm based on Upper Confidence Bound (UCB) is mainly used to balance exploration and exploitation in multi-armed slot machine problems, maximizing cumulative rewards by dynamically selecting the optimal "arm". Its core idea is to select historically well-performing actions (exploitation) while also exploring actions that haven't been fully tried (exploration). In the initialization phase, the algorithm initializes the number of times each arm (candidate container) (action) has been pulled (selection count) to 0 and the cumulative reward for each arm to 0. Then, it iterates, continuously making decisions until a termination condition is met (reaching a certain number of iterations or reaching the desired reward). For cases where all arms have been pulled at least once, the algorithm calculates the average reward and confidence interval for each arm, and then calculates the UCB value for each arm based on these values. The UCB value is derived from a combination of the arm's average reward and exploration potential, ensuring that both high-performing arms are selected and arms with high uncertainty are explored. The algorithm then selects the arm with the highest UCB value to execute. For arms that haven't been pulled yet, the algorithm prioritizes selecting one to ensure all actions have been explored. During the algorithm's update phase, once an arm is selected, it is pulled, and the reward is observed. Then, the number of pulls and the cumulative reward for that 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, resulting in the UCB-DQN algorithm. It uses each arm in the multi-armed slot machine algorithm as a candidate cache container, and the number of times each arm is pulled as the selection count for each candidate cache container. At each time step, UCB-DQN... Calculate the UCB value for each (i.e., candidate cache container) and select the action with the largest UCB value as the current decision: By dynamically balancing exploration and utilization, UCB-DQN can more efficiently search the state-action space and discover better caching strategies. At the same time, the UCB strategy reduces the dependence on ε parameter tuning, improving the algorithm's adaptability and generalization performance.
[0068] In practice, in the container caching decision module of this paper, the DQN model commonly used in deep reinforcement learning is adopted to approximate the optimal action-state value function Q(s,a).
[0069] This application uses an LSTM neural network as a Q-network, with the current state sequence s t Given 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 tThe expected cumulative reward when acting according to the optimal policy is calculated. The parameters of the Q-network are denoted as θ, and are updated by minimizing the temporal difference (TD) error. The specific objective function is as follows: in, Let s be the state at time t. t Action a at time t t Reward r at time t t and the state s at time t+1 t+1 Expected value, target value y under the given conditions t Defined as: Q′(s t+1 , a; θ - Let s be the state at time t+1. t+1 And the estimated value under 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 different. - The Q-network is updated at a low frequency (e.g., once every C steps) to provide a relatively stable Q-value estimate, avoiding oscillations and drift in the estimated target. During training, the parameters θ of the Q-network are minimized by gradient descent algorithms (e.g., Adam) to minimize the TD error, continuously approaching the estimated value Q' of the target network. Through this dual-network architecture, the improved DQN model can effectively approximate the optimal Q-function and uses the TD target as a supervision signal for training, thereby learning a high-quality caching decision strategy. Figure 3 As shown, during the training process, after the action a is performed in the environment at the current time, the reward value r at the current time and the state s′ at the next time are input into the experience pool. Then, the greedy policy is learned based on a, s, r and s′. The learning results are combined with the predicted Q value, the output of the target Q network and the output of the loss function as the input of UCB.
[0071] In practical implementation, this application proposes a cost-optimized intelligent container caching strategy (PICSE, i.e., the container caching method for serverless edge computing mentioned above). This strategy comprises two main parts: a request distribution mechanism (RDM) and a container caching mechanism (CDM), responsible for scheduling task requests to edge servers and dynamically managing container caching, respectively. In the RDM, this application designs an improved artificial bee colony algorithm (IABC), introducing mechanisms such as preset thresholds, adaptive control parameters, and intelligent solution updates to improve the algorithm's search efficiency and solution quality. In the CDM, this application employs a DQN-based intelligent caching decision model, achieving adaptive optimization of the caching strategy through deep learning and reinforcement learning techniques.
[0072] based on Figure 4 ( Figure 4In this context, Base represents the average energy consumption as the baseline strategy result when using random request distribution and LRU caching strategies. Figure 5 In this context, Base represents the average resource utilization rate as the baseline strategy result when using random request distribution and LRU caching strategies, and 6 ( Figure 6 (Base in the table represents the average response time when using random request distribution and LRU caching strategies as the baseline strategy result.) It can be seen that the above-mentioned container caching method (PICSE) for serverless edge computing, which uses RDM and CDM co-optimization, achieves a greater improvement in performance such as average energy consumption, average resource utilization, and average response time compared to optimization using RDM alone (i.e., RDM-only) or CDM alone (i.e., CDM-only). It effectively reduces the average startup latency 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 the internal bus of the computer device. When the processor executes the computer program, it implements any of the above-described container caching methods for serverless edge computing.
[0074] Specifically, the computer device can be a computer terminal, a server, or a similar computing device.
[0075] In this embodiment, a computer-readable storage medium is provided, which stores a computer program that performs any of the above-described serverless edge computing container caching methods.
[0076] Specifically, computer-readable storage media, including both permanent and non-permanent, removable and non-removable media, can store information using 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 technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable storage media does not include transient media, such as modulated data signals and carrier waves.
[0077] Based on the same inventive concept, this invention also provides a serverless edge computing container caching device, as described in the following embodiments. Since the principle behind the problem-solving of the serverless edge computing container caching device is similar to that of the serverless edge computing container caching method, the implementation of the serverless edge computing container caching device can refer to the implementation of the serverless edge computing container caching method, and repeated details will not be elaborated further. As used below, the terms "unit" or "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0078] Figure 8 This is a structural block diagram of a serverless edge computing container caching device according to an embodiment of the present invention, such as... Figure 8 As shown, it includes:
[0079] The request distribution module 801 is used at the scheduler layer to determine the edge computing node with the lowest cost required to process the user request among multiple edge computing nodes for each user request, and to map the user request to the determined edge computing node for processing.
[0080] The container candidate module 802 is used at the edge server layer to predict, based on the time series of user requests, the frequency at which the container of each edge computing node will be accessed by future user requests, and to determine the container of the edge computing node as a candidate cache container based on the frequency.
[0081] The container caching module 803 is used to dynamically determine the cache container from among the candidate cache containers based on the upper confidence bound algorithm.
[0082] In one embodiment, the request distribution module is used to calculate the Haversine distances between the user terminal and multiple schedulers; select the scheduler corresponding to the minimum distance among the multiple Haversine distances; and in the edge computing node cluster where the selected scheduler is located, use an improved artificial bee colony algorithm to determine the edge computing node with the lowest cost required to process the user request. In the improved artificial bee colony algorithm, the number of iterations in the hired bee phase and the number of iterations in the observer bee phase are adaptively controlled, and the solution is updated.
[0083] In one embodiment, the request distribution module is configured to randomly generate a set of candidate solutions using an artificial bee colony algorithm, where each candidate solution represents a user request mapped to an edge computing node in the edge computing node cluster. During the hired bee phase, each candidate solution is used as the current candidate solution, and a search is performed on its neighborhood to discover new solutions. If the fitness value of the new solution is greater than that of the current candidate solution, the current candidate solution is updated to the new solution. The number of iterations in the hired bee phase is controlled by a first adaptive control parameter. During the observer bee phase, based on the fitness value of each candidate solution in the hired bee phase, a roulette wheel selection strategy is used to select the candidate solutions from the hired bee phase. A subset of candidate solutions is selected, and a search is performed on the neighborhood of each selected candidate solution to discover new solutions. If the fitness value of the new solution is greater than that of the selected candidate solution, the selected candidate solution is updated to the new solution. The number of iterations in the observation bee phase is controlled by a second adaptive control parameter. In the scout bee phase, a randomly generated new solution is used to replace the candidate solutions that have not improved within a preset time period. Among all the current candidate solutions, the candidate solution that minimizes the objective function value of the artificial bee colony algorithm is selected as the final solution. The edge computing nodes in the final solution are selected as the edge computing nodes with the lowest cost required to process the user request.
[0084] In one embodiment, a container candidate module is used to introduce a long short-term memory network into the DQN model, input the time series of the user request into the long short-term memory network, and output the frequency at which each container of the edge computing node will be accessed in future requests. The output of the long short-term memory network is connected to the input of the Q network of the DQN model. The Q value of each container is calculated based on the frequency. Containers with Q values reaching a preset threshold are identified as candidate cache containers.
[0085] In one embodiment, the container caching module is used in the action selection part of the DQN model to treat each arm in the multi-armed slot algorithm as a candidate cache container, and the number of times each arm is pulled as the selection number of each candidate cache container. When all candidate cache containers are selected at least once, the module calculates the average reward and confidence interval of each candidate cache container using the multi-armed slot algorithm; calculates the upper confidence bound of each candidate cache container based on the average reward and confidence interval; and determines the candidate cache container with the largest upper confidence bound as the cache container.
[0086] The embodiments of this invention achieve the following technical effects: At the scheduler layer, the edge computing node with the lowest cost for processing a user request is determined from among multiple edge computing nodes. The user request is then mapped to the determined edge computing node for processing, achieving efficient allocation of user requests. At the edge server layer, the frequency of future user requests accessing the containers of the edge computing node is predicted based on the time series of the user request. The containers of the edge computing node are then determined as candidate cache containers based on this frequency. Furthermore, the cached containers are dynamically determined from the candidate cache containers using an upper confidence bound algorithm. This achieves dynamic container caching based on future access frequency, reducing startup latency and lowering the overall cost of the edge server, thereby improving the utilization rate of edge computing resources. This achieves an effective balance between resource utilization and startup latency, and also contributes to improving user experience.
[0087] Obviously, those skilled in the art should understand that the modules or steps of the above-described embodiments of the present invention can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the embodiments of the present invention are not limited to any particular hardware and software combination.
[0088] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, various modifications and variations can be made to the embodiments of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A container caching method for serverless edge computing, characterized in that, include: At the scheduling layer, for each user request, the edge computing node with the lowest cost to process the user request is determined from 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 to user requests, 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. The cache container is dynamically determined from the candidate cache containers based on the upper confidence bound algorithm; Based on the time series of user requests, predict the frequency with which the containers of the edge computing node will be accessed by future user requests, and determine the containers of the edge computing node as candidate cache containers based on the frequency, including: A Long Short-Term Memory (LSTM) network is introduced into the DQN model. The time series of the user request is input into the LTM network, and the frequency of each container of the edge computing node being accessed in future requests is output. The output of the LTM network is connected to the input of the Q network of the DQN model. Calculate the Q value of each container based on the frequency; Containers whose Q value reaches a preset threshold are identified as candidate cache containers; The upper confidence bound algorithm dynamically determines the cache container from the candidate cache containers, including: In the action selection part of the DQN model, each arm in the multi-armed slot machine algorithm is used as a candidate cache container, and the number of times each arm is pulled is used as the selection number 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 slot machine algorithm. Based on the average reward and confidence interval, calculate the upper confidence bound for each candidate cache container; The candidate cache container with the largest upper confidence boundary value is determined as the cache container; Based on the average reward and confidence interval, calculate the upper confidence bound for each candidate cache container, including: The upper confidence bound for each candidate cache container is calculated using the following formula, based on the average reward and confidence interval: in, It is the upper confidence bound of candidate cache container i. It is the cumulative reward of candidate cache container i. It is the number of times candidate cache container i is selected. This represents the average reward of candidate cache container i, where t is the current time step. This indicates the exploration reward items.
2. The container caching method for serverless edge computing as described in claim 1, characterized in that, Among multiple edge computing nodes, the edge computing node with the lowest cost required to process the user request is identified, including: Calculate the Haversine distances between the user terminal and multiple schedulers; Select the scheduler with the minimum distance from multiple Haversine distances; In the edge computing node cluster where the selected scheduler is located, the improved artificial bee colony algorithm is used to determine the edge computing node with the lowest cost required to process the user request. In the improved artificial bee colony algorithm, the number of iterations in the hired bee phase and the number of iterations in the observer bee phase are adaptively controlled, and the solution is updated.
3. The container caching method for serverless edge computing as described in claim 2, characterized in that, In the edge computing node cluster where the selected scheduler resides, an improved artificial bee colony algorithm is used to determine the edge computing node with the lowest cost required to process the user request. The improved artificial bee colony algorithm adaptively controls the number of iterations in the hired bee phase and the number of iterations in the observer bee phase, and updates the solution, including: A set of candidate solutions is randomly generated using the artificial bee colony algorithm. Each candidate solution represents a user request that is mapped to an edge computing node in the edge computing node cluster. In the bee-hiring phase, each candidate solution is taken as the current candidate solution, and a new solution is found by searching the neighborhood of the current candidate 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. The number of iterations in the bee-hiring phase is controlled by the first adaptive control parameter. During the observation bee phase, based on the fitness value of each candidate solution in the hired bee phase, a roulette wheel selection strategy is used to select a subset of candidate solutions from the candidate solutions in the hired bee phase. A search is performed on the neighborhood of each selected candidate solution 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. The number of iterations in the observation bee phase is controlled by a second adaptive control parameter. During the reconnaissance phase, a randomly generated new solution is used to replace the candidate solution that has not been improved within a preset time period. Among all the current candidate solutions, the candidate solution that minimizes the objective function value of the artificial bee colony algorithm is selected. This selected candidate solution is taken as the final solution, and the edge computing node in the final solution is taken as the edge computing node with the lowest cost required to process the user request.
4. The container caching method for serverless edge computing as described in claim 3, characterized in that, First adaptive control parameters for: Where t is the current iteration number, and T1 is the maximum number of iterations in the hired bee phase. and They are respectively The upper and lower bounds; The second adaptive control parameter is : Where T2 is the maximum number of iterations in the observation bee phase. and They are respectively The upper and lower bounds; The objective function of the artificial bee colony algorithm is: in, Represents the objective function value. Indicates user request Mapped to edge computing nodes Total processing latency Indicates user request Mapped to edge computing nodes The total resource cost of processing.
5. A container caching device for serverless edge computing, characterized in that, include: The request distribution module is used at the scheduling layer to determine the edge computing node with the lowest cost to process each user request from multiple edge computing nodes, and then map the user request to the determined edge computing node for processing. The container candidate module is used at the edge server layer to predict, based on the time series of user requests, the frequency at which the container of each edge computing node will be accessed by future user requests, and to determine the container of the edge computing node as a candidate cache container based on the frequency. The container caching module is used to dynamically determine the cache container from among the candidate cache containers based on the upper confidence bound algorithm; The container candidate module is used to introduce a long short-term memory network into the DQN model. The time series of the user request is input into the long short-term memory network, and the frequency of each container of the edge computing node being accessed in future requests is output. The output of the long short-term memory network is connected to the input of the Q network of the DQN model. The Q value of each container is calculated according to the frequency. Containers with Q values reaching a preset threshold are identified as candidate cache containers. The container caching module is used in the action selection part of the DQN model to treat each arm in the multi-armed slot machine algorithm as a candidate cache container, and the number of times each arm is pulled as the selection number 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 slot machine algorithm; based on the average reward and confidence interval, the upper confidence bound of each candidate cache container is calculated; and the candidate cache container with the largest upper confidence bound is determined as the cache container. The container caching module is used to calculate the upper confidence bound for each candidate cache container based on the average reward and confidence interval using the following formula: in, It is the upper confidence bound of candidate cache container i. It is the cumulative reward of candidate cache container i. It is the number of times candidate cache container i is selected. This represents the average reward of candidate cache container i, where t is the current time step. This indicates the exploration reward items.
6. 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, it implements the container caching method for serverless edge computing as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that performs the container caching method for serverless edge computing as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Online container scheduling method, system and terminal based on edge computing
CN118467184A
Dynamic weight updates for neural networks
US20220366220A1