A Computation Offloading Method Based on Hybrid Genetic Algorithm in Mobile Edge Computing
By adopting hybrid genetic algorithms in mobile edge computing, optimized tasks offloading to cloud servers and edge servers, solving the problem of insufficient processing capabilities of mobile devices and achieving faster task processing and delay optimization.
Patent Information
- Application Number
- CN202011057306.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-30
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2040-09-30
AI Technical Summary
Mobile devices have limited processing capabilities and cannot quickly process large applications, resulting in strict delay restrictions becoming a bottleneck in the development of mobile applications. The network bandwidth limitation of traditional mobile cloud computing has also become a bottleneck in improving computing capabilities.
In the cloud server, edge server and user local collaborative computing scenario, hybrid genetic algorithms are used for calculation and uninstallation, and the optimal uninstallation of the subtask set is achieved by establishing system models, symbol coding, fitness evaluation, cross-mechanism and simulated annealing algorithm.
It effectively reduces the total completion delay of the user terminal task set, improves the optimization effect of calculation and unloading, and optimizes task allocation and processing efficiency.
Smart Images

Figure CN112181655B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of mobile edge technology, and in particular, to a computing offloading method based on a hybrid genetic algorithm in mobile edge computing. Background Art
[0002] With the development of the Internet of Things (IoT), mobile user devices (UEs) such as smart phones and laptops have set off a new wave. Traditional applications are difficult to meet the growing needs of IoT users, such as quality of service. Recently, many novel applications have emerged and quickly gained popularity among users, such as real-time online games, virtual reality, etc.
[0003] Although the processing power of today's mobile devices is becoming more and more powerful, mobile devices usually have limited battery capacity and cannot process huge applications in a short time, which has become a bottleneck for the future development of mobile applications. Strict latency constraints have become an obstacle to running complex applications on mobile devices. Mobile cloud computing (MCC) was regarded as a promising method to relieve the burden of computing tasks in the past, because rich computing resources can significantly reduce the processing latency of applications. Although the data processing speed is very fast, the network bandwidth is limited. As the data continues to increase, the data transmission speed has become a bottleneck for improving the cloud computing ability. To address this key challenge, users can offload tasks to a mobile edge computing (MEC) server to improve performance. Therefore, in the scenario of collaborative computing offloading among cloud servers, edge servers, and user local, formulating an offloading decision scheme has become a hot issue at present. Summary of the Invention
[0004] The purpose of the present invention is to address the deficiencies of the prior art and provide a computing offloading method based on a hybrid genetic algorithm in mobile edge computing. In the scenario of collaborative computing among cloud servers, edge servers, and user local, with the goal of minimizing the total completion latency of the prioritized constrained subtask set at the user side, the subtask set with priority dependencies at the user side is offloaded to different servers. And a hybrid genetic algorithm is used for solving. Compared with the traditional genetic algorithm, a better optimization effect can be obtained.
[0005] To achieve the above purpose, the present invention adopts the following technical solutions:
[0006] A computing offloading method based on a hybrid genetic algorithm in mobile edge computing, including the steps:
[0007] S1. Establish a system model to obtain the computing delays of subtask sets on each processor and the transmission delays between processors, and determine the layer values of each task in the subtask set according to the constraint relationships of the subtask set; wherein, the system model consists of a user, a mobile cloud server, and multiple edge servers, and a centralized decision-making scheduling scheme is performed by the mobile cloud server; one server can only process one task at a time. When there are too many subtasks in the user terminal, the BS to which the user belongs can communicate with other BSs in the resource pool for collaborative computing offloading to meet the user's needs;
[0008] S2. Initialize the population according to the determined task layer values and random strategies to obtain the initial population individuals of the subtask set, and perform symbolic encoding according to the mapping relationship between tasks and processors in the initial population individuals to obtain the task scheduling sequence, and optimize the individuals in the initial population;
[0009] S3. Construct a fitness evaluation function, and perform selection operations on the individuals in the optimized initial population according to the fitness evaluation function to obtain a new population;
[0010] S4. Construct a crossover mechanism, and perform crossover on the individuals in the new population using the crossover operation based on the tabu search algorithm;
[0011] S5. Perform mutation operations on the individuals in the new population using the mutation operation based on the simulated annealing algorithm;
[0012] S6. Determine whether the iteration step length is reached. If not, repeat steps S3 - S5; if so, output the global optimal solution.
[0013] Further, in step S1, determining the layer values of each task in the subtask set according to the constraint relationships of the subtask set is specifically as follows:
[0014] The constraint relationships of the subtask set are represented using a directed acyclic graph model, which is expressed as:
[0015] G = <V, E>
[0016] wherein, V represents the subtask set, V = {v i | 1 ≤ i ≤ N}; E is the set of directed edges between subtasks, representing the precedence constraint relationships between subtasks; v i represents each subtask, v i = {d i , g i}; d i represents the cpu cycles required to complete the task; g i represents the size of the task input data;
[0017] The layer values of each task in the subtask set are expressed as:
[0018]
[0019] Among them, pre(v i ) represents the set of predecessor nodes of each subtask v i .
[0020] Furthermore, the computing delay of the subtask set obtained in step S1 on each processor is specifically as follows:
[0021] The computing delay of the i-th subtask on the local server can be expressed as:
[0022]
[0023] The computing delay of the i-th subtask on the MEC server can be expressed as:
[0024]
[0025] The computing delay of the i-th subtask on the MCC server can be expressed as:
[0026]
[0027] Among them, d i represents the task size; f L , f E , f C respectively represent the computing capabilities of the user's local server, MEC server, and MCC server, that is, the number of cpu cycles that can be provided per second;
[0028] The computing delay of the i-th subtask on the server is expressed as:
[0029]
[0030] Among them, α, β, and γ represent 0-1 variables and α + β + γ = 1.
[0031] Furthermore, the transmission delay between each processor obtained in step S1 is specifically as follows:
[0032] The upload rate at which the user offloads tasks to the affiliated BS is expressed as:
[0033]
[0034] Among them, P0 represents the fixed transmission power of the user terminal; h0 represents the channel gain between the user and the BS; σ 2 represents the power of additive white Gaussian noise; w represents the channel bandwidth;
[0035] The downlink transmission rate from the affiliated BS to the user terminal is expressed as:
[0036]
[0037] Among them, P E represents the fixed transmission power of the BS;
[0038] The transmission delay between each processor is expressed as:
[0039] c ji = c i,α→β + c i,β→α + c i,α→β' + c i,β'→α + c i,β→β'
[0040] + c i,β'→β + c i,α→γ + c i,γ→α + c i,β→γ + c i,γ→β
[0041] Among them, c ji represents the transmission delay between each processor, that is, the transmission delay from the previous task v j to the subsequent task v i .
[0042] Furthermore, the symbol encoding in the step S2 is specifically as follows:
[0043] A1. Gene value initialization, each gene value represents the processor serial number assigned to the task:
[0044] u i = p i + i × M
[0045] Among them, p i represents the processor serial number initially assigned to the task i; i represents the task number; M represents the total number of processors;
[0046] A2. Random exchange of gene values. For the gene values of tasks assigned to the same processor, randomly select two of them for exchange, and perform exchanges, where k is the total number of tasks assigned to this processor.
[0047] A3. Sort in ascending order according to the layer value of the task; for tasks with the same layer value, sort in descending order according to the individual gene value; obtain the overall scheduling column of the subtask set;
[0048] A4. Determine the processor assigned to each task according to the individual gene value:
[0049] b = mod(u i / M)
[0050] Among them, b represents the task vi The allocated processor serial number;
[0051] A5. According to the subtask set scheduling sequence obtained in step A3 and the mapping relationship between subtasks and processors obtained in A2, obtain the scheduling sequence on each processor.
[0052] Further, the optimization of individuals in the initial population in step S2 is specifically as follows:
[0053] B1. Calculate the completion time delay on each processor to obtain the processor p with the longest time delay l and the processor p with the shortest time delay s ;
[0054] B2. Search on processor p l to check if there is a certain task that has no priority restriction relationship with other tasks on the processor. If so, allocate this task to processor p s ; if not, randomly select a task on p l and forward it to p s ;
[0055] B3. Compare the total time delay of the individual before and after the modification. If the time delay becomes shorter, retain this allocation scheme; otherwise, maintain the original allocation scheme;
[0056] B4. Repeat steps B2 - B3 until the optimized individual is output;
[0057] Further, the construction of the fitness evaluation function in step S3 is expressed as:
[0058]
[0059] where T total represents the total time delay of the subtask set, which is expressed as:
[0060] T [[ID=!46]] total = max{s i + t i}
[0061] where t i represents the execution time delay of task i; s i represents the start execution time of task v i which is expressed as:
[0062]
[0063] where, represents the start execution time under resource constraint conditions; represents the start execution time under dependency constraint conditions;
[0064] The start execution time under resource constraint conditions, expressed as:
[0065]
[0066] The start execution time under dependency constraint conditions, expressed as:
[0067]
[0068] Among them, task k is the predecessor task of task v i in the assigned processor scheduling sequence.
[0069] Furthermore, in step S3, selection operation is performed on the individuals in the optimized initial population according to the fitness evaluation function, specifically:
[0070] C1. Calculate the cumulative probability of each individual in the population:
[0071]
[0072] Among them, P(U j ) represents the probability that individual U j is selected, expressed as:
[0073]
[0074] Among them, SN represents the total number of individuals in the population;
[0075] C2. Generate a random number r within [0, 1];
[0076] C3. If r ≤ q(1), then individual U1 is selected;
[0077] C4. If q(k - 1) ≤ r ≤ q(k), 2 ≤ k ≤ SN, then individual U k is selected;
[0078] C5. Repeat steps C2 - C4 until a new population is generated.
[0079] Furthermore, step S4 is specifically:
[0080] S41. Initialize, set the maximum fitness function value of the individuals in the current population as the aspiration level, set the length of the taboo list element, the crossover rate, the threshold, and set the taboo list to be empty;
[0081] S42. According to the crossover rate, select two adjacent individuals from the population and perform random number crossover to obtain two offspring individuals;
[0082] S43. Compare whether the fitness values of two offspring individuals are greater than the aspiration level. If so, the offspring enter the next generation, update the aspiration level to the fitness value of the current individual, and execute step S45; if not, execute step S44;
[0083] S44. Check whether there is an element in the taboo list such that the difference between the fitness value and the element value is less than the threshold. If not, the offspring enter the next generation and step S45 is executed; if so, discard the offspring after crossover, the parent enters the next generation, and step S46 is executed;
[0084] S45. Update the elements in the taboo list. When the number of elements in the list exceeds the list length, discard the element that first entered the list;
[0085] S46. Return to step S42 until the crossover of individuals in the population is completed.
[0086] Further, the specific steps of step S5 are as follows:
[0087] S51. Initialize, set the initial temperature T0, the termination temperature T f , the temperature reduction value ΔT, and the number of inner loop times L; set the fitness value of the selected individual U j in the population as the initial solution, the initial optimal solution is U best = U j , and the initial iteration temperature is T k = T0;
[0088] S52. Perform a mutation operation on the individual U j , and the mutated individual is U' j . Calculate the total delay increment Δf, which is expressed as:
[0089] Δf = T total (U' j ) - T total (U j )
[0090] S53. Determine whether the total delay of U' j is less than the total delay of U best . If so, U best = U' j ;
[0091] S54. Determine whether the total delay increment Δf is less than 0. If so, U j = U' j ; if not, determine whether is greater than τ. If so, U j = U' j ; if not, U j = U j ;
[0092] S55. Execute steps S52 - S54 in a loop, and determine whether the number of inner loop iterations has been reached. If so, execute step S56; if not, execute step S52;
[0093] S56. Calculate the iterative temperature T k = T k - ΔT, and output U when T k < T f ; otherwise, execute step S52. best
[0094] Compared with the prior art, in the scenario where the cloud server, edge server, and user local all have computing capabilities, the present invention uses a hybrid genetic algorithm to offload a set of subtasks with priority dependencies at the user side to different servers to minimize the total completion delay of the subtask set. Compared with the traditional genetic algorithm, it has a better optimization effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0095] Figure 1 is a flowchart of a computing offloading method based on a hybrid genetic algorithm in mobile edge computing provided in Embodiment 1;
[0096] Figure 2 is a schematic diagram of the system model provided in Embodiment 1;
[0097] Figure 3 is a schematic diagram of the DAG model of the subtask set provided in Embodiment 1;
[0098] Figure 4 is a schematic diagram of the comparison of the convergence results between the algorithm provided in Embodiment 1 and the traditional genetic algorithm. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0099] The following uses specific specific examples to illustrate the implementation manners of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific implementation manners, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0100] The purpose of the present invention is to provide a computing offloading method based on a hybrid genetic algorithm in mobile edge computing for the defects of the prior art.
[0101] Embodiment 1
[0102] This embodiment provides a collaborative computing offloading method based on a hybrid genetic algorithm in mobile edge computing, as Figure 1 shown, including the steps:
[0103] S11. Establish a system model to obtain the computing delays of the subtask set on each processor and the transmission delays between processors, and determine the layer values of each task in the subtask set according to the constraint relationships of the subtask set;
[0104] S12. Initialize the population according to the determined task layer values and a random strategy to obtain the initial population individuals of the subtask set. Then, according to the mapping relationship between tasks and processors in the initial population individuals, perform symbolic encoding to obtain a task scheduling sequence, and optimize the individuals in the initial population;
[0105] S13. Construct a fitness evaluation function, and perform a selection operation on the individuals in the optimized initial population according to the fitness evaluation function to obtain a new population;
[0106] S14. Construct a crossover mechanism, and perform crossover on the individuals in the new population using a crossover operation based on the tabu search algorithm;
[0107] S15. Perform a mutation operation on the individuals in the new population using a mutation operation based on the simulated annealing algorithm;
[0108] S16. Determine whether the iteration step size is reached. If not, repeat steps S13 - S15; if so, output the global optimal solution.
[0109] This embodiment is applicable to the mobile edge computing scenario. The system model diagram is as Figure 2 shown, consisting of a user, a mobile cloud server, and multiple edge servers. The mobile cloud server performs a centralized decision-making scheduling scheme. The distance between the BS and the MEC server is very close, so the transmission delay is very small and can be ignored. A server can only process one task at a time. When there are too many subtasks in the user terminal, the BS to which the user belongs can communicate with other BSs in the resource pool for collaborative computing offloading to meet the user's needs.
[0110] In step S11, establish a system model to obtain the computing delays of the subtask set on each processor and the transmission delays between processors, and determine the layer values of each task in the subtask set according to the constraint relationships of the subtask set.
[0111] The priority constraint relationships between the subtasks in the user terminal are represented using a directed acyclic graph (DAG) model, i.e., G = <V, E>. Where V is the subtask set, V = {v i |1 ≤ i ≤ N}. E is the set of directed edges between subtasks, representing the precedence constraint relationships between subtasks. e ij ∈E means that task v i can be executed only after task v j is executed. Each subtask v i = {d i , gi}, where d i is the number of CPU cycles required to complete the task, and g i is the size of the task input data.
[0112] A subtask without a predecessor constraint is called an entry node, and a subtask without a successor task is called an exit node. If there are multiple entry nodes at the same time, a new entry node is added as the predecessor node of the multiple entry nodes. The calculation delay of the new entry node is 0, and the communication delay with other multiple time nodes is also 0. Similarly, if there are multiple exit nodes, a new exit node is added.
[0113] For a known DAG model, the set of predecessor nodes of subtask v i is pre(v i ), and the set of successor nodes is suc(v i ). The layer value of each task in the subtask set can be determined by the following formula:
[0114]
[0115] P = {p i | 1 ≤ i ≤ M} is the set of processors in the model, where p1 is the user's local processor, p2 is the MEC server under the user's base station, p M is the MCC server, and the rest are other MEC servers in the same resource pool as the user's BS.
[0116] The processing delay of the i-th subtask on the local server can be expressed as:
[0117]
[0118] The processing delay of the i-th subtask on the edge server can be expressed as:
[0119]
[0120] The processing delay of the i-th subtask on the edge server can be expressed as:
[0121]
[0122] where d i is the task size, and f L , f E , f C represent the computing capabilities of the user's local server, MEC server, and MCC server respectively, that is, the number of CPU cycles that can be provided per second.
[0123] Then the processing delay of the i-th subtask on the server can be expressed as:
[0124]
[0125] Where α, β, and γ are 0-1 variables and α + β + γ = 1.
[0126] During the task transmission process, if the predecessor node and the successor node are allocated on the same processor, the transmission delay is 0. Considering the quasi-static channel model, the upload rate at which the user offloads tasks to the associated BS is:
[0127]
[0128] where P0 represents the fixed transmission power of the user terminal, h0 represents the channel gain between the user and the BS, σ 2 represents the power of additive white Gaussian noise, and w represents the channel bandwidth.
[0129] The downlink transmission rate from the associated BS to the user terminal is:
[0130]
[0131] where P E represents the fixed transmission power of the BS.
[0132] Then the transmission delay from the predecessor task v j to the successor task v i is:
[0133] c ji = c i,α→β + c i,β→α + c i,α→β' + c i,β'→α + c i,β→β' + c i,β'→β + c i,α→γ + c i,γ→α + c i,β→γ + c i,γ→β
[0134] The above formula includes ten cases, and the arrow direction represents the offloading platform direction. For example: c i,α→β The predecessor task j is processed on the local server, and the successor task i is processed on the MEC server of the associated BS. The following formula lists the specific calculation formulas for the ten cases:
[0135]
[0136] where, π E is the transmission rate between BSs in the resource pool, and π C is the transmission rate from the BS to the MCC server. y i,α , y j,β are both 0-1 variables. For example: when the predecessor task v jWhen it is unloaded to the MEC server of the BS to which the user belongs, y j,β = 1.
[0137] In step S12, perform a random policy initialization population process on the determined task layer value to obtain the initial population individuals of the subtask set. According to the mapping relationship between tasks and processors in the initial population individuals, perform symbolic encoding to obtain the task scheduling sequence, and optimize the individuals in the initial population.
[0138] According to the subtasks and layer values obtained in step S11, perform processor pre-allocation on tasks with the same layer value. If the total number of tasks in a certain layer is n, let a = mod(n / M), randomly select a tasks from the total tasks and allocate them to different processors, and then evenly distribute the remaining (n - a) tasks to the M processors in the scenario to obtain the initial allocation plan of the subtask set. And according to the mapping relationship between tasks and processors in the initial allocation plan, perform symbolic encoding to obtain the initial gene value sequence of the individual.
[0139] The specific encoding scheme is as follows:
[0140] A1. Gene value initialization, each gene value represents the serial number of the processor to which the task is allocated:
[0141] u i = p i + i × M
[0142] Among them, p i The serial number of the processor initially allocated to task i, i is the task number, and M is the total number of processors.
[0143] A2. Random gene value exchange, for the gene values of tasks allocated to the same processor, randomly select two of them for exchange. Perform times of exchange, where k is the total number of tasks allocated to this processor.
[0144] After obtaining the individual gene value sequence, adopt a scheduling scheme based on the task layer value and gene value. The specific steps are as follows:
[0145] A3. First, sort according to the layer value of the task from small to large; for tasks with the same layer value, sort according to the individual gene value from large to small; obtain the overall scheduling column of the subtask set.
[0146] A4. Determine the processor to which each task is allocated according to the individual gene value:
[0147] b = mod(u i / M)
[0148] b is the serial number of the processor to which task v i is allocated.
[0149] A5. According to the sub-task set scheduling sequence obtained in step A1 and the mapping relationship between the sub-tasks and the processors obtained in A2, the scheduling sequences on each processor can be finally obtained.
[0150] To improve the quality of the initial population, each individual obtained by the initial allocation strategy is optimized. The specific optimization steps are as follows:
[0151] B1. Calculate the completion time delay on each processor to obtain the processor p with the longest time delay l and the processor p with the shortest time delay s .
[0152] B2. Search on the processor p l to see if there is a task that has no priority constraint relationship with other tasks on the processor. If there is, allocate this task to the processor p s . Otherwise, randomly select a task on p l and forward it to p s .
[0153] B3. Compare the total time delays of the individual before and after modification. If the time delay becomes shorter, retain this allocation scheme; otherwise, maintain the original allocation scheme.
[0154] B4. Repeat steps B2 - B3 10 times and output the optimized individual.
[0155] The total time delay of the sub-task set can be calculated by the following formula:
[0156] T total = max{s i + t i}
[0157] where t i is the execution time delay of task i, and s i is the start execution time of task v i , which is determined by the following formula:
[0158]
[0159] is the start execution time under resource constraint conditions:
[0160]
[0161] where task k is the predecessor task of task v i in the scheduling sequence of the allocated processor.
[0162] is the start execution time under dependency constraint conditions:
[0163]
[0164] In step S13, a fitness evaluation function is constructed, and based on the fitness evaluation function, selection operations are performed on the individuals in the optimized initial population to obtain a new population.
[0165] Specifically, the fitness evaluation function is as follows:
[0166]
[0167] That is, the reciprocal of the total delay of an individual is used as the evaluation criterion. The shorter the completion delay, the larger the value of the evaluation function, indicating that the fitness of this individual is higher.
[0168] In the selection operation, according to the obtained fitness function values, roulette wheel selection is performed on the individuals in the population. The specific steps are as follows:
[0169] C1. Calculate the cumulative probability of each individual in the population:
[0170]
[0171] where P(U j ) is the probability that individual U j is selected, which is determined by the following formula:
[0172]
[0173] SN is the total number of individuals in the population;
[0174] C2. Generate a random number r in the range [0, 1];
[0175] C3. If r ≤ q(1), then individual U1 is selected;
[0176] C4. If q(k - 1) ≤ r ≤ q(k), 2 ≤ k ≤ SN, then individual U k is selected;
[0177] C5. Repeat steps C2 - C5 until a new population is generated.
[0178] In step S14, a crossover mechanism is constructed, and crossover operations based on the tabu search algorithm are used to perform crossover on the individuals in the new population.
[0179] Construct a crossover mechanism, and use crossover operations based on the tabu search algorithm (TS) to perform crossover on the individuals in the population.
[0180] The specific steps of the crossover operation based on the tabu search algorithm (TS) are as follows:
[0181] S141. Initialize, set the maximum fitness function value of individuals in the current population as the aspiration level, set parameters such as the length of the taboo list elements, crossover rate, threshold, etc., and set the taboo list to be empty;
[0182] S142. According to the crossover rate, select two adjacent individuals from the population, and perform random number crossover to obtain two offspring individuals;
[0183] S143. Compare the fitness values of the two offspring individuals with the aspiration level. If it is greater than the aspiration level, the offspring enter the next generation, update the aspiration level as the fitness value of the current individual, and turn to step S145;
[0184] S144. If it is not greater than the aspiration level, check whether there is an element in the taboo list such that the difference between the fitness value and the element value is less than the threshold. If not, the offspring enter the next generation and turn to step S145; if so, discard the offspring after crossover, and the parent enters the next generation and turns to step S146;
[0185] S145. Update the elements in the taboo list. When the number of elements in the list exceeds the list length, discard the element that entered the list first;
[0186] S146. Return to step S142 until the crossover of individuals in the population is completed.
[0187] Among them, the specific steps of the random number crossover described in step S142 are as follows:
[0188] S1421. For individuals U1 and U2 undergoing crossover operation, randomly select an initial node and a termination node in the individual gene sequence;
[0189] S1422. Randomly number the l' gene values in the selected gene segment of U1, and the number values are 1 to l';
[0190] S1423. Similarly, randomly number the gene values in U2;
[0191] S1424. Swap the positions of the gene values with the same numbers in the two gene value segments, and replace the original gene value segments to obtain new individuals.
[0192] In step S15, use the mutation operation based on the simulated annealing algorithm to perform mutation operation on the individuals in the new population.
[0193] Use the mutation operation based on the simulated annealing algorithm (SA) to perform mutation operation on the individuals in the population.
[0194] The mutation operation based on the SA algorithm is specifically as follows:
[0195] S151. Initialize, set the initial temperature T0 and the termination temperature T f, the temperature reduction value ΔT, and the number of inner loop iterations L. Select an individual U from the population j whose fitness value is set as the initial solution, and the initial optimal solution is U best = U j , and the initial iteration temperature is T k = T0;
[0196] S152. Perform a mutation operation on the individual U j , and the mutated individual is U' j . Calculate the total delay increment:
[0197] Δf = T total (U' j ) - T total (U j )
[0198] S153. If the total delay of U' j is less than the total delay of U best , then U best = U' j ;
[0199] S154. If Δf < 0, then U j = U' j ; if Δf > 0, then judge where τ = U(0,1), if it is greater, then U j = U' j , otherwise U j = U j ;
[0200] S155. Judge whether the number of inner loop iterations is reached. If it is reached, execute step S156; otherwise, execute step S152;
[0201] S156. Calculate the iteration temperature T k = T k - ΔT. When T k < T f , output U best , otherwise execute step S152.
[0202] The specific steps of the mutation operation described in step S152 are as follows:
[0203] In the gene value sequence of the individual U j , randomly select two gene values for exchange, and the obtained new gene value sequence is the gene value sequence of the individual U' j .
[0204] In step S16, judge whether the iteration step length is reached. If not, repeat the genetic operation, that is, steps S13 to S15; if it is reached, output the global optimal solution.
[0205] As shown Figure 3 in the figure, a simple DAG model diagram is shown. There are 10 subtasks in the subtask set, and the priority constraint relationships between the subtasks are represented by the connecting lines with one-way arrows.
[0206] As shown Figure 4 in the figure, a comparison diagram of the algorithm convergence results between the hybrid genetic algorithm used in this embodiment and the traditional genetic algorithm is shown. The number of iterations is set to 100. To avoid data randomness, the simulation results are the average values of 20 experiments. It can be seen from the figure that compared with the traditional genetic algorithm, the hybrid genetic algorithm adopted by the present invention can obtain a better global optimal solution.
[0207] Compared with the prior art, in the scenario where the cloud server, the edge server, and the user's local device all have computing capabilities, a hybrid genetic algorithm is used in this embodiment to offload the subtask set with priority dependencies at the user side to different servers to minimize the total completion delay of the subtask set. Compared with the traditional genetic algorithm, it has a better optimization effect.
[0208] Note that the above is only the preferred embodiment of the present invention and the technical principles applied. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein. Various obvious changes, re-adjustments, and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the present invention, more other equivalent embodiments can be included, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A computing offloading method based on a hybrid genetic algorithm in mobile edge computing, characterized in that Including the steps: S1. Establish a system model to obtain the computing delay of each subtask set on each processor and the transmission delay between processors, and determine the layer values of each task in the subtask set according to the constraint relationship of the subtask set; wherein, the system model consists of a user, a mobile cloud server, and multiple edge servers, and the mobile cloud server performs a centralized decision-making scheduling scheme; one server can only process one task at the same time. When there are too many subtasks on the user side, the BS to which the user belongs can communicate with other BSs in the resource pool for collaborative computing offloading to meet the user's needs; S2. Initialize the population according to the determined task layer values and random strategy to obtain the initial population individuals of the subtask set, and perform symbolic encoding according to the mapping relationship between tasks and processors in the initial population individuals to obtain a task scheduling sequence, and optimize the individuals in the initial population; S3. Construct a fitness evaluation function, and perform a selection operation on the individuals in the optimized initial population according to the fitness evaluation function to obtain a new population; S4. Construct a crossover mechanism, and perform crossover on the individuals in the new population using a crossover operation based on a tabu search algorithm; S5. Perform a mutation operation on the individuals in the new population using a mutation operation based on a simulated annealing algorithm; S6. Determine whether the iteration step size is reached. If not, repeat steps S3 - S5; if so, output the global optimal solution; In step S1, determining the layer values of each task in the subtask set according to the constraint relationship of the subtask set is specifically as follows: The constraint relationship of the subtask set is represented by a directed acyclic graph model, which is expressed as: G = <V, E> Among them, V represents the set of subtasks, V = {v i | 1 ≤ i ≤ N}; E is the set of directed edges between subtasks, representing the precedence constraint relationship between subtasks; v i represents each subtask, v i = {d i , g i}; d i represents the number of CPU cycles required to complete the task; g i represents the size of the task input data; The layer values of each task in the subtask set are expressed as: Among them, pre(v i ) represents the set of predecessor nodes of each subtask v i ; The specific symbolic encoding in step S2 is as follows: A1. Initialize the gene values, and each gene value represents the serial number of the processor to which the task is assigned: u i = p i + i × M Among them, p i represents the serial number of the processor initially assigned to task i; i represents the task number; M represents the total number of processors; A2. Randomly exchange gene values. For the gene values assigned to the same processor task, randomly select two of them for exchange, and perform exchanges, where k is the total number of tasks assigned to the processor; A3. Sort in ascending order according to the layer values of the tasks. For tasks with the same layer value, sort in descending order according to the individual gene values to obtain the overall scheduling column of the subtask set; A4. Determine the processor to which each task is assigned according to the individual gene values; b = mod(u i / M) Among them, b represents the serial number of the processor assigned to task v i ; A5. According to the subtask set scheduling sequence obtained in step A3 and the mapping relationship between the subtasks and processors obtained in A2, obtain the scheduling sequence on each processor.
2. The computing offloading method based on a hybrid genetic algorithm in mobile edge computing according to claim 1, wherein The specific method for obtaining the computing delay of the subtask set on each processor in step S1 is as follows: The computing delay of the i-th subtask on the local server is expressed as: The computing delay of the i-th subtask on the MEC server is expressed as: The computing delay of the i-th subtask on the MCC server is expressed as: Among them, f L , f E , f C respectively represent the computing capabilities of the user local server, the MEC server, and the MCC server, that is, the number of cpu cycles that can be provided per second; The computing delay of the i-th subtask on the server is expressed as: Wherein, α, β, and γ represent 0 - 1 variables and α + β + γ = 1.
3. The computational offloading method based on the hybrid genetic algorithm in mobile edge computing according to claim 2, wherein The specific method for obtaining the transmission delay between processors in step S1 is as follows: The upload rate at which the user offloads tasks to the BS to which the user belongs is expressed as: Among them, P0 represents the fixed transmission power of the user terminal; h0 represents the channel gain between the user and the BS; σ 2 represents the power of additive white Gaussian noise; w represents the channel bandwidth; The downlink transmission rate from the BS to which the user belongs to the user side is expressed as: Among them, P E represents the fixed transmission power of the BS; The transmission delay between processors is expressed as: c ji = c i,α→β + c i,β→α + c i,α→β' + c i,β'→α + c i,β→β' +c i,β'→β +c i,α→γ +c i,γ→α +c i,β→γ +c i,γ→β Among them, c ji represents the transmission delay between processors, that is, the transmission delay from the previous task v j to the successor task v i .
4. A computing offloading method based on a hybrid genetic algorithm in mobile edge computing according to claim 1, wherein The specific method for optimizing the individuals in the initial population in step S2 is as follows: B1. Calculate the completion time delay on each processor to obtain the processor p with the longest delay l and the processor p with the shortest delay s ; B2. Search on processor p l to see if there is a task that has no priority restriction relationship with other tasks on the processor. If so, allocate this task to processor p s ; if not, randomly select a task on p l and forward it to p s ; B3. Compare the total delays of the individuals before and after modification. If the delay becomes shorter, retain the allocation plan; otherwise, maintain the original allocation plan; Repeat steps B2 - B3 until the optimized individuals are output.
5. A computing offloading method based on a hybrid genetic algorithm in mobile edge computing according to claim 1, characterized in that In step S3, construct the fitness evaluation function, expressed as: Among them, T total represents the total time delay of the subtask set, expressed as: T total = max{s i + t i} where t i represents the execution delay of task i; s i represents the start execution time of task v i which is expressed as: Among them, represents the start execution time under resource constraint conditions; represents the start execution time under dependency constraint conditions; The start execution time under resource constraint conditions, expressed as: The start execution time under dependency constraint conditions, expressed as: Among them, task k is the predecessor task of task v i in the processor scheduling sequence assigned.
6. The computational offloading method based on a hybrid genetic algorithm in mobile edge computing according to claim 5, wherein In step S3, perform a selection operation on the individuals in the optimized initial population according to the fitness evaluation function, specifically: C1. Calculate the cumulative probability of each individual in the population: where, P(U j ) represents the probability that individual U j is selected, expressed as: where SN represents the total number of individuals in the population; C2. Generate a random number r within [0, 1]; C3. If r ≤ q(1), then individual U1 is selected; C4. If q(k - 1) ≤ r ≤ q(k), where 2 ≤ k ≤ SN, then individual U k is selected; C5. Repeat steps C2 - C4 until a new population is generated.
7. A computing offloading method based on a hybrid genetic algorithm in mobile edge computing according to claim 1, wherein Step S4 is specifically: S41. Initialize, set the maximum fitness function value of the individuals in the current population as the aspiration level, set the length of the taboo list elements, the crossover rate, and the threshold, and set the taboo list to be empty; S42. According to the crossover rate, select two adjacent individuals from the population and perform random - numbered crossover to obtain two offspring individuals; S43. Compare whether the fitness values of the two offspring individuals are greater than the aspiration level. If so, the offspring enter the next generation, update the aspiration level to the fitness value of the current individual, and execute step S45; if not, execute step S44; S44. Check whether there is an element in the taboo list such that the difference between the fitness value and the element value is less than the threshold. If not, the offspring enter the next generation and execute step S45; if so, discard the offspring after crossover, the parent generation enters the next generation, and execute step S46; S45. Update the elements in the taboo list. When the number of elements in the list exceeds the list length, discard the element that entered the list first; S46. Return to step S42 until the crossover of the individuals in the population is completed.
8. A computing offloading method based on a hybrid genetic algorithm in mobile edge computing according to claim 1, characterized in that, Step S5 is specifically: S51. Initialize, set the initial temperature T0, the termination temperature T f , the temperature decrease value ΔT, and the number of inner loop iterations L; set the fitness value of the individual U j selected from the population as the initial solution, and the initial optimal solution is U best = U j , and the initial iterative temperature is T k = T0; S52. Mutate individual U j After mutation, the individual becomes U' j , calculate the total delay increment Δf, expressed as: Δf = T total (U' j ) - T total (U j ) S53. Determine whether the total delay of U' j is less than the total delay of U best . If so, then U best = U' j ; S54. Determine whether the total delay increment Δf is less than 0. If so, then U j = U' j ; If not, then determine whether is greater than τ. If so, then U j = U' j ; If not, then U j = U j ; S55. Loop and execute steps S52 - S54, and determine whether the inner - loop count is reached. If so, execute step S56; if not, execute step S52; S56. Calculate the iterative temperature T k = T k - ΔT, output U when T k < T f , otherwise execute step S52. best
Citation Information
Patent Citations
A multitasking application unloading method in micro-cloud
CN109358953A