A multi-user complex task offloading method for an edge computing platform
By applying multi-agent reinforcement learning and hierarchical analysis on the edge computing platform, and optimizing the task offloading strategy, the problems of response latency and energy consumption of complex multi-user tasks in the smart education platform are solved, and efficient task completion rate and energy consumption optimization are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIDIAN UNIV
- Filing Date
- 2023-03-08
- Publication Date
- 2026-05-19
AI Technical Summary
In existing edge computing smart education platforms, multi-user complex task offloading schemes fail to effectively consider the dependencies between tasks, resulting in excessively long response times for computing tasks, failing to meet deadline requirements, and the overall offloading scheme fails to take energy consumption optimization into account.
A multi-agent reinforcement learning algorithm combined with the analytic hierarchy process is used to construct a task model and optimize decision-making. The task dependencies are described by a directed acyclic graph, and the MADDPG algorithm is used to optimize the task offloading strategy, taking into account both task completion rate and energy consumption.
It significantly improved task completion rate, reduced system energy consumption, and enhanced the service quality of the edge computing platform, especially when multiple users use it simultaneously.
Smart Images

Figure CN116594702B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of task offloading technology, specifically relating to a multi-user complex task offloading method for edge computing platforms. It can be used in the end-edge collaboration direction of edge computing platforms, mainly to improve the task completion rate of the platform, and can also jointly optimize energy consumption to reduce system operating costs. Background Technology
[0002] In recent years, with the widespread application of information technologies such as the Internet of Things, cloud computing, and artificial intelligence, the overall teaching mindset in the education industry has undergone tremendous changes, and smart classrooms, as an information-based teaching method, have received widespread attention. New smart classrooms utilize artificial intelligence technology to automate the assessment of all students' learning status throughout the entire classroom process, assisting teachers in understanding students' learning progress, adopting targeted teaching methods, and improving the level of personalized learning.
[0003] When multiple users simultaneously utilize a smart education platform, edge devices generate a massive amount of data and computational tasks, requiring significant computing power to process. Given limited local computing capabilities, most platforms currently employ cloud computing architectures to handle complex tasks. However, cloud computing is a centralized service architecture, requiring end-users to send all their raw data to the cloud for processing. The latency caused by long-distance data transmission is unacceptable for these real-time intelligent sensing applications. Therefore, cloud computing-based solutions are no longer suitable for new smart education platforms.
[0004] Edge computing, as a novel computing paradigm, provides solutions for these new applications. Edge computing is physically located close to the terminal device or user, enriching the computing and storage resources of that device. A typical edge computing architecture diagram is shown below. Figure 1 As shown, the structure includes a three-layer architecture: terminal devices, edge layer, and cloud data center. The terminal devices are used to collect data or perform simple preprocessing; the edge layer is used to handle offloading tasks from the terminal devices, while edge servers can communicate collaboratively and connect to the cloud data center via the Internet.
[0005] The smart education platform integrates various intelligent sensing applications, focusing on analyzing students' classroom participation. In real-world scenarios, when multiple users are using the platform simultaneously, these applications generate numerous time-bound computational tasks. Ensuring these tasks are completed within the allotted time requires a reasonable task offloading strategy. The core idea of task offloading is to offload computational tasks to edge servers or cloud servers with higher computing power to reduce response latency and improve user experience. Whether computational tasks need to be offloaded depends on whether there are dependencies between tasks, falling into two categories: complete offloading and partial offloading.
[0006] In overall offloading studies, tasks are independent of each other and are executed locally or offloaded to edge servers as a whole. In overall offloading models, task modeling typically results in an NP-hard problem. Hou et al. categorized tasks into different types for allocation, classifying this as an NP-hard problem. They proposed an online incentive-driven task allocation algorithm to improve computational speed and maximize system utility. Huang et al. weighed energy consumption and task completion latency to minimize overall offloading costs. This problem is a mixed-integer nonlinear programming problem. They proposed a joint optimization scheme based on deep reinforcement learning for task offloading and bandwidth allocation, equating the original nonconvex optimization problem to a reinforcement learning problem and using the DQN (Deep-Q Network) method to find the optimal solution.
[0007] The above overall uninstallation scheme does not consider the dependencies between tasks; it only needs to determine the optimal allocation strategy. However, in reality, when an application is divided into multiple subtasks, these subtasks have dependencies on each other, which is a key issue that needs to be considered when formulating a task uninstallation strategy.
[0008] In recent years, with the development of technologies such as model decomposition, fine-grained task offloading research has gradually become a hot topic in task offloading studies. Unlike overall offloading schemes, in partial offloading schemes, applications can be divided into multiple subtasks. Some subtasks can be executed locally, while others can be offloaded to edge servers for execution, making the offloading strategy more flexible and varied. Yang et al. established a multi-task latency model, dividing tasks into multiple stages and analyzing device energy consumption. They also studied how to deploy Cloudlet to complete requested tasks within a specified time with minimal energy consumption—an NP-hard problem. This paper models the problem as a mixed-integer linear programming problem and proposes an algorithm based on Benders decomposition to solve the optimization problem. Yi et al. designed an edge computing platform for latency-sensitive applications to minimize task response time. This paper models the task offloading problem as a mixed-integer nonlinear programming problem and solves it using a sequential quadratic programming method. However, this paper's approach has certain limitations, and when using multi-task systems, it's not enough to simply minimize latency; the conditions of all applications must be comprehensively considered to maximize the task completion rate that meets the deadline.
[0009] In summary, overall offloading solutions are not suitable for scenarios with complex computational tasks, while fine-grained task offloading solutions mostly only consider reducing application latency. Summary of the Invention
[0010] To address the issue of multi-user complex task offloading in self-developed edge computing smart education platforms in existing technologies, this invention provides a method for multi-user complex task offloading on edge computing platforms, thereby improving the platform's task completion rate. The technical problem to be solved by this invention is achieved through the following technical solution:
[0011] This invention provides a method for offloading complex multi-user tasks to edge computing platforms, comprising:
[0012] S1: Establish a multi-user complex task model in chronological order, including a terminal device model, an edge server model, and a task model;
[0013] S2: Prioritize the tasks in the task model using the Analytic Hierarchy Process (AHP).
[0014] S3: Construct decision-making models, execution models, and energy consumption models;
[0015] S4: Establish a target optimization problem based on the priority ranking and the decision model, execution model and energy consumption model. The target optimization problem is set as a joint optimization of energy consumption and task completion rate.
[0016] S5: Solve the target optimization problem using a multi-agent reinforcement learning algorithm.
[0017] In one embodiment of the present invention, the terminal device set M = {1,2,...,} includes multiple terminal devices, and the terminal device m is described as follows: in, This represents the processing power of the terminal device m. This represents the local computing queue of terminal device m. Indicates the task transfer queue;
[0018] The edge server set N = {1, 2, ...,} includes multiple edge servers, and the edge server n is described as follows: in, This represents the computing power of edge server n. This represents the task queue that is offloaded to edge server n. This represents a data transmission queue.
[0019] In one embodiment of the present invention, the task model uses a directed acyclic graph G = (V, E) to describe the execution order of the tasks, wherein the node set V = {v1, v2, ..., v...} N}, node v i Let E = {e1, e2, ...} represent subtasks of a task, and let E be the set of edges used to represent the dependencies between tasks.
[0020] The subtask is defined as: v i =(m i ,I i O i ,s i ,c i ,f i ,t i ,d i )
[0021] Where, m i Indicates processing subtask v i Edge servers, I i Subtask v i The set of prerequisite tasks, O i Subtask v i The set of post-tasks, s i Subtask v i The size of the input data, c i Subtask v i The amount of computation required, f i Subtask v i The generation frequency, t i Subtask v i The start time, d i Subtask v i The deadline.
[0022] In one embodiment of the present invention, the hierarchical analysis method includes three different hierarchical structures, namely, the target layer, the criterion layer and the scheme layer, wherein the criterion layer includes four indicators: the task deadline, the task generation frequency, the task computational size and the task data size.
[0023] The weight values of the four indicators in the criterion layer are calculated using the eigenvalue method in the analytic hierarchy process.
[0024] In one embodiment of the present invention, S3 includes:
[0025] Use variable x i ∈{0,1} represents the subtask v i To execute locally, use y. i =(y i,n (n∈N) represents task v i To which edge server to uninstall, subtask v i The unloading decision vector is (x i ,y i );
[0026] If the task is executed on a terminal device, obtain the subtask v. i The local processing time required is:
[0027]
[0028] Among them, s i Subtask v i The size of the input data, Indicates the processing power of the terminal device;
[0029] Obtain subtask v i The required local processing time is:
[0030]
[0031] Where l represents the current position of the task;
[0032] Get Task v i Local execution energy consumption:
[0033]
[0034] Where ρ represents energy density;
[0035] If the task is unloaded to an edge node for execution, obtain the terminal device unloading subtask v. i The transmission time to the edge server is:
[0036]
[0037] in, Indicates the uplink bandwidth of the terminal device;
[0038] Obtain subtask v i The waiting time for transmission is:
[0039]
[0040] Obtain subtask v i The processing time required on edge server n is:
[0041]
[0042] Obtain subtask v i The required processing latency on the edge server is:
[0043]
[0044] Obtain subtask v i Energy consumption during execution on edge servers:
[0045]
[0046] Obtain the terminal device unload subtask v i Energy consumption calculation method:
[0047]
[0048] Where, p send Indicates the transmission power of the terminal device;
[0049] Obtain the edge node receiving subtask v i Energy consumption calculation method:
[0050]
[0051] Where, p recv This indicates the received power of the edge node. This refers to the receiving time.
[0052] In one embodiment of the present invention, S4 includes:
[0053] Get subtask v i The earliest start time for execution is:
[0054]
[0055] Among them, FT j Subtask v i The completion time, I i This represents the set of tasks preceding the current subtask.
[0056] Get subtask v i The completion time is:
[0057]
[0058] Among them, t i Subtask v i The time when execution can begin. Subtask v i The time required for all data to be transmitted to the designated location. Subtask v i t is the waiting time in the queue. comp Subtask v i The computation time on the specified device;
[0059] Determine whether a task is completed or discarded based on its deadline.
[0060] The task completion rate was:
[0061]
[0062] Among them, snum f represents the number of tasks completed. num Indicates the number of task failures;
[0063] Based on the task completion rate and energy consumption during platform operation, the objective function is defined as follows:
[0064] max{α(- total )+(rate success )}
[0065] stx i ∈{0,1},
[0066] α+β=1,
[0067]
[0068] Among them, e total This represents the energy consumption of task execution. If x i =0, then If x i =1, then
[0069] In one embodiment of the present invention, S5 includes:
[0070] Obtain the edge device pair subtask v at time t i The observation space, action space, and reward function;
[0071] Based on the observation space, action space, and reward function, the optimal action for each subtask is obtained using the MADDPG algorithm.
[0072] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0073] 1. The multi-user complex task offloading method of this invention for edge computing platforms is mainly aimed at the self-developed smart education platform. Using this method can greatly improve the task completion rate, enabling the platform to provide high-quality services to users.
[0074] 2. The multi-user complex task offloading method of this invention can improve the task completion rate of edge computing platforms, considering that real-world tasks are complex and divisible. Therefore, the task is modeled as a directed acyclic graph, and the hierarchical analysis method is used to obtain a priority topology sequence based on task dependencies, which is then input into the algorithm. When multiple users use the algorithm simultaneously, the improvement effect is more significant, greatly increasing the system's task completion rate.
[0075] 3. The multi-user complex task offloading method of the present invention is not limited to the field of smart education. All similar static edge-end collaborative computing platforms based on edge computing can use this method to provide users with high-quality services.
[0076] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0077] Figure 1 This is a typical edge computing architecture diagram;
[0078] Figure 2 This is a flowchart of a multi-user complex task offloading method for edge computing platforms provided by an embodiment of the present invention;
[0079] Figure 3 This is a hierarchical structure diagram of an analytic hierarchy process provided in an embodiment of the present invention;
[0080] Figure 4 This is a schematic diagram of the task unloading process provided in an embodiment of the present invention;
[0081] Figure 5 This is a training flowchart of the MADDPG algorithm provided in an embodiment of the present invention;
[0082] Figure 6 This is a graph showing the results of a comparative experiment on the change of task completion rate with the number of users, provided by an embodiment of the present invention.
[0083] Figure 7 This refers to the impact of weights on task completion rate in the method of this embodiment of the invention;
[0084] Figure 8 This refers to the impact of weights on energy consumption in the method of this embodiment of the invention. Detailed Implementation
[0085] To further illustrate the technical means and effects adopted by the present invention to achieve the intended purpose, the following describes in detail a multi-user complex task offloading method for edge computing platforms proposed according to the present invention, in conjunction with the accompanying drawings and specific embodiments.
[0086] The foregoing and other technical contents, features, and effects of the present invention will be clearly presented in the following detailed description of specific embodiments in conjunction with the accompanying drawings. Through the description of the specific embodiments, a more in-depth and concrete understanding can be gained of the technical means and effects adopted by the present invention to achieve its intended purpose. However, the accompanying drawings are for reference and illustration only and are not intended to limit the technical solutions of the present invention.
[0087] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations are intended to cover non-exclusive inclusion, such that an article or apparatus comprising a list of elements includes not only those elements but also other elements not expressly listed. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the article or apparatus that includes said element.
[0088] Please see Figure 2 , Figure 2 This is a flowchart illustrating a multi-user complex task offloading method for edge computing platforms provided in an embodiment of the present invention. The multi-user complex task offloading method includes:
[0089] S1: Establish a multi-user complex task model in chronological order, which includes a set of terminal devices, a set of edge servers, and a task model.
[0090] Specifically, the set of terminal devices N = {1,2,...,}, the set of edge servers N = {1,2,...,}, the model is established in chronological order, the set of model time slots T = {1,2,...,}, and t represents the length of a time slot (in seconds).
[0091] The edge server set N = {1, 2, ...,} includes multiple edge servers, and the edge server n is described as follows: in, This represents the computing power of edge server n. This represents the task queue that is offloaded to edge server n. This represents a data transmission queue used for interacting with other edge servers or sending back results.
[0092] The set of terminal devices M = {1,2,...,} includes multiple terminal devices, and the terminal device m is described as follows: This represents the processing power of the terminal device m. This represents the local computing queue of terminal device m. This represents the task transfer queue.
[0093] The processing steps for edge intelligence applications generally include: data acquisition, data preprocessing, feature extraction, model inference, and output results. Data acquisition is a non-removable task, while the remaining stages can be divided for easier scheduling.
[0094] For example, the task model in this embodiment uses a directed acyclic graph G = (V, E) to describe the execution order of the task, and the node set V = {v1, v2, ..., v...} N}, node v i This represents a subtask of a task. The edge set E = {e1, e2, ...} is used to represent the dependencies between tasks.
[0095] In this embodiment, the subtasks are defined as follows:
[0096] v i =(m i ,I i O i ,s i ,c i ,f i ,t i ,d i Where, m i Indicates processing subtask v i The edge server. i Subtask v i The set of prerequisite tasks, only when I i All tasks in the process have been completed, and the required data has reached the edge server m. i Subtask v i Only then can execution begin. If set I i If the set is empty, it means this is the initial task and computation can begin immediately. i Subtask v i The set of follow-up tasks. If set O i If the set is empty, it means this task is terminated, and the output data of this task is the calculation result. i Subtask v i The size of the input data. i Subtask v i The amount of computation required. i Indicates task v i The generation frequency, t i Subtask v i The start time. d i Subtask v i The deadline is specified; if the deadline is exceeded, the task is considered incomplete.
[0097] When a task is unloaded, different subtasks under the same task may be unloaded to different edge servers. If a subtask fails, the task containing that subtask is considered to have failed, and all subtasks of that task must be discarded.
[0098] Furthermore, we introduce a task prioritization algorithm based on the Analytic Hierarchy Process (AHP). AHP is primarily applied to multi-objective decision-making, specifically by decomposing the objective into several sub-objectives, using different criteria to represent the basis for selecting the objective, qualitatively assigning values to the criteria, and achieving single-objective decision-making and overall objective ranking through a criterion layer.
[0099] The Analytic Hierarchy Process (AHP) divides the problem into three different hierarchical structures: the objective layer, the criterion layer, and the solution layer. Then, it uses the method of solving vector matrices to solve for the objective. The value of each matrix is solved by mathematical formulas, which is the weight represented by each sub-objective. Finally, the weighted sum of each sub-objective is obtained to obtain the final solution.
[0100] This embodiment uses the Analytic Hierarchy Process (AHP) to decompose the task category priority into four criteria: task deadline, generation frequency, computational complexity, and data volume. When prioritizing each task category, these four criteria are used as the basis for judgment. Figure 3 As shown, if these four criteria are used as the basis for judgment, and only qualitative comparison is made without quantitative calculation, the results are often not convincing. To address this deficiency, a matrix can be used to assign values to each criterion, and two different criteria can be compared by their importance. This combination of qualitative analysis and quantitative calculation ensures the correctness of the decision.
[0101] When comparing the importance of element i and element j in the criterion layer, the quantized weight a is used. ij To represent. If the criterion layer has n elements, then establish matrix A = (a ij ) n×n In this case, A is called the pairwise comparison matrix, and a in the pairwise comparison matrix ij The values can be compared by ratio, and the scale is shown in Table 1.
[0102] Table 1 Comparison of the importance of element i and element j in the criterion layer.
[0103]
[0104] After determining the evaluation system, this embodiment, through reviewing a large amount of literature and consulting suggestions from experts in the field, obtained the following pairwise comparison matrix between the criterion layer and the target layer:
[0105]
[0106] Upon verification, the pairwise comparison matrix A exhibits basic consistency. This embodiment uses the eigenvalue method in the Analytic Hierarchy Process (AHP) to calculate the weights of each indicator, resulting in weights of 0.444, 0.278, 0.222, and 0.055 for the four indicators. Due to the excessive number of tasks in the system, the number of solution layers in the AHP is also excessive. Therefore, this embodiment employs a weighted average method to prioritize tasks based on the weight values of the four indicators.
[0107] S3: Construct decision-making models, execution models, and energy consumption models;
[0108] Use variable x i ∈{0,1} represents the subtask v i Whether to execute locally. i =1 indicates execution locally, x i =0 indicates that the task needs to be unloaded. If subtask v i To uninstall, use y i,n =1 indicates subtask v i Unload to edge server n, otherwise y i,n =0. Therefore, use y i =(y i,n (n∈N) represents the subtask v i Which edge server to uninstall to.
[0109] In summary, subtask v i The unloading decision vector is (x i ,y i ).
[0110] (1) If the task is executed on the terminal device, its execution time includes the waiting time in the queue and the actual calculation time, and the energy consumption only includes the execution energy consumption.
[0111] Obtain subtask v i The local processing time required is:
[0112]
[0113] Among them, s i Indicates task v i The size of the input data, Indicates the processing power of the terminal device;
[0114] Obtain subtask v i The required local processing time is:
[0115]
[0116] Where l represents the current position of the task;
[0117] Obtain subtask v i Local execution energy consumption:
[0118]
[0119] Where ρ represents energy density, and its value is ρ = 10. -28 σ is a constant.
[0120] (2) If the task is unloaded to the edge node for execution, the execution time includes the task waiting time for transmission, the task transmission time, the waiting time on the edge node, and the actual execution time. The energy consumption includes transmission energy consumption, reception energy consumption, and execution energy consumption.
[0121] Obtain the terminal device unload subtask v i The transmission time to the edge server is:
[0122]
[0123] in, Indicates the uplink bandwidth of the terminal device
[0124] Obtain subtask v i The waiting time for transmission is:
[0125]
[0126] Obtain subtask v i The processing time required on edge server n is:
[0127]
[0128] Obtain subtask v i The required processing latency on the edge server is:
[0129]
[0130] Furthermore, similar to the method used to calculate energy consumption on the terminal device, subtask v i Energy consumption during execution on edge servers:
[0131]
[0132] Obtain the terminal device unload subtask v i Energy consumption calculation method:
[0133]
[0134] Where, p send Indicates the transmission power of the terminal device. Indicates transmission time;
[0135] Obtain edge node receiving task v i Energy consumption calculation method:
[0136]
[0137] Where, p recv This indicates the received power of the edge node. S4: Establish a target optimization problem based on the priority ranking, the decision model, the execution model, and the energy consumption model. The target optimization problem is set as a joint optimization of energy consumption and task completion rate.
[0138] Specifically, dependencies between subtasks are handled using a directed graph, where the current task can only be executed after all preceding tasks are completed. Therefore, tasks have four states: not ready, ready, completed, and discarded, which controls the execution order of tasks.
[0139] Execute subtask v i Previously, it was necessary to ensure that its prerequisite task set I i All tasks in task v have been completed, therefore task v i The earliest start time for execution is:
[0140]
[0141] Among them, FT j Subtask v i The completion time, I i v represents the set of preceding tasks for the current subtask. i The earliest start time of execution is determined by the latest completion time of its preceding tasks.
[0142] Get subtask v i The completion time is:
[0143]
[0144] Among them, t i Subtask v i The time at which execution can begin (i.e., the time when all its prerequisite tasks have been completed). Subtask v i The time required for all data to be transmitted to the designated location. Subtask v i t is the waiting time in the queue. comp Subtask v i The calculation time on the specified device.
[0145] Furthermore, based on the deadline of the subtask, determine whether the task is completed or discarded.
[0146] Determine subtask v i Basis for completion: If FT i >d i If the subtask times out, the entire task should be discarded; otherwise, the subtask is considered complete. However, this only determines whether a subtask has failed, and thus whether the overall task has failed; it does not mean the entire task has been successfully executed. Therefore, this embodiment defines an exit task set F for an overall task. The basis for the completion of the overall task is that all tasks in the exit task set are completed within their respective deadlines. All have FT i ≤d i .
[0147] Based on the above analysis, the task completion rate is:
[0148]
[0149] Among them, s num f represents the number of tasks completed. num This indicates the number of task failures.
[0150] Since the embodiments of the present invention only need to ensure that the task is completed within a specified time, it is not necessary to minimize the execution delay of the task.
[0151] This embodiment takes into account both task completion rate and energy consumption during platform operation, and defines the objective function as follows:
[0152] max{α(-e total )+β(rate success )}
[0153] stx i ∈{0,1},
[0154] α+β=1,
[0155]
[0156] Among them, e total This represents the energy consumption of task execution. If x i =0, then If x i =1, then
[0157] S5: Solve the target optimization problem using a multi-agent reinforcement learning algorithm.
[0158] Specifically, this embodiment uses a multi-agent reinforcement learning algorithm to solve the unloading scheme. The states observed by the terminal device include: the current subtask v i Local computing queue load Local transmission queue load The load H of each edge server is affected by many factors. The action space of the terminal device, i.e., the strategy adopted, can be directly used (x). i ,y i The reward function can be directly set as follows:
[0159] r i =-α·(Δe total )+β·k
[0160] Where, Δe total This indicates that the current subtask v has been completed. i The energy consumption increment after completion. k represents the reward coefficient for task completion, k = -1 indicates that the current subtask v i Execution failed; k = 0.5 indicates the current subtask v i Successfully completed, but not part of the exit task; k=1 indicates the current subtask v i Successfully completed, and is considered an export task. α and β represent the weighting coefficients for energy consumption increment and task completion, respectively, and α,β>0,α+β=1.
[0161] Meanwhile, in practical use, edge servers can help terminal devices train models. The actual usage process of the unloading scheme designed in this paper is as follows: Figure 4 As shown, an offloading algorithm is deployed on the terminal device for task scheduling; intelligent applications are deployed on the edge server and computation is performed according to the computation queue.
[0162] The objective optimization problem described above aims to complete as many computational tasks as possible while reducing system energy consumption. However, simultaneously providing services to multiple users dramatically increases the complexity of this problem, making it difficult for traditional optimization methods to solve quickly. Therefore, this embodiment employs a deep reinforcement learning algorithm to address the proposed multi-user task offloading problem.
[0163] The multi-user task offloading problem proposed in this embodiment falls under the category of multi-agent learning. Traditional single-agent reinforcement learning algorithms, such as DQN (Deep Q-Network), have shortcomings. These shortcomings mainly manifest in the uncertainty of the environment during training. For each agent in the environment, the other agents are part of the environment, and changes in the policies of other agents can lead to environmental instability, which does not conform to the Markov assumption. In practical applications, the results are not ideal.
[0164] This embodiment proposes applying the Multi-Agent Deep Deterministic Policy Gradient (MADDPG) algorithm to a smart education platform, obtaining the optimal unloading strategy based on the trained model. The observation space, action space, and reward function at time t are described in detail below.
[0165] Observation space: At time t, the state observed by each terminal device m∈M includes: the attribute information of the current task, namely the deadline, generation frequency, computational complexity, and data volume, as well as the number of tasks to be processed in the current computation queue broadcast by each edge server, specifically represented as follows:
[0166] o m (t)=d i ,fre i ,c i ,s i ,H(M))
[0167] In the multi-user task offloading problem proposed in this embodiment of the invention, the environment is fully observable, and the combined state observed by all agents is equivalent to the current state s of the environment.
[0168] Action space: At time t, if terminal device m generates computational task v i So the first thing to do is to determine whether it is executed locally, x i If x = 1, it will be executed locally. i If the value is 0, it needs to be unloaded and executed on an edge server. If subtask v i To uninstall, use y i,n =1 indicates subtask v i Unload to edge server b n Otherwise y i,n =0. Therefore, use y i =(y i,n (n∈N) indicates which edge server the task is unloaded to.
[0169] In summary, edge devices support subtasks v i The action space can be represented as:
[0170]
[0171] Reward Function: To optimize the proposed multi-user task offloading problem, i.e., to maximize the task completion rate, this embodiment will assign a reward function to each agent after processing the subtask v. i The rewards are set as follows:
[0172] r i =-α·(Δetotal )+β·k
[0173] Subsequently, based on the observation space, action space, and reward function, the optimal action for each subtask is obtained using the MADDPG algorithm.
[0174] The steps of the MADDPG algorithm are as follows:
[0175] (1) There are M agents in the system. Each agent contains four neural networks: online Actor network, target Actor network, online Critic network and target Critic network.
[0176] (2) The online Critic network estimates the Q value using the current state and action, calculates the difference using the temporal difference method, and updates the network parameters; the online Actor network outputs the action that maximizes the output of the Critic network, and updates the network parameters using gradient ascent.
[0177] (3) Each agent can observe its own state. m This involves generating a Directed Acyclic Graph (DAG) task, normalizing the task's attribute information, and then weighting it with the weights obtained from the Analytic Hierarchy Process (AHP) to determine the importance ω of each task node. i .
[0178] (4) Based on the dependencies between DAGs, the priority sequence of the DAGs is calculated as follows:
[0179]
[0180] (5) By sequentially inputting the DAG priority sequence into its own Actor network, the optimal unloading action a under its current strategy can be obtained. m By executing action a m The environment will provide a corresponding reward. m and the state o′ at the next moment m .
[0181] (6) Each agent will interact with the environment using data (o m ,a m ,r m ,o′ m Store in the local experience pool M m At fixed intervals, the data in the local experience pool will be synchronized to the experience pool M in the edge training center.
[0182] (7) The edge training center merges the experiences observed by each agent to obtain global experience data (s, a, r, s′). The set of deterministic policy network parameters for all agents is as follows: The policy gradient for each agent is then expressed as:
[0183]
[0184] (8) During the training phase, a batch of global empirical data is sampled, and a single Critic network parameter is trained. The Critic network parameter is trained by minimizing the loss:
[0185]
[0186]
[0187] Where γ represents the discount return, γ∈[0,1].
[0188] (9) The Actor network parameters are updated using gradient ascent by approximating the agent's policy gradient. The policy gradient is represented as follows:
[0189]
[0190] (10) Finally, the parameters of the target Actor network and the target Critic network are updated using a soft update method.
[0191] θ i ′ ←τθ i +(1-)θ i ′ .
[0192] In the MADDPG algorithm, each agent contains an action value function, which requires centralized training, and each value function can be learned independently. Therefore, MADDPG is applicable to relatively complex multi-agent environments. Specifically, the MADDPG algorithm is based on the DDPG algorithm, which primarily targets continuous action problems. However, the actions in the multi-user task offloading problem proposed in this embodiment are discrete and require special processing; otherwise, the neural network cannot backpropagate. Therefore, a Gumbel Softmax layer is added at the end of the actor network to obtain discrete action outputs in one-hot form, while ensuring that the gradients of the neural network can be effectively backpropagated.
[0193] Furthermore, the dataset used in this embodiment is partly derived from a self-developed smart education platform. Data from a period of stable system operation was collected, totaling 2000 tasks, as shown in Table 2. Without loss of generality, this paper further expands the dataset by adding tasks with various DAG structures, resulting in a current dataset containing 4200 tasks.
[0194] Table 2. Task information for some datasets used in this embodiment.
[0195]
[0196] During the training phase, the online Actor and Critic networks are configured with three fully connected layers, each using ReLU as the activation function, and a learning rate of 10. -4 The optimizer uses Adam. The soft update parameter τ for the target Actor and Critic networks is 0.05. Figure 6 The training results are shown for 5 edge nodes and 10 users. To ensure sufficient exploration of the policy, random offloading decisions are incorporated during the training phase, which may cause some fluctuations in the training results.
[0197] To evaluate the impact of user numbers on the uninstallation scheme, the experimental scenario included five edge nodes with user numbers set to [1, 5, 10, 20, 50].
[0198] The uninstallation methods compared include:
[0199] 1) Traditional single-agent reinforcement learning algorithm (DQN)
[0200] 2) All operations are performed on edge devices (Local).
[0201] 3) Earliest Complete Time (HEFT) Algorithm
[0202] 4) Randomly offload to edge nodes or execute on local terminal devices (Random)
[0203] The experimental results are shown in Table 3:
[0204] Table 3 Comparison of task completion rates for different task uninstallation methods
[0205] MADDPG DQN HEFT Local Random 1 100 100 100 29.34 100 5 99.54 84.23 93.8 29.34 64.4 10 90.15 65.45 71.01 29.34 24.02 20 58.8 37.72 48.31 29.34 5.23 50 42.3 30.33 38 29.34 0.8
[0206] Clearly, the proposed MADDPG-based algorithm performs optimally with varying numbers of users.
[0207] Furthermore, to verify the effectiveness of the joint optimization proposed in this embodiment of the invention, three sets of energy consumption and task completion rate weights are set:
[0208] α = 0.2, β = 0.8
[0209] α = 0.5, β = 0.5
[0210] α = 0.8, β = 0.2
[0211] Comparative analysis shows that as α increases and β decreases, the system energy consumption gradually decreases and the task completion rate gradually decreases, which is in line with expectations. Figure 7 and Figure 8As shown.
[0212] This invention, a multi-user complex task offloading method for edge computing platforms, is primarily designed for a self-developed smart education platform. Using this method can significantly improve task completion rates, enabling the platform to provide high-quality services to users. The multi-user complex task offloading method of this invention improves the task completion rate of edge computing platforms, considering that real-world tasks are complex and divisible. Therefore, tasks are modeled as directed acyclic graphs, and a hierarchical analysis method is used to obtain a priority topology sequence based on task dependencies, which is then input into the algorithm. The improvement effect of the algorithm is more pronounced when multiple users use it simultaneously, significantly increasing the system's task completion rate. This multi-user complex task offloading method is not limited to the smart education field; all similar static edge-end collaborative computing platforms based on edge computing can use this method to provide high-quality services to users. In the several embodiments provided in this invention, it should be understood that the apparatus and method disclosed in this invention can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules is only a logical functional division; in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0213] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated module can be implemented in hardware or in the form of hardware plus software functional modules.
[0214] Another embodiment of the present invention provides a storage medium storing a computer program for executing the steps of the multi-user complex task offloading method for edge computing platforms described in the above embodiments. A further aspect of the present invention provides an electronic device including a memory and a processor. The memory stores a computer program, and the processor, when invoking the computer program in the memory, implements the steps of the multi-user complex task offloading method for edge computing platforms as described in the above embodiments. Specifically, the integrated modules implemented as software functional modules can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0215] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such modifications and substitutions should be considered within the scope of protection of the present invention.
Claims
1. A method for offloading complex multi-user tasks to an edge computing platform, characterized in that, include: S1: Establish a multi-user complex task model in chronological order, including a terminal device model, an edge server model, and a task model; S2: Prioritize the tasks in the task model using the Analytic Hierarchy Process (AHP). S3: Construct decision-making models, execution models, and energy consumption models; S4: Establish a target optimization problem based on the priority ranking and the decision model, execution model and energy consumption model. The target optimization problem is set as a joint optimization of energy consumption and task completion rate. S5: Solve the target optimization problem using a multi-agent reinforcement learning algorithm; S4 includes: Get subtasks The earliest start time for execution is: in, Subtasks Completion time, This represents the set of preceding tasks for the current subtask; Get subtasks The completion time is: in Subtasks The time when execution can begin. Subtasks The time required for all data to be transmitted to the designated location. Subtasks Calculate the waiting time in the queue. Subtasks The computation time on the specified device; Determine whether a task is completed or discarded based on its deadline. The task completion rate was: in, Indicates the number of tasks completed. Indicates the number of task failures; Based on the task completion rate and energy consumption during platform operation, the objective function is defined as follows: in, This indicates the energy consumption of task execution. ,but ;like ,but , Indicates that the terminal device unloads the subtask. energy consumption Indicates that the edge node receives the task. energy consumption Subtasks Energy consumption during execution on edge servers ; Subtasks Unload to edge server ; S5 includes: get Edge device pairs of subtasks The observation space, action space, and reward function; Based on the observation space, action space, and reward function, the optimal action for each subtask is obtained using the MADDPG algorithm, wherein the reward function is set as follows: in, This indicates that the current subtask has been completed. The subsequent increase in energy consumption This represents the reward coefficient for task completion. , indicating the current subtask Execution failed; Indicates the current subtask Successfully completed, but not part of the export mission; Indicates the current subtask Successfully completed, and it was an export mission. and These represent the weighting coefficients for energy consumption increment and task completion, respectively. .
2. The method for offloading multi-user complex tasks to an edge computing platform according to claim 1, characterized in that, The terminal device set It includes multiple terminal devices, the terminal devices Described as ,in, Indicates terminal device Processing capacity Indicates terminal device Local computing queue, Indicates the task transfer queue; The edge server set It includes multiple edge servers, the edge servers Described as in, Represents edge server computing power This indicates that the server will be offloaded to the edge server. Task queue, This represents a data transmission queue.
3. The method for offloading multi-user complex tasks to an edge computing platform according to claim 2, characterized in that, The task model uses a directed acyclic graph. Describes the execution order of tasks, where the node set ,node A set of edges represents a subtask of a task. This is used to represent dependencies between tasks. The subtask is defined as follows: in Indicates processing subtasks Edge servers, Subtasks The set of prerequisite tasks, Subtasks The set of follow-up tasks, Subtasks The size of the input data, Subtasks The amount of computation required, Subtasks The generation frequency, Subtasks The start time, Subtasks The deadline.
4. The method for offloading complex multi-user tasks to an edge computing platform according to claim 3, characterized in that, The Analytic Hierarchy Process (AHP) includes three different hierarchical structures: the target layer, the criteria layer, and the scheme layer. The criteria layer includes four indicators: task deadline, task generation frequency, task computational load, and task data volume. The weight values of the four indicators in the criterion layer are calculated using the eigenvalue method in the analytic hierarchy process.
5. The method for offloading complex multi-user tasks to an edge computing platform according to claim 4, characterized in that, S3 includes: Use variables Subtasks Whether to execute locally, use Indicates task To which edge server to uninstall, subtask The unloading decision vector is ; If the task is executed on a terminal device, obtain the subtask. The local processing time required is: in, Subtasks The processing time required locally Subtasks The size of the input data, Indicates the processing power of the terminal device; Obtain subtasks The required local processing time is: in, Indicates the current position of the task; Get the mission Local execution energy consumption: in, Indicates energy density, It is a constant; If the task is offloaded to an edge node for execution, the terminal device offload subtask will be obtained. The transmission time to the edge server is: in, Indicates the uplink bandwidth of the terminal device; Obtain subtasks The waiting time for transmission is: Obtain subtasks On the edge server The required processing time is: Obtain subtasks The required processing latency on the edge server is: Obtain subtasks Energy consumption during execution on edge servers: Obtain the terminal device unload subtask Energy consumption calculation method: in, Indicates the transmission power of the terminal device; Obtain the edge node receiving subtask Energy consumption calculation method: in, This indicates the received power of the edge node. This refers to the receiving time.