A multi-user multi-task scheduling method based on serverless edge computing
By optimizing task scheduling based on the server computing power allocation ratio and the use of cache in serverless edge computing, the problem of waste of resources and long waiting time in multi-user multi-task scheduling is solved, and more efficient resource utilization and task processing is achieved.
Patent Information
- Application Number
- CN202411537363.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-10-31
AI Technical Summary
The existing serverless edge computing technology cannot perform segmented resource scheduling based on task conditions and server computing power in multi-user multi-task scheduling, resulting in too long waiting time for resource waste and task processing.
A multi-user multi-task scheduling method based on serviceless edge computing is proposed. By calculating the computing power allocation ratio of the function on the server, optimizing the task scheduling, using the cache record function execution results, deciding whether to adopt a concurrency strategy, and according to the computing power of the server Scheduling tasks.
It improves resource utilization, improves system throughput and efficiency, shortens task completion time, and adapts to the operation needs of different servers.
Smart Images

Figure CN119052240B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of serverless edge computing, and in particular to a multi-user multi-task scheduling method based on serverless edge computing. Background Art
[0002] With the surge in IoT devices, the amount of data is growing exponentially. These devices generate a large amount of real-time data that needs to be processed and responded to quickly. The remote data center of cloud computing cannot meet this demand. Moreover, transmitting a large amount of data to a remote data center will occupy a lot of bandwidth, resulting in network congestion and high transmission costs. In the prior art, edge computing technology is often used to place computing and data storage resources close to the data source, rather than transmitting all data to a remote data center for processing. This is edge-cloud collaborative scheduling technology. When scheduling tasks, it can be decided whether to be scheduled to an edge server or a cloud server according to the task situation. This not only takes advantage of the instant processing of edge computing, but also takes advantage of the ability of cloud computing to handle large-scale tasks. However, this task scheduling mode does not subdivide the computing power resources on the server, but instead processes the computing power resources used by all functions in a unified manner. In multi-user multi-task scheduling, it is impossible to perform overall task scheduling based on the task situation and server computing power, resulting in a waste of server resources or a long waiting time for task processing. Summary of the invention
[0003] The present application is made in view of the above-mentioned issues, and its purpose is to provide a multi-user multi-task scheduling method based on serverless edge computing, propose a new computing power allocation ratio for functions on the server, improve resource utilization, increase system throughput, optimize the performance and efficiency of multi-user multi-task processing, and use cache to record the execution results of functions, which greatly reduces the execution time of the same function, and decides whether to execute concurrent strategies according to the computing power on the server, which greatly shortens the task completion time and can adapt to the operation requirements of different servers.
[0004] Specifically, the first aspect of the present application provides a multi-user multi-task scheduling method based on serverless edge computing, comprising the following steps:
[0005] Step 1: All users upload all their tasks to the cloud. The cloud divides a task into a directed acyclic graph consisting of stateless functions and prioritizes the execution of functions based on dependencies.
[0006] Step 2: The server then obtains the computing load of different functions based on the configured function type through the information transmitted from the cloud, and obtains the computing power of different functions on the server configured with the function. The calculation formula is as follows:
[0007] ;
[0008] in: is the computing power allocated to function type j on server n;
[0009] is the computing power of server n;
[0010] is the load size of function type j;
[0011] is the total load of all functions configured on server n;
[0012] Step 3: The user terminal starts task scheduling and schedules the function to the server configured with the environment of the current function;
[0013] Step 4: Calculate the delay incurred when the function is scheduled to the corresponding server, including scheduling delay, execution delay and transmission delay. The calculation formula is as follows:
[0014] Scheduling delay:
[0015] ;
[0016] in: is the scheduling delay;
[0017] For function The data size;
[0018] is the transmission rate from the user to the edge server;
[0019] is the transmission rate from edge to cloud;
[0020] The current server is an edge server;
[0021] The current server is a cloud server;
[0022] Execution delay:
[0023] When the scheduled server supports concurrent execution:
[0024] ;
[0025] When the scheduled server does not support concurrent execution:
[0026] ;
[0027] in: To execute the delay;
[0028] The time to find the execution result in the cache;
[0029] is the cold start time; The time to obtain the cache;
[0030] The remaining execution time of the preceding function;
[0031] is the load size of function type j;
[0032] The payload size of the unfinished portion of the current function;
[0033] is the computing power allocated to function type j on server n;
[0034] is the jth function in the pth task of user i;
[0035] There is no execution record;
[0036] For the existence of execution records;
[0037] Transmission delay:
[0038] ;
[0039] in: is the transmission delay;
[0040] for The location to which they are dispatched;
[0041] function The data size;
[0042] is the transmission rate from the user to the edge server;
[0043] For function The set of direct functions of ;
[0044] Step 5: Calculate the start time and end time of each function based on the delay;
[0045] Step 6: Based on the dependencies between tasks, the time it takes for a user to complete all tasks is the maximum value of the task end times;
[0046] The dependency between tasks refers to the linear dependency between multiple tasks of each user, so the end time of the previous task is the start time of the current task, so the maximum value of the completion time of each task is the time it takes for the current user to complete all tasks.
[0047] Step 7: Since it is multi-user scheduling, and each user starts scheduling at the same time, the total time for all users to complete all task scheduling is the maximum value of the time for a single user to complete all tasks.
[0048] Concurrent execution means supporting the execution of multiple functions of the same type at the same time. Non-concurrency means that functions of the same type must wait for the execution of the currently executed function to be completed before they can start executing. Whether concurrency is supported is determined by the computing power of the server. Only when the computing power is sufficient can concurrent execution be supported.
[0049] As for whether there is an execution record, since the task function is a stateless function, the execution result is only related to the parameters passed in from the outside, so a cache is set to record the execution result. When the search is needed, the execution result can be found in the cache.
[0050] Furthermore, the computing power configuration on the server is distributed in proportion to the function load configured on the server.
[0051] Furthermore, the calculation of the computing power configuration includes the following steps:
[0052] Step 1: Traverse all servers;
[0053] Step 2: Obtain the sum of the computing loads of all function types on server i;
[0054] Step 3: Traverse each function type on server i;
[0055] Step 4: Divide the total function load of server i by function j to get the computing power ratio of function j on server i;
[0056] Step 5: Multiply this ratio by the computing power of server i to get the computing power allocated to function j on server i.
[0057] Furthermore, whether the scheduled server supports concurrent execution depends on the computing power of the server.
[0058] Furthermore, the cold start time is the time from when the container on the server is created to when the user code starts to run.
[0059] Furthermore, the cold start time includes the time required for image pulling, container initialization and environment configuration.
[0060] Furthermore, the start time of the function is calculated as follows:
[0061] ;
[0062] in: is the start time of the jth function in the pth task of user i;
[0063] for End time of
[0064] For function The direct predecessor function of ;
[0065] for arrive The transmission time;
[0066] For function The set of immediate predecessor functions of .
[0067] Furthermore, the end time of the function is calculated as follows:
[0068] ;
[0069] in: is the end time of the jth function in the pth task of user i;
[0070] For function The scheduling delay of
[0071] For function Execution delay;
[0072] is the start time of the jth function in the pth task of user i.
[0073] Furthermore, the dependency relationship between tasks specifically includes: since there is a linear dependency relationship between multiple tasks of each user, the end time of the previous task is the start time of the current task.
[0074] Furthermore, the operation logic of the execution time specifically includes:
[0075] Step 1: Determine whether the current server computing power supports concurrent execution;
[0076] Step 2: Determine whether there is an execution record of the current function in the cache;
[0077] Step 3: Select the corresponding formula to calculate the execution time according to the judgment results of step 1 and step 2;
[0078] Step 4: When outputting the execution time result, you need to add the cold start time of the function. If the container has been started, the cold start time is 0.
[0079] In the second aspect, the present application also provides a computing device, which has the function of implementing the method described in the first aspect above. The beneficial effects can be found in the description of the first aspect, which will not be repeated here. The function can be implemented by hardware, or by executing the corresponding software implementation through hardware. The hardware or software includes one or more modules corresponding to the above functions. In one possible design, the structure of the device includes an acquisition module, a training module, and optionally, a construction module. These modules can implement the function of the training node in the method example of the first aspect above. Please refer to the detailed description in the method example for details, which will not be repeated here.
[0080] In the third aspect, the present application also provides a computing device, which is used to implement the functions of the method described in the first aspect above. The beneficial effects can be found in the description of the first aspect and will not be repeated here. The structure of the computing device includes a processor and a memory, and the memory is used to store instructions and / or data. The memory is coupled to the processor, and when the processor executes the program instructions stored in the memory, the function of the training node in the example of the first aspect above can be implemented. The structure of the computing device also includes a communication interface for communicating with other devices.
[0081] In a fourth aspect, the present application also provides a computer-readable storage medium, in which instructions are stored, and when the computer-readable storage medium is run on a computer, the computer executes the method in the above-mentioned first aspect and various possible designs of the first aspect.
[0082] In a fifth aspect, the present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method in the above-mentioned first aspect and various possible designs of the first aspect.
[0083] In a sixth aspect, the present application also provides a computing chip, which is connected to a memory, and the chip is used to read and execute a software program stored in the memory, and to execute the methods in the above-mentioned first aspect and various possible implementation methods of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] In order to more clearly illustrate the embodiments of the present drawings or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present drawings. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.
[0085] Figure 1 A flowchart of the steps of a multi-user multi-task scheduling method based on serverless edge computing;
[0086] Figure 2 This is the overall framework diagram of this application;
[0087] Figure 3 A flowchart of the steps for calculating the computing power configuration for this application.
[0088] The purpose, features and advantages of this figure will be further described in conjunction with the embodiments with reference to the accompanying drawings. DETAILED DESCRIPTION
[0089] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0090] Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in this field, the present application can also be applied to other similar scenarios based on these drawings without creative work. In addition, it can also be understood that although the efforts made in this development process may be complicated and lengthy, for ordinary technicians in this field related to the content disclosed in this application, some changes in design, manufacturing or production based on the technical content disclosed in this application are just conventional technical means, and should not be understood as insufficient content disclosed in this application.
[0091] Unless otherwise specified, all embodiments and optional embodiments of the present application can be combined with each other to form a new technical solution.
[0092] Unless otherwise specified, all technical features and optional technical features of this application can be combined with each other to form a new technical solution.
[0093] If there is no special explanation, all steps of the present application can be performed sequentially or randomly, preferably sequentially. For example, the method includes steps (a) and (b), which means that the method may include steps (a) and (b) performed sequentially, or may include steps (b) and (a) performed sequentially. For example, the method may further include step (c), which means that step (c) may be added to the method in any order. For example, the method may include steps (a), (b) and (c), or may include steps (a), (c) and (b), or may include steps (c), (a) and (b), etc.
[0094] If there is no special explanation, the "include" and "comprising" mentioned in this application are open-ended or closed-ended. For example, the "include" and "comprising" may mean that other components not listed may also be included or only the listed components may be included or only the listed components may be included.
[0095] If not specifically stated, in this application, the term "or" is inclusive. For example, the phrase "A or B" means "A, B, or both A and B". More specifically, any of the following conditions satisfies the condition "A or B": A is true (or exists) and B is false (or does not exist); A is false (or does not exist) and B is true (or exists); or both A and B are true (or exist).
[0096] In order to better understand the solutions of the embodiments of the present application, some relevant terms and concepts that may be involved in the embodiments of the present application are first introduced below.
[0097] (1) Cloud server, also known as cloud host or cloud computing server, is a computing service model based on the Internet. It abstracts, integrates and allocates physical server cluster resources through virtualization technology to provide users with elastically scalable computing power. Unlike traditional physical servers, cloud servers do not rely on a single physical hardware, but integrate the resources of multiple physical servers through distributed architecture and virtualization technology. Cloud servers are simple and efficient, safe and reliable, and have elastically scalable processing power.
[0098] (2) Edge server is a distributed computing model that aims to improve the efficiency of data centers and cloud services and solve the latency problem of communication between devices. It transfers business from central data centers to edge devices, and places computing, storage, and network resources close to end users and devices to achieve faster data processing and response.
[0099] (3) Cache is a storage technology used to temporarily store and quickly access frequently needed data. It plays a vital role in computer systems and improves performance by copying data from slower memory to faster memory. Its main function is to reduce the number of accesses to main memory (DRAM), thereby speeding up program execution and response time.
[0100] In this embodiment, Figure 1 As shown, a multi-user multi-task scheduling method based on serverless edge computing includes the following steps:
[0101] Step 1: All users upload all their tasks to the cloud. The cloud divides a task into a directed acyclic graph consisting of stateless functions and prioritizes the execution of functions based on dependencies.
[0102] Step 2: The server then obtains the computing load of different functions based on the configured function type through the information transmitted from the cloud, and obtains the computing power of different functions on the server configured with the function. The calculation formula is as follows:
[0103] ;
[0104] in: is the computing power allocated to function type j on server n;
[0105] is the computing power of server n;
[0106] is the load size of function type j;
[0107] is the total load of all functions configured on server n;
[0108] Step 3: The user terminal starts task scheduling and schedules the function to the server configured with the environment of the current function;
[0109] Step 4: Calculate the delay incurred when the function is scheduled to the corresponding server, including scheduling delay, execution delay and transmission delay. The calculation formula is as follows:
[0110] Scheduling delay:
[0111] ;
[0112] in: is the scheduling delay;
[0113] For function The data size;
[0114] is the transmission rate from the user to the edge server;
[0115] is the transmission rate from edge to cloud;
[0116] The current server is an edge server;
[0117] The current server is a cloud server;
[0118] Execution delay:
[0119] When the scheduled server supports concurrent execution:
[0120] ;
[0121] When the scheduled server does not support concurrent execution:
[0122] ;
[0123] in: To execute the delay;
[0124] The time to find the execution result in the cache;
[0125] is the cold start time; The time to obtain the cache;
[0126] The remaining execution time of the preceding function;
[0127] is the load size of function type j;
[0128] The payload size of the unfinished portion of the current function;
[0129] is the computing power allocated to function type j on server n;
[0130] is the jth function in the pth task of user i;
[0131] There is no execution record;
[0132] For the existence of execution records;
[0133] Transmission delay:
[0134] ;
[0135] in: is the transmission delay;
[0136] for The location to which they are dispatched;
[0137] function The data size;
[0138] is the transmission rate from the user to the edge server;
[0139] For function The set of direct functions of ;
[0140] Step 5: Calculate the start time and end time of each function based on the delay;
[0141] Step 6: Based on the dependencies between tasks, the time it takes for a user to complete all tasks is the maximum value of the task end times;
[0142] The dependency between tasks refers to the linear dependency between multiple tasks of each user, so the end time of the previous task is the start time of the current task, so the maximum value of the completion time of each task is the time it takes for the current user to complete all tasks.
[0143] Step 7: Since it is multi-user scheduling, and each user starts scheduling at the same time, the total time for all users to complete all task scheduling is the maximum value of the time for a single user to complete all tasks.
[0144] Concurrent execution means supporting the execution of multiple functions of the same type at the same time. Non-concurrency means that functions of the same type must wait for the execution of the currently executed function to be completed before they can start executing. Whether concurrency is supported is determined by the computing power of the server. Only when the computing power is sufficient can concurrent execution be supported.
[0145] As for whether there is an execution record, since the task function is a stateless function, the execution result is only related to the parameters passed in from the outside, so a cache is set to record the execution result. When the search is needed, the execution result can be found in the cache.
[0146] In this embodiment, Figure 2As shown, the overall framework of the present invention is composed of users, edge servers and cloud servers. In a scheduling process, first, one of the user terminals sends the function information that it currently needs to process to the nearest edge server, and then sends it to the container orchestrator in the cloud server center through the edge server. The scheduler in the cloud server decides which server to schedule to. Since it is serverless computing, compared with traditional scheduling, the computing power resources of the edge server are limited and not all function types can be configured. Therefore, the main difference is that the computing power resources on the edge server are classified, and the computing power resources on the server are distributed to the configured functions in a certain proportion, that is, different functions have different computing power sizes.
[0147] Furthermore, the computing power configuration on the server is allocated in proportion to the function load configured on the server.
[0148] Furthermore, in this embodiment, if Figure 3 As shown, the calculation of the computing power size configuration includes the following steps:
[0149] Step 1: Traverse all servers;
[0150] Step 2: Obtain the sum of the computing loads of all function types on server i;
[0151] Step 3: Traverse each function type on server i;
[0152] Step 4: Divide the total function load of server i by function j to get the computing power ratio of function j on server i;
[0153] Step 5: Multiply this ratio by the computing power of server i to get the computing power allocated to function j on server i.
[0154] Furthermore, whether the scheduled server supports concurrent execution depends on the computing power of the server.
[0155] Furthermore, the cold start time is the time from when the container on the server is created to when the user code starts to run.
[0156] Furthermore, the cold start time includes the time required for image pulling, container initialization, and environment configuration.
[0157] Furthermore, the start time of the function is calculated as follows:
[0158] ;
[0159] in: is the start time of the jth function in the pth task of user i;
[0160] for End time of
[0161] For function The direct predecessor function of ;
[0162] for arrive The transmission time;
[0163] For function The set of immediate predecessor functions of .
[0164] Furthermore, the end time of the function is calculated as follows:
[0165] ;
[0166] in: is the end time of the jth function in the pth task of user i;
[0167] For function The scheduling delay of
[0168] For function Execution delay;
[0169] is the start time of the jth function in the pth task of user i.
[0170] Furthermore, according to the dependency relationship between tasks, specifically including: since there is a linear dependency relationship between multiple tasks of each user, the end time of the previous task is the start time of the current task.
[0171] Furthermore, the operation logic of the execution time specifically includes:
[0172] Step 1: Determine whether the current server computing power supports concurrent execution;
[0173] Step 2: Determine whether there is an execution record of the current function in the cache;
[0174] Step 3: Select the corresponding formula to calculate the execution time according to the judgment results of step 1 and step 2;
[0175] Step 4: When outputting the execution time result, you need to add the cold start time of the function. If the container has been started, the cold start time is 0.
[0176] The calculation of function execution time is divided into four cases, including the server supports concurrency and there is cache, the server supports concurrency and there is no cache, the server does not support concurrency and there is cache, and the server does not support concurrency and there is no cache. There is a calculation formula for each case, and you can make the calculation based on the situation.
[0177] It should be noted that the present application is not limited to the above-mentioned embodiments. The above-mentioned embodiments are only examples, and the embodiments having the same structure as the technical idea and exerting the same effect within the scope of the technical solution of the present application are all included in the technical scope of the present application. In addition, without departing from the scope of the main purpose of the present application, various modifications that can be thought of by those skilled in the art to the embodiments and other methods of combining some of the constituent elements in the embodiments are also included in the scope of the present application.
Claims
1. A multi-user multi-task scheduling method based on serverless edge computing, characterized in that: The following steps are involved: Step 1: All users upload all their tasks to the cloud. The cloud divides a task into a directed acyclic graph consisting of stateless functions and prioritizes the execution of functions based on dependencies. Step 2: The server then obtains the computing load of different functions based on the configured function type through the information transmitted from the cloud, and obtains the computing power of different functions on the server configured with the function. The calculation formula is as follows: ; in: is the computing power allocated to function type j on server n; is the computing power of server n; is the load size of function type j; is the total load of all functions configured on server n; Step 3: The user terminal starts task scheduling and schedules the function to the server configured with the environment of the current function; Step 4: Calculate the delay incurred when the function is scheduled to the corresponding server, including scheduling delay, execution delay and transmission delay. The calculation formula is as follows: Scheduling delay: ; in: is the scheduling delay; For function The data size; is the transmission rate from the user to the edge server; is the transmission rate from edge to cloud; The current server is an edge server; The current server is a cloud server; Execution delay: When the scheduled server supports concurrent execution: ; When the scheduled server does not support concurrent execution: ; in: To execute the delay; The time to find the execution result in the cache; is the cold start time; The time to obtain the cache; The remaining execution time of the preceding function; is the load size of function type j; The payload size of the unfinished portion of the current function; is the computing power allocated to function type j on server n; is the jth function in the pth task of user i; There is no execution record; For the existence of execution records; Transmission delay: ; in: is the transmission delay; for The location to which they are dispatched; function The data size; is the transmission rate from the user to the edge server; For function The set of direct functions of ; Step 5: Calculate the start time and end time of each function based on the delay; Step 6: Based on the dependencies between tasks, the time it takes for a user to complete all tasks is the maximum value of the task end times; Step 7: Since it is multi-user scheduling, and each user starts scheduling at the same time, the total time for all users to complete all task scheduling is the maximum value of the time for a single user to complete all tasks.
2. A multi-user multi-task scheduling method based on serverless edge computing according to claim 1, characterized in that: The computing power configuration on the server is distributed in proportion to the function load configured on the server.
3. A multi-user multi-task scheduling method based on serverless edge computing according to claim 2, characterized in that: The calculation of the computing power size configuration includes the following steps: Step 1: Traverse all servers; Step 2: Obtain the sum of the computing loads of all function types on server i; Step 3: Traverse each function type on server i; Step 4: Divide the total function load of server i by function j to get the computing power ratio of function j on server i; Step 5: Multiply this ratio by the computing power of server i to get the computing power allocated to function j on server i.
4. The multi-user multi-task scheduling method based on serverless edge computing according to claim 1 is characterized in that: Whether the scheduled server supports concurrent execution depends on the computing power of the server.
5. The multi-user multi-task scheduling method based on serverless edge computing according to claim 1 is characterized in that: The cold start time is the time from when the container on the server is created to when the user code starts to run.
6. A multi-user multi-task scheduling method based on serverless edge computing according to claim 5, characterized in that: The cold start time includes the time required for image pulling, container initialization, and environment configuration.
7. The multi-user multi-task scheduling method based on serverless edge computing according to claim 1 is characterized in that: The start time of the function is calculated as follows: ; in: is the start time of the jth function in the pth task of user i; for End time of For function The direct predecessor function of ; for arrive The transmission time; For function The set of immediate predecessor functions of .
8. The multi-user multi-task scheduling method based on serverless edge computing according to claim 1, characterized in that: The end time of the function is calculated as follows: ; in: is the end time of the jth function in the pth task of user i; For function The scheduling delay of For function Execution delay; is the start time of the jth function in the pth task of user i.
9. The multi-user multi-task scheduling method based on serverless edge computing according to claim 1, characterized in that: The dependency relationship between tasks specifically includes: since there is a linear dependency relationship between multiple tasks of each user, the end time of the previous task is the start time of the current task.
10. The multi-user multi-task scheduling method based on serverless edge computing according to claim 1, characterized in that: The operation logic of the execution time specifically includes: Step 1: Determine whether the current server computing power supports concurrent execution; Step 2: Determine whether there is an execution record of the current function in the cache; Step 3: Select the corresponding formula to calculate the execution time according to the judgment results of step 1 and step 2; Step 4: When outputting the execution time result, you need to add the cold start time of the function. If the container has been started, the cold start time is 0.