Calculation unloading method oriented to task dependent application in edge calculation

By constructing a directed acyclic graph of task dependencies and improving the genetic algorithm, the complex coupling problem of task offloading strategies in multi-user scenarios is solved, achieving multi-objective balanced optimization in 5G mobile edge computing and improving the system's real-time performance and resource utilization efficiency.

CN121967414APending Publication Date: 2026-05-01CHANGSHA INSTITUTE OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHANGSHA INSTITUTE OF TECHNOLOGY
Filing Date
2026-01-15
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In 5G heterogeneous network environments, task offloading strategies in multi-user scenarios are difficult to effectively balance the competition for computing resources, task dependencies, and multi-objective optimization. Existing technologies are unable to achieve optimal system performance in complex, coupled scenarios with multiple applications.

Method used

A directed acyclic graph (DAG) of task dependencies is constructed, and an improved genetic algorithm (IGA) is used to optimize the objective function through binary matrix encoding and penalty function to calculate the optimal unloading strategy, balancing the dependencies between tasks and multi-objective constraints.

Benefits of technology

It enables fast and efficient optimal uninstallation decisions in multi-user scenarios, optimizes system real-time performance and resource utilization efficiency, avoids performance imbalance caused by single-objective optimization, and adapts to changes in the scale of different tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121967414A_ABST
    Figure CN121967414A_ABST
Patent Text Reader

Abstract

The invention discloses a task-dependent application-oriented computing unloading method in edge computing, which comprises the following steps of: 1, constructing a system model consisting of a plurality of mobile terminals and a single MEC (Mobile Edge Computing) server, and representing a dependency relationship among tasks generated by the mobile terminals by using a DAG (Directed Acyclic Graph); and step 2, constructing a problem model, respectively calculating the execution total time delay and total energy consumption of the dependent task at the mobile terminal and at the MEC server side, and setting an optimization target as the minimization of the total cost of the mobile terminal and the MEC server. And 3, regarding a calculation unloading problem as an NP-hard binary combination optimization problem, and calculating by adopting an improved genetic algorithm to obtain an optimal unloading strategy with the minimum total cost. According to the method, the technical problem of a current 5G mobile edge computing task unloading strategy is effectively solved. According to a multi-mobile terminal concurrent request scene, the task dependency relationship is abstracted, so that the processing of a complex coupling problem among multiple tasks is optimized, and an unloading strategy is more suitable for practical application.
Need to check novelty before this filing date? Find Prior Art

Description

A computation offloading method for task-dependent applications in edge computing Technical Field

[0001] This invention relates to the field of edge computing, and in particular to a computation offloading method for task-dependent applications in edge computing. Background Technology

[0002] With the deep integration of the Internet of Things (IoT) and 5G technologies, the number of mobile terminal devices is growing exponentially, generating a continuous surge in the total amount of data. In traditional cloud computing models, data needs to be transmitted to remote cloud processing, resulting in inherent drawbacks such as high latency, difficulty in meeting real-time requirements, data security risks associated with remote transmission, and computational bottlenecks in centralized cloud computing due to massive device access. Meanwhile, emerging applications such as autonomous driving and virtual reality place even more stringent demands on network latency, bandwidth, and storage capacity. Mobile edge computing (MEC), by offloading computing power to network edge nodes and building a collaborative computing system between terminals, edge, and the cloud, has become a key paradigm for solving these problems. Computation offloading, as the core mechanism of MEC, significantly reduces processing latency and saves terminal energy by migrating the computing tasks of mobile terminals to nearby edge servers.

[0003] However, in the context of 5G heterogeneous networks, task offloading optimization faces multiple challenges: First, current research largely focuses on single-user optimization scenarios, which differs significantly from the demands of multi-user concurrent application requests in real-world environments. Under resource constraints, while requests are independent in terms of dependency, they compete for computing resources. In multi-application computational offloading scenarios, tasks exhibit highly complex coupling relationships. Existing offloading strategies designed for single applications lack consideration for the complex coupling characteristics of multiple applications, making direct deployment in real-world scenarios difficult. Second, tasks within mobile terminals often have strict dependencies (subsequent tasks require the output of predecessor tasks as input), and a final result is only achieved after all tasks are completed. This dependency characteristic renders offloading decision frameworks based on independent task scheduling ineffective, necessitating offloading optimization strategies for task-dependent applications. Third, existing research often focuses on single-objective optimization in computational offloading (such as minimizing latency or energy consumption), neglecting the nonlinear conflicts between multiple objectives in real-world scenarios. Simply reducing latency may exacerbate energy consumption, while pure energy saving can easily lead to task timeouts, especially when edge node load fluctuates, the cumulative effect of queuing latency will further deteriorate system real-time performance. How to balance the relationship between multiple objectives to achieve relative optimization of system performance has become a core contradiction in 5G mobile edge computing. Therefore, there is still a lack of effective solutions for considering the dependencies between tasks in multi-user scenarios and achieving multi-objective optimization of multi-dimensional performance constraints such as task computing energy consumption and latency, to obtain the optimal offloading decision scheme with the minimum total cost in edge computing scenarios. Summary of the Invention

[0004] To address the technical problem of finding the optimal offloading decision scheme with the minimum total cost in edge computing scenarios with difficulty in quickly and efficiently obtaining such schemes in multi-user scenarios, this invention provides a computational offloading method for task-dependent applications in edge computing that can effectively improve system real-time performance and resource utilization efficiency.

[0005] The technical solution of this invention is:

[0006] A computation offloading method for task-dependent applications in edge computing includes the following steps:

[0007] Step 1: Construct a system model consisting of multiple mobile terminals and a single MEC server. Each mobile terminal in the system model includes multiple tasks with dependencies. These tasks and their corresponding dependencies are represented by a directed acyclic graph (DAG): the vertices of the DAG represent the set of tasks, and the lines between the vertices represent the dependencies between tasks.

[0008] Step 2: Calculate the total execution latency and total energy consumption of all tasks on the mobile terminal and the MEC server respectively, and set the optimization objective as minimizing the total cost of the mobile terminal and the MEC server, thereby establishing a computation offloading problem model. The offloading problem is an NP-hard binary combinatorial optimization problem.

[0009] Step 3: Perform binary matrix encoding based on the DAG, with rows representing mobile terminals and columns representing tasks, and arrange the tasks in order according to their priority constraints. Then, calculate the optimal unloading strategy with the minimum total cost based on an improved genetic algorithm: Each individual in the genetic algorithm represents an unloading strategy. In each iteration, the total cost of each individual in the population is calculated based on the penalty function, and the fitness of the current generation of individuals is calculated based on the total cost. The individuals in the population are adjusted according to the fitness value. Then, the gene matching degree between different individuals is calculated to determine whether to perform a crossover operation on individuals. Finally, the individuals are mutated based on the adaptive mutation operator to complete one iteration. Repeat the iteration until the preset number of iterations is reached to obtain the optimal unloading strategy.

[0010] Furthermore, in step 1, when establishing the DAG, the execution order of tasks is determined based on the task dependencies. The execution order of tasks includes the following: a successor task can only begin execution after all predecessor tasks have been completed and output results; the end node of the DAG without any successor tasks is considered an exit task, and the complete computation task represented by the DAG is considered to be completed only after all exit tasks have been processed.

[0011] Furthermore, step 2 includes:

[0012] Calculate the total execution latency of all tasks on the mobile terminal and on the MEC server respectively. Total energy consumption The optimization target is set as the total cost of mobile terminals and MEC servers. Minimize, i.e. Furthermore, when a task is unloaded to the MEC server for execution, the MEC server assigns the j-th task to the i-th mobile terminal. computing resources No more than the total computing resources of the MEC server ,in, Indicates the task unloading status. ,when When, it indicates a task. When processed on a mobile terminal, when When, it indicates a task. Unload and process on the MEC server; For weights, For applications pre-classified as latency-sensitive, choose a value close to 1. For applications pre-classified as energy-sensitive, a value close to 0 is selected. .

[0013] Furthermore, in step 2, the total latency and total energy consumption of all tasks on the mobile terminal and MEC server are calculated using the following formula:

[0014] The total delay of task completion for:

[0015] ;

[0016] Total energy consumption for task completion for:

[0017] ;

[0018] in, , Representing tasks Execution time and energy consumption in mobile terminal processing; Indicates task Execution time processed by the MEC server; , Representing tasks Mobile terminal processing, tasks Precursor mission Communication time and energy consumption processed on the MEC server; , Representing tasks Processing tasks on the MEC server Precursor mission Communication time and energy consumption processed on mobile terminals; , Indicates task The transmission time and energy consumption from the mobile terminal to the MEC server for processing are represented by the subscripts L and C, which represent the mobile terminal and the MEC server, respectively.

[0019] Furthermore, step 3 includes:

[0020] Step 301: Perform binary matrix encoding based on the number of mobile terminals and tasks, as well as the dependencies of the DAG;

[0021] Step 302: Initialize the parameters in the genetic algorithm, including assigning the total number of iterations and the population size, setting the current iteration number to 1, and randomly generating an initial population of the corresponding population size.

[0022] Step 303: Calculate the total cost of individuals in the population at each iteration based on the penalty function, and then calculate the fitness of the current generation of individuals based on the total cost;

[0023] Step 304: Sort individuals in the population based on their fitness, eliminate a preset proportion of individuals with low fitness, retain a preset proportion of individuals with medium fitness, and double-copy a preset proportion of individuals with high fitness.

[0024] Step 305: Calculate the gene matching degree based on the length of the longest common subsequence between two random individuals and the total coding length of the chromosomes of individuals in the population; then decide whether to perform the crossover operation based on the crossover threshold and the gene matching degree between individuals.

[0025] Step 306: Use an adaptive mutation operator to mutate the individual fitness, thereby achieving adaptive adjustment of the individual;

[0026] Step 307: Repeat steps 303-306 until the preset number of iterations is reached, thereby obtaining the optimal unloading strategy with the minimum total cost.

[0027] Furthermore, step 301 includes:

[0028] use 3D binary matrix encoding The matrix represents the computation offloading strategy, where the rows of the matrix represent different mobile terminals, the columns of the matrix represent tasks initiated by the mobile terminals, and the tasks are arranged according to the topology of the DAG. Tasks with priority constraints are arranged from front to back according to the order of the tasks, and parallel tasks without priority constraints are randomly ordered in adjacent columns.

[0029] Furthermore, step 302 includes:

[0030] Initialize parameters, assign values ​​to the total number of iterations (ITER) and the population size (noP), and define the current number of iterations. And randomly generate an initial population containing noP individuals. Furthermore, if there are duplicate individuals in the initial population, the duplicate individuals are discarded, and new individuals are randomly generated to fill the gaps.

[0031] Furthermore, step 303 includes:

[0032] The constrained optimization problem is transformed into an unconstrained problem using the penalty function method, and the total cost of each generation is calculated. ,in, It is a preset penalty factor, and then Calculate the fitness function of the current generation of individuals by taking the reciprocal. This ensures that the fitness value aligns with the optimization direction.

[0033] Furthermore, step 304 includes:

[0034] The selection operator first sorts the entire population in descending order based on individual fitness, thus classifying individuals into hierarchical categories of superiority and inferiority. Then, the sorted individuals are divided into three groups according to their fitness at a predetermined ratio. The last group, containing all individuals with the lowest fitness, is directly eliminated. All individuals in the middle group (those with medium fitness) undergo a one-to-one copying process to preserve genetic traits. The individuals in the first group (those with the highest fitness) undergo a double copying operation, thus providing them with two opportunities to transmit superior genes in the next generation. The first and last groups contain the same number of individuals.

[0035] Furthermore, step 305 includes:

[0036] The crossover operator is executed, using gene matching degree as the criterion. For two binary-coded parent individuals P and Q selected through random selection or a competition mechanism, the formula for calculating gene matching degree is as follows: ,in, For individuals P and Q, the first... The length of the longest common subsequence of rows. The dimension of the binary matrix encoding is the total encoding length of the chromosomes of individuals in the population. The gene matching degree s between any two individuals in the population ranges from... Then, the crossover threshold and the similarity index between individuals are used to determine whether to perform a crossover operation. When, parent individuals P and Q do not undergo crossover operations; when At that time, parent individuals P and Q undergo crossover operations, and the crossover threshold is defined as follows: .

[0037] Furthermore, step 306 includes:

[0038] The mutation operator is executed, and an improved adaptive mutation operator is used to realize the mutation probability. The adaptive adjustment of individual fitness, the ,in , These represent the preset maximum and minimum mutation probabilities, respectively. , , These represent the fitness of the individual to be mutated, the maximum fitness of all individuals in the population, and the average fitness of the population per generation, respectively.

[0039] The technical advantage of this invention lies in its effective overcoming of the technical challenges of current 5G mobile edge computing task offloading strategies. For multi-user concurrent request scenarios, it optimizes the handling of complex coupling problems between multiple tasks by abstracting task dependencies, making the offloading strategy more aligned with practical applications. In terms of multi-objective optimization, a total cost minimization model is established to accurately balance the nonlinear conflicts between objectives such as energy consumption and latency, avoiding system performance imbalances caused by single-objective optimization. An improved genetic algorithm (IGA) is designed, linking the optimization problem with a fitness function, ensuring that the fitness value aligns with the optimization direction. Experimental verification shows that in multi-terminal, multi-task computing offloading scenarios, the improved genetic algorithm (IGA) can quickly converge to the optimal offloading strategy adapted to the terminal and MEC, while maintaining a smoother increase in total cost as the task scale expands. It combines high search efficiency with good scale adaptability, providing an efficient and reliable solution for 5G mobile edge computing task offloading. Attached Figure Description

[0040] Figure 1 is a system architecture diagram of the present invention.

[0041] Figure 2 is a flowchart of the present invention.

[0042] Figure 3 is an example diagram of calculating the unloading task request in the edge computing scenario of the present invention.

[0043] Figure 4 is an example diagram of the edge server, mobile terminal, and task matching of the present invention.

[0044] Figure 5 is a flowchart of the optimal unloading decision scheme with the minimum total cost obtained by using an improved genetic algorithm in the edge computing scenario of the present invention.

[0045] Figure 6 is a schematic diagram comparing the change of the total system cost with the number of iterations in an embodiment of the present invention.

[0046] Figure 7 is a schematic diagram comparing the impact of the number of tasks on the total system cost in an embodiment of the present invention.

[0047] Figure 8 is a schematic diagram comparing the impact of task data size on the total system cost in an embodiment of the present invention. Detailed Implementation

[0048] The invention will now be further described with reference to the accompanying drawings.

[0049] The computation offloading method for task-dependent applications in edge computing provided in this embodiment runs on a system with the architecture shown in Figure 1, and includes the following steps as shown in Figure 2:

[0050] Step 1: Construct a system model consisting of multiple mobile terminals and a single MEC server. The system model includes K mobile terminals. The MEC server is represented by C. Each mobile terminal It includes N tasks with dependencies. These tasks can be executed on a mobile terminal or offloaded to the MEC server for execution. See Figure 3. The dependencies between tasks are represented by a directed acyclic graph. This indicates the vertices of the graph. Represents a set of tasks; the lines connecting the vertices represent the dependencies between tasks. It means that, among them, , for The precursor mission. for The subsequent tasks. In this step, the execution order of tasks is determined based on the dependencies between tasks in the DAG. A subsequent task can only begin execution after all its predecessor tasks have been completed and output their results. It is important to note that terminal nodes in a DAG have no successor tasks; these nodes are often referred to as exit tasks. In real-world applications, there are often multiple exit tasks. In such cases, it is essential to ensure that all exit tasks are completed before the complete computation task represented by the DAG is considered complete.

[0051] Step 2: Construct a problem model and calculate the total execution latency of all tasks on the mobile terminal and the MEC server respectively. Total energy consumption The optimization target is set as the total cost of mobile terminals and MEC servers. Minimize, i.e. Furthermore, when a task is unloaded to the MEC server for execution, the MEC server assigns the j-th task to the i-th mobile terminal. computing resources No more than the total computing resources of the MEC server ,in, Indicates the task unloading status. ,when When, it indicates a task. When processed on a mobile terminal, when , indicating task Unload and process on the MEC server; For weights, For applications pre-classified as latency-sensitive, choose a value close to 1. For applications pre-classified as energy-sensitive, a value close to 0 is selected. .

[0052] Step 3: Treat the unloading problem as an NP-hard binary combinatorial optimization problem. Each individual in the genetic algorithm represents an unloading strategy. Then, an improved genetic algorithm is used to calculate the optimal unloading strategy with the minimum total cost. As shown in Figure 4, the unloading strategy is represented as the matching relationship between the edge server, mobile terminal, and task.

[0053] In step two, the total latency and total energy consumption of all tasks on the mobile terminal and MEC server are calculated respectively, where the total latency of task completion is... Total energy consumption ,in, , Representing tasks Execution time and energy consumption in mobile terminal processing To carry out the mission Number of CPU cycles required This refers to the local computing power (CPU cycle frequency) of the mobile terminal. Indicates that the mobile terminal is performing a task. The power; Indicates task During the execution time processed by the MEC server This indicates that the MEC server is assigned to the task. Computing resources (CPU cycle frequency); , Representing tasks Mobile terminal processing, tasks Precursor mission Communication time and energy consumption processed on the MEC server For the task Precursor mission Based on the calculation results, the mobile terminal receives the task from the MEC server. The transmission rate of the calculated results , For the channel bandwidth between the mobile terminal and the MEC server, This refers to the receiving power of the mobile terminal. The channel gain when receiving the calculation results of the task. The noise power spectral density; , Representing tasks Processing tasks on the MEC server Precursor mission Communication time and energy consumption processed on the mobile terminal; the mobile terminal sends tasks to the MEC server. transmission rate , Upload task for mobile terminal The transmission power at that time Channel gain when sending tasks to a mobile terminal; , Indicates task Transmission time and energy consumption from mobile terminal to MEC server for processing For the task The size of the symbol is given by the subscripts L and C, which represent the mobile terminal and the MEC server, respectively.

[0054] Based on the NP-hard binary combinatorial optimization problem described in step three, an improved genetic algorithm is used to find the optimal unloading decision scheme with the minimum total cost, as shown in Figure 5. The solution process includes at least the following steps:

[0055] 1) Encoding, using 3D binary matrix encoding This represents the computational offloading strategy, where the rows of the matrix represent different mobile terminals. The columns of the matrix represent tasks initiated by the mobile terminals. Tasks must be arranged strictly according to the topology in the DAG. Tasks with priority constraints are arranged from front to back according to their order of occurrence, while parallel tasks without priority constraints are randomly ordered within adjacent columns.

[0056] 2) Initialize parameters: Assign values ​​to the total number of iterations (ITER) and the population size (noP), and define the current number of iterations. And randomly generate an initial population containing noP individuals. To maintain population diversity and prevent homogenization of individuals, duplicate individuals in the initial population need to be discarded, and new individuals are randomly generated to fill the gaps.

[0057] 3) Fitness function: For constrained optimization problems, the penalty function method can be used to transform them into unconstrained problems, and the total cost of each generation can be calculated. ,in, It is a penalty factor, and then Calculate the fitness function of the current generation by taking the reciprocal. This transformation aligns the fitness value with the optimization direction, meaning that individuals with higher fitness have the lowest total cost of their corresponding unloading strategy, thus precisely driving the genetic algorithm to find the best solution in the solution space.

[0058] 4) Selecting the operator: First, the entire population is sorted in descending order based on individual fitness to determine the hierarchy of individual merits. Then, in this embodiment, the sorted individuals are divided into three groups in a 3:4:3 ratio. The bottom 30% of individuals with the lowest fitness are directly eliminated, preventing them from participating in the next generation of evolution. The remaining 40% of individuals with moderate fitness are copied one-to-one to preserve their genetic characteristics. Finally, the top 30% of individuals with the highest fitness are given double copies, allowing them two opportunities to transmit superior genes in the next generation. In practice, the specific proportions of individuals in the three groups can be adjusted as needed, but the proportions in the first and third groups should remain consistent.

[0059] 5) Crossover operator: Introducing "gene matching degree" as a criterion. For a given binary encoded parent individuals P and Q, their "gene matching degree" is defined as... ,in, For individuals P and Q, the first... The length of the longest common subsequence of rows. The total coding length of chromosomes in an individual population is given by the given value. The "gene matching degree s" between any two individuals in the population ranges from 1 to 2. The decision to perform a crossover operation is made using the crossover threshold and the similarity index between individuals. At this time, parent individuals P and Q do not undergo crossover. At this time, parent individuals P and Q undergo crossover. The crossover threshold is defined as follows: .

[0060] 6) Mutation operator: An improved adaptive mutation operator is used to realize the mutation probability. Adaptive regulation of individual fitness ,in , They represent the maximum and minimum mutation probabilities, respectively. , , This represents the fitness of the individual to be mutated, the maximum fitness of all individuals in the population, and the average fitness of the population per generation.

[0061] 7) Repeat steps 3) to 6) until... This yields the optimal unloading decision scheme with the minimum total cost.

[0062] To verify the performance advantages of this embodiment in computational offloading, a simulation case based on the Matlab platform is constructed for experimentation. The weighted sum of energy consumption and latency is selected as the core evaluation index. Under appropriate constraints, the overhead of mobile terminal task offloading is evaluated, and the proposed method (IGA) is compared with traditional genetic algorithms (GA), random algorithms (RA), and traversal algorithms (TA) decision schemes. The key parameters of the simulation environment are shown in Table 1 below:

[0063] Table 1 Simulation Parameter List

[0064] .

[0065] Figure 6 shows a comparison curve of the total system cost changing with the number of iterations in a computational offloading scenario (2 mobile terminals, each containing 8 dependent tasks), verifying the convergence capability and performance advantage of the IGA proposed in this embodiment in solving the optimal offloading strategy. Experimental results show that in the early stage of iteration, the total cost of IGA shows a rapid decreasing trend. This is because IGA accelerates the search for high-quality solutions to the "computational offloading decision" by improving the evolutionary strategy, and can select the optimal offloading scheme more quickly. The total cost of GA decreases at a more gradual rate, reflecting its limitations in offloading strategy search. When the number of iterations reaches about 10, the total cost of IGA tends to stabilize, and it enters convergence to the optimal offloading strategy ahead of time. GA, on the other hand, requires about 20 iterations to complete convergence. The total costs of the two after final convergence are similar, but IGA converges faster, demonstrating its superior convergence efficiency in computational offloading strategy optimization.

[0066] Figure 7 shows the fitness evolution curve of IGA in this embodiment under a computation offloading scenario (2 mobile terminals, each containing 6 dependent tasks). The evolutionary characteristics of the curves show that in the early stages of iteration, the optimal fitness (corresponding to the optimal computation offloading strategy for each terminal task) exhibits a rapid upward trend and quickly stabilizes. This indicates that the algorithm can quickly locate a relatively optimal computation offloading strategy in the early stages of the search, demonstrating strong global search efficiency. Meanwhile, the average fitness (corresponding to the overall level of offloading strategies within the population) approaches the fluctuation range of the optimal fitness after about 10 iterations, and fluctuates slightly around the optimal fitness in subsequent iterations.

[0067] Figure 8 illustrates the variation of the total cost of IGA in this embodiment, and TA and RA as a comparison, with the number of tasks in two mobile terminal scenarios. As can be seen from the figure, the total cost of each algorithm increases with the increase in the number of tasks, but the performance differences are significant: the total cost of IGA increases at a relatively slow rate, and its optimized offloading strategy is better suited to the resource allocation between the terminal and MEC in multi-tasking scenarios; RA, due to its random offloading decision, experiences large fluctuations in total cost, making it difficult to stably match the computational needs of the tasks; TA has the lowest total cost when the number of tasks is small, but as the number of tasks increases, its ability to schedule resources becomes insufficient, gradually leading to a performance bottleneck.

Claims

1. A computation offloading method for task-dependent applications in edge computing, characterized in that, Includes the following steps: Step 1: Construct a system model consisting of multiple mobile terminals and a single MEC server. Each mobile terminal in the system model includes multiple tasks with dependencies. These tasks and their dependencies are represented by a Directed Acyclic Graph (DAG): vertices of the DAG represent the set of tasks, and the connections between vertices represent the dependencies between tasks. Step 2: Calculate the total execution latency and total energy consumption of all tasks on the mobile terminals and the MEC server, respectively. Set the optimization objective as minimizing the total cost of the mobile terminals and the MEC server, thus establishing a computational offloading problem model. The offloading problem is an NP-hard binary combinatorial optimization problem. Step 3: Perform binary matrix encoding based on the DAG. The algorithm uses a matrix where rows represent mobile terminals and columns represent tasks, arranging tasks according to their priority. Then, an improved genetic algorithm is used to calculate the optimal unloading strategy with the minimum total cost. Each individual in the genetic algorithm represents an unloading strategy. In each iteration, the total cost of each individual in the population is calculated based on a penalty function, and the fitness of the current generation of individuals is calculated based on the total cost. The fitness of individuals in the population is adjusted, and the gene matching degree between different individuals is calculated to determine whether to perform a crossover operation. Finally, an adaptive mutation operator is used to mutate individuals to complete one iteration. This iteration is repeated until a preset number of iterations is reached, thereby obtaining the optimal unloading strategy.

2. The method according to claim 1, characterized in that, In step 1, when establishing the DAG, the execution order of tasks is determined based on the task dependencies. The execution order of tasks includes the following: a successor task can only start executing after all predecessor tasks have been completed and output results; the end node of the DAG without any successor tasks is considered an exit task, and the complete computation task represented by the DAG is considered to be completed only after all exit tasks have been processed.

3. The method according to claim 1, characterized in that, Step 2 includes: calculating the total execution latency of all tasks on the mobile terminal and on the MEC server, respectively. Total energy consumption The optimization target is set as the total cost of mobile terminals and MEC servers. Minimize, i.e. Furthermore, when a task is unloaded to the MEC server for execution, the MEC server assigns the j-th task to the i-th mobile terminal. computing resources No more than the total computing resources of the MEC server ,in, Indicates the task unloading status. ,when When, it indicates a task. When processed on a mobile terminal, when When, it indicates a task. Unload and process on the MEC server; For weights, For applications pre-classified as latency-sensitive, choose a value close to 1. For applications pre-classified as energy-sensitive, a value close to 0 is selected. 。 4. The method according to claim 3, characterized in that, In step 2, the total latency and total energy consumption of all tasks on the mobile terminal and MEC server are calculated using the following formula: where, the total latency of task completion is... for: Total energy consumption for task completion for: ;in, 、 Representing tasks Execution time and energy consumption in mobile terminal processing; Indicates task Execution time processed by the MEC server; 、 Representing tasks Mobile terminal processing, tasks Precursor mission Communication time and energy consumption processed on the MEC server; 、 Representing tasks Processing tasks on the MEC server Precursor mission Communication time and energy consumption processed on mobile terminals; 、 Indicates task The transmission time and energy consumption from the mobile terminal to the MEC server for processing are represented by the subscripts L and C, which represent the mobile terminal and the MEC server, respectively.

5. The method according to claim 1, characterized in that, Step 3 includes: Step 301, performing binary matrix encoding based on the number of mobile terminals and tasks, and the dependency relationship of the DAG; Step 302, initializing the parameters in the genetic algorithm, including assigning the total number of iterations and the population size, setting the current iteration number to 1, and randomly generating an initial population of the corresponding population size; Step 303, calculating the total cost of individuals in the population at each iteration based on the penalty function, and then calculating the fitness of the current generation of individuals based on the total cost of individuals; Step 304, sorting the individuals in the population based on their fitness, eliminating a predetermined proportion of individuals with lower fitness, and retaining the fittest individuals. Step 305: Calculate the gene matching degree based on the length of the longest common subsequence between two random individuals and the total coding length of the chromosomes of individuals in the population; then decide whether to perform a crossover operation based on the crossover threshold and the gene matching degree between individuals; Step 306: Use an adaptive mutation operator to mutate the individual fitness to achieve adaptive adjustment of the individuals; Step 307: Repeat steps 303-306 until the preset number of iterations is reached to obtain the optimal unloading strategy with the minimum total cost.

6. The method according to claim 5, characterized in that, Step 301 includes: employing 3D binary matrix encoding The matrix represents the computation offloading strategy, where the rows of the matrix represent different mobile terminals, the columns of the matrix represent tasks initiated by the mobile terminals, and the tasks are arranged according to the topology of the DAG. Tasks with priority constraints are arranged from front to back according to the order of the tasks, and parallel tasks without priority constraints are randomly ordered in adjacent columns.

7. The method according to claim 5, characterized in that, Step 302 includes: initializing parameters, assigning values ​​to the total number of iterations (ITER) and the population size (noP), and defining the current number of iterations. And randomly generate an initial population containing noP individuals. Furthermore, if there are duplicate individuals in the initial population, the duplicate individuals are discarded, and new individuals are randomly generated to fill the gaps.

8. The method according to claim 7, characterized in that, Step 303 includes: transforming the constrained optimization problem into an unconstrained problem using the penalty function method, and calculating the total cost for each generation of individuals. ,in, It is a preset penalty factor, and then Calculate the fitness function of the current generation of individuals by taking the reciprocal. This ensures that the fitness value aligns with the optimization direction.

9. The method according to claim 5, characterized in that, Step 304 includes: selecting an operator, firstly sorting the entire population in descending order based on individual fitness to complete the hierarchy of individual fitness, then dividing the sorted individuals into three groups according to their individual fitness in a preset ratio, and then directly eliminating all individuals in the last group, i.e., those with the lowest individual fitness; performing a one-to-one copy on all individuals in the middle group, i.e., those with medium individual fitness, to preserve genetic characteristics; and performing a double copy operation on individuals with the highest individual fitness, i.e., those in the first group, thereby obtaining two opportunities to transmit superior genes in the next generation population; wherein the number of individuals in the first group and the last group is equal.

10. The method according to claim 7, characterized in that, Step 305 includes: executing a crossover operator, using gene matching degree as a criterion, and calculating the gene matching degree for two binary-coded parent individuals P and Q selected through random selection or a competition mechanism using the following formula: ,in, For individuals P and Q, the first... The length of the longest common subsequence of rows. The dimension of the binary matrix encoding is the total encoding length of the chromosomes of individuals in the population. The gene matching degree s between any two individuals in the population ranges from... Then, the crossover threshold and the similarity index between individuals are used to determine whether to perform a crossover operation. When, parent individuals P and Q do not undergo crossover operations; when At that time, parent individuals P and Q undergo crossover operations, and the crossover threshold is defined as follows: Step 306 includes: executing the mutation operator, using an improved adaptive mutation operator, and realizing the mutation probability. The adaptive adjustment of individual fitness, the ,in 、 These represent the preset maximum and minimum mutation probabilities, respectively. 、 、 These represent the fitness of the individual to be mutated, the maximum fitness of all individuals in the population, and the average fitness of the population per generation, respectively.