Edge computing task unloading method based on Harris eagle optimization strategy
By improving the Harris Eagle Optimization Strategy (HPHHO) to optimize edge computing task offloading, the problems of high transmission costs, communication latency, and privacy leaks in mobile edge computing are solved, realizing an efficient and secure task offloading method that is suitable for edge computing environments of IoT devices.
Patent Information
- Application Number
- CN202511116529.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-11
- Publication Date
- 2025-11-25
AI Technical Summary
Mobile edge computing suffers from problems such as high transmission costs, communication latency, low computing efficiency, and privacy leaks. In particular, existing research has failed to effectively address user security issues in scenarios involving massive amounts of data and intensive tasks brought about by IoT devices.
An improved Harris Eagle Optimization Strategy (HPHHO) is adopted, which optimizes the randomly generated parameters in the Harris Eagle algorithm through a Logistic sequence strategy. Combined with dynamic back learning and smoothing optimization algorithms, the predation behavior is dynamically adjusted to optimize the offloading of edge computing tasks, increase population diversity, reduce fluctuations in the solution process, and protect user privacy.
By minimizing overhead while ensuring user information remains in a chaotic state, effectively selecting offloading methods that protect privacy, computational efficiency is improved, transmission costs are reduced, and information security is enhanced.
Smart Images

Figure CN121013129A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of Internet of Things, and particularly relates to an edge computing task offloading method based on Harris hawk optimization strategy. BACKGROUND
[0002] With the rapid development of Internet of Things technology, the service system in modern industry is increasingly facing the challenge of massive data and intensive tasks brought by a large number of Internet of Things devices. Although the proposal of mobile edge computing provides a feasible solution to solve the problem, there are still problems such as high transmission cost, communication delay, low computing efficiency and privacy leakage. Current research mainly focuses on resource consumption in the offloading process, but as a new theory in the ascendant, the safety of users in mobile edge computing is also worth serious consideration.
[0003] Harris Hawk Optimization (HHO) has been widely used in function optimization, engineering design and machine learning in recent years, and was proposed by Heidary. The invention concept is derived from the cooperative behavior of Harris individuals in hunting prey and the hunting style of sudden attack. The algorithm simulates the hunting behavior of Harris hawk, i.e. three hunting stages of search, search and hunting conversion and hunting, and has the advantages of less parameter adjustment, easy implementation and strong local search ability. The application optimizes the original Harris Hawk Optimization (HHO) algorithm and applies the improved Harris Hawk Optimization (HPHHO) to the field of Internet of Things to solve the problems of high transmission cost, communication delay, low computing efficiency and privacy leakage caused by massive data and intensive tasks brought by a large number of Internet of Things devices. SUMMARY
[0004] The application studies the task offloading problem of fixed equipment in the factory and considers the information security problem caused by data transmission in offloading, and provides an edge computing task offloading method based on Harris hawk optimization strategy. The application considers that the initialization of the original Harris Hawk Optimization (HHO) algorithm is randomly generated, the coverage area is low, and fluctuations will occur in the solving process. Therefore, dynamic reverse learning strategy and smoothing optimization algorithm are introduced to optimize the original Harris Hawk Optimization (HHO) algorithm. Experiments show that the method can minimize the overhead under the condition of ensuring user information chaos, and effectively select the offloading mode that protects privacy.
[0005] The edge computing task offloading method based on Harris hawk optimization strategy provided by the application comprises the following steps:
[0006] Step 1: initialize parameters and establish an information entropy model, including the number N of user devices U, the number M of MEC devices, the maximum number of iterations T, task-related parameters, and task processing parameters; wherein the task-related parameters include task name Tasks and task data size Ds, and the task processing parameters include edge node e iThe number of processor cycles C spent processing a unit of data j The edge node e j The processor power consumption η j The user device u i The processor cycle c to process 1 bit i The CPU power consumption η i of the user device
[0007] Step two: optimize the randomly generated parameter r in the Harris Hawk algorithm through the Logistic sequence strategy, and improve the Harris Hawk algorithm calculation fitness through the dynamic back learning strategy and evolution operator, and then determine the optimal individual according to the smoothing optimization algorithm;
[0008] Step three: judge whether the current iteration number reaches the maximum number, if the condition is met, the loop is interrupted, otherwise, the optimal individual is updated according to step two, and the following steps are executed;
[0009] Step four: calculate the prey escape energy |E| and the individual hunting grasp Sp, and refresh the individual position according to the values;
[0010] Step five: according to the prey escape energy |E| and the individual hunting grasp Sp value, judge how to change the stage and the strategy to be taken, determine whether the prey escape energy |E|≥1, if yes, return to step three, otherwise, judge the condition prey escape energy |E|≥0.5, if yes, judge the condition individual hunting grasp Sp≥0.5, if yes, enter step six, otherwise, enter step seven; Otherwise, judge the condition individual hunting grasp Sp≥0.5, if yes, enter step eight, otherwise, enter step nine;
[0011] Step six: refresh the individual position by the soft surrounding strategy and return to step three;
[0012] Step seven: refresh the individual position by the hard surrounding strategy and return to step three;
[0013] Step eight: refresh the individual position by the gradual rapid dive soft surrounding strategy and return to step three;
[0014] Step nine: refresh the individual position by the gradual rapid dive hard surrounding strategy and return to step three;
[0015] Step ten: output the optimal solution.
[0016] Further, in the information entropy model in step one, an information entropy parameter is set to increase the redundancy of user sensitive information tasks, so that the user's data becomes blurred, and malicious attacks cannot steal user sensitive information from the uninstallation to make inferences and judgments;
[0017] Let function f be an uncertain function that is negatively correlated with probability. The sum of the common uncertainties of the two signals is equal to the sum of their individual uncertainties, i.e., f(P1,P2)=f(P1)+f(P2). If function f satisfies the above two conditions, then it is a logarithmic function, as shown in formula (1).
[0018]
[0019] In the information source, all possible uncertainties must be considered. If the information source has n symbols: U1, U2, ..., U... n The probabilities are: p1, p2, ..., p n Furthermore, if the information sources do not interfere with each other, then the randomness of the information source needs to be transformed into the randomness of each symbol by -log p. i The overall mean (E) is defined as the information entropy, as shown in formula (2).
[0020]
[0021] Properties of information entropy:
[0022] (1) Continuity: H(X) = H(P) X ) in P X continuous;
[0023] (2) Monotonically increasing property: Let There are K discrete values for a random variable. g(·) reflects the entropy of information when the probabilities are equal. If A>B, then g(A)>g(B).
[0024] (3) Additivity: As shown in formula (3),
[0025] f(p1,…,p n )=f(p1+…+p M +…p n )+(p1+…+p M )*f(p′1,…,p′ M )#(3)
[0026] in
[0027] (4) The uniqueness of information entropy is determined by the above three properties;
[0028] In this model, each task i Each task is composed of different types of data, and each task is derived according to formulas (1), (2), and (3). i Information entropy H i As shown in formula (4),
[0029]
[0030] where, is the proportion of the kth information in the ith task, the negative sign in the bracket is because , the value of the log function in this domain is negative, and the information entropy of the local task is 0 because the local processing task does not involve information transmission.
[0031] Further, in step two, the parameter r generated randomly in the optimization of the Harris Hawk algorithm by the Logistic sequence strategy means that the original Harris Hawk algorithm generates a population using a random parameter r. Random generation can lead to excessive concentration or dispersion of individuals in the population, reducing population diversity and affecting algorithm convergence speed and optimization efficiency. The original parameter r is replaced by the Logistic sequence in the classical chaos theory. Due to the non-conflict of the chaotic sequence, this method can develop the population faster and more evenly than ordinary random. The strategy formula is as formula (5),
[0032] log(n+10=k*log(n)*(1-log(n))#(5)
[0033] where, log(n+1) represents the generated population of the next generation, log(n) represents the current population, and k is a random parameter that controls the chaotic effect by controlling r;
[0034] The calculation of fitness by the dynamic reverse learning strategy and evolutionary operator to improve the Harris Hawk algorithm means that the initialization of the original Harris Hawk algorithm is randomly generated, and the coverage area is low. Reverse learning can generate new areas in the initial stage, increase the number of initial solutions, and use dynamic reverse learning for improvement, as shown in formula (6),
[0035] X op =X init +k1*(k2*(lb+ub-X init )-X init )#(6)
[0036] where, X init represents an original solution, X op represents a generated reverse solution, k1 and k2 are random numbers with a value range of [0, 1], ub is the upper limit of the solution, and lb is the lower limit of the solution. By combining the two solutions, the search range is expanded.
[0037] The evolutionary operator is a common optimization method, which uses the current population optimal solution to speed up the search and reduce the risk of local optimum. The original algorithm uses two strategies in the exploration stage to launch a probability uniform distribution global search for the target prey. When the random number takes a smaller value, the individual starts to migrate according to its companions and the location of the target prey. When the random number takes a larger value, the individual will randomly inhabit a tree within the population range. The expression of this stage is as formula (7),
[0038]
[0039] Wherein, X(t), X(t+1) represent the current and next iteration position of Harris eagle respectively, t is the current iteration number, X rand (t) represents the randomly generated individual position, X rabbit (t) is the position of the prey, that is, the position of the individual with the optimal fitness, r1, r2, r3, r4, q are randomly generated parameters, the value range is [0, 1], Q parameter is used to help Harris eagle select action strategy, randomly generated, X m (t) is the average position of the eagle individual, expressed as formula (8),
[0040]
[0041] Wherein, X k (t) represents the position of the eagle individual at the kth iteration, M is the maximum evolution number of Harris eagle population;
[0042] The original algorithm adopts four different strategies in the development stage to simulate the hunting process of Harris eagles in nature. These strategies are divided into soft encirclement, gradual rapid dive soft encirclement, hard encirclement and gradual rapid dive hard encirclement. When the prey still has the opportunity to escape from the encirclement and has enough energy to avoid the pursuit, the Harris eagle will use the gradual rapid dive soft encirclement strategy, and constantly correct its position and direction according to the prey's counter tracking behavior, so as to use the best position to hunt the prey. This stage is implemented through two strategies, and another strategy will be used if the first strategy fails. The specific formula is as formula (9),
[0043]
[0044] Y=X rabbit (t)-E|JX rabbit (t)-X(t)|#(10)
[0045] Z=Y+S*LF(2)#(11)
[0046] Where f is the defined fitness function, E is the escape energy of the prey, S represents a 2-dimensional random vector, is a random parameter between [0,1], and LF is a mathematical expression representing the Levy flight strategy;
[0047] When the prey is exhausted and has insufficient energy to escape, but still has a chance, the Harris hawk will adopt a gradual rapid dive strategy to develop a hard enclosure to the prey. The position update method in this case is similar to the above gradual soft enclosure, and in this case, the predator tries to shorten the average distance between them and the prey, and the update is as formula (12),
[0048]
[0049] Y=X rabbit (t)-E|JX rabbit (t)-X m (t)|#(13)
[0050] Z=Y+S*LF(2)#(14)
[0051] In order to optimize the solution speed, two evolution operators are used for optimization. The first is to rewrite formula (7) in the exploration stage of the original algorithm as formula (15) by DE evolution operator,
[0052]
[0053] r=r0·2 λ #(16)
[0054]
[0055] Where r1, r2, r3, r4, r5 are random numbers between [0,1], λ is the weight coefficient, optimized by formula (16), t is the current iteration number, T is the maximum iteration number, and this operator can effectively control evolution and avoid premature affecting the final result;
[0056] The second is improved by Lv evolution operator, which has heavy-tailed properties and can evolve new individuals to reduce local optimum. The original algorithm's formula (11) and (14) are rewritten as formula (18) by Lv evolution operator,
[0057] Z=Y+Y×Lv(D)#(18)
[0058] Through the combination of these two ways, the solving effect of the algorithm is improved, and the solving speed is optimized;
[0059] The optimal individual determined according to the smoothing optimization algorithm refers to, in order to reduce the interference of abnormal solutions as much as possible, the improved Harris hawk algorithm uses the smoothing optimization algorithm to reduce the fluctuation abnormal value generated in the solving process, and the value after smoothing optimization is used to replace the original abnormal value, and the specific optimization method is as shown in formula (19),
[0060]
[0061] Wherein, λ is a weight coefficient, Is a new smoothing value, u k The abnormal value to be replaced, the sg function is used to judge the positive and negative of a number, and the algorithm is applicable to the case of lightning discount, and u k-1 , u k And u k+1 are used to describe the values before, during and after the anomaly, and finally the average value between three consecutive points is used to reduce the fluctuation amplitude.
[0062] Further, the judgment of how to change the stage and the strategy to be taken according to the escape energy |E| of the prey and the individual hunting grasp Sp value in step five, specifically includes: according to the hunting behavior of Harris hawk, the Harris hawk algorithm divides its hunting process into exploration behavior and development behavior, and the energy of the prey will be consumed in the process of avoiding the enemy and constantly escaping, so the escape energy of the prey is used to dynamically select exploration or development behavior for the next action, and the escape energy E of the prey is defined as formula (20),
[0063]
[0064] Wherein, E0 is the initial escape energy of the prey, which is a random number in the interval [-1, 1], t is the current evolution times, M is the maximum evolution times of Harris hawk population, when |E| >= 1, the individual changes to exploration stage, and when |E| < 1, the individual changes to development stage;
[0065] When the prey target is obtained, the Harris hawk will launch an attack, and the hawk population around the prey will launch a siege, wait for the opportunity to launch a surprise attack, and according to the specific situation that the surrounded prey may choose to escape from the encirclement, the Harris hawk algorithm adopts four different strategies of soft encirclement, gradual rapid dive soft encirclement, hard encirclement and gradual rapid dive hard encirclement to simulate the hunting link of Harris hawk in nature;
[0066] The algorithm defines the individual hunting grasp as Sp, which is a random number with a value range of (0, 1), which also reflects the escape opportunity of the prey. When Sp < 0.5, it means that the prey still has a chance to escape. Combined with the escape energy |E| of the prey and the escape probability Sp of the prey, the next action of the individual is determined:
[0067] a. When 0.5<=|E|<1 and Sp>=0.5, the individual adopts soft encirclement
[0068] At this time, the prey still has energy to escape, trying to jump randomly to escape the encirclement, at this time, the individual adopts the strategy of soft encirclement to exhaust it, and then launches a surprise attack, the update is as formula (21),
[0069] X(t+1) = ΔX(t) - E|JX rabbit (t) - X(t) |#(21)
[0070] Where, ΔX(t) = X rabbit (t) - X(t) represents the position distance between the hawk individual and the prey, J is the jumping strength of the prey, and the range is [0, 2];
[0071] b. When |E|<0.5 and Sp>=0.5, the individual adopts hard encirclement
[0072] At this time, the prey has insufficient energy to escape and loses the opportunity to escape, and the Harris hawk will launch a surprise attack on the prey through the hard encirclement strategy to complete the predation, and the update is as formula (22),
[0073] X(t+1) = X rabbit (t) - E|ΔX(t) |#(22);
[0074] c. When 0.5<=|E|<1 and Sp<0.5, the individual adopts soft encirclement of gradual rapid dive;
[0075] d. When |E|<0.5 and Sp<0.5, the individual adopts hard encirclement of gradual rapid dive.
[0076] Advantages and positive effects of the application:
[0077] The application mainly designs an edge computing task offloading method based on the Harris hawk optimization strategy, which overcomes the shortcomings of the original Harris hawk algorithm. The method considers that the original Harris hawk algorithm is randomly generated, the coverage area is low, and fluctuations occur in the solving process, and therefore introduces a dynamic reverse learning strategy and a smoothing optimization algorithm to optimize the original Harris hawk algorithm. Experiments show that the method can minimize the overhead under the condition of ensuring the chaotic state of user information, and effectively select the offloading mode that protects privacy. BRIEF DESCRIPTION OF DRAWINGS
[0078] Figure 1 is a graph of the relationship between the number of iterations and the time delay;
[0079] Figure 2 is a graph of the relationship between the number of iterations and the energy consumption;
[0080] Figure 3 is a graph of the number of iterations versus fitness;
[0081] Figure 4 is a graph of the number of users versus fitness;
[0082] Figure 5 is a graph of the number of users versus latency;
[0083] Figure 6 is a graph of the number of users versus energy consumption;
[0084] Figure 7 is a graph of the weight g versus fitness;
[0085] Figure 8 is a graph of the weight g versus information entropy;
[0086] Figure 9 is an actual scenario model graph;
[0087] Figure 10 is a graph of the number of iterations versus fitness in an actual scenario;
[0088] Figure 11 is a graph of the number of iterations versus latency in an actual scenario;
[0089] Figure 12 is a graph of the number of iterations versus energy consumption in an actual scenario;
[0090] Figure 13 is a flowchart of the edge computing task offloading method based on the Harris eagle optimization strategy. DETAILED DESCRIPTION
[0091] Embodiment 1
[0092] To verify the performance of the method in actual problems, this embodiment uses simulation experiments and field experiments to verify the algorithm effect.
[0093] Referring to the accompanying drawings, Figure 13 the edge computing task offloading method based on the Harris eagle optimization strategy of this embodiment mainly includes the following steps:
[0094] Step 1: initialize parameters, including the number of user devices U N, the number of MEC devices M, the maximum number of iterations T, task-related parameters (task name Tasks, task data size Ds), and task processing parameters (number of edge nodes e i , the number of processor cycles C j spent per unit data, the processor power consumption η j of the edge node e j , and the processor cycle c i of the user device u iThe CPU power consumption of the user equipment is η i ) and the like.
[0095] Step two: optimize the randomly generated parameter r in the Harris hawk algorithm through the Logistic sequence strategy, improve the Harris hawk algorithm calculation fitness through the dynamic back learning strategy and evolution operator, and then determine the optimal individual according to the smoothing optimization algorithm.
[0096] Step three: judge whether the current iteration number reaches the maximum number, if the condition is met, the loop is interrupted, otherwise, the optimal individual is updated according to step two, and the following steps are executed.
[0097] Step four: calculate the prey escape energy |E| and the individual hunting grasp Sp, and refresh the individual position according to the values.
[0098] Step five: judge how to change the stage and the strategy to be taken according to the prey escape energy |E| and the individual hunting grasp Sp value, determine whether the prey escape energy |E|≥1, if yes, return to step three, otherwise, judge the condition prey escape energy |E|≥0.5, if yes, judge the condition individual hunting grasp Sp≥0.5, if yes, enter step six, otherwise, enter step seven; otherwise, judge the condition individual hunting grasp Sp≥0.5, if yes, enter step eight, otherwise, enter step nine.
[0099] Step six: refresh the individual position by the soft surrounding strategy and return to step three.
[0100] Step seven: refresh the individual position by the hard surrounding strategy and return to step three.
[0101] Step eight: refresh the individual position by the gradual rapid dive soft surrounding strategy and return to step three.
[0102] Step nine: refresh the individual position by the gradual rapid dive hard surrounding strategy and return to step three.
[0103] Step ten: output the optimal solution.
[0104] Further, in the information entropy model of step one, the application sets an information entropy parameter to increase the redundancy of user sensitive information tasks, so that the user's data becomes blurred, and malicious attacks cannot steal user sensitive information from the uninstallation to make inferences.
[0105] Let the function f be an uncertain function, which is negatively related to the probability. The common uncertainty of two signals is equal to the sum of the respective accumulations, that is, f(P1, P2) = f(P1) + f(P2). If the function f satisfies the above two points, it is a logarithmic function, as shown in formula (1).
[0106]
[0107] All possible uncertainties must be considered in the information source. If the information source has n symbols: U1, U2, ..., U... n The probabilities are: p1, p2, ..., p n And they do not interfere with each other. In this case, the randomness of the information source needs to be transformed into the randomness of each symbol -log p i The overall mean (E) is defined as the information entropy, as shown in formula (2).
[0108]
[0109] Properties of information entropy:
[0110] (1) Continuity: H(X) = H(P) X ) in P X continuous.
[0111] (2) Monotonically increasing property: Let A random variable has K discrete values, and g(·) reflects the entropy of information when the probabilities are equal. If A>B, then g(A)>g(B).
[0112] (3) Additivity: as shown in formula (3).
[0113] f(p1,…,p n )=f(p1+…+p M +…p n )+(p1+…+p M )*f(p′1,…,p′ M )#(3)
[0114] in
[0115] (4) The uniqueness of information entropy can be determined by the above three properties.
[0116] In this model, each task i Each task is composed of different types of data, and each task is derived according to formulas (1), (2), and (3). i Information entropy H i As shown in formula (4).
[0117]
[0118] in, It represents the proportion of the k-th type of information in the i-th task. The negative sign in the parentheses is because... The value ranges from [0,1], and the log function's value is negative in this domain. Furthermore, since locally processed tasks do not involve information transmission, the information entropy of a local task is 0.
[0119] Further, in step two, the parameter r generated randomly in the Harris Hawk Optimization algorithm is optimized by the Logistic sequence strategy. The original Harris Hawk Optimization algorithm HHO uses a random parameter r to generate a population, and random generation may cause the individuals in the population to be too concentrated or dispersed, reducing population diversity and affecting the convergence speed and optimization efficiency of the algorithm. The Logistic sequence in classical chaos theory is selected to replace the original parameter r. Due to the non-conflict of the chaotic sequence, this method can develop the population faster and more evenly than ordinary random. The strategy formula is as formula (5).
[0120] log(n+1)=k*log(n)*(1-log(n))#(5)
[0121] Wherein, log(n+1) represents the population generated in the next generation, log(n) represents the current population, and k is a random parameter. By controlling r, the chaotic effect can be further controlled.
[0122] In step two, the fitness of the Harris Hawk algorithm is improved by the dynamic reverse learning strategy and the evolutionary operator. The initialization of the original HHO is randomly generated, and the coverage area is low. Reverse learning can generate new areas in the initial stage, increasing the number of initial solutions. The present application uses dynamic reverse learning for improvement, as shown in formula (6).
[0123] X op =X init +k1*(k2*(lb+ub-X init )-X init )#(6)
[0124] Wherein, X init represents an original solution, X op represents a generated reverse solution, k1 and k2 are random numbers with a value range of [0, 1], ub is the upper limit of the solution, and lb is the lower limit of the solution. By combining the two solutions, the search range is expanded.
[0125] The evolutionary operator is a commonly used optimization method, which can use the optimal solution of the current population to speed up the search and reduce the risk of local optimization. The original algorithm uses two strategies to launch a globally uniform search on the target prey in the exploration stage. When the random number takes a small value, the individual starts to migrate according to its companions and the location of the target prey; when the random number takes a large value, the individual will randomly inhabit a tree within the range of the population. The expression of this stage is as formula (7).
[0126]
[0127] Wherein, X(t), X(t+1) represent the current and next iteration positions of the Harris Hawk, t is the current iteration number, and X rand(t) represents the randomly generated individual position, X rabbit (t) is the position of the prey, i.e. the position of the individual with the best fitness, r1, r2, r3, r4, q are randomly generated parameters with values in the range [0, 1]. The Q parameter is used to help the Harris Hawks to select the action policy and is randomly generated. X m (t) is the average position of the hawk individuals, expressed as formula (8).
[0128]
[0129] where X k (t) represents the position of the hawk individuals at the kth iteration, M is the maximum number of evolution of the Harris Hawks population.
[0130] The original algorithm used four different strategies in the development phase to simulate the hunting phase of the Harris Hawks in nature, which can be divided into soft encirclement, gradual rapid dive soft encirclement, hard encirclement and gradual rapid dive hard encirclement. Among them, when the prey still has the opportunity to escape from the encirclement and has enough energy to avoid pursuit, the Harris Hawks will use the gradual rapid dive soft encirclement strategy, constantly correcting their own position and direction according to the prey's counter-tracking behavior, so as to use the best position to pursue the prey. This stage is implemented through two strategies, and the other strategy will be used if the first strategy fails, as shown in formula (9).
[0131]
[0132] Y = X rabbit (t) - E|JX rabbit (t) - X(t) # (10)
[0133] Z = Y + S*LF(2) # (11)
[0134] where f is the defined fitness function, E is the escape energy of the prey, S represents a 2-dimensional random vector, which is a random parameter between [0, 1], and LF is a mathematical expression representing the Levy flight strategy.
[0135] When the prey is exhausted and has insufficient energy to escape, but still has the opportunity, the Harris Hawks will use the gradual rapid dive strategy to encircle the prey hard. The position update method in this case is similar to the gradual soft encirclement described above. In this case, the hunter tries to close the average distance between them and the prey, and the update is as shown in formula (12).
[0136]
[0137] Y = X rabbit (t) - E|JX rabbit (t) - X m(t)|#(13)
[0138] Z=Y+S*LF(2)#(14)
[0139] In order to optimize the solving speed, two evolution operators can be used for optimization. The first is to rewrite formula (7) in the exploration stage of the original algorithm as formula (15) through the DE evolution operator.
[0140]
[0141] r=r0·2 λ #(16)
[0142]
[0143] Wherein, r1, r2, r3, r4, r5 are random numbers between [0, 1], λ is a weight coefficient, optimized through formula (16), t is the current iteration number, and T is the maximum iteration number. The operator can effectively control evolution and avoid premature influence on the final result.
[0144] The second is improved through the Lv evolution operator, and the mathematical prototype has the property of heavy tail, which can evolve new individuals and reduce local optimum. Therefore, formula (11) and (14) of the original algorithm are rewritten as formula (18) through the Lv evolution operator.
[0145] Z=Y+Y*Lv(D)#(18)
[0146] Through the combination of the two ways, the solving effect of the algorithm is improved, and the solving speed is optimized.
[0147] In step two, the optimal individual is determined according to the smoothing optimization algorithm. In order to reduce the interference of abnormal solutions as much as possible, the improved Harris Hawk Optimization Algorithm HPHHO proposed in the application uses a smoothing optimization algorithm to reduce the fluctuation of abnormal values generated in the solving process, and uses the value after smoothing optimization to replace the original abnormal value. The specific optimization method is as formula (19).
[0148]
[0149] Wherein, λ is a weight coefficient, is a new smoothing value, u k is an abnormal value to be replaced, and the sg function is used to judge the positive and negative of a number. The algorithm is suitable for the case of lightning discount, and uses u k-1 , u k and u k+1 to describe the values before, during and after the anomaly. Finally, the average value of three consecutive points is used to reduce the fluctuation amplitude.
[0150] Further, step five determines how to change the stage and the strategy to be taken according to the prey escape energy |E| and the individual hunting grasp Sp value. According to the Harris hawk's hunting behavior, the HHO algorithm divides its hunting process into exploration behavior and exploitation behavior, and the prey's energy will be consumed in the process of constantly escaping from the enemy, so the prey escape energy is used to dynamically select exploration or exploitation behavior for the next action. The definition of the prey escape energy E is as formula (20).
[0151]
[0152] Wherein, E0 is the initialized prey escape energy, which is a random number in the interval [-1, 1], t is the current evolution number, and M is the maximum evolution number of the Harris hawk population. When |E| >= 1, the individual changes to the exploration stage, and when |E| < 1, the individual changes to the exploitation stage.
[0153] When the prey target is obtained, the Harris hawk will launch an attack, and the hawk population will spread around the prey to wait for the opportunity to launch a surprise attack. The actual hunting link is more complex, for example, the surrounded prey may choose to escape from the encirclement, and the Harris hawk will also make necessary adjustments according to the prey behavior. Therefore, HHO adopts four different strategies to simulate the hunting link of the Harris hawk in nature. These strategies can be divided into soft encirclement, gradual rapid dive soft encirclement, hard encirclement, and gradual rapid dive hard encirclement.
[0154] The algorithm defines the individual hunting grasp as Sp, which is a random number with a value range of (0, 1), which also reflects the prey's escape opportunity. Sp < 0.5 indicates that the prey still has a chance to escape, and combined with the prey's remaining escape energy |E| and the prey's escape probability Sp, the individual's next action can be determined.
[0155] a. When 0.5 <= |E| < 1 and Sp >= 0.5, the individual adopts soft encirclement.
[0156] At this time, the prey still has energy to escape and tries to jump randomly to escape the encirclement, so the individual adopts the strategy of soft encirclement to exhaust it and launch a surprise attack, which is updated as formula (21).
[0157] X(t+1) = ΔX(t) - E|JX rabbit (t) - X(t) | # (21)
[0158] Wherein, ΔX(t) = X rabbit (t) - X(t) represents the position distance between the hawk individual and the prey, and J is the jump strength of the prey, ranging from [0, 2].
[0159] b. When |E| < 0.5 and Sp >= 0.5, the individual adopts hard encirclement.
[0160] At this time, the energy of the prey is not enough to escape, and the opportunity to escape is also lost, and the Harris hawk will launch a surprise attack on the prey by a hard encirclement strategy to complete the predation, as formula (22).
[0161] X(t+1)=X rabbit (t)-E|ΔX(t)|#(22)
[0162] c. When 0.5≤|E|<1 and Sp<0.5, the individual adopts a soft encirclement of gradual rapid dive.
[0163] d. When |E|<0.5 and Sp<0.5, the individual adopts a hard encirclement of gradual rapid dive
[0164] The soft encirclement of gradual rapid dive and the hard encirclement of gradual rapid dive have been described in detail above, and will not be expanded here.
[0165] The equipment and parameters of the unloading environment of the experiment are shown in Table 1:
[0166] Table 1 Parameter list
[0167]
[0168]
[0169] In this experiment, the whale optimization algorithm (WOA), artificial fish swarm algorithm (AFSA), quantum particle swarm algorithm (QPSO), chaotic quantum particle swarm algorithm (CQPSO) and HPHHO algorithm are compared.
[0170] (1) Algorithm convergence comparison: As shown in Figure 1 , Figure 2 and Figure 3 , this experiment compares the change trend of fitness, time delay and energy consumption of different algorithms with the increase of iteration number. It can be seen that the three values of the five algorithms decrease to different degrees with the increase of iteration, and the convergence performance of WOA algorithm is limited and cannot be well reduced; the final convergence effect of AFSA, QPSO and CQPSO algorithms is roughly the same, and the convergence effect of CQPSO is the best among the three, and the speed and stability are better; the mixed improved HHO has certain improvement in convergence performance compared with other algorithms, and can better balance each index.
[0171] (2) User number influence comparison: The size of the user scale will also affect the processing effect of the calculation task. In the actual factory environment, the scale of industrial equipment is large, which will increase the time delay and energy consumption of the processing task, and at the same time provide a large amount of data for malicious third parties to analyze, which may lead to user behavior being observed and privacy being leaked.
[0172] This experiment analyzes the change trend of fitness, latency and energy consumption of different algorithms as the number of users increases. From Figure 4 , Figure 5 and Figure 6 , it can be seen that during the increase of the number of users, each index is rising. Among them, when the number of users increases from 40 to 50, the latency and energy consumption have a large increase, but the fitness increases smoothly, indicating that the algorithm makes a large overhead on latency and energy consumption in order to balance the overall fitness, that is, to keep the information chaotic enough. On the other hand, it also reflects that the method of the present application can effectively select tasks to be processed locally or at the edge to protect user safety.
[0173] (3) Weight number influence comparison: In the algorithm, the weight g determines whether the system focuses more on resource consumption or information security, and the influence of g on the two is shown in the following figure. From Figure 7 and Figure 8 , with the continuous increase of g, the fitness is continuously decreasing, and the information entropy is also decreasing, but the overall decrease amplitude is continuously decreasing, that is, the information entropy decreases slower than the fitness, indicating that the algorithm focuses more on the degree of chaos, that is, the information entropy value, rather than the resource consumption. The fitness of the algorithm of the present application is lower, the information is more chaotic, and the overall better meets the needs of the problem model.
[0174] Referring to the attached Figure 9 , in order to test the performance of the algorithm in the actual scene, an industrial park is selected as the test environment of the problem model of the present application, and an edge server is set at each of the four directions of the intersection, and 200 user terminals are dispersedly set.
[0175] In order to verify the privacy protection effect of the algorithm of the present application in reality, this section also selects WOA, AFSA, QPSO, CQPSO and the HPHHO algorithm proposed by the present application for comparison to investigate their performance in actual scene.
[0176] From Figure 10 , Figure 11 and Figure 12 , it can be seen that with the increase of iterations, the fitness, time and energy consumption are continuously decreasing and optimizing, and the five algorithms all show that they play a role in the model of the present application, but WOA has insufficient optimization effect and converges the slowest; the effect of AFSA, QPSO and CQPSO algorithms is better than that of WOA; the algorithm proposed by the present application converges faster and the three indexes are better, and basically reaches the optimum at about 300 times. In addition, compared with simulation, the actual test has degradation in each standard, which is due to the more complex actual environment, but the overall change is not large.
[0177] By simulation and field experiment, it can be obtained that the application can reduce the consumption of resources as much as possible under the condition of ensuring information confusion, and can solve the fixed equipment task offloading problem in the factory and the information security problem caused by data transmission in offloading due to other algorithms.
Claims
1.A method for edge computing task offloading based on a Harris hawk optimization strategy, characterized in that The method comprises the following steps: Step one: initialize parameters and establish information entropy model, including the number of user equipment N, the number of MEC equipment M, the maximum number of iterations T, task related parameters, task processing parameters; wherein, the task related parameters include: task name Tasks, the data size of the task Ds, the task processing parameters include: the processor power consumption of the edge node e i The number of processor cycles C spent per unit of data j The processor power consumption of the edge node e j The processor power consumption of the edge node e j The processor power consumption of the edge node e i The processor power consumption of the edge node e i The processor power consumption of the edge node e i ; Step two: optimizing the randomly generated parameter r in the Harris hawk algorithm through a Logistic sequence strategy, improving the Harris hawk algorithm calculation fitness through a dynamic reverse learning strategy and evolutionary operator, and then determining the optimal individual according to a smoothing optimization algorithm; Step three: determining whether the current iteration number reaches the maximum number, and if the condition is met, the loop is interrupted, otherwise, the optimal individual is updated according to step two, and the following steps are executed; Step four: calculating the prey escape energy |E| and the individual hunting grasp Sp, and refreshing the individual position according to the values; Step five: determining how to change the stage and the strategy to be taken according to the prey escape energy |E| and the individual hunting grasp Sp value, determining whether the prey escape energy |E| is greater than or equal to 1, if yes, returning to step three, otherwise, determining whether the prey escape energy |E| is greater than or equal to 0.5, if yes, determining whether the individual hunting grasp Sp is greater than or equal to 0.5, if yes, entering step six, otherwise, entering step seven; otherwise, determining whether the individual hunting grasp Sp is greater than or equal to 0.5, if yes, entering step eight, otherwise, entering step nine; Step six: refreshing the individual position by the soft surrounding strategy and returning to step three; Step seven: refreshing the individual position by the hard surrounding strategy and returning to step three; Step eight: refreshing the individual position by the gradual rapid dive soft surrounding strategy and returning to step three; Step nine: refreshing the individual position by the gradual rapid dive hard surrounding strategy and returning to step three; Step ten: outputting the optimal solution. 2.The edge computing task offloading method based on the Harris hawk optimization strategy of claim 1, wherein, In the information entropy model of step one, an information entropy parameter is set to increase the redundancy of user sensitive information tasks, so that the user's data becomes blurred, and malicious attacks cannot steal user sensitive information from the uninstallation to make inferences; Let f be an uncertain function, which is negatively related to probability, and the common uncertainty of two signals is equal to the sum of the respective accumulations, that is, f(P1, P2) = f(P1) + f(P2), if the function f satisfies the above two points, it is a logarithmic function, as shown in formula (1), In the information source, all possible uncertainties must be considered. If the information source has n symbols: U1, U2, ..., U... n The probabilities are: p1, p2, ..., p n Furthermore, if the information sources do not interfere with each other, then the randomness of the information source needs to be transformed into the randomness of each symbol by -logp. i The overall mean (E) is defined as the information entropy, as shown in formula (2). Properties of information entropy: (1) continuity: H(X) = H(P X ) in P X continuity; (2) Monotonicity: Let The discrete values of the random variable have K in common, and g(·) reflects the uniformity of the likelihood. If A > B, then g(A) > g(B). (3) Additivity: as shown in formula (3), f(p1,...,p n ) = f(p1+...+p M +...p n ) + (p1+...+p M )*f(p'1,...,p' M ) # (3) wherein (4) The uniqueness of information entropy is determined by the above three properties; In the present model, each task task i is composed of different types of data, and the information entropy H i of each task task i is obtained according to formula (1), formula (2) and formula (3), as shown in formula (4), where, is the proportion of the kth information in the ith task, the negative sign in the bracket is because takes value [0, 1], the value of the log function in this domain is negative, and in addition, since the local processing task does not involve information transmission, the information entropy of the local task is 0. 3.The edge computing task offloading method based on the Harris hawk optimization strategy of claim 1, wherein, In step two, the random generated parameter r in the Harris hawk algorithm optimized by the Logistic sequence strategy refers to that the original Harris hawk algorithm uses a random parameter r to generate a population, and the random generation can lead to excessive concentration or dispersion of individuals in the population, reduce population diversity, and affect the convergence speed and optimization efficiency of the algorithm. Replace the original parameter r with the Logistic sequence in the classical chaos theory. Due to the non-conflict of the chaotic sequence, this method can develop the population more quickly and evenly compared to ordinary random. The strategy formula is as follows: log(n+1)=k*log(n)*(1-log(n))#(5) Where, log(n+1) represents the next generation of population, log(n) represents the current population, and k is a random parameter, which further controls the chaotic effect by controlling r. The dynamic reverse learning strategy and evolution operator improve the Harris hawk algorithm calculation fitness, the initialization of the original Harris hawk algorithm is randomly generated, the coverage area is low, and the reverse learning can generate new areas in the initial stage, increase the number of initial solutions, and use dynamic reverse learning for improvement, as shown in formula (6), X op = X init + k1*(k2*(lb+ub-X init ) - X init ) # (6) where X init represents an original solution, X op represents a generated inverse solution, k1 and k2 are random numbers with a value range of [0, 1], ub is an upper bound of the solution, and lb is a lower bound of the solution, and the search range is expanded by merging the two solutions; The evolution operator is a common optimization method, which uses the current population optimal solution to speed up the search and reduce the risk of local optimization, the original algorithm uses two strategies in the exploration stage to launch a global search with a uniform distribution of probability to the target prey, when the random number is small, the individual starts to migrate according to its companions and the location of the target prey; When the random number is large, the individual will randomly inhabit a tree within the population range, the expression of this stage is formula (7), where X(t) and X(t+1) represent the position of Harris Hawk before and after the next iteration, respectively, t is the current iteration number, X rand (t) represents the randomly generated individual position, X rabbit (t) is the position of the prey, i.e., the position of the individual with the best fitness, r1, r2, r3, r4, and q are randomly generated parameters with a value range of [0, 1], and Q is a parameter used to help the Harris Hawk select an action strategy, which is randomly generated, X m (t) is the average position of the hawk individual, which is expressed as formula (8). wherein X k (t) denotes the position of the hawk individual at the kth iteration, M is the maximum number of generations of the Harris hawk population; The original algorithm uses four different strategies in the development stage to simulate the hunting process of Harris hawks in nature, which are soft encirclement, gradual rapid dive soft encirclement, hard encirclement and gradual rapid dive hard encirclement, when the prey still has the opportunity to escape and has enough energy to avoid pursuit, the Harris hawk will use the gradual rapid dive soft encirclement strategy, and constantly correct its position and direction according to the prey's counter-tracking behavior, so as to use the best position to hunt the prey, this stage is implemented through two strategies, if the first strategy fails, the other strategy will be used, as shown in formula (9), Y = X rabbit (t)-E|JX rabbit (t)-X(t)|#(10) Z=Y+S*LF(2)#(11) Where f is the defined fitness function, E is the escape energy of the prey, S represents a 2-dimensional random vector, which is a random parameter between [0,1], and LF is a mathematical expression representing the Levy flight strategy; When the prey is exhausted and has insufficient energy to escape, but still has the opportunity, the Harris hawk will use the gradual rapid dive strategy to encircle the prey, the position updating method in this case is similar to the above gradual soft encirclement, in this case, the hunter tries to shorten the average distance between them and the prey, the update is as formula (12), Y = X rabbit (t)-E|JX rabbit (t)-X m (t)|#(13) Z=Y+S*LF(2)#(14) In order to optimize the solution speed, two evolution operators are used for optimization, the first is to rewrite formula (7) in the exploration stage of the original algorithm to formula (15) through the DE evolution operator, r=r0·2 λ #(16) Where r1, r2, r3, r4, r5 are random numbers between [0,1], λ is the weight coefficient, optimized by formula (16), t is the current iteration number, T is the maximum iteration number, this operator can effectively control evolution and avoid premature effects on the final result; The second is improved by Lv evolution operator, which has heavy-tailed properties and can evolve new individuals, reduce local optimization, rewrite formula (11) and (14) of the original algorithm to formula (18) through the Lv evolution operator, Z=Y+Y*Lv(D)#(18) Through the combination of these two ways, the algorithm solving effect is improved, and the solving speed is optimized; The optimal individual is determined according to the smoothing optimization algorithm, that is, in order to reduce the interference of abnormal solutions as much as possible, the improved Harris hawk algorithm uses the smoothing optimization algorithm to reduce the fluctuation abnormal value generated in the solving process, and the value after smoothing optimization is used to replace the original abnormal value, and the specific optimization method is shown in formula (19), where λ is the weight coefficient, is the new smoothed value, u k is the abnormal value to be replaced, the sg function is used to determine the positive and negative of a number, and this algorithm is applicable to the case of lightning discount, and u k-1 , u k and u k+1 are used to describe the values before, during and after the anomaly, and finally the average value between three consecutive points is used to reduce the fluctuation range. 4.The edge computing task offloading method based on the Harris hawk optimization strategy of claim 1, wherein, The judgment of how to change the stage and the strategy to be taken according to the escape energy |E| of the prey and the individual hunting grasp Sp value in step five specifically includes: according to the hunting behavior of Harris hawk, the Harris hawk algorithm divides its hunting process into exploration behavior and development behavior, and the energy of the prey will be consumed in the process of escaping from the predator, so the escape energy of the prey is used to dynamically select the exploration or development behavior for the next action, and the definition of the escape energy E of the prey is shown in formula (20), Wherein, E0 is the initial escape energy of the prey, which is a random number in the interval [-1, 1], t is the current evolution times, and M is the maximum evolution times of the Harris hawk population, when |E| >= 1, the individual changes to the exploration stage, and when |E| < 1, the individual changes to the development stage; After obtaining the prey target, the Harris hawk will launch an attack, and the hawk population around the prey will launch a siege, waiting for the opportunity to launch a surprise attack, and according to the specific situation that the surrounded prey may choose to escape from the encirclement, the Harris hawk algorithm adopts four different strategies of soft encirclement, gradual rapid dive soft encirclement, hard encirclement and gradual rapid dive hard encirclement to simulate the hunting link of the Harris hawk in nature; The individual hunting grasp is defined as Sp, which is a random number with a value range of (0, 1), which also reflects the escape opportunity of the prey, and Sp < 0.5 indicates that the prey still has the opportunity to escape, and the escape energy |E| of the prey and the escape probability Sp of the prey are combined to determine the next action of the individual: a. When 0.5 <= |E| < 1 and Sp >= 0.5, the individual adopts soft encirclement At this time, the prey still has energy to escape, and tries to jump randomly to escape from the encirclement, at this time, the individual adopts the strategy of soft encirclement to make it exhausted, so as to launch a surprise attack, and the update is shown in formula (21), X(t + 1) = ΔX(t) - E|JX rabbit (t) - X(t) |#(21) where ΔX(t) = X rabbit (t) - X(t) represents the position distance between the hawk individual and the prey, and J is the jump strength of the prey, ranging from [0, 2]; b. When |E| < 0.5 and Sp >= 0.5, the individual adopts hard encirclement At this time, the energy of the prey is not enough to escape, and the prey also loses the opportunity to escape, so the Harris hawk will launch a surprise attack on the prey through the hard encirclement strategy to complete the hunting, and the update is shown in formula (22), X(t + 1) = X rabbit (t) - E | AX(t) | # (22); c. When 0.5 <= |E| < 1 and Sp < 0.5, the individual adopts gradual rapid dive soft encirclement; d. When |E| < 0.5 and Sp < 0.5, the individual adopts gradual rapid dive hard encirclement.