The MADDPG model training and main performance tests were based on a simulated task dataset generated from a directed acyclic graph, completed on the WANem network simulation platform and MEC test platform, and do not involve human experiments or biomedical research. To verify the solution's effectiveness in practical applications, the study used historical operational logs from the fall semester of 2024 of a university's online teaching platform for backtracking testing. The data only contains system information such as task requests, network status, resource utilization, and task execution results, and does not contain any personally identifiable information. All data was anonymized and desensitized before analysis and is used solely for algorithm performance evaluation and system verification. Therefore, this study is not a human subject study, and no ethical review or informed consent is required. All experiments comply with data security and privacy protection requirements and are used solely for scientific research. All the materials used in this study are listed in the Table of Materials.
MEC-based smart education platform
Teachers generate a large amount of real-time data (such as videos, interactive task feedback, etc.) during teaching17. MEC provides low-latency, high-bandwidth real-time services by processing data locally18,19. To improve teaching effectiveness and help teachers understand students' learning situations, a smart education platform based on MEC is proposed, as shown in Figure 1.
Overall architecture of the smart education platform
In Figure 1, the platform mainly consists of cloud nodes, edge nodes, and terminal devices. The cloud node architecture includes an AI training platform, a private image repository, a data repository, and a knowledge recommendation engine, as shown in Figure 2.
Cloud node architecture
As shown in Figure 2, to achieve rapid portability and efficient deployment of intelligent applications, Docker technology is introduced into cloud nodes. Docker is an open-source project that simplifies application deployment and management through lightweight containerization technology20,21. The system first packages the trained model and its running environment into a Docker image and uploads it to a private image repository for centralized management. To meet different task requirements, the cloud nodes regularly update the images to ensure that the application and model versions are up-to-date. Considering the limited storage capacity of edge nodes, the system adopts distributed storage and data backup technology to store resources such as teaching videos, e-textbooks, and exercise sets in the database. The Docker Engine version is v20.10, using the overlay2 storage driver.
The container runtime uses runc, and each container's CPU quota is limited to 2 cores, memory is limited to 4GB, and the log driver is json-file. The maximum size of a single container log file is limited to 100MB, and a maximum of 3 log files are retained. The Docker image is built on an Ubuntu 20.04 LTS base image and comes pre-installed with TensorFlow 2.0 and PyTorch 1.7 inference environments. The private image repository is deployed using Harbor v2.5 in a high-availability cluster (3 replicas). The storage backend uses MinIO distributed object storage, with security authentication via TLS-encrypted communication and Role-Based Access Control (RBAC). The use of MinIO distributed object storage ensures high availability of image data. Edge nodes establish a secure connection to the repository via Docker Engine v20.10 and periodically pull the latest model images using the “docker pull” command. The image pull policy is set to “IfNotPresent”, and the garbage collection cycle is set to execute every 72h. Cloud nodes automatically build and push updated images to the private repository every 24h via a CI/CD pipeline (Jenkins), ensuring image version consistency. The knowledge recommendation engine intelligently recommends resources based on user behavior and learning needs to enhance the teaching experience and learning efficiency. The edge node architecture mainly includes data middleware and the edge service layer, as shown in Figure 3.
Edge node architecture
As shown in Figure 3, after the device connects to the edge node, the data middleware first performs authentication to prevent attacks from malicious devices. The authentication mechanism uses JSON Web Token (JWT) verification, with a token validity period of 24 hours. The data middleware is deployed based on EMQX v5.0, supporting the MQTT protocol and WebSocket connections. The message queue is configured with QoS level 1, message retention enabled, message persistent storage to local SSD, and a maximum queue depth of 10,000 messages/second. After successful authentication, the middleware verifies the received data to ensure its legality and integrity. The validation rules include: data format validation (JSON Schema validation), integrity validation (MD5 hash comparison), and timestamp freshness validation (deviation less than 5 s). If the data is illegal, the data source will be blacklisted, preventing subsequent interactions. If the data is legal, it will be cleaned to remove invalid information and noise, improving processing efficiency and accuracy. The cleaned data is then transmitted to the edge service layer, which includes business management, data storage and visualization, collaborative computing services, and message queues. The business management module uses Docker to uniformly manage various business functions of the platform. Each edge node pre-deploys Docker containers, including: a data middleware container (EMQX), a message queue container (RabbitMQ), a collaborative computing service container (gRPC Server), and a resource monitoring agent container (Prometheus Node Exporter). All containers are orchestrated and managed using Docker Compose v2.20, the container network uses bridge mode, and inter-container communication is isolated through a custom network (edge_network, subnet 172.20.0.0/16).
The data storage and visualization module is primarily responsible for data storage, caching, and visualization. This module uses Redis v6.2 as the caching middleware, configured with an LRU eviction policy, a maximum memory limit of 4GB, and a cache expiration time of 300 s. The storage module reduces system response time by caching hot resources and duplicate computation results. Through a graphical interface, the visualization module displays system status, task progress, and resource usage in real time, allowing users to quickly grasp the overall picture and make decisions. The collaborative computing service enables interaction among the cloud, the edge, and devices, enabling collaborative task allocation and execution. The collaborative computing service is implemented based on the gRPC protocol, using port 50051 and TLS 1.3 encryption. The maximum gRPC message size is set to 50MB, the connection timeout is 10s, the keepalive interval is 30s, the keepalive timeout threshold is 10s, and the TLS encryption suite uses TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256. The heartbeat detection interval is 5s, the timeout threshold is 30s, and the retry mechanism uses an exponential backoff strategy (initial interval 1s, maximum interval 60s).
The message queue module, responsible for asynchronous communication between components, alleviates multi-task concurrency conflicts, ensuring tasks are processed according to priority and time order, improving system response speed and operational stability. The message queue is deployed using RabbitMQ v3.9, configured as a persistent queue with an acknowledgment mechanism. RabbitMQ listens on ports 5672 (AMQP) and 15672 (management interface). The queue persistence policy is set to “durable = true”, the dead-letter exchange is set to “dlx.exchange”, and the message unacknowledged timeout is set to 30 s. The exchange type is “topic”, the queue binding keys are set to “task.#” and “resource.#”, the message acknowledgment mode is manual ack, and the prefetch count is 100. For EMQX configuration, it listens on ports 1883 (MQTT), 8083 (WebSocket), and 8883 (MQTT over TLS). The maximum concurrent connections are set to 10,000, the heartbeat interval is set to 60 s, and the maximum message ordering queue depth is set to 100. The MQTT protocol supports QoS levels 0, 1, and 2, with QoS 1 used by default. Reserved messages are enabled, and the maximum message packet size is set to 256MB. For resource monitoring, each edge node deploys Prometheus Node Exporter v1.3, collecting CPU utilization, memory usage, network I/O, and disk read/write metrics at 15-second intervals. Data is aggregated to a central Prometheus server via Pushgateway, with Grafana v9.0 providing a real-time monitoring dashboard. Alarm rules are set as follows: CPU utilization exceeding 85% for 5 minutes triggers an alert, exceeding 95% triggers an emergency alert. Memory utilization exceeding 90% for 5 minutes triggers an alert. Disk utilization exceeding 85% triggers an alert, and network packet loss exceeding 1% triggers an alert. The terminal device architecture is shown in Figure 4.
Terminal device architecture
In Figure 4, the terminal device architecture is broken into a hardware layer, a business support layer, and a presentation layer. The hardware layer includes a CPU and communication modules such as WiFi and Bluetooth, providing underlying support for data acquisition, communication, and basic computing. The business support layer provides edge-end collaboration and supports task offloading decisions. The presentation layer is responsible for the visual interface and improves the user experience. The sub-task attributes of devices of the same type are usually consistent22. It assumes that the edge node computing power is 16 cores and the main frequency is 3.6 GHz. During the data acquisition phase, the study conducts multiple rounds of testing on the intelligent sensing application within the platform by accessing the /proc file system, recording the attribute values of the subtasks during each round of runtime. Simultaneously, to adapt to different types of directed acyclic graph structures, a directed acyclic graph generator is designed to control the number of nodes, the maximum in-degree, and the maximum out-degree based on user input. The dataset construction process is as follows:
The study first uses Python 3.8 to implement a directed acyclic graph generator, and then randomly generates task topologies based on the number of nodes, the maximum in-degree, and the maximum out-degree. The number of nodes is set to 5–20, the maximum in-degree to 3, and the maximum out-degree to 4. Each directed acyclic graph corresponds to a complete teaching task, with nodes representing executable subtasks and edges representing dependencies between tasks. Subsequently, computational and communication attributes are assigned to each subtask. The task data size is randomly set to 1–3MB, the computational requirement to 500–6,000 Mcycles, the task deadline to 5–25s, and the task arrival interval to 2–10s. To simulate scenarios such as real-time video analysis, classroom interaction feedback, and online assessment in a smart education platform, the system further randomly generates user request intensity, task priority, and resource requirement levels. The task priority is divided into three levels: high, medium, and low, with corresponding weights of 1.0, 0.7, and 0.4, respectively. The network environment is built using WANem. Communication bandwidth between terminal devices and edge nodes is randomly set to 10–100 Mbps, link latency to 5–50 ms, packet jitter to 1–10 ms, and packet loss rate to 0.1%. Six edge nodes are deployed in the edge computing layer, each configured with a 16-core 3.6 GHz processor and 64 GB of memory. Terminal device CPU frequencies are set to 1.8–2.4 GHz, and memory capacity to 4–8GB. During task generation, task status, network status, and edge resource usage are recorded in real time. Task status includes task data volume, computational requirements, and remaining deadline; network status includes available bandwidth and link latency. Resource status includes CPU utilization, memory utilization, and task queue length. A total of 19,200 task instances are generated, with 80% used for environment interaction and policy learning during model training, and 20% used for model testing and performance evaluation. To reduce the impact of random initialization on experimental results, all experiments are run independently using five different random seeds, and the final result is the average of the five experiments.
Multi-delay multi-agent task offloading model based on MADDPG
In edge computing environments, the efficiency of task offloading directly affects the overall performance of MEC smart education platforms. The offloading process is constrained by various latency factors, mainly including transmission latency, computation latency, and queuing latency23,24. Among them, transmission latency is mainly affected by transmission distance and bandwidth; computation latency depends on the resource load and processing capacity of edge nodes. Computational latency depends on the resource load and processing capacity of edge nodes, while queuing latency stems from the system's task scheduling and resource allocation mechanisms. Various types of latency overlap during the offloading, increasing the complexity of task offloading. In multi-agent scenarios, multiple users run multiple intelligent applications simultaneously, and each user may initiate multiple computationally intensive tasks at the same time, with varying resource requirements and priorities, further exacerbating the difficulty of computing resource scheduling and allocation25,26.
MADDPG adopts a "centralized training, distributed execution" architecture, which is suitable for multi-user offloading scenarios27. In this model, each computational task corresponds to an agent, and decision optimization is performed based on the Actor-Critic architecture. This study models the multi-latency task offloading problem as a partially observable Markov decision process (POMDP). For any agent, its state space consists of the task data volume, task computation requirements, current network bandwidth, link latency, and edge node queue length. The observation space is defined as the local information that each agent can acquire, including the local state of the corresponding task (task data volume, computation requirements, remaining deadline) and the available bandwidth and queue length of the currently connected edge nodes. The action space is defined as continuous offloading decision variables, with values ranging from [0,1], where 0 indicates that the task is executed entirely locally, 1 indicates that the task is completely offloaded to the edge node, and intermediate values indicate partial offloading. The offloading decision encoding uses a direct continuous-valued output without discretization.
The core idea of the Actor-Critic architecture is to improve the efficiency and performance of the decision-making process through cooperation and optimization between Actor networks and Critic networks28,29. The structure of the Actor is denoted in Figure 5.
Actor network structure
In Figure 5, the Actor consists of two fully connected layers: the first layer contains 1024 neurons and uses the ReLU activation function to enhance nonlinear expressive power. The second layer contains 500 neurons and is used for high-dimensional abstraction and mapping of features. The output layer generates continuous action values based on the agent's action dimensions, realizing forward propagation of the optimal policy's action decisions. The Critic structure is denoted in Figure 6.
Critic network structure
In Figure 6, the Critic contains three fully connected layers. The input layer is first mapped to a 500-dimensional feature representation through the first fully connected layer. Then, it is further compressed into a 128-dimensional feature space through the second fully connected layer. Finally, the Q-value estimate corresponding to the action space dimension is output through the third fully connected layer. Information is passed layer by layer through forward connections. Each agent stores its observations, actions, rewards, and next state in a local experience pool. The experience data of all agents are periodically merged to form a shared experience pool for all agents to learn from. In this way, each agent can learn not only from its own experience but also from the experience of other agents, reducing inefficient decisions caused by insufficient information. During training, the platform randomly selects a batch of data from the merged experience pool to update each agent's decision network. The agent uses the policy gradient of the current state to calculate the loss, updates the evaluation network, and thus optimizes the policy. This entire process uses gradient ascent to maximize the system's long-term reward. During the update process, the parameters of the evaluation and decision networks are updated softly, so that the agent's decision strategy can gradually approach the optimum.
In addition, the reasonable design of the reward function is the key prerequisite for the multi-agent deep reinforcement learning algorithm to maximize long-term rewards30. Considering that the task offloading objective in the smart education platform not only needs to reduce system energy consumption, but also needs to ensure that the task can be completed within the deadline. The reward function ri designed in the study mainly consists of two parts: energy consumption reward and task completion rate reward, as shown in Equation (1).
(1)
In Equation (1), Δfnorm (ei) represents the normalized increase in system energy consumption after completing the current subtask,
is the reward coefficient for task completion rate, α and β represent the energy consumption increment and the weight coefficient for task completion, respectively. Task completion rate reflects the platform's Quality of Service (QoS), while system energy consumption reflects the efficiency of edge computing resource utilization, both jointly determine the effectiveness of the task offloading strategy. To avoid imbalances caused by different metric dimensions during training, the energy consumption metric is first normalized. The task completion reward is defined in binary form: 1 for completion within the deadline, 0 otherwise. To ensure the reward value remains stable within the [-1, 1] interval, linear normalization is further applied during training. The weight parameters α and β are determined using a validation set search. The study sets α ∈ {0.2, 0.4, 0.6, 0.8} and β = 1 − α, and runs five experiments independently under the same training environment. The comprehensive evaluation index of task completion time, task completion rate, and system energy consumption is used as the optimization objective for parameter selection. Experimental results show that when α = 0.6 and β = 0.4, the model achieves the best balance between task completion rate and system energy consumption. If is too small, the model tends to frequently unload tasks to pursue higher task completion rates, leading to increased overall energy consumption. If is too large, the model focuses excessively on energy optimization, and some high-priority tasks cannot be completed in time. Therefore, α = 0.6 and β = 0.4 are ultimately chosen. Furthermore, to improve training stability, all reward values are smoothed using a sliding window mean, with a window length of 100 steps. During the experiment, it is observed that the average reward stabilizes after approximately 7.8 × 104 steps, indicating that the designed reward function can effectively guide MADDPG to learn a reasonable task offloading strategy and promote model convergence. Based on the above design, the multi-latency, multi-agent task offloading process is shown in Figure 7.
Task offloading process
As shown in Figure 7, the terminal device first generates a batch of new computing tasks. The system then determines the dependencies and execution order between each task and its subtasks, clarifying the requirements for serial and parallel processing. Based on a preset task priority model, the platform parses the computing tasks and generates corresponding topology sequences. After task parsing, an unloading decision is made for each task, determining whether it should be executed locally or unloaded to the edge server. If a subtask needs to be unloaded, it is added to the local transmission queue, waiting to be uploaded to the edge node. Each terminal device directly connected to the edge node independently formulates an unloading strategy for each subtask through the task offloading module (using the MADDPG algorithm). After the decision is made, the terminal device executes the corresponding operation according to the unloading command. The platform then transmits the subtask data (including the task topology sequence and all data of ready subtasks) in the local transmission queue to the designated edge node according to the decision result. The edge node executes the subtasks in the computing queue in a first-in-first-out order. This process realizes dynamic scheduling and collaborative computing in multi-latency and multi-agent environments, effectively ensuring the real-time performance and stability of the MEC smart education platform in complex scenarios. The training process for the MADDPG model is as follows:
First, the study initializes the parameters of the Actor network, Critic network, and corresponding target network, and establishes an experience replay pool with a capacity of 1,000,000. The system generates unloading actions based on the current state information (using an ε-greedy strategy, with an initial exploration noise standard deviation of 0.2, a noise attenuation coefficient of 0.995, and a minimum noise standard deviation of 0.01). After executing task scheduling, it obtains the immediate reward and the state at the next time step, and stores the state transition samples in the experience pool. When the number of samples in the experience pool reaches the batch update condition, 64 samples are randomly selected for training. The Critic network uses gradient descent to minimize the temporal difference error to improve the accuracy of the value function estimation. The Actor network updates its parameters according to a deterministic strategy gradient, continuously optimizing the task offloading strategy by maximizing the long-term cumulative reward. To ensure training stability, a soft update mechanism is used to synchronize the target network parameters, with the soft update coefficient set to 0.005. The total number of training steps is set to 100,000. The network parameters are updated every 10 steps. The model is considered to have converged, and training is stopped when the maximum number of training steps of 100,000 is reached, or when the average reward change is less than 1% within 5,000 consecutive steps.
The study primarily uses task completion time, task completion rate, task failure rate, system energy consumption, and resource utilization as evaluation metrics. Task completion time is defined as the total time elapsed from task generation to completion. Task completion rate is defined as the percentage of tasks successfully completed within the deadline. Task failure rate is defined as the percentage of tasks failing to complete within the specified time. System energy consumption includes local computing energy consumption and transmission energy consumption, and resource utilization is defined as the ratio of the actual resource usage of edge nodes to the total resource capacity.
Theoretical analysis and theorem proof
To further verify the effectiveness and theoretical feasibility of the proposed multi-delay multi-agent task offloading model, the study conducted a theoretical analysis from two aspects: task delay characteristics and MADDPG policy optimization characteristics. Assumed that there are agents in the smart education platform, and each agent corresponds to a task. The total delay Di of task i consists of data transmission delay
, queuing, waiting, delay
and calculation execution delay
, as shown in Equation (2).
(2)
In Equation (2), Li represents the amount of input data for the task i, Bi represents the current available communication bandwidth for the task i, Qi represents the queue length of the task i in the edge node, μi represents the average service rate of the edge server for the task i, Ci represents the number of CPU computation cycles required for the task i, fi represents the edge computing resources allocated to the task i, αi and represents the task offloading ratio. Therefore, the system optimization objective can be expressed as:
(3)
In Equation (3), Ei represents the total energy consumption of the task,
represents the latency weighting coefficient, and
represents the energy consumption weighting coefficient.
Lemma 1: Under the condition of fixed computing resources at edge nodes, the total latency Di of task i is a convex function of its offloading ratio αi.
Proof: From equation (2), the study can obtain:
(4)
The first derivative is taken with respect to αi:
(5)
The study continues to find the second derivative:
(6)
Since linear functions are convex functions, the total delay Di of task i is a convex function of its unloading ratio αi. Lemma 1 is thus proved.
Theorem 1: For a POMDP task offloading model with a finite state space and a finite reward function, there exists at least one optimal policy π* that maximizes the long-term cumulative reward.
Proof: Assume that the long-term cumulative discounted return of the agent is as shown in Equation (7).
(7)
In Equation (7), Gt represents the cumulative discount reward at time t, k represents the future time step index, γ represents the discount factor, and rt+k represents the instant reward obtained at time t + k. The Bellman optimal equation is shown in Equation (8).
(8)
In Equation (8),
represents the optimal action value function, s represents the current system state, a represents the current action,
represents the immediate reward, s' represents the state at the next moment, a' represents the action at the next moment, and
represents the state transition probability. The Bellman operator T(Q) is shown in Equation (9).
(9)
In Equation (9), Q represents the action value function, represents the reward function, and represents the state transition matrix. For any two Q functions:
(10)
Since 0 < γ < 1, the Bellman operator is a contraction mapping. According to Banach's fixed-point theorem, there exists a unique fixed point:
(11)
Corresponding to the unique optimal strategy:
(12)
Therefore, the optimal unloading strategy exists. Theorem 1 is proved.
Theorem 2: Under the conditions that the experience replay pool is sufficiently large, the learning rate satisfies the Robbins-Monro condition, and the target network adopts a soft update mechanism, the MADDPG policy parameters can converge to a local stable equilibrium point.
Proof: The Actor update process is shown in Equation (13).
(13)
In Equation (13),
represents the Actor network parameters at the k-th iteration,
represents the updated parameters, η represents the learning rate, J(θ) represents the policy objective function, and
represents the gradient of the objective function with respect to the parameters. According to the deterministic policy gradient theorem:
(14)
In Equation (14),
represents the mathematical expectation,
represents the policy function with a parameter
,
represents the policy gradient,
represents the action value function, and
represents the gradient of the Q function with respect to the action. The target network uses soft updates:
(15)
In Equation (15), θ represents the current network parameters, θ' represents the target network parameters, represents the soft update coefficient. According to the theory of stochastic approximation, when
and
, the parameter update sequence converges to the neighborhood of the stable equilibrium point. Therefore, MADDPG can gradually approximate the local optimal policy and achieve a stable task offloading decision. Theorem 2 is proved.
Model complexity analysis
The study analyzes the proposed MADDPG model from two aspects: time complexity and space complexity. Assume the number of agents is N, the number of parameters in the Actor network is PA, the number of parameters in the Critic network is PC, the number of training steps is T. For a single agent, the forward propagation complexity of the Actor network is
. The forward and backward propagation complexity of the Critic network is
. Since there are agents in the system, the computational complexity of a single parameter update is
. The training process involves iterations, so the overall training time complexity is
. The study employs a fixed network structure, with the network size remaining constant during training. Therefore,
, where c is a constant. The overall training time complexity can be further simplified to
.
Assume the experience pool capacity is
, and the storage overhead of the experience pool is
. The storage complexity of the Actor network parameters is
, and
the storage complexity of the Critic network parameters is
. Therefore, the total space complexity is . Since the size of the experience pool is much larger than the size of the network parameters, the space complexity can be approximated as
.
Therefore, the time complexity increases linearly with the number of agents N. The space complexity is mainly affected by the capacity of the experience replay pool. When training with an Intel Xeon 16-Core 3.6GHz CPU and a Tesla V100 GPU, a single complete training session takes approximately 2.4 hours, with peak memory usage of approximately 7.8GB, both below the upper limit of available resources on the experimental platform. Thus, as the number of users and the scale of tasks increase, the computational cost of the proposed model scales linearly, demonstrating good scalability and engineering-deployment feasibility, and meeting the computational needs of multi-user, multi-task, real-time offloading scenarios in smart education platforms.
While the theoretical analysis above validated the rationality of the proposed method from aspects such as task latency modeling and reinforcement learning policy optimization, certain limitations still exist. Due to the nonlinear function approximation characteristics of deep reinforcement learning models and the complex policy interactions among multiple agents, rigorously proving the global convergence and theoretical optimality of the MADDPG policy in dynamic edge computing environments remains a significant challenge. Furthermore, as the task scale and the number of agents increase, the computational complexity and scalability of the algorithm still require further systematic theoretical derivation. Therefore, this paper primarily analyzed the effectiveness of the proposed multi-latency, multi-agent task offloading strategy through mathematical modeling and experimental verification. Future research will further delve into the convergence boundary of reinforcement learning policies, theoretical analysis of complexity, and scalability in large-scale edge computing scenarios.