Layered multi-edge cooperation no-service computing system
By designing a hierarchical multi-edge collaborative serviceless computing system in a mobile edge computing system, and using DRL and Lyapunov optimization methods to optimize task scheduling and mirror placement, problems such as service-free cold start and limited edge resources are solved, and system performance and user experience are improved.
Patent Information
- Application Number
- CN202411932441.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-04
AI Technical Summary
There are problems in existing mobile edge computing systems such as inefficient cold start without service, limited edge resources, unreasonable resource allocation, and high coupling of mirror placement and request scheduling, resulting in low system performance and low cost efficiency.
A hierarchical multi-edge collaborative serviceless computing system is designed. By dividing the system runtime into multiple time slots, optimizing task scheduling and mirror placement schemes, using DRL and Lyapunov optimization methods for resource allocation and mirror placement to maximize system performance.
By optimizing task scheduling and mirroring placement, the response delay of serviceless computing is reduced, the system's resource utilization rate and user's QoS are improved, and the system's energy consumption and operation and maintenance overhead are reduced.
Smart Images

Figure CN119767359A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of mobile edge computing technology, and in particular to a layered multi-edge collaborative serverless computing system. Background Art
[0002] With the rapid development of the Internet of Things (IoT), various intelligent applications have emerged and integrated into all aspects of people's lives, such as autonomous driving, virtual reality, and smart homes. However, IoT device resources are limited and cannot meet the high-performance requirements of these emerging intelligent applications. Although cloud computing has abundant computing and storage resources, it exposes problems such as severe network congestion, high latency, and high overhead. To alleviate these problems, Mobile Edge Computing (MEC) deploys resources at the edge of the network, and the computing tasks of intelligent applications can be offloaded to edge nodes for processing to reduce service latency and meet the quality of service (QoS). In existing MEC systems, developers usually use a pre-allocation mechanism to manage and optimize resources. Therefore, users need to pay in advance before using resources, regardless of whether they can fully utilize these resources. In this mode, additional operation and maintenance expenses need to be borne for idle resources, which leads to cost inefficiency. At the same time, developers must monitor the load of the MEC system in real time and adjust resource configuration according to its changes, which usually requires expert knowledge and lacks flexibility. In complex practical application scenarios, user needs may change at any time, which places extremely high demands on the speed and adaptability of resource adjustment.
[0003] As an emerging computing paradigm, serverless computing has shown great potential in improving resource utilization and development efficiency. In the serverless computing mode, developers can focus on writing business core logic code without managing server resources and long-running applications. Specifically, the application is split into a series of stateless functions that are triggered and executed only when needed. Therefore, there is no need to pre-allocate resources for these functions, which ensures elastic scaling and on-demand allocation of resources. By combining serverless computing and MEC, serverless mobile edge computing (SMEC) is regarded as a promising solution to deal with edge resource optimization problems. In SMEC, stateless function images can be placed on edge nodes according to user needs to provide serverless computing services. When the terminal device initiates a serverless computing request, SMEC responds to the request and feeds back the result through container technology. Although SMEC has many excellent features and broad application prospects, how to design an efficient SMEC system still faces the following important challenges.
[0004] (1) Inefficient cold start without service. The processing flow of the request without service in the SMEC system is as follows: Figure 1 Before executing a stateless function, four steps are usually required: request forwarding, image downloading, container initialization, and resource allocation. Figure 2 As shown in Figure 1, we measured the response time of executing functions written in different languages in existing serverless systems, among which the cold start time accounts for a high proportion in most cases. Existing work usually uses container preheating to reduce cold start latency or uses container reuse to avoid cold start, which requires preparing initialized containers in advance. However, these methods are prone to generate a large number of redundant containers, which seriously reduces the resource utilization of the SMEC system.
[0005] (2) Limited and heterogeneous edge resources. In SMEC, function images can be placed on edge nodes in advance to reduce cold start latency. However, the storage resources of a single edge node are limited and cannot store all function images. Frequently pulling images from the remote cloud will cause serious service delays and bandwidth pressure. In addition, service-free computing requests need to be scheduled to edge nodes where the corresponding function images have been placed. Inappropriate function image placement will cause idle edge resources to be unable to respond to service-free requests. At the same time, different edge nodes may be equipped with different computing and storage resources, which also poses a huge challenge to image placement and service-free request scheduling.
[0006] (3) Unreasonable resource allocation. Although developers do not need to directly manage the underlying resources, they still need to configure the computing resources required for each function to run. However, in a complex and dynamic SMEC system, the actual demand for computing resources of each function is difficult to fully understand and evaluate, which leads to unreasonable computing resource allocation. At the same time, most existing solutions adopt a fixed mode of computing resource allocation, which not only seriously reduces QoS but also causes excessive system overhead.
[0007] (4) High coupling between image placement and serverless request scheduling. Images usually need to be placed on edge nodes close to users, and then the appropriate serverless request scheduling strategy is determined based on the image placement location and the available resources of the node. However, existing work usually only considers the serverless request scheduling problem when the image placement location is fixed, ignoring the coupling relationship between the two and the necessity of joint optimization. Summary of the invention
[0008] In view of this, an object of the present invention is to provide a hierarchical multi-edge collaborative serverless computing system that can generate appropriate task scheduling and mirror placement solutions according to environmental conditions to maximize system performance.
[0009] To achieve the above-mentioned purpose, the present invention adopts the following technical scheme: a hierarchical multi-edge collaborative serviceless computing system, including a SMEC node, wherein the SMEC node is equipped with a heterogeneous edge server to provide services for terminal devices; the SMEC node includes a local edge node and a data aggregation node; the local edge node is connected to the terminal device through a cellular network and serves as its wireless access point, and the data aggregation node receives serviceless requests from lower-level nodes and processes or forwards them; the SMEC nodes are connected through a wired network; the function image file saves the code and library files required to execute the serviceless computing task, and the serviceless computing service is deployed on the SMEC node by storing the image file, and then the specific function instance is started according to the image file to provide the serviceless computing service.
[0010] In a preferred embodiment, the system operation time is divided into L time slots of equal length, denoted as the set Γ = {τ 1 ,τ 2 ,...,τ L}, where the time interval of each time slot is Δτ; the network topology of the system is depicted as a directed graph V={v 1 ,v 2 ,...,v N} contains all SMEC nodes, where N represents the number of nodes; each node is equipped with computing and storage resources, where and Respectively represent the node v i The number of CPU cores, frequency of a single CPU core, and storage space; represents an optional serviceless request forwarding path between nodes, where Indicates that no service request will be sent from v i Forward to v j ; The service-free computing function is recorded as the set F = {f 1 ,f 2 ,...,f M}, where M represents the number of functions; the terminal device accesses the function by initiating a serviceless request to the local edge node; f m is defined as a sextuplet in The number of instructions required to complete the function. is the maximum number of CPU cores that can be used by this function. The minimum number of CPU cores that should be allocated to respond to unserved requests to this function. Indicates the image size of the function, Indicates the delay in starting the function container instance after storing the function image file. Indicates the input data size of the function, represents the long-term average tolerance delay of the function; S = {s 1 ,s 2 ,...,s I} represents the service area of the SMEC node, where I represents the number of service areas; Indicated in τ l Time slot service area i Initiate access m The number of requests, which is subject to the parameter Poisson distribution.
[0011] In a preferred embodiment, the function image is placed in the local edge node in advance to avoid download delays during the cold start process, thereby reducing the service delay of the system; Indicates the deployment status of the function; limited by the storage capacity of the SMEC node, v i The sum of the sizes of stored function image files must not exceed the storage capacity of the node, which is defined as:
[0012]
[0013]
[0014] In a preferred embodiment, the service quality model consists of no service request r = (v i ,f m ) is measured by the forwarding delay and execution delay of i and f m They represent the local edge node to which the terminal device is connected and the function to be accessed respectively; vi,r Indicates v i Is it a node that responds to r? It is defined as
[0015]
[0016]
[0017] In a preferred embodiment, the forwarding delay of the quality of service model is determined by the link bandwidth of the forwarding path and the amount of transmitted data; the forwarding delay of r is:
[0018]
[0019]
[0020] in, Indicates whether r selects a path Forwarding, represents the bandwidth of the link; at the same time, request forwarding should satisfy the law of conservation of data flow, which is expressed as:
[0021]
[0022]
[0023] Among them, β(r,v i ) is used to determine whether the local edge node to which the terminal device initiating r is connected is v i , Ι[·] represents the indicator function.
[0024] In a preferred embodiment, the service quality model execution delay is: if v i In response to r, after receiving the request, the node will parse the function to be accessed in the request; then, it will start the container instance according to the image file of the function and form a serverless computing task; the execution delay of this task is affected by the resource type, allocated resources and cold start delay of the SMEC node; the heterogeneity of SMEC nodes leads to obvious differences in their processing speed, so the number of instructions they can complete with the same number of CPU cycles is different, among which v i Execute f m The relative speed of r represents the number of instructions that can be completed in one CPU cycle; therefore, the execution delay of r is:
[0025]
[0026] in, Indicates the computing resources allocated in response to the unserved request, which should meet the minimum resource requirements, defined as:
[0027]
[0028] In addition, the sum of the number of CPU cores allocated for serverless computing tasks cannot exceed the total number of CPU cores of the SMEC node, which is defined as:
[0029]
[0030] in, Represents the time slot τ l In v i A collection of serverless computing tasks executed in ;
[0031] Combining the forwarding delay and execution delay, the response delay of unserviced request r is expressed as
[0032]
[0033] Each unserved request is assigned to at most one SMEC node that has placed its required function image, which is defined as:
[0034]
[0035] Indicated in τ l Access f in time slot m The response delay of all unserviced requests should meet the long-term average tolerance delay, that is:
[0036]
[0037] in, Indicates the number of elements in this collection.
[0038] In a preferred embodiment, when providing services, the SMEC node generates energy consumption; in the time slot τ l , v i The energy consumption is defined as
[0039]
[0040] in, is the capacitance coefficient;
[0041] Therefore, in the time slot τ l , the total energy consumption of the system is expressed as
[0042]
[0043] The proposed system aims to optimize the long-term benefits of the system, which is formalized as
[0044]
[0045] Among them, X, Y and π represent function image placement, no-service request scheduling and computing resource allocation strategy respectively; γ is the revenue of responding to no-service requests.
[0046] In a preferred embodiment, for problem P1, first, it is decoupled into several resource allocation sub-problems to reduce its complexity, and a resource allocation method based on Lyapunov optimization enabling DRL is designed; then, it is theoretically proved that the optimal solution can be approached when the system is load balanced; the original problem is converted into several function mirror placement sub-problems, and a concept of a fully derived subgraph and a load-aware mirror placement method are introduced, aiming to minimize the load difference between fully derived subgraphs to optimize the mirror placement decision; finally, according to the given resource allocation and mirror placement strategy, the best serviceless request scheduling is performed.
[0047] In a preferred embodiment, given the no-service request scheduling and mirror placement strategy, P1 can be decoupled into N independent sub-problems corresponding to resource allocation problems on different SMEC nodes; for node v i ,have
[0048]
[0049] To solve P2, we need to decide to schedule to v i The resources allocated to the unserviced request are determined, and the constraint of the long-term average response delay of the unserviced request is satisfied when resources are limited. The response delay of the unserviced request consists of the forwarding delay and the execution delay. After determining the node that responds to the request, the optimal forwarding delay is calculated by the shortest path method. Therefore, constraint (14) is converted to
[0050]
[0051] in, is the optimal forwarding delay to which the unserviced request is forwarded;
[0052] Therefore, P2 is further rewritten as
[0053]
[0054] To satisfy constraint (19), a Lyapunov virtual queue with an initial value of 0 is defined for each service-free function, that is,
[0055]
[0056] in, Indicates access to f m The cumulative delay of the portion of unserviced requests that exceeds the long-term average response delay.
[0057] In a preferred embodiment, DRL interacts with an unknown environment to maximize long-term rewards as a decision criterion. The state space, action space, and reward function are defined as follows:
[0058] State space: represents the node states observable by the DRL agent; in τ l Time slot, status Contains the node's computing resource usage, pending serverless computing requests, and virtual queue size, which is defined as
[0059]
[0060] in, Represents τ l Time slot v i The number of CPU cores used;
[0061] Action space: In τ l Time slot, action is defined as
[0062]
[0063] The actual computing resources allocated to the unserved requests are
[0064]
[0065] Reward function: used to guide the DRL agent to learn a better resource allocation strategy; according to the optimization goal of P4, the reward function is defined as
[0066]
[0067] The key steps of the DRL-enabled resource allocation method based on Lyapunov optimization are: First, according to the function set F and the network topology Transform the constraint (13); then, initialize the actor and critic network parameters θ and μ respectively; in each learning trajectory, initialize the environment and policy experience pool; for each time step, the actor network converts the state Takes as input and outputs actions according to the current policy π After the environment receives the action, it calculates the immediate reward according to the Lyapunov-Drift-Plus-Penalty function and feedback the next state The state transfer process is stored in the strategy experience pool; then, the expected reward of each state is calculated based on the strategy experience pool; the advantage function is used as the target of model update; it is defined as
[0068]
[0069] In each training round, batch samples are drawn from the policy experience pool without duplication; then, the loss function of the actor network is defined as
[0070]
[0071] Among them, r(π θ ) is expressed as the ratio between the new and old strategies, which is defined as
[0072]
[0073] A clip function is used to clip the update range of the strategy, which is defined as
[0074]
[0075] Among them, ε represents the size of the control update interval;
[0076] Next, the loss function of the critic network is defined as
[0077]
[0078] Finally, the Adam optimizer is used to optimize the actor and critic networks by minimizing their loss functions.
[0079] Compared with the prior art, the present invention has the following beneficial effects: The method proposed in the present invention is aimed at the task scheduling problem of service-free mobile edge computing, and can generate appropriate task scheduling and mirror placement schemes according to the environmental status to maximize system performance. A large number of simulation experiments have verified the effectiveness of the Heroes method in improving user QoS. Compared with the three benchmark methods, the Heroes method shows superior performance in test scenarios with different numbers of nodes, storage capacities, and numbers of functions, and the response delay of the function can meet the long-term average tolerance delay. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] Figure 1 A schematic diagram of a hierarchical multi-edge collaborative serverless computing system according to a preferred embodiment of the present invention;
[0081] Figure 2 A schematic diagram showing the effect of different numbers of nodes on the performance of various methods in a preferred embodiment of the present invention;
[0082] Figure 3 A schematic diagram showing the effect of different storage capacities on the performance of various methods according to a preferred embodiment of the present invention;
[0083] Figure 4 A schematic diagram showing the effect of different numbers of functions on the performance of various methods in a preferred embodiment of the present invention;
[0084] Figure 5 Response delays of different functions of the preferred embodiment of the present invention, the dotted line represents a schematic diagram of the long-term average response and long-term average tolerance delay of the function;
[0085] Figure 6 This is a schematic diagram of the effect of different numbers of SMEC nodes on the performance of Heroes components after replacement according to a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0086] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0087] It should be noted that the following detailed descriptions are illustrative and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.
[0088] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application; as used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or their combinations.
[0089] like Figure 1-6 As shown, the present invention designs a novel hierarchical multi-edge collaborative serviceless computing system, in which SMEC nodes are equipped with heterogeneous edge servers to provide services for terminal devices. SMEC nodes include local edge nodes and data aggregation nodes. The local edge node is connected to the terminal device through a cellular network and serves as its wireless access point (Wireless Access Point). The data aggregation node receives serviceless requests from lower-level nodes and processes or forwards them. SMEC nodes are connected through a wired network. The function image file saves the code and library files required to perform serviceless computing tasks. By storing the image file, a specific serviceless computing service can be deployed on the SMEC node, and then a specific function instance can be started according to the image file to provide serviceless computing services. Furthermore, we divide the system running time into L equal-length time slots, denoted as the set Γ={τ 1 ,τ 2 ,...,τ L}, where the time interval of each time slot is Δτ.
[0090] The network topology of the proposed system can be depicted as a directed graph V={v 1 ,v 2 ,...,v N} contains all SMEC nodes, where N represents the number of nodes. Each node is equipped with computing and storage resources, where and Respectively represent the node v i The number of CPU cores, frequency of a single CPU core, and storage space. represents an optional serviceless request forwarding path between nodes, where Indicates that no service request can be sent from v i Forward to v j The serverless computing function is recorded as the set F = {f 1 ,f 2 ,...,f M}, where M represents the number of functions. A function can be abstracted as a service, such as video stream analysis, augmented reality, and real-time gaming. The terminal device accesses the function by initiating a serviceless request to the local edge node, which may have different resource requirements. Specifically, f m is defined as a sextuplet in The number of instructions required to complete the function. is the maximum number of CPU cores that can be used by this function. The minimum number of CPU cores that should be allocated to respond to unserved requests to this function. Indicates the image size of the function, Indicates the delay (cold start delay) of starting the function container instance after storing the function image file. Indicates the input data size of the function, It represents the long-term average tolerance delay of the function. 1 ,s 2 ,...,s I} represents the service area of the SMEC node, where I represents the number of service areas. Indicated in τ l Time slot service area i Initiate access m The number of requests, which is subject to the parameter Poisson distribution.
[0091] We consider placing the function image on the local edge node in advance to avoid download delays during the cold start process, thereby reducing the system's service latency. Indicates the deployment status of the function. Limited by the storage capacity of the SMEC node, v i The sum of the sizes of the stored function image files must not exceed the storage capacity of the node, which is defined as
[0092]
[0093]
[0094] QoS Model
[0095] QoS is determined by no service request r = (v i ,f m ) is measured by the forwarding delay and execution delay of i and f m They represent the local edge node to which the terminal device is connected and the function to be accessed. In addition, Indicates v i Is it a node that responds to r? It is defined as
[0096]
[0097]
[0098] (1) Forwarding delay: It is determined by the link bandwidth of the forwarding path and the amount of data transmitted. Therefore, the forwarding delay of r is
[0099]
[0100]
[0101] in, Indicates whether r selects a path Forwarding, represents the bandwidth of the link. At the same time, request forwarding should satisfy the law of data flow conservation, which is expressed as
[0102]
[0103]
[0104] Among them, β(r,v i ) is used to determine whether the local edge node to which the terminal device initiating r is connected is v i , Ι[·] represents the indicator function.
[0105] (2) Execution delay: If v i In response to r, after receiving the request, the node will parse the function to be accessed in the request. Then, the container instance is started according to the image file of the function and a serverless computing task is formed. The execution delay of this task is affected by the resource type, allocated resources and cold start delay of the SMEC node. The heterogeneity of SMEC nodes leads to significant differences in their processing speeds, so the number of instructions they can complete with the same number of CPU cycles is different. v i Execute f m The relative speed of r represents the number of instructions that can be completed in one CPU cycle. Therefore, the execution delay of r is
[0106]
[0107] in, Represents the computing resources allocated in response to the unserved request, which should meet the minimum resource requirements, defined as
[0108]
[0109] In addition, the sum of the number of CPU cores allocated for serverless computing tasks cannot exceed the total number of CPU cores of the SMEC node, which is defined as
[0110]
[0111] in, Represents the time slot τ l In v i A collection of serverless computing tasks executed in .
[0112] Combining the forwarding delay and execution delay, the response delay of unserviced request r can be expressed as
[0113]
[0114] Each unserved request is assigned to at most one SMEC node that has placed its required function image, which is defined as
[0115]
[0116] Indicated in τ l Access f in time slot m The response delay of all unserviced requests should meet the long-term average tolerance delay, that is,
[0117]
[0118] in, Indicates the number of elements in this collection.
[0119] Problem Definition
[0120] When providing services, SMEC nodes consume energy. l , v i The energy consumption is defined as
[0121]
[0122] in, is the capacitance coefficient.
[0123] Therefore, in the time slot τ l , the total energy consumption of the system can be expressed as
[0124]
[0125] The proposed system aims to optimize the long-term benefits of the system, which can be formalized as
[0126]
[0127] Where X, Y, and π represent function image placement, no-service request scheduling, and computing resource allocation strategies, respectively. γ is the revenue in response to no-service requests.
[0128] P1 can be viewed as a nonlinear mixed integer optimization problem. There are many challenges in solving this problem. First, the user's serviceless requests are dynamic and difficult to predict accurately. Second, constraint (13) is a coupling term, which means that it is very difficult to minimize the objective function only by optimizing the serviceless request scheduling or function mirror placement. Finally, P1 can be viewed as a complex variant of the generalized assignment problem, which is NP-hard.
[0129] Lemma 1: P1 can be viewed as a complex variant of the generalized assignment problem, which is NP-hard.
[0130] Proof: The generalized assignment problem can be abstracted as a mapping relationship between workers and tasks. Workers are assigned to perform any task and incur certain costs and profits, which vary according to the mapping relationship between workers and tasks. Each worker has a budget, and the sum of the costs of the assigned tasks cannot exceed this value. This problem aims to maximize the total profit without exceeding the cost budget, which has been proven to be NP-hard. We regard responding to no-service requests as tasks, the heterogeneous edge servers equipped on the SMEC nodes as workers, and the workers' budgets as the available resources of the servers. For P1, not only do we need to allocate heterogeneous edge servers to respond to no-service requests, but we also need to mirror the decision function. Therefore, the complexity of P1 is higher than the generalized assignment problem, which is at least NP-hard.
[0131] Overview of the proposed Heroes technical solution
[0132] For the optimization problem P1, we propose Heroes, a novel heterogeneity-aware framework of resource allocation and image placement for hierarchical multi-edge cooperative serverless systems. First, we decouple it into several resource allocation subproblems to reduce its complexity, and design a resource allocation method based on Lyapunov optimization-enabled DRL. Then, we theoretically prove that the optimal solution can be approached when the system is load balanced. Furthermore, we transform the original problem into several function image placement subproblems, and introduce a concept of fully derived subgraphs and a load-aware image placement method, which aims to minimize the load difference between fully derived subgraphs to optimize image placement decisions. Finally, the optimal serverless request scheduling is performed based on the given resource allocation and image placement strategies.
[0133] Resource allocation based on Lyapunov optimization to enable DRL
[0134] Given the serverless request scheduling and image placement strategy, P1 can be decoupled into N independent sub-problems, corresponding to resource allocation problems on different SMEC nodes. i ,have
[0135]
[0136] To solve P2, we need to decide to schedule to v i The resources allocated to the unserviced request are determined, and the long-term average response delay of the unserviced request is satisfied when resources are limited. The response delay of the unserviced request consists of the forwarding delay and the execution delay. After determining the node that responds to the request, the optimal forwarding delay can be calculated by the shortest path method. Therefore, constraint (14) can be converted to
[0137]
[0138] in, is the optimal forwarding delay to which no service request is forwarded.
[0139] Therefore, P2 can be further rewritten as
[0140]
[0141] To satisfy constraint (17), we define a Lyapunov virtual queue with an initial value of 0 for each serviceless function, namely
[0142]
[0143] in, Indicates access to f m The cumulative delay of the portion of unserviced requests that exceeds the long-term average response delay.
[0144] Lemma 2: By controlling The stability of can ensure that constraint (17) holds.
[0145] Proof: According to The definition of
[0146]
[0147] Perform accumulation operation on all time slots, that is,
[0148]
[0149] Taking the expected value of both sides of the inequality gives
[0150]
[0151] By controlling The stability of
[0152]
[0153] Therefore, we can get
[0154]
[0155] If you can guarantee The stability of and minimizing the long-term average energy consumption is equivalent to solving P3. For the stability of
[0156]
[0157] Δ(θ(τ l ))=Θ(τ l+1 )-Θ(τ l ).(25)
[0158] according to The definition of
[0159]
[0160] in,
[0161] In order to ensure the long-term stability of the virtual queue, the value of the Lyapunov drift function should be minimized in a single time slot. At the same time, the energy consumption of responding to unserved requests also needs to be considered. Therefore, we define a Lyapunov-Drift-Plus-Penalty function as
[0162]
[0163] Among them, V is used to balance the stability and energy consumption of the virtual queue.
[0164] Lemma 3: If v i Computing resources are sufficient to solve It can approach the optimal solution of P3.
[0165] Proof: According to the optimal ω-only theorem, There exists a computing resource allocation strategy π′ that satisfies
[0166]
[0167]
[0168] Among them, p * is the optimal solution for P3.
[0169] Then, we can deduce
[0170]
[0171] Let χ→0, add up all time slots and divide by L, and we get
[0172]
[0173] Let L→∞, we can get
[0174]
[0175] When V is positive infinity, P3 can approach the optimal solution.
[0176] According to Lemma 3, v i The resource allocation problem on
[0177]
[0178] To solve P4, we formalize it as a Markov decision process and customize a DRL-based method. DRL can be regarded as a potential feasible solution to the resource allocation problem in complex SMEC environments by interacting with the unknown environment and maximizing the long-term reward as the decision criterion. The state space, action space, and reward function are defined as follows.
[0179] State space: It represents the node states observable by the DRL agent. l Time slot, status Contains the node's computing resource usage, pending serverless computing requests, and virtual queue size, which is defined as
[0180]
[0181] in, Represents τ l Time slot v i The number of available CPU cores.
[0182] Action Space: Since there is an upper limit on the number of CPU cores that a serverless function can use, the computing resources allocated to serverless requests should avoid exceeding the limit. l Time slot, action is defined as
[0183]
[0184] Lemma 3 proves that by minimizing the Lyapunov-Drift-Plus-Penalty function, the optimal solution of P3 can be approached. However, due to the limited computing resources of SMEC nodes, it may not be possible to schedule all nodes to v. i Therefore, the actual computing resources allocated to the unserved requests are
[0185]
[0186] Reward function: It is used to guide the DRL agent to learn a better resource allocation strategy. According to the optimization objective of P4, we define the reward function as
[0187]
[0188] The key steps of the proposed DRL-enabled resource allocation method based on Lyapunov optimization are shown in Algorithm 1. First, according to the function set F and the network topology The constraint (13) is transformed (line 1). Next, the actor and critic network parameters θ and μ are initialized respectively (line 2). In each learning trajectory, the environment and policy experience pool are initialized (lines 4-5). For each time step, the actor network transforms the state Takes as input and outputs actions according to the current policy π (Line 7). After the environment receives the action, it calculates the immediate reward according to the Lyapunov-Drift-Plus-Penalty function (Formula (27)) and feedback the next state And store the state transition process in the policy experience pool (lines 8-9). Next, calculate the expected reward for each state based on the policy experience pool (line 11). In order to reduce the impact of noise on gradient estimation, we use the advantage function as the target of model update (line 12), which is defined as
[0189]
[0190] In each training round, batch samples are drawn from the policy experience pool without duplication (line 14). Next, the loss function of the actor network is defined as
[0191]
[0192] Among them, r(π θ ) is expressed as the ratio between the new and old strategies, which is defined as
[0193]
[0194] In order to avoid training instability caused by the large difference between the new and old strategy updates, we use a clip function to clip the update range of the strategy, which is defined as
[0195]
[0196] Among them, ε represents the size of the control update interval.
[0197] Next, the loss function of the critic network is defined as
[0198]
[0199] Finally, the loss functions of the actor and critic networks are minimized using the Adam optimizer to optimize them (Lines 15-16).
[0200]
[0201]
[0202] Load-aware image placement and serverless request scheduling
[0203] In τ l Time slot, v i The load can be expressed as Lemma 4: When the SMEC nodes are load balanced and respond to all unserved requests, P1 can approach the optimal solution. Proof: Assume X * , Y * and π * is the optimal solution of P1, then
[0204]
[0205] According to the Cauchy-Schwarz inequality, we have
[0206]
[0207] Among them, if and only if The equation holds.
[0208] To achieve load balancing between SMEC nodes, we further decompose P1 into N sub-problems, which correspond to the mirror placement problem on each SMEC node. First, we introduce the concept of a fully derived subgraph, which is defined as a graph containing all nodes that can forward no-service requests to v i The induced subgraph of the node set is denoted as The root node is v i , which responds to access f m The expected number of unserviced requests is
[0209]
[0210] Among them, S(T i ) indicates T i A collection of service areas.
[0211] Therefore, T i The expected load of the SMEC node in response to the no-service request is
[0212]
[0213]
[0214] in, Indicates the response to access f m The expected load of unserviced requests.
[0215] For v i , Represents the collection of its child nodes. For each child node We construct a completely induced subgraph And by optimizing the mirror placement, it can ease the gap between exported subgraphs. difference. express will visit f m No service request is forwarded to v i ratio, which satisfies
[0216]
[0217]
[0218] Therefore, v i The mirror placement problem on can be expressed as
[0219]
[0220] Lemma 5: P5 is a Convex optimization problem.
[0221] Proof: Given v i Image placement strategy on x i , P5 can be converted into
[0222]
[0223] Among them, constraints (46) and (47) are about The affine function of .
[0224] The feasible domain of the objective function is a convex set. At the same time, max(·) and -min(·) in the objective function are both convex functions. Therefore, P6 is a convex optimization problem.
[0225] According to Lemma 5, P5 can be transformed into i The optimization problem is expressed as
[0226]
[0227] in, For the problem P6 The optimal solution of .
[0228] Lemma 6: is a monotonically increasing submodular function.
[0229] Proof: For the feasible domain S of Ω(s), any subset s 1 ,s 2 ,like And satisfy Ω(s 1 )≤Ω(s 2 ), then Ω(s) is monotonically increasing. If s 1 =s 2 , the inequality holds. If we expand s 1 , which is equivalent to relaxing the constraint (45), which means expanding the solution space of P6. Therefore, the value of the optimal solution of the objective function at least does not decrease, that is, Ω(s 1 )≤Ω(s 2 ).
[0230] Any subset s 1 ,s 2 ,like And meet
[0231]
[0232] Then Ω(s) is a submodular function. If s 1 =s 2 , the inequality holds. If We have Ω(s 1 )≤Ω(s 2 ), which means that fully exporting the subgraph will forward more unserved requests to v i , to reduce The constraint (46) will be further tightened. Therefore, when s = s 1 , v i Have more free resources to respond to access f m There is no service request, so inequality (48) holds.
[0233] The main steps of the proposed load-aware mirror placement method are shown in Algorithm 2. First, i The child nodes of construct the complete induced subgraph (line 1). i If there is free storage resource, select and place the function image with the greatest gain to the objective function (lines 4-5).
[0234]
[0235]
[0236] Lemma 7: The approximation ratio of the solution obtained by Algorithm 2 to the optimal solution is
[0237] Proof: Assume that the optimal solution of P5 is s * ,s p represents the solution obtained by Algorithm 2 at the pth iteration. Since Ω(s) is a submodular function, ΔΩ s (x) = Ω(s∪{x})-Ω(s), the following inequality holds.
[0238]
[0239] Algorithm 2 always chooses to place The largest function mirror, so there is
[0240]
[0241] Because v i The storage resources are limited, so there is
[0242]
[0243] Combining inequalities (49), (50) and (51), we have
[0244]
[0245] By recursively solving this inequality, we get
[0246]
[0247] According to the inequality 1-x≤e -x , we have
[0248]
[0249] We take s′ as the solution obtained by Algorithm 2, so we have Its satisfaction
[0250]
[0251]
[0252] Next, here are
[0253]
[0254] therefore,
[0255]
[0256] According to the given resource allocation and image placement strategy, we perform the best serverless request scheduling, and its main steps are shown in Algorithm 3. First, according to the network topology With the mirror placement strategy X, obtain the candidate node set V that can respond to the no-service request r r (Line 1). Next, calculate v i ∈V r The weighted sum of the computing resources required to allocate in response to r and the difference in revenue and load (lines 2-5), where Indicates v i CPU cores used. Then, according to V r Sort in ascending order (line 6). Finally, select Nodes with smaller values and sufficient free CPU cores respond with r (lines 7-12).
[0257]
[0258]
[0259] Method evaluation:
[0260] The Heroes method proposed in this invention builds and trains neural networks based on Python 3.8 and Pytorch framework. All simulation experiments were carried out on a workstation equipped with Intel(R) Xeon(R) Silver 4208, whose CPU clock frequency is 2.10GHz and memory is 96G. We used the real operation data set of Azure serverless cluster to verify the effectiveness of the proposed Heroes method. The data set records the operation of different serverless functions in Azure serverless cluster within 14 days, including the average response delay of the function and resource usage records. In the experiment, we randomly sampled from the serverless functions with high access volume and used them in the proposed system. In the experiment, we set up 16 SMEC nodes and divided them into 10 service areas. The storage capacity of each node is evenly distributed between [20,24]GB, the number of CPU cores is evenly distributed between [10,20], and the frequency is evenly distributed between [2.5,3.5]GHz. In addition, the number of serverless computing functions is 5, and the image size of each function is evenly distributed between [5,10]GB. The number of machine instructions required to execute these functions is evenly distributed between [5e9,5e10], while the maximum number of CPU cores that can be used by each function is evenly distributed between {1,2,3,4}.
[0261] Based on the above experimental settings and datasets, we conducted comparative experiments on the proposed Heroes method and the following state-of-the-art methods.
[0262] Popular-based: In this method, the image of the function with the most user requests is selected and placed on the root node according to the service area of the fully derived subgraph. Both request scheduling and resource allocation use random methods.
[0263] Latency-aware: In this method, each SMEC node allocates computing resources based on the long-term average tolerable latency of the function. If the available computing resources are insufficient or the function image is not deployed, the request is forwarded to the nearest node. Functions with large input data are given priority, and the images of these functions are placed on nodes near the service area.
[0264] Convex: In this method, unserviced requests are forwarded to the SMEC node that can meet the maximum CPU demand of the function. In each time slot, resources are allocated by greedily minimizing the Lyapunov-Drift-Plus-Penalty function through a convex optimization method, and mirrors are placed based on the relative speed of the nodes executing the function.
[0265] We compare and analyze the performance of Heroes and other comparison methods under different numbers of SMEC nodes, storage resources, and functions. Figure 2 As shown in the figure, Heroes shows more outstanding performance compared with other comparison methods. As the number of nodes increases, the benefits brought by the Heroes method to the system also increase. This is due to the fact that Heroes places function images and schedules no-service requests based on a load balancing method. When the number of nodes in the system that respond to no-service requests increases, the load of each node will decrease accordingly. It is worth noting that there is a quadratic relationship between the energy consumption and load of the node, which means that a reduction in load will lead to a significant decrease in energy consumption, thereby bringing higher benefits. At the same time, since the total number of no-service requests remains unchanged, the system benefits increase slowly. Since the latency-aware method forwards requests to the nearest SMEC node, it is easy to cause some nodes to be in a high-load state for a long time, resulting in a decrease in system benefits.
[0266] Because Figure 3 As shown in the figure, as storage resources increase, SMEC nodes can accommodate more function images, thereby providing users with richer serverless computing services, which significantly increases the system's benefits. Compared with other comparison methods, Heroes also shows outstanding advantages in performance. By optimizing resource allocation and request scheduling strategies, Heroes can more effectively utilize storage resources and improve computing resource utilization. In addition, we also observed that the performance of the comparison methods fluctuates due to the number of nodes. This is because they place function images based on rules, which may cause the images of stateless functions with a large number of user requests to be placed far away from users, resulting in some nodes with sufficient free resources being unable to provide services due to lack of function images.
[0267] like Figure 4 As shown in the figure, when the number of functions increases, the performance of all methods fluctuates. This is because as the number of functions increases, the difference in the load of no-service requests in different service areas becomes more significant. At the same time, since SMEC nodes are limited by storage resources, the number of nodes that respond to no-service requests decreases. As a result, this causes the system to be unable to meet most of the no-service requests, resulting in a decrease in system revenue. When the number of functions is 5, Heroes can just coordinate each node to effectively handle the user's no-service requests. Therefore, in this case, the system revenue is the highest.
[0268] Next, we verified the resource allocation method based on Lyapunov optimization and DRL. Figure 5 As shown in the figure, the response delay of each function meets the long-term average tolerance delay. This is because the DRL agent aims to maximize the cumulative reward and make computing resource allocation actions. If the agent allocates less computing resources to respond to unserviced requests, its response delay will be higher than the long-term average tolerance delay, which will cause the virtual queue to be unstable and the agent will receive a lower reward value.
[0269] Finally, we replaced the components of Heroes with the following methods and conducted ablation experiments to verify the effectiveness of each designed method.
[0270] Try-Best: This method always allocates the maximum number of CPU cores available to the function in response to a user unserviced request.
[0271] Fair-Scheduling: This method schedules serverless requests to the node that performs the least serverless computing tasks.
[0272] Deadline-Placement: In this method, the mirror of the function with smaller long-term average tolerance delay has a higher priority to be placed in the SMEC node.
[0273] like Figure 6 As shown in the figure, the experimental results show that the performance of Heroes is reduced to varying degrees when the components are replaced with other methods. The reason why Fair-scheduling has the smallest performance loss is that the number of serverless computing tasks executed in the node is positively correlated with the load. By scheduling serverless requests to the node with the least number of serverless computing tasks, the load of each node can be balanced to a certain extent. However, due to the heterogeneity of edge servers, the node with the least number of serverless computing tasks does not necessarily mean that its load is low. This situation may cause the node to bear a higher load in actual operation, thereby affecting the performance of the overall system. Although the Try-Best method schedules serverless requests based on load balancing, its method always allocates enough computing resources to serverless requests, while the computing resources of the node are limited, which causes the system to be unable to respond to some serverless requests. Finally, since the Deadline-placement method places images based on the long-term average tolerated delay of the function, it fails to fully consider the number of requests for different serverless functions from users in each service area. This results in many serverless requests not having corresponding function images placed on the corresponding nodes, thus failing to respond to user requests in a timely manner. Therefore, the performance of this method is the worst.
[0274] The process or method of using the product
[0275] (1) The system generates a function image placement decision based on the network topology and relevant information of all functions, including the number of instructions required to execute the function, the maximum number of CPU cores, the minimum number of CPU cores, the image size, the cold start delay, the input data size, and the long-term average tolerable delay of the function.
[0276] (2) The system dispatches the user's serviceless request to the appropriate SMEC server for response based on the user's serviceless request and the function image placement status.
[0277] (3) After receiving the user's no-service request, the SMEC server starts the function instance according to the function image. Then, the DRL agent decides the resources required for this instance.
[0278] (4) The SMEC server forwards the instance running results to the user.
Claims
1. A hierarchical multi-edge collaborative serverless computing system, characterized in that: It includes a SMEC node, wherein the SMEC node is equipped with a heterogeneous edge server to provide services for terminal devices; the SMEC node includes a local edge node and a data aggregation node; The local edge node is connected to the terminal device through the cellular network and serves as its wireless access point. The data aggregation node receives the no-service request from the lower-level nodes and processes or forwards it. The SMEC nodes are connected through a wired network. The function image file saves the code and library files required to execute the serverless computing task. The serverless computing service is deployed on the SMEC node by storing the image file, and then the specific function instance is started according to the image file to provide the serverless computing service.
2. A hierarchical multi-edge collaborative serverless computing system according to claim 1, characterized in that: The system running time is divided into L time slots of equal length, denoted as the set Γ = {τ1, τ2, ..., τ L }, where the time interval of each time slot is Δτ; the network topology of the system is depicted as a directed graph l = (V, E); V = {v1, v2, ..., v N } contains all SMEC nodes, where N represents the number of nodes; each node is equipped with computing and storage resources, where and Respectively represent the node v i The number of CPU cores, frequency of a single CPU core, and storage space; represents an optional serviceless request forwarding path between nodes, where Indicates that no service request will be sent from v i Forward to v j ; The serverless computing function is recorded as a set F = {f1,f2,...,f M }, where M represents the number of functions; the terminal device accesses the function by initiating a serviceless request to the local edge node; f m is defined as a sextuplet in The number of instructions required to complete the function. is the maximum number of CPU cores that can be used by this function. The minimum number of CPU cores that should be allocated to respond to unserved requests to this function. Indicates the image size of the function, Indicates the delay in starting the function container instance after storing the function image file. Indicates the input data size of the function, represents the long-term average tolerable delay of the function; S = {s1, s2, ..., s I } represents the service area of the SMEC node, where I represents the number of service areas; Indicated in τ l Time slot service area i Initiate access m The number of requests, which is subject to the parameter Poisson distribution.
3. A hierarchical multi-edge collaborative serverless computing system according to claim 2, characterized in that: Pre-place the function image on the local edge node to avoid download delays during cold start, thereby reducing the system's service latency. Indicates the deployment status of the function; limited by the storage capacity of the SMEC node, v i The sum of the sizes of stored function image files must not exceed the storage capacity of the node, which is defined as:
4. The hierarchical multi-edge collaborative serverless computing system according to claim 1, characterized in that: The service quality model consists of no service request r = (v i ,f m ) is measured by the forwarding delay and execution delay of i and f m They represent the local edge node to which the terminal device is connected and the function to be accessed respectively; Indicates v i Is it a node that responds to r? It is defined as 5. A hierarchical multi-edge collaborative serverless computing system according to claim 4, characterized in that: The forwarding delay of the service quality model is determined by the link bandwidth of the forwarding path and the amount of transmitted data; the forwarding delay of r is: in, Indicates whether r selects a path Forwarding, represents the bandwidth of the link; at the same time, request forwarding should satisfy the law of conservation of data flow, which is expressed as: Among them, β(r,v i ) is used to determine whether the local edge node to which the terminal device initiating r is connected is v i , Ι[·] represents the indicator function.
6. A hierarchical multi-edge collaborative serverless computing system according to claim 4, characterized in that: Service quality model execution delay: If v i In response to r, after receiving the request, the node will parse the function to be accessed in the request; then, it will start the container instance according to the image file of the function and form a serverless computing task; the execution delay of this task is affected by the resource type, allocated resources and cold start delay of the SMEC node; the heterogeneity of SMEC nodes leads to obvious differences in their processing speed, so the number of instructions they can complete with the same number of CPU cycles is different, among which v i Execute f m The relative speed of r represents the number of instructions that can be completed in one CPU cycle; therefore, the execution delay of r is: in, Indicates the computing resources allocated in response to the unserved request, which should meet the minimum resource requirements, defined as: In addition, the sum of the number of CPU cores allocated for serverless computing tasks cannot exceed the total number of CPU cores of the SMEC node, which is defined as: in, Represents the time slot τ l In v i A collection of serverless computing tasks executed in ; Combining the forwarding delay and execution delay, the response delay of unserviced request r is expressed as Each unserved request is assigned to at most one SMEC node that has placed its required function image, which is defined as: Indicated in τ l Access f in time slot m The response delay of all unserviced requests should meet the long-term average tolerance delay, that is: in, Indicates the number of elements in this collection.
7. The hierarchical multi-edge collaborative serverless computing system according to claim 1, characterized in that: When providing services, SMEC nodes consume energy; in time slot τ l , v i The energy consumption is defined as in, is the capacitance coefficient; Therefore, in the time slot τ l , the total energy consumption of the system is expressed as The proposed system aims to optimize the long-term benefits of the system, which is formalized as Among them, X, Y and π represent function image placement, no-service request scheduling and computing resource allocation strategy respectively; γ is the revenue of responding to no-service requests.
8. The hierarchical multi-edge collaborative serverless computing system according to claim 1, characterized in that: For problem P1, first, it is decoupled into several resource allocation sub-problems to reduce its complexity, and a resource allocation method based on Lyapunov optimization enabling DRL is designed; then, it is theoretically proved that the optimal solution can be approached when the system is load balanced; the original problem is converted into several function mirror placement sub-problems, and a concept of fully derived subgraph and a load-aware mirror placement method are introduced, aiming to minimize the load difference between fully derived subgraphs to optimize the mirror placement decision; finally, according to the given resource allocation and mirror placement strategy, the optimal serverless request scheduling is performed.
9. The hierarchical multi-edge collaborative serverless computing system according to claim 1, characterized in that: Given the serviceless request scheduling and mirror placement strategy, P1 can be decoupled into N independent sub-problems, corresponding to resource allocation problems on different SMEC nodes; for node v i ,have To solve P2, we need to decide to schedule to v i The resources allocated to the unserviced request are used, and the constraint of the long-term average response delay of the unserviced request is met when resources are limited; the response delay of the unserviced request consists of the forwarding delay and the execution delay. After determining the node that responds to the request, the optimal forwarding delay is calculated by the shortest path method; Therefore, constraint (14) is transformed into in, is the optimal forwarding delay to which the unserviced request is forwarded; Therefore, P2 is further rewritten as To satisfy constraint (19), a Lyapunov virtual queue with an initial value of 0 is defined for each service-free function, that is, in, Indicates access to f m The cumulative delay of the portion of unserviced requests that exceeds the long-term average response delay.
10. A hierarchical multi-edge collaborative serverless computing system according to claim 9, characterized in that: DRL interacts with an unknown environment to maximize long-term rewards as a decision criterion. The state space, action space, and reward function are defined as follows: State space: represents the node states observable by the DRL agent; in τ l Time slot, status Contains the node's computing resource usage, pending serverless computing requests, and virtual queue size, which is defined as in, Represents τ l Time slot v i The number of CPU cores used; Action space: In τ l Time slot, action is defined as The actual computing resources allocated to the unserved requests are Reward function: used to guide the DRL agent to learn a better resource allocation strategy; according to the optimization goal of P4, the reward function is defined as The key steps of the DRL-enabled resource allocation method based on Lyapunov optimization are: first, the constraints (13) are transformed according to the function set F and the network topology l; then, the actor and critic network parameters θ and μ are initialized respectively; in each learning trajectory, the environment and policy experience pools are initialized; for each time step, the actor network transforms the state Takes as input and outputs actions according to the current policy π After the environment receives the action, it calculates the immediate reward according to the Lyapunov-Drift-Plus-Penalty function and feedback the next state The state transfer process is stored in the strategy experience pool; then, the expected reward of each state is calculated based on the strategy experience pool; the advantage function is used as the target of model update; it is defined as In each training round, batch samples are drawn from the policy experience pool without duplication; then, the loss function of the actor network is defined as Among them, r(π θ ) is expressed as the ratio between the new and old strategies, which is defined as A clip function is used to clip the update range of the strategy, which is defined as Among them, ε represents the size of the control update interval; Next, the loss function of the critic network is defined as Finally, the Adam optimizer is used to optimize the actor and critic networks by minimizing their loss functions.
Citation Information
Patent Citations
Server-free edge task unloading method based on experience sharing deep reinforcement learning
CN115499440A
Server-free multi-edge function dynamic deployment and task unloading method and system
CN117376357A
OpenFaaS-based multi-edge management framework system
CN117873490A