A collaborative service caching and task scheduling optimization method in mobile edge computing environment
By adopting a collaborative service caching and task scheduling method based on the Squirrel Search Algorithm in a mobile edge computing environment, the coordination problem between MEC servers is solved, the task offloading scheme is optimized, resource utilization is improved, energy consumption is reduced, and the latency and outsourcing budget constraints of computing tasks are met.
Patent Information
- Application Number
- CN202410274029.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-11
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2044-03-11
AI Technical Summary
Existing task offloading scheduling methods fail to effectively consider the collaborative service caching and task scheduling between MEC servers, resulting in low resource utilization, high energy consumption and increased latency, and unable to meet the deadlines and outsourcing budget constraints of computing tasks.
A metaheuristic method based on the squirrel search algorithm is adopted, combined with the outsourcing cost calculation strategy, the maximum completion time calculation strategy and the optimization target calculation strategy, to optimize the task offloading scheme, offload the tasks to the MEC servers in the same subnet or outsource them to the cloud data center, and utilize the collaborative cache and resources between MEC servers to reduce the overall energy consumption.
It improves resource utilization and reduces the total energy consumption in the mobile edge computing environment, while meeting the latency and outsourcing budget constraints of computing tasks and optimizing the efficiency of task scheduling.
Smart Images

Figure CN118093136B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an optimization method for collaborative service caching and task scheduling, which fully utilizes the storage and computing capabilities of edge servers to minimize the overall edge server energy consumption, and belongs to the field of Mobile Edge Computing (MEC). Background Art
[0002] With the increasing popularity of mobile devices and the rapid development of IoT technology, resource-intensive and latency-sensitive mobile applications, such as object recognition and augmented reality, have been widely deployed on mobile devices. However, offloading such applications to a central cloud results in significant latency and energy consumption. To address this, MEC (Meanwhile Integrated Circuit) (MEC) is an effective solution. It deploys edge servers (i.e., MEC servers) at the edge of mobile networks to reduce end-to-end latency and enhance performance. Furthermore, by pre-storing mobile application service programs and related data on MEC servers, service caching allows mobile devices to offload or outsource computational tasks to nearby MEC servers that meet the application's service requirements. This service caching significantly reduces data transmission and energy overhead during offloading. However, for computationally intensive and latency-constrained applications, resource-limited MEC servers may not be able to complete the offloaded tasks before the application's deadline. To meet deadline constraints, MEC servers must further offload certain computational tasks to other nearby MEC servers or, if computational resources remain insufficient, even outsource the tasks to the central cloud. In this case, it will be a challenge to develop an effective scheduling method that can consider the collaboration between adjacent edge nodes and the central cloud, and take into account energy consumption, latency, and outsourcing costs.
[0003] A large body of work has introduced metaheuristic methods to address the problem of task offloading in edge computing. Metaheuristic methods, such as genetic algorithms and particle swarm optimization, provide a set of rules or heuristics to guide the search for sufficiently good solutions to large, complex optimization problems. The Squirrel Search Algorithm (SSA) is a recently proposed metaheuristic method that has demonstrated its solution exploration capabilities compared to many other metaheuristic methods. For example, the paper "HSSIW: Hybrid Squirrel Search and Invasive Weed Based Cost-Makespan Task Scheduling for Fog-Cloud Environment" studies the balance between makespan and cost in task scheduling in a distributed fog-cloud environment. Based on the SSA, it introduces an invasive weed algorithm and proposes a novel hybrid metaheuristic algorithm. The paper "Nature-inspired chaotic squirrel search algorithm (CSSA) for multi-objective task scheduling in an IAAS cloud computing atmosphere" introduces a chaotic SSA metaheuristic method with the goal of optimizing cost to solve the resource-constrained task scheduling problem in cloud data centers. The paper "SAEA: A security-aware and energy-aware task scheduling strategy by Parallel Squirrel Search Algorithmin cloud environment" studies the multi-objective task scheduling problem in multiple regions. Targeting the hierarchical network structure in the cloud environment, it introduces a parallel SSA metaheuristic method to speed up the calculation process and obtain higher-quality fuzzy rules.
[0004] Although the above-mentioned meta-heuristic algorithms based on SSA are effective in solving specific task scheduling problems, these methods do not consider the application scenarios of collaborative service caching and task scheduling between MEC servers, and are therefore not suitable for solving the technical problems in the present invention: in a mobile edge computing environment, considering the collaboration between MEC servers in the same subnet and with the central cloud, the computing tasks of mobile devices are effectively offloaded to MEC servers in the same subnet or outsourced to the cloud data center for processing, and the MEC server service caching situation is combined under the constraints of outsourcing budget, MEC server resource constraints and deadline to obtain an effective offloading scheduling scheme for computing tasks, thereby improving resource utilization while reducing the total energy consumption of the entire MEC server. Summary of the Invention
[0005] In view of the fact that the existing task offloading scheduling method does not take into account the collaborative service caching and task scheduling between adjacent MEC servers, and edge collaboration will greatly affect the offloading decision and the resource utilization of the MEC server, and at the same time affect the latency, outsourcing cost and energy consumption of the task processing process. The present invention proposes a collaborative service caching and task scheduling optimization method in a mobile edge computing environment, the purpose of which is to provide an optimization method for collaborative service caching and computing task scheduling in a mobile edge computing environment, including reading device information, related information of tasks on the device, virtual machine information and MEC server information, inputting the read device information, task information, virtual machine information and MEC server information into the meta-heuristic method based on SSA implementation to obtain the task offloading scheme and optimization target value, the squirrel search algorithm includes at least an outsourcing cost calculation strategy, a maximum completion time calculation strategy and an optimization target calculation strategy, and the device offloads part of the tasks to the MEC server in the same subnet for execution according to the offloading scheme, and part of the tasks are executed on the central cloud. The specific technical solution is as follows:
[0006] A collaborative service caching and task scheduling optimization method in a mobile edge computing environment schedules tasks on multiple devices between MEC servers in a subnet and a central cloud, obtaining a task scheduling solution that minimizes overall system energy consumption while meeting outsourcing cost constraints, MEC server resource limitations, and computing task deadline constraints. The main steps of the method include:
[0007] Step S1: Read device information (including but not limited to the number of tasks in the device), task information in the device (including but not limited to the data volume and required resource type of the task), virtual machine information (including but not limited to the virtual machine resource type), and MEC server information (including but not limited to the MEC server resource type);
[0008] Step S2: Input the read device information, task information, virtual machine information, and MEC server information into a meta-heuristic algorithm based on SSA to obtain the task offloading plan (including at least the offloading order and offloading location) and the optimized target energy consumption value. The squirrel search algorithm includes at least one outsourcing cost calculation strategy, one maximum completion time calculation strategy, and one optimization target calculation strategy.
[0009] In step S3, the device offloads part of the tasks to the MEC server in the same subnet according to the offloading plan, and outsources part of the tasks to the central cloud for execution.
[0010] In step S1, it is assumed that there are N={1,2,...,N} edge nodes in a multi-MEC server system environment, namely MEC servers, and N MECs form a multi-edge system. Each subnet is represented by Sub u , considering that there are U = {1, 2, ..., U} subnets, then u∈U. The device information read includes but is not limited to the number of tasks in the device, the device transmission power, etc.; the task information includes but is not limited to the amount of data to be processed for each task and the number of CPU cycles required to process each bit of data in the task ; Virtual machine information includes but is not limited to virtual machine frequency, virtual machine memory, etc.; MEC server information includes but is not limited to the corresponding computing capacity R n (n∈N) and storage capacity P n (n∈N). Assume that the number of tasks requested by the mobile device is k, and the task sequence can be expressed as π=(π1,π2,…,π k Each task is atomic and indivisible, meaning that tasks on the device side can be executed on the first MEC server that arrives, or on adjacent MEC servers within the subnet. If the resource constraints of the servers within the subnet are not met, the tasks can also be outsourced to the cloud data center.
[0011] In step S2, the main steps include:
[0012] Step SS1, initialize the squirrel search algorithm (including but not limited to the squirrel population, the location of the individual squirrel and the maximum number of iterations of the evolution process, etc.), and according to the initialized squirrel individual FS i Location Mapping ROV to the corresponding task sequence for calculation of subsequent task-related conditions and target values;
[0013] Step SS2, according to the formula Calculate the outsourcing budget for the corresponding task sequence;
[0014] Step SS3, based on the outsourcing cost calculation strategy, the maximum completion time calculation strategy and the optimization target calculation strategy, the task allocation in the corresponding task sequence of the squirrel individual is realized, thereby calculating the fitness value of the corresponding squirrel individual. The main steps are as follows;
[0015] Step SS31, traverse the task sequence π obtained after the squirrel individual mapping. If the traversal is completed, it means that the unloading allocation of all tasks is completed, and the corresponding fitness value E of the individual is obtained. total , go to step SS4, otherwise go to step SS32 to continue allocating the task sequence;
[0016] Step SS32, judging the current task π according to the service cache and resource remaining status of the server in the current subneti Whether it can be executed in the subnet, where if the task arrives at the server first and has cached the service required by the task, the task will be executed on the server that arrives first. If the server that arrives at the task first does not cache the service, but the adjacent server has cached the service, the task will be assigned to the adjacent server for collaborative execution; if no server in the subnet has cached the service, then the remaining resources of the server are judged at this time. If the server that arrives first has sufficient resources, the task will be offloaded to the server that arrives first first, otherwise it will be offloaded to the adjacent server for collaborative execution; if the server resources are sufficient, it is considered that there are multiple feasible solutions for offloading allocation in the subnet, and go to step SS35 to perform the next constraint condition judgment; if the corresponding service is not cached in the subnet at this time and the server resource conditions are not met, then only π i You can try outsourcing to the central cloud for processing. First, go to step SS33 to calculate the task outsourcing fee.
[0017] Step SS33, according to the formula Calculate the outsourcing cost of the current task, where Indicates the unit price of renting a virtual machine. Represents task π i The execution time can be calculated by the formula Calculate and record the task π at this time i outsourcing costs;
[0018] Step SS34: Determine the outsourcing cost of the task Is it less than the outsourcing budget? If so, go to step SS35 to perform the next constraint condition judgment. Otherwise, go to step SS38, indicating that the task sequence has no feasible solution;
[0019] Step SS35: Calculate the maximum completion time of the current task when unloading to different locations based on the existence of feasible solutions. , the calculation can be performed according to the following completion time calculation strategy:
[0020]
[0021] The calculation of has been introduced in step SS33, where the dynamic frequency selection (Dynamic Frequency Selection, DFS) is introduced to calculate the frequency by selecting the virtual machine Balance time and energy consumption, The calculation is based on the following formula:
[0022]
[0023] Indicates the transmission rate within the subnet, B nIt represents the transmission rate to the central cloud. It is calculated in the same way as R, but only the transmission power is changed.
[0024] Step SS36: determine whether the maximum completion time of the current subtask sequence meets the deadline constraint. If not, it means that there is no feasible solution for the current task sequence, and go to step SS38; if there is an unloading solution that meets the deadline constraint, calculate the energy consumption value of unloading to the location where the feasible solution exists, according to the formula Calculated, where represents the execution energy consumption, represents the transmission energy consumption;
[0025] Step SS37, based on the greedy idea and the energy consumption calculation results of different unloading locations in step SS36, decide the current task unloading location. Note that each decision may affect the server service cache status in the current subnet. The current total energy consumption is recorded as Go to step SS31 to determine the termination condition.
[0026] In step SS3, in order to minimize the energy consumption of the entire MEC server of the system and shorten the completion time of the task subsequence when executing the task sequence, a closer server should be selected for offloading to reduce the energy consumption and delay caused by the transmission process. The task allocation strategy of the MEC server collaborative service cache makes it possible to preferentially allocate the task to the adjacent MEC server in the same subnet for offloading execution when the corresponding service of the task is not cached on the MEC server that arrives first or does not meet the resource constraints. When the resource conditions of all MEC servers in the same subnet are not met, the task is considered to be outsourced to the cloud data center for execution when the outsourcing budget constraint and deadline constraint are met. Depending on the different allocation of previous tasks in the task sequence, the cache service situation of the MEC server in the subnet will also be different.
[0027] In step SS3, the virtual machine calculation frequency will be decided for each task. In order to minimize the energy consumption of the entire MEC server of the system when calculating and executing the task sequence, a smaller virtual machine calculation frequency should be selected. Assuming that all tasks select the smallest virtual machine calculation frequency, when a smaller virtual machine calculation frequency is selected, the execution time of the task will be correspondingly extended. Therefore, in the virtual machine calculation frequency allocation strategy, it is necessary to calculate the maximum completion time of the task subsequence, and select the virtual machine frequency that consumes less energy to execute the task under the premise of meeting the deadline constraint.
[0028] Step SS4: The fitness value (final total energy consumption E total ) sorted in ascending order, and assigned the squirrel individuals to the optimal hickory tree, the second-optimal acorn tree, and the ordinary tree according to the sorted order;
[0029] Step SS5: determine whether the stopping criteria are met. If so, proceed to step SS11 to output the solution corresponding to the optimal position and the corresponding minimum energy consumption value. Otherwise, repeat steps SS6 to SS10.
[0030] Step SS6: randomly select some squirrel individuals on ordinary trees and individuals on acorn trees to go to hickory trees together, and the remaining individuals on ordinary trees go to acorn trees;
[0031] Step SS7: Update the individual position according to the position update formula corresponding to different individuals on different trees. When there is no predator, the individual update formula on the acorn tree is: The formula for updating individuals from a common tree to an acorn tree is: The update formula for the hickory tree individual on the common tree is: When a predator is present, all squirrels will perform a random walk in a very small range, and will also be mapped to the corresponding task sequence through ROV, and jump to step SS3 to calculate the fitness value;
[0032] Step SS8: Determine whether seasonal monitoring conditions are met If satisfied, proceed to step SS9, otherwise proceed to step SS3;
[0033] Step SS9: According to the random migration formula, some individuals on ordinary trees are randomly migrated in late winter, and the squirrel individuals after migration are also mapped to obtain a task sequence;
[0034] Step SS10, update the minimum value of seasonal constant Where t is the current iteration number, t m is the maximum number of iterations;
[0035] Step SS11: output the unloading plan corresponding to the hickory tree and the corresponding optimal overall energy consumption after the iteration is completed.
[0036] Step SS2 describes the calculation method for the task outsourcing budget. The outsourcing budget is calculated by inputting a task sequence and calculating the outsourcing cost when all tasks are outsourced to the central cloud while meeting the deadline constraint. This is the outsourcing budget.
[0037] The task allocation method described in step SS3 is to calculate the corresponding fitness values of individual squirrels through the outsourcing cost calculation strategy, the maximum completion time calculation strategy, and the optimization target calculation strategy. Among them, the maximum completion time calculation strategy described in step SS35 is to calculate the maximum completion time of the current subtask sequence by calculating the preparation time and execution time of the current subtask sequence respectively; the optimization target calculation strategy described in step SS36 is also to calculate the total system energy consumption corresponding to the current subtask sequence by calculating the task transmission energy consumption and execution energy consumption respectively. When a task begins to execute, all tasks before this task have been completed, and the data transmission work of the current task has been completed. At the same time, since task execution is carried out by deploying virtual machines, it is assumed that the virtual machines deployed for task execution are released at one time after all tasks are completed. After all tasks are traversed, the total energy consumption fitness value corresponding to a task sequence is obtained for the subsequent squirrel search algorithm.
[0038] Beneficial effects of the present invention
[0039] This invention can effectively improve the quality of scheduling solutions and reduce the total energy consumption of computing tasks in a mobile edge computing environment while ensuring latency constraints and outsourcing budget constraints.
[0040] 1) The present invention is conducive to fully utilizing the idle resources of MEC servers in the same subnet in the system by collaboratively caching services between MEC servers. Taking into account various constraints, tasks are offloaded to MEC servers in the same subnet for execution, which not only improves the execution efficiency of tasks but also improves resource utilization.
[0041] 2) The present invention is conducive to resolving the contradiction between energy consumption, task delay requirements, and outsourcing costs. It introduces DFS into the task allocation method based on the greedy strategy and optimizes the algorithm exploration capability by deciding the virtual machine computing frequency, thereby reducing the energy consumption and cost of executing the requested task while meeting the user response time requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 The overall flow chart of the method of the present invention is
[0043] Figure 2 Detailed flow chart of the method of the present invention DETAILED DESCRIPTION
[0044] The following combination Figure 2The embodiment is described in detail. In this embodiment, there are 10 subnets, each of which contains 5 to 7 mobile devices and 1 to 3 MEC servers. Each MEC server is homogeneous, with 16 CPUs and 32GB of memory. There are 7 types of virtual machines. Assuming that a total of 5 tasks need to be processed, the optimal solution for the following tasks is required to minimize overall energy consumption. The task parameters are as follows:
[0045]
[0046] In addition to the above task instance information, the following information is related to the virtual machine, which introduces DFS and sets the virtual machine frequency to two levels: 1.8 GHz and 3.3 GHz:
[0047] VM Type Number of CPUs Memory(GB) VM unit price ($ / h) 1 1 1 0.014 2 1 2 0.028 3 2 4 0.056 4 1 3.75 0.077 5 2 7.5 0.154 6 4 15 0.308 7 8 30 0.616
[0048] Step S1: Obtain device information, virtual machine information, MEC server information, and task information to be processed, including task number, task data volume, number of CPU cycles required per bit of data, and virtual machine type corresponding to the task. Define the task set as π = {π0, π1, π2, π3, π4} and establish a related task offloading scheduling model.
[0049] In step S2, the algorithm is iterated according to the information read in step S1.
[0050] In step SS1, the squirrel population is initialized and the number of squirrels is defined as 10. The location information of the squirrels is as follows:
[0051]
[0052]
[0053] The squirrel individual is mapped into the corresponding task sequence through ROV based on the squirrel position information, Squirrel FS i The position is defined as X i , which is a 5-dimensional vector Taking squirrel FS0 as an example, the position array of squirrel FS0 is (3.0575, 3.8568, 1.8857, 3.7653, 1.7193). If the position sequence values are sorted in ascending order, it can be seen that the ranking sequence of the values of the five positions is 3, 1, 4, 2, 5. Therefore, the task sequence corresponding to this individual squirrel is {π2, π0, π3, π1, π4}.
[0054] Step SS2: Assuming that all tasks are outsourced to the cloud data center, calculate the public cloud rental budget corresponding to the task sequence. Represents task π iThe unit price of the corresponding virtual machine, Represents task π i The amount of data, Represents task π i The frequency of the corresponding virtual machine. Calculate the cost of outsourcing the task to the cloud data center. Taking task π0 as an example, the cost is
[0055] Step SS3, based on the outsourcing cost calculation strategy, the maximum completion time calculation strategy and the optimization target calculation strategy, realizes the task allocation in the corresponding task sequence of the squirrel individual, thereby calculating the fitness value of the corresponding squirrel individual, wherein step SS31 is to judge whether the traversal is terminated.
[0056] Step SS32, judging the current task π according to the service cache and resource remaining status of the server in the current subnet i Whether it can be executed within the subnet. If the task arrives at the server first and the required service has been cached, the task will be executed on the server that arrives first. If the task arrives at the server first and the service is not cached, but the adjacent server has cached the service, the task will be assigned to the adjacent server for collaborative execution. If no server in the subnet has cached the service, then the remaining resources of the server are judged. Taking the Squirrel FS0 task sequence {π2,π0,π3,π1,π4} as an example, when executing the task, no server has cached the service. First, it is judged whether it meets the resource constraints of the MEC server that arrives first:
[0057]
[0058]
[0059] where μ nj ∈{0,1}, indicating whether the virtual machine corresponding to the task is cached on the MEC server, r j Indicates the computing power of this type of virtual machine, p j Indicates the storage capacity of this type of virtual machine. Since the MEC server resources are not occupied at this time, task π2 will arrive at the server first for execution.
[0060] Step SS33: Calculate the outsourcing cost of the current task according to the formula provided by the task outsourcing cost calculation strategy. Assuming that task π1 will be outsourced to the central cloud for execution, and its corresponding virtual machine type is 5, then its outsourcing cost is Go to step SS34 to determine whether the outsourcing cost of the task is less than the outsourcing budget. If so, go to step SS35 to perform the next constraint condition judgment. Otherwise, go to step SS38, indicating that the task sequence has no feasible solution.
[0061] Step SS35: Calculate the maximum completion time t of the current task subsequence when unloading to different locations based on the existence of feasible solutions. πi , taking the execution of task π0 as an example, the current task subsequence is {π2,π0}, where task π2 is unloaded to the MEC server first for execution, and the preparation time is To indicate whether the task is outsourced to a cloud data center, To indicate whether the task is executed by adjacent MEC servers in the same subnet, is the task data volume. At this time, the virtual machine frequency on the server is selected as 3.3GHz, and the execution time of task π2 is Then the task completion time corresponding to task π2 is executed Assume that task π0 is also offloaded to the server that arrives first. The corresponding maximum completion time is
[0062] In step SS36, based on the maximum completion time of the task sequence calculated in step SS35, we determine whether it meets the deadline constraint. If there is an offloading solution that meets the deadline constraint, we calculate the energy consumption of offloading to the location where the feasible solution exists. The calculation of total energy consumption is also divided into two parts: transmission energy consumption and execution energy consumption. The transmission energy consumption is as follows:
[0063]
[0064] where τ and τ B are the transmission power between mobile devices and MEC servers or between MEC servers in the subnet and the transmission power from MEC server to cloud data center. Taking task π0 as an example, the transmission energy consumption is The execution energy consumption is The energy consumption of executing task π0 is about 9.01J. Similarly, the energy consumption of task π2 is about 3.58J. Then the current total energy consumption E′ when executing task π0 is total =12.59 J. If multiple offloading locations are feasible, the current task offloading plan is greedily determined in step SS37 based on the energy consumption calculation results at different offloading locations. When the energy consumption calculation for a task in the task sequence is completed, the resource availability and service cache status of the MEC server in the system may also change accordingly. Similarly, the energy consumption of the remaining tasks in the task sequence is calculated to obtain the fitness value corresponding to the individual squirrel FS0. When the fitness value calculation for an individual is completed, the tasks in the task sequence are completely assigned.
[0065] Step SS4: calculate the fitness value E totalSort in ascending order and assign squirrels to the best location, hickory tree, the second best location, acorn tree and ordinary tree according to the sorted order;
[0066] Step SS5, determining whether the stopping criteria are met, if so, outputting the solution corresponding to the optimal position and the corresponding minimum energy consumption value, otherwise repeating steps SS6 to SS10;
[0067] Step SS6, randomly select some squirrel individuals on ordinary trees to go to the hickory tree, and the remaining individuals on ordinary trees to go to the acorn tree;
[0068] Step SS7, update the individual position according to the position update formula corresponding to different individuals on different trees. For example, take the individual on the acorn tree moving to the hickory tree as an example. At this time, the update formula is used Calculate, where the first term is the current position of the squirrel individual, and the second term represents the squirrel moving from its current position to its new position due to the attraction of food. g is the sliding distance of the squirrel individual, ranging from [1 / 6, 10 / 19), R1 is a random number in the range of [0, 1], and t represents the current iteration. c Is the sliding constant, and the working value is usually considered to be 1.9. If the current optimal solution is the squirrel individual FS2, and the squirrel FS0 is the individual on the acorn tree, then the individual FS0 moves towards the individual FS2, and the corresponding position vectors are X2 = (0.0694, 2.6750, 2.6696, 3.4157, 0.9286) and X0 = (3.0575, 3.8568, 1.8857, 3.7653, 1.7193), then X'0 = X0 + d g ×G c ×(X2-X0)=(0.7865,2.9586,2.4815,3.4996,1.1184), where d is assumed to be g 0.4. Also through ROV mapping, the updated position X'0 of the squirrel individual FS0 is mapped to the corresponding task sequence, which in this case is {π4,π1,π2,π0,π3}, and then jumps to step SS3 for a new round of fitness value calculation;
[0069] Step SS8: Determine whether seasonal monitoring conditions are met If satisfied, go to step SS9, otherwise go to step SS3, where the seasonal constant and minimize the seasonal constant S min as follows:
[0070]
[0071] Where d represents the dimension. In this example, we assume that there is only one individual on the acorn tree, namely the squirrel individual. Assume that the maximum number of iterations t m is 100, and the current iteration number t is 95, then the minimized seasonal constant is calculated in the same way At this time, the seasonal monitoring conditions are not met and the process goes to step SS3.
[0072] Step SS9, according to the formula, some individuals on ordinary trees are randomly migrated in late winter. The resettlement of squirrels is performed by random walk through Lévy flight. The migrated individuals can also obtain the corresponding task sequence through mapping, and jump to step SS3 for a new round of fitness value calculation; go to step SS10, increase the number of iterations, and update the seasonal constant minimum value S through the modeling formula described in step SS8 min .
[0073] Step SS11: Output the unloading plan corresponding to the squirrel individual on the pecan tree and the corresponding optimal overall energy consumption E after the iteration. total is 25.73 J, as shown below:
[0074] Task Number Whether to offload to adjacent servers Whether to outsource to the central cloud Virtual machine computing frequency 4 no no 3.3GHz 1 no no 3.3GHz 2 yes no 3.3GHz 0 no no 3.3GHz 3 no yes 1.8GHz
[0075] In step S3, the device offloads part of the tasks to the MEC server in the same subnet according to the offloading plan, and outsources part of the tasks to the cloud data center for execution.
[0076] The present invention provides an optimization method for collaborative service caching and computing task scheduling in a mobile edge computing environment. There are many methods and approaches to implement this technical solution. The above is only a preferred embodiment of the present invention. It should be noted that those skilled in the art can make several improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention. Any components not specified in this embodiment can be implemented using existing technologies.
Claims
1. A collaborative service caching and task scheduling optimization method in a mobile edge computing environment, which schedules tasks on multiple devices between MEC servers in a subnet and a central cloud. It is characterized by It includes the following steps: Step S1, read the device information, task information in the device, virtual machine information and MEC server information; In step S1, there are N = {1, 2, ..., N} edge nodes in the multi-MEC server system environment, namely MEC servers. N MEC servers, multiple mobile devices and a cloud data center together form a multi-edge system. Each subnet is represented by Sub u , considering a total of U = {1, 2, ..., U} subnets, then u∈U; each edge node is equipped with corresponding computing power R n and storage capacity P n , n∈N; Assume that there are k tasks requested by the mobile device, and the task set β={β1,β2,...,β k }, for each task β i Both have two properties, Indicates the amount of data to be processed by the task, in kb; To process task β i The number of CPU cycles required for each bit of data; define π=(π1,π2,…,π k ) is a set of scheduling sequences for task offloading, namely Each task is atomic and indivisible; Step S2: Input the read device information, task information, virtual machine information, and MEC server information into a squirrel search algorithm based on SSA to obtain the task offloading plan and the corresponding overall total energy consumption; The squirrel search algorithm includes at least one outsourcing cost calculation strategy, one maximum completion time calculation strategy and one optimization target calculation strategy; The unloading scheme at least includes an unloading sequence and an unloading location; In step S3, the device offloads part of the tasks to the MEC server in the same subnet according to the offloading plan, and outsources part of the tasks to the central cloud for execution.
2. The method according to claim 1, characterized in that Step S2 specifically includes: Step SS1, initialize the squirrel search algorithm, including but not limited to the squirrel population, the location of the individual squirrel and the maximum number of iterations of the evolution process; and according to the initialized squirrel individual FS i Location Mapped to the corresponding task sequence through ROV, it is used to calculate the relevant conditions and target values of subsequent tasks; i is a k-dimensional array; Step SS2, calculating the outsourcing budget of the corresponding task sequence according to the task outsourcing cost calculation strategy; Step SS3, according to the outsourcing cost calculation strategy, the maximum completion time calculation strategy and the optimization target calculation strategy, the task allocation in the corresponding task sequence of the squirrel individual is realized, thereby calculating the fitness value E of the corresponding squirrel individual. total ; Step SS4: The fitness value E calculated in step SS3 is total Sort in ascending order and assign squirrel individuals to the optimal location (hickory tree), the second-optimal location (acorn tree), and the ordinary tree according to the sorted order; Step SS5: determine whether the stopping criteria are met. If so, proceed to step SS11 to output the solution corresponding to the optimal position and the corresponding minimum energy consumption value. Otherwise, repeat steps SS6 to SS10. Step SS6: randomly select some squirrel individuals on ordinary trees and individuals on acorn trees to go to hickory trees together, and the remaining individuals on ordinary trees go to acorn trees; Step SS7: Update individual positions according to the position update formulas corresponding to different individuals on different trees, where d in the update formula is g is the random sliding distance of the individual, G c is a sliding constant; when there is no predator, the individual update formula on the acorn tree is: in is the updated position of the individual on the acorn tree, is the current position of the individual on the acorn tree; the position update formula for the squirrel individual on the ordinary tree to go to the acorn tree is: in is the updated position of the individual on the common tree, is the current position of the individual on the ordinary tree; the position update formula for the squirrel individual on the ordinary tree to go to the hickory tree is: in is the updated position of the individual on the common tree, is the current position of the individual on the common tree; when there is a predator, all squirrel individuals will perform a random walk in a very small range, and are also mapped to the corresponding task sequence through ROV, and jump to step SS3 to calculate the fitness value; Step SS8: Determine whether seasonal monitoring conditions are met in is the individual position on the acorn tree, x ht,k is the individual position on the pecan tree, S min is the minimum value of the seasonal constant. If it is satisfied, go to step SS9, otherwise go to step SS3; Step SS9: According to the random migration formula, some individuals on ordinary trees are randomly migrated in late winter, and the squirrel individuals after migration are also mapped to obtain a task sequence; Step SS10, update the minimum value of seasonal constant Where t is the current iteration number, t m is the maximum number of iterations; Step SS11: output the unloading plan corresponding to the hickory tree and the corresponding optimal overall energy consumption after the iteration is completed.
3. The method according to claim 2, characterized in that In step SS1, initialize the squirrel population Ω={FS1, FS2, ..., FS |Ω| }, set the population size to |Ω|, randomly generate individual squirrel positions in the initialization process, and use the sorting-based ROV rule to sort the position values of the individual squirrels to map the individual squirrels to the scheduling solution; the ROV rule is to first sort the k-dimensional array corresponding to the individual position according to the size of the value of each dimension position, and obtain a new position sorted from small to large, that is, a newly sorted k-dimensional array, and map the new order of the tasks in the task sequence based on the new order of the position subscripts of the flag dimension in the updated array.
4. The method according to claim 2, characterized in that In step SS2, according to the calculation formula Calculate the outsourcing budget for tasks outsourced to the central cloud, where Indicates the unit price of renting a virtual machine. Represents task π i The execution time is calculated by the formula Calculated, where Represents the processing task π i The number of CPU cycles required for each bit of data, Indicates the amount of data to be processed by the task, Indicates the virtual machine computing frequency.
5. The method according to claim 2, characterized in that In step SS3, the specific steps are as follows: Step SS31, traverse the task sequence π obtained after the squirrel individual mapping. If the traversal is completed, it means that the unloading allocation of all tasks is completed, and the current total energy consumption is obtained. As the corresponding fitness value E of the individual total , go to step SS4, otherwise go to step SS32 to continue allocating the task sequence; Step SS32, judging the current task π according to the service cache and resource remaining status of the server in the current subnet i Whether it can be executed in the subnet, where if the task arrives at the server first and has cached the service required by the task, the task will be executed on the server that arrives first. If the server that arrives at the task first does not cache the service, but the adjacent server has cached the service, the task will be assigned to the adjacent server for collaborative execution; if no server in the subnet has cached the service, then the remaining resources of the server are judged at this time. If the server that arrives first has sufficient resources, the task will be offloaded to the server that arrives first first, otherwise it will be offloaded to the adjacent server for collaborative execution; if the server resources are sufficient, it is considered that there are multiple feasible solutions for offloading allocation in the subnet, and go to step SS35 to perform the next constraint condition judgment; if the corresponding service is not cached in the subnet at this time and the server resource conditions are not met, then only π i You can try outsourcing to the central cloud for processing. First, go to step SS33 to calculate the task outsourcing fee. Step SS33, according to the formula Calculate the outsourcing cost of the current task, where Indicates the unit price of renting a virtual machine. Represents task π i The execution time is calculated by the formula Calculated, where Represents the processing task π i The number of CPU cycles required for each bit of data, Indicates the amount of data to be processed by the task, and records the task π at this time i outsourcing costs; Step SS34: Determine the outsourcing cost of the task Is it less than the outsourcing budget? If so, go to step SS35 to perform the next constraint condition judgment. Otherwise, go to step SS38, indicating that the task sequence has no feasible solution; Step SS35, obtaining the maximum completion time of the current subtask sequence by respectively calculating the preparation time and execution time of the current subtask sequence; Step SS36: Determine whether the maximum completion time of the current subtask sequence meets the deadline constraint. If not, it means that there is no feasible solution for the current task sequence, and go to step SS38; if there is an unloading solution that meets the deadline constraint, calculate the energy consumption value of unloading to the location where the feasible solution exists. Step SS37, based on the greedy idea and the energy consumption calculation results of different unloading locations in step SS36, decide the current task unloading location. Note that each decision may affect the server service cache status in the current subnet. The current total energy consumption is recorded as Go to step SS31 to determine the termination condition.
6. The method according to claim 5, characterized in that The specific steps of step SS35 are: According to the existence of feasible solutions, calculate the maximum completion time of the current task when unloading to different locations The calculation is based on the following completion time calculation strategy: Dynamic frequency selection (DFS) is introduced to calculate the frequency by selecting a virtual machine Balance time and energy consumption, The calculation is based on the following formula, where Indicates the amount of data to be processed by the task, Indicates whether the task is outsourced to the data center. =1 means the task is outsourced to the data center, Indicates that the task is still being executed within the subnet; Indicates whether the task is executed collaboratively by other edge nodes in the subnet. The task is handed over to other MEC servers for execution, otherwise it is executed on the MEC server that arrives first: represents the transmission rate within the subnet, where ω is the channel bandwidth, g0 is the path loss constant, θ is the path loss exponent, d0 is the reference distance, d represents the distance from the mobile device to the MEC server, N0 is the noise power spectral density between the mobile device and the MEC server, and τ is the transmission power within the subnet; B n Indicates the rate at which the MEC server transmits data to the central cloud, calculated as follows: Only change the transmit power τ B .
7. The method according to claim 5, characterized in that In step SS36, the energy consumption value Calculated according to the following formula: in: represents the execution energy consumption, where is the dynamic power, where Represents the processing task π i The number of CPU cycles required for each bit of data, Indicates the amount of data to be processed by the task, The frequency of the virtual machine corresponding to the task; represents the transmission energy consumption, where Indicates the amount of data to be processed by the task, Indicates whether the task is outsourced to the data center. Indicates whether the task is executed collaboratively by other edge nodes in the subnet, R represents the transmission rate in the subnet, and B n represents the transmission rate from the MEC server to the central cloud, τ is the transmission power within the subnet, and τ B is the transmit power of the core network.
8. The method according to claim 2, characterized in that In steps SS8-SS10, under the premise of meeting seasonal monitoring conditions, some common tree squirrel individuals will be selected for random migration in late winter to enhance population diversity, explore more task sequence arrangements, and update the minimum value of the seasonal constant.
Citation Information
Patent Citations
MEC system task scheduling strategy game optimization method based on visible information
CN113360248A
Task scheduling method, equipment, storage medium and device
CN116980981A