A method of online deploying edge dynamic DAG serverless functions for fast startup

By constructing a dynamic DAG model and an online preheating scheduling algorithm, the cold start problem of dynamic DAG functions in edge computing is solved, achieving fast startup and efficient task scheduling, and adapting to the dynamic changes of the edge environment.

CN120066729BActive Publication Date: 2025-11-21SOUTHEAST UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510219670.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-26
Publication Date
2025-11-21
Estimated Expiration
2045-02-26

AI Technical Summary

Technical Problem

In edge computing environments, the cold start problem of serverless functions in dynamic DAGs is severe, leading to prolonged response times. Existing technologies struggle to effectively address the deployment of function containers and task scheduling for dynamic DAGs, especially when resources are limited and paths are dynamically changing.

Method used

A dynamic DAG model with preheating and function scheduling was constructed. By analyzing the function call probability through historical data, and combining random rounding search algorithm and constraint linear relaxation, task scheduling was optimized to reduce cold start latency. Online preheating and function scheduling algorithms were designed to adapt to dynamic requests.

Benefits of technology

It effectively alleviates cold start latency, improves the response speed and resource utilization efficiency of edge computing systems, adapts to changes in dynamic requests, and optimizes task scheduling and resource allocation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066729B_ABST
    Figure CN120066729B_ABST
Patent Text Reader

Abstract

The application discloses a method for online deployment of edge dynamic DAG serverless functions to realize fast startup, and belongs to the field of edge computing. The method comprises the following steps: step 1, defining a dynamic DAG and establishing a modeling criterion for function pre-warming processing; step 2, constructing a dynamic DAG model with pre-warming preparation and function scheduling, which realizes minimization of overall expected execution time through pre-warming and function deployment; step 3, converting a quadratic programming problem into a convex optimization problem by processing a quadratic constraint condition; for the converted problem, an optimal solution is solved by using a search algorithm based on random rounding; and step 4, designing an online pre-warming and function scheduling algorithm. The algorithm comprises function weight calculation, pre-warming container adjustment and optimal container selection to process multiple online arrival requests. Through the online pre-warming and dynamic scheduling strategy, the cold start problem is effectively alleviated, and the execution efficiency of the serverless function in the edge computing environment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of edge computing and serverless computing, and particularly relates to a method for online deployment of edge dynamic DAG serverless functions to achieve fast startup. BACKGROUND

[0002] With the development of virtualization technology, serverless computing has become an important mode in the cloud computing ecosystem. The characteristic of serverless computing is to disassemble services into multiple independent function units, so that users can focus on code development while enjoying the advantages of convenient deployment, dynamic expansion, and pay-per-use billing. However, when a function is not called for a long time, the related container is terminated to save resources, resulting in the need to restart the container for the next call, thereby causing high latency and response time, i.e., the cold start problem.

[0003] Edge computing has the advantages of low latency, high bandwidth, and real-time data processing, and can better support the Internet of Things and intelligent applications. However, edge computing resources are limited and management is complex, which makes the cold start problem more serious. Therefore, serverless edge computing has attracted widespread attention.

[0004] In serverless edge computing, tasks are usually modeled in the form of a directed acyclic graph (DAG), and functions are called in the order of the DAG. DAGs can be divided into two categories: one is a static DAG with a preset path, and the other is a dynamic DAG with a path determined dynamically according to the input of the previous function. Static DAGs can be pre-configured with containers because of their fixed paths, while dynamic DAGs cannot be pre-configured with containers due to their path uncertainty, further exacerbating the cold start problem. Current research mostly focuses on container deployment and task scheduling for static DAGs, and there is still little research on dynamic DAG tasks. Therefore, designing a serverless edge computing model for dynamic DAGs and corresponding function container deployment and task scheduling algorithms is still a difficult problem to be solved.

[0005] Consider an edge system composed of multiple edge servers, each with a certain amount of memory resources. Suppose that the application uses a dynamic DAG, and the execution path of each request varies. Containers deployed on edge nodes are limited by memory resources, and the cold start problem must also be considered. In the case of identical edge server capacity and ignoring the cold start time, the static DAG scheduling problem in a heterogeneous edge system has been proven to be an NP-hard problem. If we consider a more realistic scenario where the DAG execution path varies dynamically and the cold start time has a significant impact on the overall startup time, the problem becomes even more complex. SUMMARY

[0006] Technical problem: Before a new request arrives, the historical data of the DAG application will be used to preheat the related function container and plan the deployment of the function. In order to cope with the challenges of DAG serverless function execution in a dynamic edge environment, the following problems are mainly faced: how to efficiently preheat the related function container and plan its deployment based on historical data before a new request arrives; how to alleviate the cold start problem to improve the response speed of the system; and how to optimize task scheduling and meet the dynamic request demand in the dynamic environment of request complexity and function call probability fluctuation. In order to solve the above problems, the present application provides a method for online deployment of edge dynamic DAG serverless function to realize fast start. First, a dynamic DAG model with preheating preparation and function scheduling is constructed, which captures the characteristics of dynamic DAG by capturing function call probability through real-time updated historical data. Secondly, a random rounding-based search algorithm is proposed to alleviate the cold start problem, combining constraint linear relaxation and random progressive search. Finally, considering the influence of request complexity and function call probability fluctuation on actual application, an online preheating and task scheduling algorithm is developed for task scheduling under online request.

[0007] Technical scheme: The present application is a method for online deployment of edge dynamic DAG serverless function to realize fast start, comprising the following steps:

[0008] Step 1, define the dynamic DAG and establish the modeling criteria for function preheating processing, analyze the characteristics of serverless application, calculate the selection probability of each function call and execution path, and determine which functions need to be preheated and formulate corresponding strategies; abstract the serverless application as a directed acyclic graph (DAG), calculate the path selection probability by analyzing the call probability of functions on the execution path, calculate and smooth the function call probability using the EWMA method, improve the prediction accuracy and stability, and determine whether preheating is needed according to the call probability of the function, and mark it as needing preheating when the probability exceeds the threshold, otherwise no preheating is needed;

[0009] Step 2, construct a dynamic DAG model with preheating preparation and function scheduling, which realizes the minimization of the overall expected execution time through preheating and function deployment. By constructing a quadratic integer programming model, the objective is to minimize the overall expected execution time of the function, which uses the historical call data in step 1 to predict the future possible call situation and reasonably allocate preheating and computing resources on the edge server, thereby reducing cold start delay and resource waste, the constraint conditions ensure that the execution path probability of the task meets the requirements, the resource usage of each edge server does not exceed the available capacity, the data transmission, processing order and preheating and execution time of the function meet the actual execution conditions, through these constraint conditions, the model can efficiently allocate edge computing resources and optimize the task scheduling process;

[0010] Step 3, based on step 2, construct a quadratic integer linear programming problem, and convert it into a convex optimization problem by processing the quadratic constraint conditions. For the transformed problem, a search algorithm based on random rounding is used to solve the optimal solution. Since the original problem is a quadratic nonlinear programming problem, it is complex to solve directly, so the problem is transformed into a convex optimization problem by adjusting the decision variables and constraint conditions, and then a search algorithm based on random rounding is proposed to solve the optimization problem. The core is to search for the optimal integer solution that meets all the constraint conditions. The algorithm first linearizes the nonlinear constraints by relaxing the variables, and uses Gurobi and other solvers to perform initial optimization on the problem to obtain effective fractional solutions. Then, through randomized search, the final solution that meets the integer requirements is generated to ensure that the solution meets all the constraint conditions, and finally the solution accuracy is further improved and the system response speed is optimized;

[0011] Step 4, based on the calculation results of step 3 algorithm for a single request, design an online preheating and function scheduling algorithm. This algorithm includes function weight calculation, preheating container adjustment, and optimal container selection to handle multiple online arrival requests; an online preheating and function scheduling algorithm is designed. First, according to the calculated duration of each function in the potential execution path, the importance of the function is evaluated to optimize resource allocation. Then, before the time slice starts, the preheating resources and priority on the edge server are dynamically adjusted to ensure effective allocation of function resources, and the preheating strategy is flexibly adjusted according to actual needs. Subsequently, all functions to be processed are sorted according to the request priority and dependency of the task, and the optimal computing resources are allocated to ensure that the task can be completed according to the optimal scheduling strategy, and the resources that are no longer needed are dynamically released. Finally, by determining the earliest start time and the earliest completion time of the function, the completion efficiency of the task is compared among the candidate edge nodes, and the transmission delay and resource state are considered to select the optimal edge node to maximize the task execution efficiency and reduce resource waste, thereby optimizing the overall task scheduling in the edge computing environment.

[0012] Further, the definition of dynamic DAG and function preheating processing modeling in step 1 specifically includes the following steps:

[0013] Step 101, define the serverless application as a directed acyclic graph (DAG), where functions are divided into ordinary functions and dynamic functions. Ordinary functions are always called, while dynamic functions are called conditionally. A DAG may contain multiple execution paths, and the selection probability of each path is calculated based on the call probability of all functions on the path;

[0014] Step 102, calculate the historical call probability of each function in a specified observation period by analyzing historical data, and smooth the data fluctuations by normalization and EWMA method to improve the accuracy and stability of the historical call probability;

[0015] Step 103, according to the historical call probability, judge whether the function needs to be warmed up. Introduce a warm-up probability threshold, when the EWMA probability of the function reaches the threshold, mark the function as needing to be warmed up, otherwise it does not need to be warmed up. The warm-up strategy does not depend on the specific edge server, but directly decides whether the function itself needs to be warmed up.

[0016] Further, the step 2 of constructing a dynamic DAG model with warm-up preparation and function scheduling specifically includes the following steps:

[0017] Step 201, construct a system model, including edge servers m i Set M = {m1,...,m l}, l represents the number of edge servers, R(m i ) represents the storage resources of edge server m i . G = (F, E, P) represents a DAG graph, where F = {f1,...,f n} represents a set of functions f v arranged in topological order, n represents the number of functions, r v,i represents the memory resources required by function f v when executed on edge m i . The functions here are divided into dynamic functions f d and ordinary functions f r . E represents a set of function dependency relationships, e u,v represents that function f v depends on function f u . Set P = {p1,...,p n} represents the probability of function call. G(λ) represents a set of paths in the DAG, λ k is a path on the DAG, p k is the execution probability of path λ k , g k is the number of functions of path λ k . The calculation formula of p k is Decision variable x v,i represents whether function f v is cold start or hot start on edge m i , decision variable represents whether function f k of path λ v is scheduled to edge m i .

[0018] The transmission communication time required for data transmission from the previous function to the next function can be represented as where c i,j represents the communication time from edge server m i to m j transmitting one unit of data, d u,v represents the data transmitted to function f u by path λ v , represents whether function f k of path λ v is scheduled to edge m i , represents whether function f k of path λ v is scheduled to edge m j .

[0019] The function processing time can be represented as where x v,u represents whether function f v is cold start or hot start on edge m i , represents the cold start time of function f v on edge m i , represents the execution time of function f v on edge m i . When a function is executed on a container, if it is a hot start when it arrives on a preheated container, only the execution time needs to be calculated, and if there is no preheated container, the container cold start time also needs to be added

[0020] The dependency relationship between functions can be represented as where represents the end execution time of function f k on path λ v , represents the start execution time of function f k on path λ v . The calculation formula is

[0021] A quadratic integer programming mathematical model is established,

[0022]

[0023] subject to:

[0024]

[0025] The mechanism aims to minimize the overall expected execution time by pre-warming and function deployment, as follows. By the historical call data of step 1, predict the functions that may be called in the near future and pre-warm their containers on the edge server to reduce the cold start delay, then step 2 deploys them according to the call frequency and resource requirements of the functions, ensuring efficient use of computing resources, constraint (1a) ensures that the function demand probability on all possible execution paths is met, constraint (1b) guarantees that the amount of resource used on each edge server does not exceed its available resources, constraints (1c) and (1d) ensure that the task execution order depends on the same path, and constraints (1e) and (1f) specify the range of the above variables.

[0026] Further, step 3 proposes a search algorithm based on random rounding by transforming the original problem into a convex optimization problem. The specific steps include the following:

[0027] Step 301, since the original problem is a quadratic linear programming problem, it is relatively complex to solve directly, so by adjusting the decision variables and constraints, the problem is simplified into a convex optimization problem. The specific optimization goal is to minimize the sum of cold start time and execution time, and to solve the optimal allocation scheme under various constraints of pre-warming resources and task execution. After optimization, the problem becomes:

[0028]

[0029] subject to:

[0030]

[0031] Problem (2) is a convex optimization problem, where constraint (2c) corresponds to (1c), and constraint (2d) corresponds to constraint (1d); the remaining constraints remain unchanged. Therefore, we can solve problem (1) by solving problem (2);

[0032] Step 302, a search algorithm based on random rounding is proposed to solve the problem proposed in step 301. The core of the algorithm is to use a random method to gradually search for the optimal integer solution that satisfies all the constraints. First, by relaxing the variables to continuous values (between 0 and 1), the initial fractional solution is obtained by solving the relaxed optimization problem using Gurobi, and then the solution is approximated to an integer solution that satisfies all the constraints through probability and multiple random iterations. Finally, the solution is used to pre-warm the corresponding function container to reduce the cold start time and improve the system response speed.

[0033] Further, step 4 describes an online pre-warming and function scheduling algorithm, which specifically includes the following steps:

[0034] Step 401, based on the calculation of step 3, evaluate the duration of each function in all potential execution paths, and calculate the weight of each function combined with the path probability. Determine the importance of preheating functions in the path through these weights to prioritize high-weight functions for resource allocation;

[0035] Step 402, preheating is completed in two stages. Before the time slice starts, determine the function containers that need to be preheated according to the calculation results of step 3, and allocate them to the edge server, while updating the memory resource usage of the server; during the time slice running process, dynamically adjust the newly added preheating containers on the edge server, and reset the usage at the end of the time slice.

[0036] Step 403, according to the priority of preheating and function scheduling, maintain all requests in a queue. When requests are processed in order, dynamically allocate function priority and resources to ensure optimal function scheduling strategy, while removing completed tasks to achieve dynamic scheduling of online requests;

[0037] Step 404, in order to select the optimal node, first determine the earliest start time (EST) of the function, which depends on the completion time of the preceding task on its node and the time required for task data transmission to the target node. At the same time, it is also necessary to ensure that the selected edge node does not conflict with other tasks in terms of resources, which means that the start time of the function cannot be earlier than the earliest completion time of other tasks on the same node. In addition, the resource status of the edge node is an important factor in determining whether the function can be started in time, especially when the resource needs to be cold started, the start time of the function must be delayed until the cold start process is completed. When the node meets the above conditions, the earliest finish time (EFT) of the function can be calculated by its start time and processing time. Finally, by comparing the earliest finish time of the task in all candidate edge nodes, the node that can finish the task earliest is selected to ensure that the optimal edge node is found under the premise of considering task dependency, data transmission and resource constraints. This method can achieve efficient scheduling of tasks in edge computing environment, and maximize the reduction of delay and resource waste.

[0038] An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement the method of online deploying edge dynamic DAG serverless functions to achieve fast startup.

[0039] A computer readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the steps of the method of online deploying edge dynamic DAG serverless functions to achieve fast startup.

[0040] Advantages:

[0041] The effectiveness of the present application lies in:

[0042] By a method of deploying an edge dynamic DAG serverless function online to realize fast startup, the cold start delay problem of serverless functions caused by function scheduling in edge computing is effectively alleviated, so as to meet the task scheduling demand of dynamic DAG application in the edge environment.

[0043] Compared with the prior art, the present application has the following characteristics:

[0044] 1、The present application constructs a dynamic DAG model considering preheating preparation and function scheduling, and updates the function call probability in real time through historical data, so as to accurately reflect the characteristics of dynamic DAG.

[0045] 2、The present application proposes a search algorithm based on random rounding, which combines linear constraint relaxation and random progressive search, can convert the original problem into a convex optimization problem, and gradually approaches the optimal offline solution.

[0046] 3、The present application designs an online preheating and function scheduling algorithm, which can adjust the preheating position in real time according to the current resource availability and container preheating state, select the best server to execute task scheduling, adapt to function fluctuation under online request, and improve the service throughput of parallel request. DETAILED DESCRIPTION

[0047] Figure 1 is the dynamic DAG scheduling flowchart of the present application technology;

[0048] Figure 2 is the algorithm flowchart of the present application;

[0049] Figure 3a , 3b is the experimental result comparison diagram of the offline algorithm and other existing algorithms of the present application;

[0050] Figure 4a , 4b is the experimental result comparison diagram of the online algorithm and other existing algorithms of the present application. DETAILED DESCRIPTION

[0051] In order to facilitate those skilled in the art to understand and implement the present application, the present application will be further described in detail below in combination with the drawings and examples, and it should be understood that the implementation examples described herein are only used to illustrate and explain the present application, and are not used to limit the present application.

[0052] Embodiment: First, some important symbols used in the embodiment are explained in Table 1:

[0053] Table 1 Important symbols

[0054]

[0055] The method for online deployment of edge dynamic DAG serverless functions to achieve fast startup of the embodiment includes the following steps:

[0056] Step 1, define dynamic DAG and function preheating processing modeling preparation, the specific process is:

[0057] Step 101, serverless application is usually regarded as a series of event triggered functions for processing data, and there is a dependency relationship between functions. The structure of the application is defined as a directed acyclic graph (DAG), as shown in Figure 1 . Functions are divided into two types: normal functions and dynamic functions. Normal functions are always called during execution, while dynamic functions are conditionally executed according to the calling conditions of adjacent functions. The dependency relationship between functions is represented by edges, and the execution of a function requires its dependent functions to complete and pass the corresponding data. Each function is also assigned a call probability, and the call probability of normal functions is 1, while the call probability of dynamic functions ranges from 0 to 1, which is derived from historical data. When a request arrives, the entire DAG is not guaranteed to be executed. On the contrary, the execution path is dynamically adjusted according to the request. Each execution path in the DAG is composed of multiple functions, including normal functions and dynamic functions. The selection probability of each path is calculated by multiplying the probabilities of all functions on the path. There may be multiple execution paths in the DAG, and the path set represents all possible paths.

[0058] Step 102, by analyzing historical data, the historical call probability of a function in a specific observation period can be calculated. The historical call probability is calculated by the number of calls of the function in the period and the length of the observation period. In order to ensure that the probability value is within the range of [0, 1], the historical call probability needs to be normalized. The normalization process is based on the minimum and maximum number of calls of all functions in the observation period. In order to improve accuracy and smooth fluctuations, the Exponentially Weighted Moving Average (EWMA) method is introduced. The EWMA method combines the historical call probability of the current observation period with the previous EWMA value. The formula is as follows:

[0059] P EWMA (f v )=μP NORM (f v )+(1-μ)P last-EWMA (f v )

[0060] Where μ is the smoothing factor, which determines the weight ratio of the current observation period data and the previous data. P EWMA (f v ) is the current observation period function f vExponentially weighted moving average probability. P NORM (f v ) is a function f v The normal probability, P last-EWMA (f v ) is a historical observation periodic function f v Exponentially weighted moving average probability.

[0061] Step 103: To determine whether a function needs preheating, a preheating probability threshold P is introduced. pre Its value ranges from 0 to 1. This threshold defines the function f. v The minimum probability that preheating is required. Unlike deployment decisions, the preheating decision for a function does not depend on a specific edge server. Therefore, x v Instead of considering the specific index of the server, the function f is directly represented. v Does preheating need to be done? If function f v EWMA probability P EWMA (f v Reaching or exceeding P pre Then mark the function as requiring preheating (i.e., x). v =1); otherwise preheating is not required (x v =0).

[0062] Step 2: Construct a dynamic DAG model with preheating preparation and function scheduling.

[0063] Step 201: Construct a system model, including edge server m i Set M = {m1,...,m} l}, where l represents the number of edge servers, R(m i ) represents the edge server m i Storage resources. G = (F, E, P) represents a DAG graph, where F = {f1, ..., f...} n} represents the function f arranged in topological order. v Set, where n represents the number of functions, r v,i Represents the function f v At the edge m i The memory resources required during execution. The functions here are divided into dynamic functions f. d and ordinary function f r E represents the set of functional dependencies, e u,v Represents the function f v Dependency function f u Set P = {ρ1,...,ρ...} n} represents the probability of the function being called. G(λ) represents the set of paths in the DAG, where λ k It is a path on the DAG, pk is the execution probability of path λ k g k is the number of functions of path λ k p k The calculation formula of is decision variable x v,i represents function f v on edge m i is a cold start or a hot start, and the decision variable represents function f k of path λ v whether to be scheduled to edge m i .

[0064] The transmission communication time of data required to be transmitted from the previous function to the next function can be represented as where c i,j represents the communication time of transmitting one unit of data from edge server m i to m j , d u,v represents the data transmitted by function f u to function f v , represents whether function f k of path λ v is scheduled to edge m i , represents whether function f k of path λ v is scheduled to edge m j .

[0065] The function processing time can be represented as where x v,i represents whether function f v on edge m i is a cold start or a hot start, represents the cold start time of function f v on edge m i , represents the execution time of function f v on edge m i . When a function is executed on a container, if it is a hot start when a preheated container function arrives, only the execution time needs to be calculated, and if there is no preheated container, the container cold start time also needs to be added

[0066] The dependency relationship between functions can be represented as where represents the end execution time of function f k of path λ v , representing path λ k start execution time of function f v The calculation formula of

[0067] establish a quadratic integer programming mathematical model,

[0068]

[0069] subject to:

[0070]

[0071] The mechanism aims to minimize the overall expected execution time through preheating and function deployment, as follows. Through the historical call data of step 1, predict the functions that may be called in the near future and preheat their containers on the edge server to reduce cold start delay, then step 2 deploys them according to the call frequency and resource requirements of the functions, ensuring efficient use of computing resources, constraint (1a) ensures that the function demand probability on all possible execution paths is met, constraint (1b) ensures that the amount of resource used on each edge server does not exceed its available resources, constraints (1c) and (1d) ensure that the task execution order depends on the same path, constraints (1e) and (1f) specify the range of the above variables.

[0072] Step 3, based on step 2, the original problem is transformed into a convex optimization problem and a search algorithm based on random rounding is proposed.

[0073] Step 301, problem (1) is a quadratic linear programming problem, which is difficult to solve directly, so it is tried to reduce the complexity of the problem. First, modify (1e) to

[0074]

[0075] For the quadratic constraint (1d), is the product of binary variables, in order to simplify it, it is tried to fix the value of x v,i first. Specifically, the value of x v can be obtained through the preheating preparation of step 1. When x v = 1, first let all x v,i = 1, then the current decision variable is only In this way, the following convex optimization problem is proposed:

[0076]

[0077] subject to:

[0078]

[0079] Problem (2) is a convex optimization problem, where constraint (2c) corresponds to constraints (1c) and (1e), and constraint (2d) corresponds to constraints (1d) and (1f); the remaining constraints remain unchanged. Thus we can handle problem (1) by solving problem (2).

[0080] Step 302, To solve problem (2), we propose a search algorithm based on a random rounding method. The core idea of this algorithm is to find the optimal integer solution of this problem through a random rounding method. First, the relaxation variable is a continuous value between 0 and 1, and then the Gurobi linear solver is used to solve the relaxation optimization problem to obtain the optimal fractional solution All are initialized to 0, according to the probability distribution of , there is a corresponding probability of occurrence. Next, the occurrence of these events is simulated through multiple random iterations, and the result of each iteration is calculated. This process is repeated until a feasible solution that satisfies all the constraints is finally obtained Once we finally obtain a feasible solution that satisfies all the constraints, we will warm up the corresponding function container according to this result. The purpose of warming up is to reduce the cold start time and improve the response speed of the system.

[0081] Step 4, Step 3 algorithm considers the case of arranging only one request at a time, but in real life, multiple random sequences arrive at any time. Based on the step 3 algorithm, an online warm-up and function scheduling algorithm is designed to handle the case of multiple online arrivals (as shown in Figure 2 ).

[0082] Step 401, based on the algorithm of step 3, we can calculate the duration of a function in its potential execution path, and combine it with the probability of each path being selected to obtain the weight of the function. Suppose function f v may belong to multiple paths λ k , get all possible path sets containing this function First, calculate the execution time of function f v on a specific path λ k , and multiply it by the probability p k of this path. Then, these probabilities and corresponding path execution times are summarized in all potential paths of the function, thus obtaining the weight of the function. Let represent the weight of function f v , defined as follows:

[0083]

[0084] Step 402, we will adjust the pre-warming process of containers in two stages, and the entire time span is divided into multiple fixed time slices. The first stage is to pre-warm the container using x v,i calculated by step 3 before the start of each time slice. Let s v,i be the number of containers pre-warmed on edge server m i for function f v . At this moment, the remaining memory capacity of the server is

[0085]

[0086] The second stage is to pre-warm new containers for function f i on edge server m v at the beginning of each time slice. We define y v,i = 1 to indicate that a new container is pre-warmed on edge server m v for function f i in the current request. The decision process (y v,i = 1) will be introduced in the next step. Let q v,i represent the total number of newly pre-warmed containers, then the remaining resources of the edge server are

[0087]

[0088] At the end of the current time slice, reset q v,i = 0.

[0089] Step 403, the online pre-warming and function scheduling algorithm efficiently schedules incoming requests by maintaining them in a topologically sorted queue, ensuring that each function is processed in order. It dynamically updates function priorities and server assignments to optimize resource allocation and handle completed functions. First, initialize the request queue and candidate set to empty, and when a new request arrives, generate a scheduling list in topological order and add it to the queue. Then, extract the function that needs to be scheduled from the queue, update the candidate set, and assign the highest priority function to the best edge server according to the weight order. The scheduled function is removed from the corresponding scheduling list, and when the scheduling list is empty, the request is removed from the queue. This process is repeated until all requests are processed, ensuring efficient scheduling of functions in order and reasonable allocation of resources.

[0090] Step 404, next we discuss how to determine the best edge server for a function. First, define the concept of earliest start time (EST), which must be greater than the earliest finish time (EFT) of the previous function in the same request, which ensures that the current function can only start execution after the previous function has completed and the necessary data has been transmitted, i.e.:

[0091]

[0092] where EST(τ a ,f v ,m i ) denotes the earliest start time of function f a in request τ v on edge server m i , and EFT(τ a ,f u ,m j ) denotes the earliest finish time of function f a in request τ u on edge server m j .

[0093] It must also be greater than the earliest start time of the same function from a different request on the same edge server, which ensures that functions from multiple requests do not overlap on the same edge server:

[0094] EST(τ a ,f v ,m i ) ≥ min(EFT(τ b ,f v ,m i )) (4)

[0095] where EFT(τ b ,f v ,m i ) denotes the earliest finish time of function f b in request τ v on edge server m i .

[0096] Furthermore, it must be greater than the time required to directly launch a container, defining Avail(f v ,m i ) as the time that edge server m i has available to warm up function f v , which ensures that the function is either warm or cold-starts a container before execution,

[0097] 3) on the same edge server as the previous function execution:

[0098]

[0099] where Avail(f v ,m i ) denotes the time that edge server m i has available to warm up function f v .

[0100] 4) On different edge servers where the previous functions are not executed:

[0101]

[0102] The earliest completion time of a function is calculated as follows:

[0103]

[0104] EFT(τ a ,f v ,m i ) represents the earliest completion time of function f a in request τ v on edge server m i . represents the processing time of function f v on edge server m i when executing path λ k .

[0105] Based on the above, the earliest start time of a function is

[0106] EST(τ a ,f v ,m i ) ≥ min([3], [4], [5], [6]).

[0107] Experimental configuration:

[0108] The experiment was conducted in a cluster containing six edge servers, using Kubernetes and OpenFaaS frameworks. In practical applications, the cold start time and execution time of the same function on different servers will vary, so the memory resources of the edge servers are set to different value ranges (0.5 to 3 GB), and the data transfer rate between servers is set to 10 Gbps.

[0109] The experimental application selected the Social Network application in the DeathStar benchmark suite. For this application, three sizes of DAGs (small, medium, and large) were set up, containing 11 functions and 7 paths, 15 functions and 14 paths, and 18 functions and 21 paths, respectively. Based on actual execution information, historical data such as execution time, cold start time, function usage rate, and call probability of each function were collected and preprocessed for experimental modeling.

[0110] Experimental comparison:

[0111] As shown in FIG. 3, in the offline experiment, each request only executes one path in the DAG to better observe the overall performance of different algorithms. Evaluation is done by measuring the average completion time of each request under different numbers of requests. Figure 2 It is shown that when the number of requests is 20, 40, 60 and 80, a random rounding-based search algorithm (EBRO) of the present application is superior to the baseline algorithm in terms of both cold start and warm start delays of container launch. Figure 3a It is further shown that the average execution time, cold start time, data transfer time and function execution time of each request, and the results show that EBRO significantly reduces these times, with an average reduction of 63.1%, 61.1% and 62.7%, and the maximum reduction of request completion time reaches 78.4%, and the maximum reduction of cold start time reaches 88.5%. Figure 3b It is shown that the average cold start probability of each function under different numbers of requests, and the results show that the cold start probability of EBRO is the lowest, ranging from 5.1% to 13.9%, while the cold start probability of the baseline algorithm ranges from 32.1% to 61.7%.

[0112] As shown in FIG. 4, the online algorithm aims to handle requests that arrive in order and need to be processed in parallel in a short time. We evaluate the algorithm performance by testing the arrival of different numbers of requests in a short time. Figure 4a It is shown that the total completion time of all tasks is defined as the time from the arrival of the first request to the completion of the last task. From the results, an online preheating and function scheduling algorithm (OPTS) of the present application always performs best, saving 21.6% of time compared to the comparison algorithm Fixed, and saving 25.2% of time compared to the comparison algorithm FCFS. Figure 4b It is shown that the total cold start time of all requests, and the results clearly show that the cold start time of OPTS is significantly lower than the baseline algorithm, with an average reduction of 76.9% and 80.1% compared to Fixed and FCFS, respectively.

[0113] The present application can also have other various implementations, and those skilled in the art can make various corresponding changes and modifications to the present application without departing from the spirit and essence of the present application, and these corresponding changes and modifications shall all belong to the protection scope of the claims appended to the present application.

Claims

1. A method for online deployment of serverless functions of edge dynamic DAG to achieve fast startup, characterized in that, The method includes the following steps: Step 1: Abstract the serverless application into a directed acyclic graph (DAG). Calculate the path selection probability by analyzing the function call probability on the execution path. Calculate and smooth the function call probability using historical data and the EWMA method to improve prediction accuracy and stability. Determine whether preheating is needed based on the function call probability. If the probability exceeds a threshold, mark it as needing preheating; otherwise, no preheating is required. Step 2: By constructing a quadratic integer programming model with the goal of minimizing the overall expected execution time of the function, this model uses the historical call data from Step 1 to predict possible future calls and rationally allocates warm-up and computing resources on edge servers, thereby reducing cold start latency and resource waste. Constraints ensure that the execution path probability of the task meets the requirements, the resource usage of each edge server does not exceed the available capacity, and the data transmission, processing order, warm-up and execution time of the function meet the actual execution conditions. Through these constraints, the model can efficiently allocate edge computing resources and optimize the task scheduling process. Step 3: Based on Step 2, the algorithm first linearizes the nonlinear constraints by slack variables and uses the Gurobi solver to perform initial optimization of the problem to obtain effective fractional solutions. Then, it generates the final solution that meets the integer requirements through randomized search, ensuring that the solution satisfies all constraints. This further improves the solution accuracy and optimizes the system response speed. Step 4: Based on Step 3, design an online preheating and function scheduling algorithm. First, assess the importance of each function based on its continuous impact in potential execution paths to optimize resource allocation. Next, before the time slice begins, dynamically adjust the preheating resources and priorities on the edge servers to ensure effective allocation of function resources and flexibly adjust the preheating strategy according to actual needs. Then, sort all pending functions according to task request priorities and dependencies, and allocate optimal computing resources to ensure tasks can be completed according to the optimal scheduling strategy, and dynamically release resources that are no longer needed. Finally, by determining the earliest start time and earliest completion time of the functions, compare the task completion efficiency among candidate edge nodes, comprehensively consider transmission latency and resource status, and select the optimal edge node to maximize task execution efficiency and reduce resource waste, thereby optimizing the overall task scheduling in the edge computing environment.

2. The method for online deployment of edge dynamic DAG serverless functions to achieve fast startup as described in claim 1, characterized in that: Step 1, which defines the dynamic DAG and prepares the function preheating model, specifically includes the following steps: Step 101: Define the serverless application as a directed acyclic graph (DAG), where functions are divided into ordinary functions and dynamic functions. Ordinary functions are always called, while dynamic functions are called according to conditions. The DAG contains multiple execution paths, and the selection probability of each path is calculated from the calling probabilities of all functions on the path. Step 102: By analyzing historical data, calculate the historical call probability of each function within a specified observation period, and smooth data fluctuations through normalization and EWMA methods to improve the accuracy and stability of the historical call probability. Step 103: Based on the historical call probability, determine whether the function needs to be warmed up. Introduce a warm-up probability threshold. When the EWMA probability of a function reaches the threshold, mark the function as needing to be warmed up. Otherwise, no warm-up is required. The warm-up strategy does not depend on the specific edge server, but directly determines whether the function itself needs to be warmed up.

3. The method for online deployment of edge dynamic DAG serverless functions to achieve fast startup as described in claim 1, characterized in that: Step 2, which involves constructing a dynamic DAG model with preheating preparation and function scheduling, specifically includes the following steps: Step 201: Construct a system model, including edge server m i Set M = {m1,...,m} l }, where l represents the number of edge servers, R(m i ) represents the edge server m i Storage resources, G = (F, E, P) represents a DAG graph, where F = {f1, ..., f...} n } represents the function f arranged in topological order. v Set, where n represents the number of functions, r v,i Represents the function f v At the edge m i The memory resources required during execution; the functions here are divided into dynamic functions f. d and ordinary function f r E represents the set of functional dependencies, e u,v Represents the function f v Dependency function f u The set P = {ρ1,...,ρ n } represents the probability of the function being called, G(λ) represents the set of paths in the DAG, and λ k It is a path on the DAG, p k It is path λ k The execution probability, g k It is path λ k The number of functions, p k The calculation formula is: Decision variable x v,i Represents the function f v At the edge m i Whether it's a cold start or a warm start, the decision variables Represents path λ k function f v Is it scheduled to the edge m? i superior, The communication time required to transfer data from one function to the next is expressed as: Where c i,j Indicates from edge server m i to m j The communication time to transmit one unit of data, d u,v Represents the function f u Transmitted to function f v Data, Represents path λ k function f u Is it scheduled to the edge m? i superior, Represents path λ k function f v Is it scheduled to the edge m? j superior, Function processing time is expressed as Where x v,i Represents the function f v At the edge m i Is it a cold start or a warm start? Represents the function f v At the edge m i Cold start time Represents the function f v At the edge m i The execution time of a function on a container is calculated as follows: if the container is warmed up before execution, only the execution time needs to be calculated. If the container has not been warmed up, the cold start time of the container must also be added. The dependency relationship between functions is represented as in Represents path λ k function f u The end execution time, Represents path λ k function f v The start time of execution. The calculation formula is: Establish a mathematical model for quadratic integer programming. subject to: The overall expected execution time is minimized through preheating and function deployment, as follows: using historical call data from step 1, functions that may be called in the near future are predicted, and their containers are preheated on edge servers to reduce cold start latency. Then, step 2 deploys them according to the function call frequency and resource requirements to ensure efficient utilization of computing resources. Constraint (1a) ensures that the function requirement probability is met on all possible execution paths. Constraint (1b) guarantees that the resource usage on each edge server does not exceed its available resources. Constraints (1c) and (1d) ensure that the task execution order depends on the same path. Constraints (1e) and (1f) specify the range of the above variables.

4. The method for online deployment of serverless edge dynamic DAG functions to achieve fast startup as described in claim 1, characterized in that: Step 3 transforms the original problem into a convex optimization problem, proposing a search algorithm based on random rounding. The specific steps include the following: Step 301: The specific optimization objective is to minimize the sum of cold start time and execution time, and to find the optimal allocation scheme under various constraints of preheating resources and task execution. After optimization, the problem becomes: subject to: Problem (2) is a convex optimization problem, where constraint (2c) corresponds to constraint (1c), and constraint (2d) corresponds to constraint (1d); the remaining constraints remain unchanged. Step 302 proposes a search algorithm based on random rounding to solve the problem proposed in Step 301. The core of the algorithm is to use a random method to progressively search for the optimal integer solution that satisfies all constraints. First, it uses slack variables... Given continuous values ​​between 0 and 1, the initial fractional solution is obtained by solving the relaxation optimization problem using Gurobi. Then, through probability and multiple random iterations, the solution is approximated to an integer solution that satisfies all constraints. Finally, the solution results are used to preheat the corresponding function container to reduce cold start time and improve system response speed.

5. The method for online deployment of serverless edge dynamic DAG functions to achieve fast startup as described in claim 1, characterized in that: The online preheating and function scheduling algorithm described in step 4 specifically includes the following steps: Step 401: Based on the calculation in Step 3, evaluate the duration of each function in all potential execution paths, and calculate the weight of each function in combination with the path probability. Use these weights to determine the importance of warming up the function in the path, so as to prioritize the allocation of resources to functions with high weights. Step 402: The preheating is completed in two phases. Before the time slice begins, based on the calculation results of Step 3, the function containers that need to be preheated are determined and allocated to the edge servers, while the memory resource usage of the servers is updated. During the time slice, the newly added preheating containers on the edge servers are dynamically adjusted, and the usage is reset at the end of the time slice. Step 403: Based on the priority of warm-up and function scheduling, keep all requests in a queue and sort them. When the requests are processed in order, dynamically allocate function priorities and resources to ensure the optimal function scheduling strategy. At the same time, remove completed tasks to realize dynamic scheduling of online requests. Step 404: To select the optimal node, the earliest start time (EST) of the function must first be determined. This depends on the completion time of the preceding tasks on their respective nodes and the time required for the task data to be transmitted to the target node. Simultaneously, it must be ensured that the selected edge node will not conflict with other tasks in terms of resources. The resource status of the edge node is a crucial factor in determining whether the function can start in a timely manner. When resources require a cold start, the function's start time must be delayed until the cold start process is complete. Once the node meets the above conditions, the earliest completion time (EFT) of the function is calculated using its start time and processing time. Finally, by comparing the earliest completion times of the tasks among all candidate edge nodes, the node that can complete the task earliest is selected, ensuring that the optimal edge node is found while considering task dependencies, data transmission, and resource constraints.

6. The method for online deployment of edge dynamic DAG serverless functions to achieve fast startup as described in claim 5, characterized in that: In step 401, the assumed function f v Belongs to multiple paths λ k Get the set of all possible paths containing the function. First, calculate the function f. v In a specific path λ k The execution time on the path is multiplied by the probability p of that path. k Then, these probabilities and corresponding path execution times are aggregated across all potential paths of the function to obtain the function's weights. Let... Represents the function f v The weights are defined as follows: Step 402: The preheating process of the container will be adjusted in two stages. The entire time span is divided into multiple fixed time slices. The first stage is before the start of each time slice, using x calculated in step 3. v,i To preheat the container, let s v,i For all requests on edge server m i The above is the function f v The number of containers being preheated, and the remaining server memory capacity R′(m) at this moment. i )for The second phase occurs at the beginning of each time slice, with edge server m i Need to be for function f v Preheat the new container, define y v,i =1 indicates that in the current request, it is f v On edge server m i Preheat a new container, let q v,i This represents the total number of newly preheated containers. Therefore, the remaining resources on the edge servers are... Reset q at the end of the current time slice. v,i =0, Step 403: The online preheating and function scheduling algorithm efficiently schedules incoming requests by maintaining them in a topologically ordered queue, ensuring that each function is processed sequentially. It dynamically updates function priorities and server allocation to optimize resource allocation and process completed functions. First, the request queue and candidate set are initialized to empty. When a new request arrives, it is added to the queue in topological order to generate a scheduling list. Then, the functions currently needing scheduling are extracted from the queue, the candidate set is updated, and the highest-priority function is selected based on weight and assigned to the best edge server. Scheduled functions are removed from their corresponding scheduling lists. When the scheduling list is empty, the request is deleted from the queue. This process is repeated until all requests are processed, ensuring efficient sequential function scheduling and reasonable resource allocation. Step 404: Determine the optimal edge server for a function. First, define the concept of the earliest start time (EST). It must be greater than the earliest completion time (EFT) of the preceding function in the same request. This ensures that the current function can only begin execution after the preceding function has completed and the necessary data has been transmitted. Where EST(τ) a ,f v ,m i ) indicates a request τ a function f v On edge server m i The earliest start time, EFT(τ) a ,f u ,m j ) indicates a request τ a function f u On edge server m j The earliest completion time, It must also be greater than the earliest start time of the same function from different requests on the same edge server, which ensures that functions from multiple requests do not overlap on the same edge server: EST(τ a ,f v ,m i )≥min(EFT(τ b ,f v ,m i )) (4) Where EFT(τ) b ,f v ,m i ) indicates a request τ b function f v On edge server m i The earliest completion time, Furthermore, it must be greater than the time required to directly start a container, defining Avail(f v ,m i ) for edge server m i With sufficient preheating function f v This timeframe ensures that the container has been warmed up or cold-started before the function is executed. 1) On the same edge server where the previous function was executed: Among them, Avail(f v ,m i ) represents the edge server m i Function f that can be preheated v Time, 2) On different edge servers where the previous function was not executed: The earliest completion time of the function is calculated as follows: EFT(τ a ,f v ,m i ) indicates a request τ a function f v On edge server m i The earliest completion time, Represents the function f v On edge server m i Execution path λ k Processing time Based on the above, the earliest start time of the function is EST(τ). a ,f v ,m i )≥min([3],[4],[5],[6]), Wherein, min([3],[4],[5],[6]) represents the minimum value of the calculation results of formulas (3), (4), (5), and (6).

7. An electronic 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 program, it implements a method for quickly starting up an online deployment of a serverless edge dynamic DAG function as described in any one of claims 1 to 6.

8. A computer-readable storage medium storing computer instructions thereon, characterized in that: When executed by a processor, the computer instructions implement the steps of a method for quickly starting up an online deployment of a dynamic edge DAG serverless function as described in any one of claims 1-6.