Task offloading scheduling method and device
By improving the firefly population update rules and simulated annealing algorithm, the local optimization problem of the firefly algorithm in the integrated environment of cloud computing and edge computing is solved, achieving lower energy consumption task offloading and scheduling, and improving system performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA MOBILE GROUP JIANGSU
- Filing Date
- 2022-03-21
- Publication Date
- 2026-04-21
AI Technical Summary
In existing technologies, the Firefly algorithm cannot effectively escape local optimization in a cloud computing and edge computing convergence environment, resulting in high system energy consumption and the inability to find a better task offloading and scheduling scheme.
An improved firefly population update rule is adopted, combined with the idea of simulated annealing algorithm, and a mechanism for accepting poor solutions with probability is introduced. By using the linear movement of the firefly position vector and the simulated annealing acceptance criterion, the firefly position is updated to escape local extrema and find a better task unloading scheduling scheme.
It effectively reduces system energy consumption, improves the efficiency of task unloading and scheduling, avoids local optimization, and finds the global optimal solution.
Smart Images

Figure CN116820698B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud computing and edge computing convergence technology, specifically to a task offloading and scheduling method and apparatus. Background Technology
[0002] In a converged cloud computing and edge computing environment, the uninstallation of mobile applications by users is moved to an edge server or cloud server. Considering the uninstallation time constraints and the goal of minimizing energy consumption, it is necessary to determine the uninstallation order and location of mobile applications.
[0003] Existing technologies use the firefly algorithm to find the optimal scheduling for uninstalling mobile applications. The uninstallation order of mobile applications is used as the population of individuals in the firefly algorithm. The system energy consumption value is correlated with the brightness of individual fireflies. By simulating the behavior of fireflies moving towards brighter individuals, the optimal scheduling scheme for uninstalling mobile applications is determined.
[0004] However, this scheme uses a location mapping method to map the seed sequence of individual fireflies based on the current optimal solution to the uninstallation order of mobile applications. When the algorithm is unable to update the current optimal solution, this mapping method also cannot obtain a new solution, and the algorithm gets stuck in local optimization, resulting in high system energy consumption.
[0005] Application content
[0006] To address the aforementioned problems in the existing technology, this application provides a task offloading and scheduling method and apparatus.
[0007] Firstly, this application provides a task offloading and scheduling method, including:
[0008] The initial uninstallation sequence of multiple mobile applications to be uninstalled in a cloud-edge collaborative environment is obtained, a task uninstallation scheduling model is constructed, and an objective function is generated. The initial uninstallation sequence is determined based on the ascending order of the total computational workload of each mobile application. The task uninstallation scheduling model is an optimization model that allocates uninstallation positions to mobile applications with the goal of minimizing the total system energy consumption and the uninstallation deadline as a constraint.
[0009] The initial position vector of the fireflies is randomly set based on the initial unloading sequence, and the initial optimal scheduling solution sequence is determined based on the shortest task priority principle.
[0010] Execute a target iteration process, the target iteration process including:
[0011] The solution sequence of the firefly is determined based on the probability function of each position component of the firefly's position vector.
[0012] The optimal solution sequence in the current firefly population is determined based on the fitness value corresponding to the solution sequence of each firefly; the fitness value is determined based on the optimal unloading position corresponding to the solution sequence of the firefly.
[0013] The difference between the fitness value of the current optimal scheduling solution sequence and the fitness value of the optimal solution sequence in the current firefly population is determined. Based on the difference and the simulated annealing acceptance criterion, the optimal scheduling solution sequence of the current firefly population is determined. The current optimal scheduling solution sequence is the optimal scheduling solution sequence of the previous generation of firefly population.
[0014] If the preset number of iterations has not been reached, the position vector of each firefly is updated based on the update formula of the linear movement of all fireflies toward the firefly with the highest brightness, and the current temperature is cooled according to the cooling function of the simulated annealing acceptance criterion. If the preset number of iterations has been reached, the optimal scheduling solution sequence of the current firefly population in the last target iteration is determined as the optimal uninstallation order of the multiple mobile applications.
[0015] Optionally, the objective function satisfies:
[0016] E = E device +E server +E cloud
[0017] Where E represents the total energy consumption of the system, E device E represents the energy consumption of mobile device transmission. server E represents the energy consumption generated by the edge server. cloud This indicates the energy consumption generated by the cloud server.
[0018] Optionally, the determination of the firefly's solution sequence based on the probability function of each position component of the firefly's position vector includes:
[0019] Initialize the first empty solution sequence and the second empty solution sequence;
[0020] The probability of each position component of the firefly's position vector is determined based on the probability function.
[0021] For each position component of the firefly's position vector, take a first random number and determine the relationship between the probability and the first random number. When the probability is greater than the first random number, add the mobile application at the corresponding position in the current optimal scheduling solution sequence to the first empty solution sequence.
[0022] When the probability is less than the first random number, the mobile application at the corresponding position in the current optimal scheduling solution sequence is added to the second empty solution sequence;
[0023] The mobile applications in the second empty solution sequence are added to the empty positions in the first empty solution sequence with uniform probability to obtain the solution sequence of the firefly.
[0024] Optionally, the probability function satisfies:
[0025]
[0026] Where Xil represents the l-th position component of the i-th firefly, and ρ represents the probability of the l-th position component of the i-th firefly.
[0027] Optionally, determining the optimal solution sequence in the current firefly population based on the fitness value corresponding to the solution sequence of each firefly includes:
[0028] With minimizing the objective function as the optimization objective and the uninstallation deadline as the constraint, the optimal uninstallation position of each mobile application under the uninstallation order corresponding to the solution sequence of Firefly is determined.
[0029] The fitness value of the firefly's solution sequence is determined based on the optimal unloading position corresponding to the solution sequence of the firefly.
[0030] The solution sequence of the firefly with the highest fitness value is determined as the optimal solution sequence in the current firefly population.
[0031] Optionally, determining the optimal scheduling solution sequence for the current firefly population based on the difference and the simulated annealing acceptance criterion includes:
[0032] Determine the difference in fitness values between the current optimal scheduling solution sequence and the optimal solution sequence in the current firefly population;
[0033] When the difference is less than 0, the optimal scheduling solution sequence of the current firefly population is determined to be the optimal solution sequence in the current firefly population.
[0034] When the difference is greater than 0, the acceptance probability of the worse solution sequence in the current firefly population is determined based on the simulated annealing acceptance criterion.
[0035] If the acceptance probability is greater than the second random number, then the optimal scheduling solution sequence of the current firefly population is determined to be the optimal solution sequence in the current firefly population.
[0036] If the acceptance probability is less than the second random number, then the optimal scheduling solution sequence for the current firefly population is determined as the current optimal scheduling solution sequence.
[0037] Optionally, the determination of the acceptance probability of the poor solution sequence in the current firefly population based on the simulated annealing acceptance criterion satisfies the following calculation formula:
[0038]
[0039] Where p represents the acceptance probability, k represents the Boltzmann constant, dE represents the difference in fitness between the current optimal scheduling solution sequence and the current optimal solution sequence in the firefly population, and T represents the initial temperature.
[0040] Optionally, the update formula based on the linear movement of all fireflies towards the firefly with the highest brightness updates the position vector of each firefly, satisfying the following calculation formula:
[0041]
[0042] Where, X′ i Let X represent the updated position vector of the i-th firefly. i Let represent the position vector of the i-th firefly that has not been updated, and β0 represent the original attraction of the firefly. Let represent the position vector of the firefly with the highest brightness, α represent the randomization parameter, and ε represent the second random number uniformly distributed in [0,1].
[0043] Secondly, this application provides a task offloading scheduling apparatus, comprising:
[0044] The acquisition module is used to acquire the initial uninstallation sequence of multiple mobile applications to be uninstalled in the cloud-edge collaborative environment, construct a task uninstallation scheduling model and generate an objective function; the initial uninstallation sequence is determined based on the total computational workload of each mobile application in ascending order; the task uninstallation scheduling model is an optimization model that allocates uninstallation positions to mobile applications with the goal of minimizing the total system energy consumption and the uninstallation deadline as a constraint.
[0045] The determination module is used to randomly set the initial position vector of the fireflies based on the initial unloading sequence and determine the initial optimal scheduling solution sequence, which is determined based on the shortest task priority principle.
[0046] An iteration module is used to execute a target iteration process, the target iteration process including:
[0047] The solution sequence of the firefly is determined based on the probability function of each position component of the firefly's position vector.
[0048] The optimal solution sequence in the current firefly population is determined based on the fitness value corresponding to the solution sequence of each firefly; the fitness value is determined based on the optimal unloading position corresponding to the solution sequence of the firefly.
[0049] The difference between the fitness value of the current optimal scheduling solution sequence and the fitness value of the optimal solution sequence in the current firefly population is determined. Based on the difference and the simulated annealing acceptance criterion, the optimal scheduling solution sequence of the current firefly population is determined. The current optimal scheduling solution sequence is the optimal scheduling solution sequence of the previous generation of firefly population.
[0050] If the preset number of iterations has not been reached, the position vector of each firefly is updated based on the update formula of the linear movement of all fireflies toward the firefly with the highest brightness, and the current temperature is cooled according to the cooling function of the simulated annealing acceptance criterion. If the preset number of iterations has been reached, the optimal scheduling solution sequence of the current firefly population in the last target iteration is determined as the optimal uninstallation order of the multiple mobile applications.
[0051] Thirdly, this application provides an electronic device, including a memory and a memory storing a computer program, wherein the processor executes the program to implement the steps of the task offloading and scheduling method described in the first aspect.
[0052] Fourthly, this application provides a processor-readable storage medium storing a computer program for causing the processor to perform the steps of the task offloading scheduling method described in the first aspect.
[0053] The task offloading scheduling method and apparatus provided in this application, referencing the idea in the simulated annealing algorithm of accepting a poor solution with a certain probability, design an improved firefly population update rule to help escape local extrema, find a better task offloading scheduling scheme, and further reduce energy consumption. Attached Figure Description
[0054] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0055] Figure 1 This is one of the flowcharts illustrating the task unloading and scheduling method provided in the embodiments of this application;
[0056] Figure 2 This is a second flowchart illustrating the task unloading and scheduling method provided in the embodiments of this application;
[0057] Figure 3 This is a flowchart illustrating the updated optimal solution sequence based on the simulated annealing acceptance criterion provided in an embodiment of this application.
[0058] Figure 4 This is a schematic diagram of the structure of the task unloading and scheduling device provided in the embodiments of this application;
[0059] Figure 5 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0060] To better describe the technical solutions in the embodiments of this application, relevant knowledge is introduced below.
[0061] (1) Cloud computing and edge computing
[0062] With the rapid development of the internet, the amount of data that mobile smart devices need to process is constantly increasing. The limited battery storage and memory space on mobile devices have become important factors restricting the timely processing of intensive applications and affecting user experience.
[0063] To overcome these challenges, cloud computing emerged. Cloud computing provides powerful cloud services and data storage platforms, possesses vast computing resources, and can reduce the execution time of mobile applications and the energy consumption of mobile devices. However, due to the long distance between cloud servers and mobile devices, uninstalling mobile applications to remote cloud servers consumes significant network bandwidth, resulting in data latency and energy consumption issues.
[0064] Edge computing involves migrating some of the computing and storage capabilities of remote cloud servers to edge servers. Edge servers are closer to the data source, reducing network load and latency caused by data transmission, thus improving user experience. However, compared to cloud servers, edge computing servers have limited resources. When mobile users experience a surge in tasks, they may not be able to meet all computing demands in a timely manner, causing some mobile applications to experience longer wait times.
[0065] Therefore, executing mobile users' task requests through collaboration between cloud servers and edge servers can better improve the user experience.
[0066] (2) Uninstalling mobile applications
[0067] In hybrid cloud and edge computing environments, users uninstall mobile applications (MA) to edge servers or cloud servers. Considering uninstallation time constraints and the goal of minimizing energy consumption, it is necessary to determine the uninstallation order and location of mobile applications. Current methods often employ metaheuristic algorithms for global optimization, optimizing the uninstallation of mobile applications while ensuring latency.
[0068] (3) Firefly Algorithm
[0069] The Firefly Algorithm is a novel metaheuristic algorithm that simulates the behavior of firefly swarms in nature. The algorithm works by simulating fireflies moving towards the brightest individual in the swarm, thus finding the optimal solution. Existing techniques applying the Firefly Algorithm to find the optimal scheduling for mobile application uninstallation treat the uninstallation order of mobile applications as individuals in the firefly population, correlate the system energy consumption of the optimization objective with the brightness of individual fireflies, and obtain the optimal scheduling for mobile application uninstallation by simulating the behavior of fireflies moving towards brighter individuals.
[0070] In this scheme, a location mapping method is used to map the seed sequence of individual fireflies based on the current optimal solution to the uninstallation order of mobile applications. If the algorithm is unable to update the current optimal solution, the mapping method will also be unable to obtain a new solution. At this time, the algorithm gets stuck in local optimization and will be unable to further reduce energy consumption.
[0071] To address the aforementioned problems in the existing technology, this application provides a task offloading scheduling method and apparatus. Referring to the idea in the simulated annealing algorithm of accepting a poor solution with a certain probability, an improved firefly population update rule is designed to help escape local extrema, find a better task offloading scheduling scheme, and further reduce energy consumption.
[0072] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0073] Figure 1 This is one of the flowcharts illustrating the task unloading and scheduling method provided in the embodiments of this application, such as... Figure 1 As shown in the figure, this application provides a task offloading and scheduling method, which includes at least the following steps:
[0074] Step 101: Obtain the initial uninstallation sequence of multiple mobile applications to be uninstalled in the cloud-edge collaborative environment, construct a task uninstallation scheduling model and generate an objective function; the initial uninstallation sequence is determined based on the ascending order of the total computational workload of each mobile application; the task uninstallation scheduling model is an optimization model that allocates uninstallation positions to mobile applications with the goal of minimizing the total system energy consumption and the uninstallation deadline as a constraint.
[0075] Specifically, first, the mobile applications to be uninstalled are obtained and their relevant parameters are initialized. Multiple mobile applications to be uninstalled, along with their relevant parameters, are obtained. These parameters include the data volume of each mobile application and the CPU computational workload per unit of data processed. The total computational workload required for each mobile application is calculated based on these parameters. The total computational workload for each mobile application is determined according to the following formula:
[0076] w i =d i ×c i
[0077] Among them, w i d represents the total computational workload of the i-th mobile application. i c represents the amount of data for the i-th mobile application. i This represents the CPU computational workload for processing a unit of data.
[0078] The mobile applications are sorted in ascending order based on their total computational workload to determine the initial uninstall sequence for the multiple mobile applications.
[0079] Then, a task offloading scheduling model is constructed. This model aims to minimize the total system energy consumption and uses the offloading deadline as a constraint to allocate the offloading order and location for mobile applications. The objective function is the total system energy consumption, which consists of three parts: the energy consumption generated by mobile devices, the energy consumption generated by edge servers, and the energy consumption generated by cloud servers.
[0080] Step 102: Randomly set the initial position vector of the fireflies based on the initial unloading sequence and determine the initial optimal scheduling solution sequence, which is determined based on the shortest task priority principle.
[0081] Specifically, the firefly population is initialized by randomly generating multiple fireflies and randomly setting the initial position vector of the fireflies. The dimension of the initial position vector of the fireflies is the same as the total number of mobile applications to be uninstalled.
[0082] In this embodiment, the initial position vectors of fireflies are randomly set, and the optimal solution sequence is searched from them. The initial optimal scheduling solution sequence for the first generation of firefly population is generated using the Shortest Task First (STF) principle.
[0083] Step 103: Execute the target iteration process, which includes: determining the solution sequence of fireflies based on the probability function of each position component of the firefly's position vector; determining the optimal solution sequence in the current firefly population based on the fitness value corresponding to the solution sequence of each firefly; the fitness value is determined based on the optimal unloading position corresponding to the solution sequence of the firefly; determining the difference between the fitness value of the current optimal scheduling solution sequence and the fitness value of the optimal solution sequence in the current firefly population, and determining the optimal scheduling solution sequence of the current firefly population based on the difference and the simulated annealing acceptance criterion; the current optimal scheduling solution sequence is the optimal scheduling solution sequence of the previous generation of firefly population; determining whether a preset number of iterations has been reached; if the preset number of iterations has not been reached, updating the position vector of each firefly based on the update formula of all fireflies moving linearly towards the firefly with the highest brightness, and cooling the current temperature according to the cooling function of the simulated annealing acceptance criterion; if the preset number of iterations has been reached, determining the optimal scheduling solution sequence of the current firefly population in the last target iteration process as the optimal unloading order of the multiple mobile applications.
[0084] Specifically, for each firefly in the current firefly population, the probability function is used to determine the relationship between the probability of each position component of the firefly's position vector and the size of the random number, thus determining the firefly's solution sequence, instead of directly arranging each position component in ascending order and mapping it to the uninstallation order of mobile applications.
[0085] After determining the solution sequence for each firefly in the current firefly population, for each firefly solution sequence, with minimizing the total system energy consumption as the optimization objective and the unloading deadline as the constraint, determine the optimal unloading location for each mobile application in the unloading order corresponding to the solution sequence. The unloading location is either a cloud server or an edge server.
[0086] The total system energy consumption for each firefly is determined by its solution sequence and corresponding optimal unloading position. This information is then used to further assess the fitness value of each firefly's solution sequence. A lower total system energy consumption indicates a higher fitness value; conversely, a higher total system energy consumption indicates a lower fitness value.
[0087] The solution sequence of the firefly with the highest fitness value is taken as the optimal solution sequence in the current firefly population.
[0088] To avoid the firefly algorithm getting trapped in local optima, the idea of accepting worse solutions, as in the simulated annealing algorithm, is introduced. The difference in fitness values between the current optimal scheduling solution sequence and the optimal solution sequence in the current firefly population is determined, and the optimal scheduling solution sequence for the current firefly population is determined based on this difference. The current optimal scheduling solution sequence is the optimal scheduling solution sequence of the previous generation of firefly populations.
[0089] If the fitness value of the optimal solution sequence in the current firefly population is higher, then the optimal scheduling solution sequence for the current firefly population is determined as the optimal solution sequence for the current firefly population. If the fitness value of the optimal scheduling solution sequence in the previous generation of firefly population is higher, then the acceptance probability of the worse solution sequence in the current firefly population is determined according to the simulated annealing acceptance principle. Based on this acceptance probability, the optimal scheduling solution sequence for the current firefly population is determined as either the optimal solution sequence for the current firefly population or the optimal scheduling solution sequence for the previous generation of firefly population.
[0090] If the preset number of iterations has not been reached, the position vectors of each firefly are updated based on the update formula for the linear movement of all fireflies towards the firefly with the highest brightness, and the current temperature is cooled according to the cooling function of the simulated annealing acceptance criterion to complete the mutation of the firefly population; if the preset number of iterations has been reached, the optimal scheduling solution sequence of the current firefly population in the last target iteration is determined as the optimal uninstallation order of multiple mobile applications.
[0091] In the traditional firefly algorithm, the firefly ψ i The position update formula is:
[0092]
[0093] Where β0 represents the firefly's primal attraction, γ represents the light absorption coefficient, and r ij Let represent the Euclidean distance between two fireflies, α represent the randomization parameter, and ε represent a random number uniformly distributed in [0,1]. This represents randomization of the random search, allowing the firefly to move randomly within a certain range. (Firefly ψ) i I need to update my location X multiple times. i X towards every individual brighter than itself j Movement, due to frequent calculations of r ij This results in a significant increase in computation time.
[0094] In this embodiment of the application, the brightest individual firefly in each generation of firefly population is identified. This causes all fireflies to gravitate towards the brightest individual firefly during the next generation population update. The time and computational load for moving and updating firefly positions are greatly reduced.
[0095] The task offloading scheduling method provided in this application, referencing the idea in the simulated annealing algorithm of accepting a poor solution with a certain probability, designs an improved firefly population update rule to help escape local extrema, find a better task offloading scheduling scheme, and further reduce energy consumption.
[0096] Optionally, the update formula based on the linear movement of all fireflies towards the firefly with the highest brightness updates the position vector of each firefly, satisfying the following calculation formula:
[0097]
[0098] Where, X′ i Let X represent the updated position vector of the i-th firefly. i Let represent the position vector of the i-th firefly that has not been updated, and β0 represent the original attraction of the firefly. Let represent the position vector of the firefly with the highest brightness, α represent the randomization parameter, and ε represent the second random number uniformly distributed in [0,1].
[0099] After updating the firefly's position vector, the current temperature is reduced according to the cooling function of the simulated annealing acceptance criterion, and the process proceeds to the next target iteration.
[0100] T′=r×T
[0101] Where T′ represents the temperature after cooling, r represents the cooling parameter, and T represents the temperature before cooling.
[0102] The task offloading scheduling method provided in this application, referencing the idea in the simulated annealing algorithm of accepting a poor solution with a certain probability, designs an improved firefly population update rule to help escape local extrema, find a better task offloading scheduling scheme, and further reduce energy consumption.
[0103] Optionally, the objective function satisfies:
[0104] E = E device +E server +E cloud
[0105] Where E represents the total energy consumption of the system, E device E represents the energy consumption of mobile device transmission. server E represents the energy consumption generated by the edge server. cloud This indicates the energy consumption generated by the cloud server.
[0106] Specifically, the task offloading scheduling model aims to minimize the total system energy consumption, with the offloading deadline as a constraint. The objective function of the task offloading model is the total system energy consumption, and its expression is:
[0107] E = E device +E server +E cloud
[0108] Where E represents the total energy consumption of the system; E deviceThis indicates the energy consumption of mobile device transmission, mainly including the energy consumption for data transmission and data encryption; E server This refers to the energy consumption generated by the edge server, mainly including the energy consumed by the edge server in receiving, decrypting, and processing data; E cloud This indicates the energy consumption generated by the cloud server, mainly including the energy consumption of data transmission from the base station to the cloud server, and the energy consumption of the cloud server in receiving, decrypting and processing data.
[0109] Optionally, the determination of the firefly's solution sequence based on the probability function of each position component of the firefly's position vector includes:
[0110] Initialize the first empty solution sequence and the second empty solution sequence;
[0111] The probability of each position component of the firefly's position vector is determined based on the probability function.
[0112] For each position component of the firefly's position vector, take a first random number and determine the relationship between the probability and the first random number. When the probability is greater than the first random number, add the mobile application at the corresponding position in the current optimal scheduling solution sequence to the first empty solution sequence.
[0113] When the probability is less than the first random number, the mobile application at the corresponding position in the current optimal scheduling solution sequence is added to the second empty solution sequence;
[0114] The mobile applications in the second empty solution sequence are added to the empty positions in the first empty solution sequence with uniform probability to obtain the solution sequence of the firefly.
[0115] Specifically, initialize the firefly population Ω, randomly generate multiple fireflies, and firefly ψ i The position vector is X i =(X i1 ,X i2 ,…,X in ), where n represents the total number of mobile applications to be uninstalled, and the value range of each position component is [-2, 2].
[0116] The initial optimal scheduling solution sequence ζ is generated based on the shortest task priority principle. best =(ζ1,ζ2,…,ζ) n ).
[0117] Firefly position mapping: For each firefly ψ i Initialize the first empty solution sequence Second empty solution sequence ζ temp From the position vector X i Each dimension of position component X ilThe probability function determines the probability ρ of each positional component in each dimension.
[0118] Optionally, the probability function satisfies:
[0119]
[0120] Among them, X il Let ρ represent the l-th positional component of the i-th firefly, and let ρ represent the probability of the l-th positional component of the i-th firefly. l is a positive integer from 1 to n, and n is the total number of mobile applications to be uninstalled.
[0121] Take a first random number λ in the interval (0, 1) and determine the relationship between the probability of each position component and the first random number.
[0122] If λ < ρ, then the current optimal scheduling solution sequence ζ best Add the mobile application to the corresponding location in Firefly ψ i The corresponding first empty solution sequence If λ > ρ, then the current optimal solution sequence ζ will be... best Add the mobile application to the corresponding location in Firefly ψ i The corresponding second empty solution sequence ζ temp In the first objective iteration, the current optimal scheduling solution sequence ζ best The initial optimal scheduling solution sequence is given; during the nth (n>1) objective iteration, the current optimal scheduling solution sequence ζ is given. best This is the sequence of optimal scheduling solutions output after n-1 iterations.
[0123] Then the second empty solution sequence ζ temp The mobile application in the middle is added to the first empty solution sequence with a uniform probability. The empty spaces form a complete solution sequence for the firefly, which corresponds to the uninstallation order of the mobile application.
[0124] Optionally, determining the optimal solution sequence in the current firefly population based on the fitness value corresponding to the solution sequence of each firefly includes:
[0125] With minimizing the objective function as the optimization objective and the uninstallation deadline as the constraint, the optimal uninstallation position of each mobile application under the uninstallation order corresponding to the solution sequence of Firefly is determined.
[0126] The fitness value of the firefly's solution sequence is determined based on the optimal unloading position corresponding to the solution sequence of the firefly.
[0127] The solution sequence of the firefly with the highest fitness value is determined as the optimal solution sequence in the current firefly population.
[0128] Specifically, the solution sequence for each firefly is obtained. Then, based on the optimization objective of the task offloading scheduling model—namely, minimizing the total system energy consumption—and with the offloading deadline as a constraint, the solution sequence for each firefly is determined. The optimal uninstallation location for each mobile application can be either on a cloud server or an edge server.
[0129] Determine the solution sequence for each firefly. After determining the optimal uninstallation location for each mobile application, the fitness value of each firefly is calculated. The solution sequence of the firefly with the highest fitness value is determined, thus obtaining the optimal solution sequence ζ in the current firefly population. * The fitness value of each firefly reflects the total system energy consumption of the mapped mobile application uninstallation; the lower the total system energy consumption, the higher the fitness value.
[0130] Optionally, determining the optimal scheduling solution sequence for the current firefly population based on the difference and the simulated annealing acceptance criterion includes:
[0131] Determine the difference in fitness values between the current optimal scheduling solution sequence and the optimal solution sequence in the current firefly population;
[0132] When the difference is less than 0, the optimal scheduling solution sequence of the current firefly population is determined to be the optimal solution sequence in the current firefly population.
[0133] When the difference is greater than 0, the acceptance probability of the worse solution sequence in the current firefly population is determined based on the simulated annealing acceptance criterion.
[0134] If the acceptance probability is greater than the second random number, then the optimal scheduling solution sequence of the current firefly population is determined to be the optimal solution sequence in the current firefly population.
[0135] If the acceptance probability is less than the second random number, then the optimal scheduling solution sequence for the current firefly population is determined as the current optimal scheduling solution sequence.
[0136] Specifically, the optimal solution sequence ζ in the firefly is obtained. * Then, calculate the current optimal scheduling solution sequence ζ. best and the optimal solution sequence ζ * The difference in fitness between them, dE, is calculated using the following formula:
[0137] dE=f(ζ best )-f(ζ * )
[0138] Update the current optimal scheduling solution sequence ζ according to the simulated annealing (Metropolis) acceptance criterion. best If dE < 0, then the optimal scheduling solution sequence for the current firefly population is determined to be the optimal solution sequence ζ in the current population. * If dE > 0, then the acceptance probability P of the worse solution sequence in the firefly population is determined based on the simulated annealing acceptance criterion.
[0139] Optionally, the acceptance probability of the poor solution sequence in the current firefly population is determined based on the simulated annealing acceptance criterion, satisfying the following calculation formula:
[0140]
[0141] Where k represents the Boltzmann constant, with a value of approximately 1.38 × 10⁻⁶. -23 T represents the initial temperature. The initial temperature T and cooling parameter r of the simulated annealing acceptance criterion are preset. The initial temperature should be determined according to the actual situation. Different values of the initial temperature can be used for experiments, and the value with better results can be selected. The cooling parameter is usually set to 0.98.
[0142] Take a second random number q in the interval (0,1). If p>q, then the optimal scheduling solution sequence for the current firefly population is determined to be the optimal solution sequence ζ in the current population. * If p < q, then the optimal scheduling solution sequence for the current firefly population is determined to be the optimal scheduling solution sequence for the previous generation of firefly population.
[0143] The task unloading scheduling method provided in this application maps fireflies to a solution sequence for mobile application unloading scheduling and updates the firefly position update method in the firefly algorithm to a linear movement method, thereby reducing the computational load and update time of position updates and improving the efficiency of task unloading scheduling. At the same time, the simulated annealing acceptance criterion from the simulated annealing algorithm is introduced into the firefly population update process, which accepts non-optimal individuals in the population with a certain probability. This allows the firefly algorithm to potentially escape local optima during the optimization process and search for the global optimum in the solution space, eventually converging to the global optimum.
[0144] The task unloading and scheduling method provided in this application embodiment is further illustrated below with a specific example.
[0145] Figure 2 This is a second flowchart illustrating the task unloading and scheduling method provided in this application embodiment, as shown below. Figure 2 As shown, the method includes at least the following steps:
[0146] Step 201: Prepare the mobile application. This includes reading relevant data and establishing a task offloading scheduling model.
[0147] (1) Read the user input from 5 mobile applications ζ i Process the request and retrieve the mobile application ζ i Data volume d i The average CPU computation workload c per unit of data i , compute mobile application ζ i Total computational workload required w i For w i =d i ×c i As shown in Table 1:
[0148] Table 1: Relevant Data for Mobile Applications
[0149]
[0150]
[0151] (2) Establish a task offloading scheduling model, and determine that the objective function of the mobile application offloading scheduling model is to minimize the total system energy consumption E:
[0152] E = E device +E server +E cloud
[0153] Where E represents the total energy consumption of the system; E device This indicates the energy consumption of mobile device transmission, mainly including the energy consumption for data transmission and data encryption; E server This refers to the energy consumption generated by the edge server, mainly including the energy consumed by the edge server in receiving, decrypting, and processing data; E cloud This indicates the energy consumption generated by the cloud server, mainly including the energy consumption of data transmission from the base station to the cloud server, and the energy consumption of the cloud server in receiving, decrypting and processing data.
[0154] Step 202: Initialization.
[0155] (1) Initialize the firefly population Ω, randomly generate 4 fireflies, and firefly ψ i The position vector is X i =(X i1 ,X i2 ,X i3 ,X i4 ,X i5 The value range of each position component is [-2, 2].
[0156] (2) Generate the initial optimal solution ζ by following the shortest task priority principle. best =(ζ1,ζ2,…,ζ) n ).
[0157] (3) Determine the initial temperature T and cooling parameter r in the simulated annealing acceptance criteria.
[0158] Step 203: Generate the optimal schedule.
[0159] (1) Firefly position mapping: For each firefly ψ i Initialize empty solution sequence and temporary solution sequence ζ temp From position X i Calculate the position X in each dimension il probability Take a random number λ from the interval (0,1). If λ < ρ, then the initial optimal solution ζ is... best Add the mobile application to the corresponding location in Firefly ψ i Corresponding solution sequence Otherwise, add to sequence ζ temp In the middle. (The text abruptly ends here, likely due to an incomplete sentence or a formatting error.) temp The mobile application in the solution sequence is added with uniform probability. This constitutes a complete uninstallation scheduling scheme for mobile applications.
[0160] Table 2 Firefly ψ i Location mapping information
[0161]
[0162]
[0163] Table 2 shows the firefly ψ i From Table 2, we know that positions 2 and 5 satisfy λ < ρ. Therefore, ζ... best If the task at the corresponding position is assigned to the firefly, then the firefly's solution sequence is as follows: Here This represents the empty positions in the sequence. The remaining tasks are then inserted into these empty positions in a uniformly distributed manner. At this point, ζ... temp There are three tasks, ζ3, ζ4, and ζ2, which are inserted into the [program / system] with uniform probability. In the empty positions, assume the sequence after insertion is This is the solution sequence of the mapped individual fireflies.
[0164] (2) Unloading Location Allocation: To satisfy the deadline constraint and achieve the optimization objective minE of unloading scheduling, the unloading locations of mobile applications are allocated, and the optimal allocation scheme is calculated. The decision variable x i =1 indicates that task ζ i Distribute to edge servers for offloading, x i =0 indicates task ζi It is assigned to a cloud server for uninstallation.
[0165] (3) Calculate the ψ of each firefly i fitness value Obtain the optimal solution sequence ζ in the current population. * As a new solution, as shown in Table 3, if but
[0166] Table 3 Firefly ψ i scheduling information
[0167]
[0168] Step 204: Update the optimal solution sequence of the current population. Figure 3 This is a flowchart illustrating the updated optimal solution sequence based on the simulated annealing acceptance criterion provided in an embodiment of this application, as shown below. Figure 3 As shown, it should include at least the following:
[0169] (1) Calculate the initial optimal solution sequence ζ best And the new interpretation ζ * The difference in fitness between them, dE, is calculated using the following formula:
[0170] dE=f(ζ best )-f(ζ * )
[0171] (2) Update the initial optimal solution sequence ζ according to the simulated annealing acceptance criterion. best If dE < 0, then update the optimal solution sequence ζ. best A new solution ζ in the current population * If dE > 0, then calculate the acceptance probability of the poor solution sequence according to the simulated annealing acceptance criterion.
[0172] Take a random number q in the interval (0,1). If p>q, then accept the new solution ζ from the current population. * The optimal solution sequence ζ best If p < q, then keep the current optimal solution unchanged.
[0173] Step 205: Determine if the required number of iterations is met. If so, output the optimal solution ζ. best If the conditions are not met, proceed to step 206.
[0174] Step 206: Update the firefly location.
[0175] The brightest individual firefly from the previous generation among all fireflies. The update formula for linear motion is:
[0176]
[0177] Step 207: Cool down the temperature according to the cooling function.
[0178] The current temperature is cooled according to the cooling function, and then the process proceeds to step 203 for the next iteration. The cooling function satisfies:
[0179] T′=r×T
[0180] Where T′ represents the temperature after cooling, r represents the cooling parameter, and T represents the temperature before cooling.
[0181] Figure 4 This is a schematic diagram of the structure of the task offloading and scheduling device provided in the embodiments of this application, as shown below. Figure 4 As shown, the device includes at least:
[0182] The acquisition module 401 is used to acquire the initial uninstallation sequence of multiple mobile applications to be uninstalled in the cloud-edge collaborative environment, construct a task uninstallation scheduling model and generate an objective function; the initial uninstallation sequence is determined based on the ascending order of the total computational workload of each mobile application; the task uninstallation scheduling model is an optimization model that allocates uninstallation positions to mobile applications with the goal of minimizing the total system energy consumption and the uninstallation deadline as a constraint.
[0183] The determining module 402 is used to randomly set the initial position vector of the fireflies based on the initial unloading sequence and determine the initial optimal scheduling solution sequence, wherein the initial optimal scheduling solution sequence is determined based on the shortest task priority principle;
[0184] Iteration module 403 is used to execute a target iteration process, the target iteration process including:
[0185] The solution sequence of the firefly is determined based on the probability function of each position component of the firefly's position vector.
[0186] The optimal solution sequence in the current firefly population is determined based on the fitness value corresponding to the solution sequence of each firefly; the fitness value is determined based on the optimal unloading position corresponding to the solution sequence of the firefly.
[0187] The difference between the fitness value of the current optimal scheduling solution sequence and the fitness value of the optimal solution sequence in the current firefly population is determined. Based on the difference and the simulated annealing acceptance criterion, the optimal scheduling solution sequence of the current firefly population is determined. The current optimal scheduling solution sequence is the optimal scheduling solution sequence of the previous generation of firefly population.
[0188] If the preset number of iterations has not been reached, the position vector of each firefly is updated based on the update formula of the linear movement of all fireflies toward the firefly with the highest brightness, and the current temperature is cooled according to the cooling function of the simulated annealing acceptance criterion. If the preset number of iterations has been reached, the optimal scheduling solution sequence of the current firefly population in the last target iteration is determined as the optimal uninstallation order of the multiple mobile applications.
[0189] Optionally, the objective function satisfies:
[0190] E = E device +E server +E cloud
[0191] Where E represents the total energy consumption of the system, E device E represents the energy consumption of mobile device transmission. server E represents the energy consumption generated by the edge server. cloud This indicates the energy consumption generated by the cloud server.
[0192] Optionally, the determination of the firefly's solution sequence based on the probability function of each position component of the firefly's position vector includes:
[0193] Initialize the first empty solution sequence and the second empty solution sequence;
[0194] The probability of each position component of the firefly's position vector is determined based on the probability function.
[0195] For each position component of the firefly's position vector, take a first random number and determine the relationship between the probability and the first random number. When the probability is greater than the first random number, add the mobile application at the corresponding position in the current optimal scheduling solution sequence to the first empty solution sequence.
[0196] When the probability is less than the first random number, the mobile application at the corresponding position in the current optimal scheduling solution sequence is added to the second empty solution sequence;
[0197] The mobile applications in the second empty solution sequence are added to the empty positions in the first empty solution sequence with uniform probability to obtain the solution sequence of the firefly.
[0198] Optionally, the probability function satisfies:
[0199]
[0200] Among them, X il Let ρ represent the l-th positional component of the i-th firefly, and let ρ represent the probability of the l-th positional component of the i-th firefly.
[0201] Optionally, determining the optimal solution sequence in the current firefly population based on the fitness value corresponding to the solution sequence of each firefly includes:
[0202] With minimizing the objective function as the optimization objective and the uninstallation deadline as the constraint, the optimal uninstallation position of each mobile application under the uninstallation order corresponding to the solution sequence of Firefly is determined.
[0203] The fitness value of the firefly's solution sequence is determined based on the optimal unloading position corresponding to the solution sequence of the firefly.
[0204] The solution sequence of the firefly with the highest fitness value is determined as the optimal solution sequence in the current firefly population.
[0205] Optionally, determining the optimal scheduling solution sequence for the current firefly population based on the difference and the simulated annealing acceptance criterion includes:
[0206] Determine the difference in fitness values between the current optimal scheduling solution sequence and the optimal solution sequence in the current firefly population;
[0207] When the difference is less than 0, the optimal scheduling solution sequence of the current firefly population is determined to be the optimal solution sequence in the current firefly population.
[0208] When the difference is greater than 0, the acceptance probability of the worse solution sequence in the current firefly population is determined based on the simulated annealing acceptance criterion.
[0209] If the acceptance probability is greater than the second random number, then the optimal scheduling solution sequence of the current firefly population is determined to be the optimal solution sequence in the current firefly population.
[0210] If the acceptance probability is less than the second random number, then the optimal scheduling solution sequence for the current firefly population is determined as the current optimal scheduling solution sequence.
[0211] Optionally, the determination of the acceptance probability of the poor solution sequence in the current firefly population based on the simulated annealing acceptance criterion satisfies the following calculation formula:
[0212]
[0213] Where p represents the acceptance probability, k represents the Boltzmann constant, dE represents the difference in fitness between the current optimal scheduling solution sequence and the current optimal solution sequence in the firefly population, and T represents the initial temperature.
[0214] Optionally, the update formula based on the linear movement of all fireflies towards the firefly with the highest brightness updates the position vector of each firefly, satisfying the following calculation formula:
[0215]
[0216] Where, X′ i Let X represent the updated position vector of the i-th firefly. i Let represent the position vector of the i-th firefly that has not been updated, and β0 represent the original attraction of the firefly. Let represent the position vector of the firefly with the highest brightness, α represent the randomization parameter, and ε represent the second random number uniformly distributed in [0,1].
[0217] The methods and apparatuses provided in the various embodiments of this application are based on the same concept. Since the methods and apparatuses solve problems in similar ways, the implementations of the apparatuses and methods can refer to each other, and repeated details will not be repeated.
[0218] Figure 5 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application, such as... Figure 5 As shown, the electronic device may include: a processor 501, a communication interface 502, a memory 503, and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 communicate with each other via the communication bus 504. The processor 501 can call a computer program in the memory 503 to execute the steps of a task offloading and scheduling method, such as including:
[0219] The initial uninstallation sequence of multiple mobile applications to be uninstalled in a cloud-edge collaborative environment is obtained, a task uninstallation scheduling model is constructed, and an objective function is generated. The initial uninstallation sequence is determined based on the ascending order of the total computational workload of each mobile application. The task uninstallation scheduling model is an optimization model that allocates uninstallation positions to mobile applications with the goal of minimizing the total system energy consumption and the uninstallation deadline as a constraint.
[0220] The initial position vector of the fireflies is randomly set based on the initial unloading sequence, and the initial optimal scheduling solution sequence is determined based on the shortest task priority principle.
[0221] Execute a target iteration process, the target iteration process including:
[0222] The solution sequence of the firefly is determined based on the probability function of each position component of the firefly's position vector.
[0223] The optimal solution sequence in the current firefly population is determined based on the fitness value corresponding to the solution sequence of each firefly; the fitness value is determined based on the optimal unloading position corresponding to the solution sequence of the firefly.
[0224] The difference between the fitness value of the current optimal scheduling solution sequence and the fitness value of the optimal solution sequence in the current firefly population is determined. Based on the difference and the simulated annealing acceptance criterion, the optimal scheduling solution sequence of the current firefly population is determined. The current optimal scheduling solution sequence is the optimal scheduling solution sequence of the previous generation of firefly population.
[0225] If the preset number of iterations has not been reached, the position vector of each firefly is updated based on the update formula of the linear movement of all fireflies toward the firefly with the highest brightness, and the current temperature is cooled according to the cooling function of the simulated annealing acceptance criterion. If the preset number of iterations has been reached, the optimal scheduling solution sequence of the current firefly population in the last target iteration is determined as the optimal uninstallation order of the multiple mobile applications.
[0226] Furthermore, the logical instructions in the aforementioned memory 503 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0227] On the other hand, this application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, and when the program instructions are executed by a computer, the computer is able to perform the steps of the task offloading and scheduling methods provided by the above methods, such as including:
[0228] The initial uninstallation sequence of multiple mobile applications to be uninstalled in a cloud-edge collaborative environment is obtained, a task uninstallation scheduling model is constructed, and an objective function is generated. The initial uninstallation sequence is determined based on the ascending order of the total computational workload of each mobile application. The task uninstallation scheduling model is an optimization model that allocates uninstallation positions to mobile applications with the goal of minimizing the total system energy consumption and the uninstallation deadline as a constraint.
[0229] The initial position vector of the fireflies is randomly set based on the initial unloading sequence, and the initial optimal scheduling solution sequence is determined based on the shortest task priority principle.
[0230] Execute a target iteration process, the target iteration process including:
[0231] The solution sequence of the firefly is determined based on the probability function of each position component of the firefly's position vector.
[0232] The optimal solution sequence in the current firefly population is determined based on the fitness value corresponding to the solution sequence of each firefly; the fitness value is determined based on the optimal unloading position corresponding to the solution sequence of the firefly.
[0233] The difference between the fitness value of the current optimal scheduling solution sequence and the fitness value of the optimal solution sequence in the current firefly population is determined. Based on the difference and the simulated annealing acceptance criterion, the optimal scheduling solution sequence of the current firefly population is determined. The current optimal scheduling solution sequence is the optimal scheduling solution sequence of the previous generation of firefly population.
[0234] If the preset number of iterations has not been reached, the position vector of each firefly is updated based on the update formula of the linear movement of all fireflies toward the firefly with the highest brightness, and the current temperature is cooled according to the cooling function of the simulated annealing acceptance criterion. If the preset number of iterations has been reached, the optimal scheduling solution sequence of the current firefly population in the last target iteration is determined as the optimal uninstallation order of the multiple mobile applications.
[0235] On the other hand, embodiments of this application also provide a processor-readable storage medium storing a computer program for causing the processor to execute the steps of the task offloading and scheduling method provided in the above embodiments, such as including:
[0236] The initial uninstallation sequence of multiple mobile applications to be uninstalled in a cloud-edge collaborative environment is obtained, a task uninstallation scheduling model is constructed, and an objective function is generated. The initial uninstallation sequence is determined based on the ascending order of the total computational workload of each mobile application. The task uninstallation scheduling model is an optimization model that allocates uninstallation positions to mobile applications with the goal of minimizing the total system energy consumption and the uninstallation deadline as a constraint.
[0237] The initial position vector of the fireflies is randomly set based on the initial unloading sequence, and the initial optimal scheduling solution sequence is determined based on the shortest task priority principle.
[0238] Execute a target iteration process, the target iteration process including:
[0239] The solution sequence of the firefly is determined based on the probability function of each position component of the firefly's position vector.
[0240] The optimal solution sequence in the current firefly population is determined based on the fitness value corresponding to the solution sequence of each firefly; the fitness value is determined based on the optimal unloading position corresponding to the solution sequence of the firefly.
[0241] The difference between the fitness value of the current optimal scheduling solution sequence and the fitness value of the optimal solution sequence in the current firefly population is determined. Based on the difference and the simulated annealing acceptance criterion, the optimal scheduling solution sequence of the current firefly population is determined. The current optimal scheduling solution sequence is the optimal scheduling solution sequence of the previous generation of firefly population.
[0242] If the preset number of iterations has not been reached, the position vector of each firefly is updated based on the update formula of the linear movement of all fireflies toward the firefly with the highest brightness, and the current temperature is cooled according to the cooling function of the simulated annealing acceptance criterion. If the preset number of iterations has been reached, the optimal scheduling solution sequence of the current firefly population in the last target iteration is determined as the optimal uninstallation order of the multiple mobile applications.
[0243] The processor-readable storage medium can be any available medium or data storage device that the processor can access, including but not limited to magnetic memory (e.g., floppy disk, hard disk, magnetic tape, magneto-optical disk (MO)), optical memory (e.g., CD, DVD, BD, HVD), and semiconductor memory (e.g., ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state drive (SSD)).
[0244] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0245] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0246] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A task offloading and scheduling method, characterized in that, include: Obtain the initial uninstallation sequence of multiple mobile applications to be uninstalled in a cloud-edge collaborative environment, construct a task uninstallation scheduling model and generate an objective function; The initial unloading sequence is determined based on the ascending order of the total computational workload of each mobile application; the task unloading scheduling model is an optimization model that allocates unloading positions to mobile applications with the goal of minimizing the total system energy consumption and the constraint of the unloading deadline. The initial position vector of the fireflies is randomly set based on the initial unloading sequence, and the initial optimal scheduling solution sequence is determined based on the shortest task priority principle. Execute a target iteration process, the target iteration process including: The solution sequence of the firefly is determined based on the probability function of each position component of the firefly's position vector. The optimal solution sequence in the current firefly population is determined based on the fitness value corresponding to the solution sequence of each firefly; the fitness value is determined based on the optimal unloading position corresponding to the solution sequence of the firefly. The difference between the fitness value of the current optimal scheduling solution sequence and the fitness value of the optimal solution sequence in the current firefly population is determined. Based on the difference and the simulated annealing acceptance criterion, the optimal scheduling solution sequence of the current firefly population is determined. The current optimal scheduling solution sequence is the optimal scheduling solution sequence of the previous generation of firefly population. If the preset number of iterations has not been reached, the position vector of each firefly is updated based on the update formula of the linear movement of all fireflies toward the firefly with the highest brightness, and the current temperature is cooled according to the cooling function of the simulated annealing acceptance criterion. If the preset number of iterations has been reached, the optimal scheduling solution sequence of the current firefly population in the last target iteration is determined as the optimal uninstallation order of the multiple mobile applications.
2. The task offloading and scheduling method according to claim 1, characterized in that, The objective function satisfies: E=E device +E server +E cloud Where E represents the total energy consumption of the system, E device E represents the energy consumption of mobile device transmission. server E represents the energy consumption generated by the edge server. cloud This indicates the energy consumption generated by the cloud server.
3. The task offloading and scheduling method according to claim 1, characterized in that, The method for determining the solution sequence of fireflies based on the probability function of each position component of the firefly's position vector includes: Initialize the first empty solution sequence and the second empty solution sequence; The probability of each position component of the firefly's position vector is determined based on the probability function. For each position component of the firefly's position vector, take a first random number and determine the relationship between the probability and the first random number. When the probability is greater than the first random number, add the mobile application at the corresponding position in the current optimal scheduling solution sequence to the first empty solution sequence. When the probability is less than the first random number, the mobile application at the corresponding position in the current optimal scheduling solution sequence is added to the second empty solution sequence; The mobile applications in the second empty solution sequence are added to the empty positions in the first empty solution sequence with uniform probability to obtain the solution sequence of the firefly.
4. The task offloading and scheduling method according to claim 3, characterized in that, The probability function satisfies: Among them, X il Let ρ represent the l-th positional component of the i-th firefly, and let ρ represent the probability of the l-th positional component of the i-th firefly.
5. The task offloading and scheduling method according to claim 1, characterized in that, The process of determining the optimal solution sequence in the current firefly population based on the fitness value corresponding to the solution sequence of each firefly includes: With minimizing the objective function as the optimization objective and the uninstallation deadline as the constraint, the optimal uninstallation position of each mobile application under the uninstallation order corresponding to the solution sequence of Firefly is determined. The fitness value of the firefly's solution sequence is determined based on the optimal unloading position corresponding to the solution sequence of the firefly. The solution sequence of the firefly with the highest fitness value is determined as the optimal solution sequence in the current firefly population.
6. The task offloading and scheduling method according to claim 1, characterized in that, The process of determining the optimal scheduling solution sequence for the current firefly population based on the difference and the simulated annealing acceptance criterion includes: Determine the difference in fitness values between the current optimal scheduling solution sequence and the optimal solution sequence in the current firefly population; When the difference is less than 0, the optimal scheduling solution sequence of the current firefly population is determined to be the optimal solution sequence in the current firefly population. When the difference is greater than 0, the acceptance probability of the worse solution sequence in the current firefly population is determined based on the simulated annealing acceptance criterion. If the acceptance probability is greater than the second random number, then the optimal scheduling solution sequence of the current firefly population is determined to be the optimal solution sequence in the current firefly population. If the acceptance probability is less than the second random number, then the optimal scheduling solution sequence for the current firefly population is determined as the current optimal scheduling solution sequence.
7. The task offloading and scheduling method according to claim 6, characterized in that, The acceptance probability of the poor solution sequence in the current firefly population is determined based on the simulated annealing acceptance criterion, and the following calculation formula is satisfied: Where p represents the acceptance probability, k represents the Boltzmann constant, dE represents the difference in fitness between the current optimal scheduling solution sequence and the current optimal solution sequence in the firefly population, and T represents the initial temperature.
8. The task unloading and scheduling method according to claim 1, characterized in that, The update formula based on the linear movement of all fireflies towards the firefly with the highest brightness updates the position vector of each firefly, satisfying the following calculation formula: Where, X′ i Let X represent the updated position vector of the i-th firefly. i Let represent the position vector of the i-th firefly that has not been updated, and β0 represent the original attraction of the firefly. Let represent the position vector of the firefly with the highest brightness, α represent the randomization parameter, and ε represent the second random number uniformly distributed in [0,1].
9. A task offloading and scheduling device, characterized in that, include: The acquisition module is used to acquire the initial uninstallation sequence of multiple mobile applications to be uninstalled in the cloud-edge collaborative environment, build a task uninstallation scheduling model and generate an objective function; The initial unloading sequence is determined based on the ascending order of the total computational workload of each mobile application; the task unloading scheduling model is an optimization model that allocates unloading positions to mobile applications with the goal of minimizing the total system energy consumption and the constraint of the unloading deadline. The determination module is used to randomly set the initial position vector of the fireflies based on the initial unloading sequence and determine the initial optimal scheduling solution sequence, which is determined based on the shortest task priority principle. An iteration module is used to execute a target iteration process, which includes: The solution sequence of the firefly is determined based on the probability function of each position component of the firefly's position vector. The optimal solution sequence in the current firefly population is determined based on the fitness value corresponding to the solution sequence of each firefly; the fitness value is determined based on the optimal unloading position corresponding to the solution sequence of the firefly. The difference between the fitness value of the current optimal scheduling solution sequence and the fitness value of the optimal solution sequence in the current firefly population is determined. Based on the difference and the simulated annealing acceptance criterion, the optimal scheduling solution sequence of the current firefly population is determined. The current optimal scheduling solution sequence is the optimal scheduling solution sequence of the previous generation of firefly population. If the preset number of iterations has not been reached, the position vector of each firefly is updated based on the update formula of the linear movement of all fireflies toward the firefly with the highest brightness, and the current temperature is cooled according to the cooling function of the simulated annealing acceptance criterion. If the preset number of iterations has been reached, the optimal scheduling solution sequence of the current firefly population in the last target iteration is determined as the optimal uninstallation order of the multiple mobile applications.
10. An electronic device comprising a processor and a memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the task offloading scheduling method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Cloud workflow scheduling method based on firefly algorithm and dynamic priority algorithm
CN106648831A
Mobile device multi-task competition unloading method based on prediction mechanism
CN111328023A