Edge computing offloading method, device, equipment and medium based on simulated annealing
By applying the improved simulated annealing algorithm in edge computing, offloading decisions and resource allocation are optimized, solving the problem of dimensional differences in energy consumption and delay, avoiding local optimal solutions, and achieving more efficient resource utilization and system cost reduction. .
Patent Information
- Application Number
- CN202410672958.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-28
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-05-28
AI Technical Summary
Existing edge computing offloading strategies and resource allocation technologies lead to waste of energy consumption and delay when processing multi-tasks in the cloud edge environment, and the simulated annealing algorithm easily falls into the local optimal solution and fails to effectively consider energy consumption and time. The dimensional difference of extension.
Adopt an edge computing offloading method based on simulated annealing, define the offloading decision and resource allocation matrix through the initialization temperature, maximum iteration number and annealing cooling coefficient, perform disturbance processing and temperature adjustment, optimize the total cost function, and ensure reasonable energy consumption and delay performance and accuracy, and avoid local optimal solutions.
It improves the globality and accuracy of the simulated annealing algorithm, optimizes offloading decisions, achieves more effective resource allocation and energy consumption management, reduces system costs, and improves processing efficiency.
Smart Images

Figure CN118245198B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of edge computing technology based on simulated annealing, and in particular to an edge computing offloading method, device, equipment and medium based on simulated annealing. Background Art
[0002] With the popularization of IoT devices and the rapid development of intelligent applications, as well as the rapid emergence of emerging fields such as the Internet of Things, Industrial Internet, and Internet of Vehicles, these emerging fields have put forward higher requirements for network performance such as network service quality, latency, and bandwidth. The traditional cloud computing model has obvious latency problems when processing a large number of computing tasks, cannot meet application scenarios with high real-time requirements, and has data privacy and security issues. In order to solve the above problems, edge computing came into being. It moves the computing power of the terminal upward and sinks the computing power of the cloud to the edge of the network, building a "cloud-edge-end" three-party collaborative architecture. This architecture effectively breaks the bottleneck of cloud computing development, releases the pressure on the terminal, and realizes edge intelligence, low latency, and large bandwidth data processing.
[0003] In response to edge computing issues, domestic and foreign scholars have conducted a series of studies on the efficient offloading of terminal device tasks and reasonable resource allocation under low latency and low energy consumption conditions. For low latency research, a centralized distribution offloading working mode based on relay auxiliary nodes is designed. The simulated annealing algorithm is deployed in the relay auxiliary nodes to optimize the offloading decision, and the relay auxiliary nodes are used to forward the offloading tasks, so as to achieve the purpose of minimizing the total delay of the system. This algorithm does not add local variables and may quickly fall into the local optimal solution. The computational delay is defined as the time consumed by data offloading and calculation, and a multidimensional resource allocation method that minimizes the sum of node computational delays is proposed. A series of slack variables and auxiliary variables are introduced to simplify the optimization problem and decouple the optimization variables. On this basis, an iterative algorithm based on dichotomy is proposed to solve the optimal solution of the original problem by deeply analyzing the structural characteristics of the simplified problem. For low energy consumption research, a Markov decision process model based on reinforcement learning is proposed, and a computational offloading and resource allocation scheme based on dual-depth Q network and dual-depth Q network in edge-cloud collaboration scenarios is given, which significantly reduces the energy consumption of the system. A hybrid action multi-agent reinforcement learning algorithm based on graph attention network is proposed. The graph attention network captures the potential spatial correlation between wireless network states, allowing the base station to selectively pay attention to the wireless network state information of other base stations in the neighborhood, thereby learning better computing offloading and resource allocation strategies. In the study of weighing delay and energy consumption, considering the limited computing resources of edge servers and the limited bandwidth constraints of small base stations in the service area, a non-convex optimization model is established to minimize the cost of task completion delay and terminal energy consumption, and an optimization algorithm based on simulated annealing is proposed. However, this model directly adds energy consumption to delay without considering the difference in dimensions. There is also a method that takes comprehensive consideration of computing delay and resource scheduling energy consumption as the optimization calculation target, transforms the multi-objective optimization model into an effective indicator optimization model, uses simulated annealing algorithm to calculate the appropriate transmission power, and proposes an optimization algorithm RA-NSGAⅢ. This simulated annealing algorithm may also quickly fall into a local optimal solution. A fast learning space DRL framework integrating rewards and simplified actions is proposed. This framework uses a low-complexity method to jointly optimize TO and RA strategies.
[0004] The above-mentioned existing technical solutions are not mature enough in terms of computing offloading strategies and resource allocation technologies when processing multiple tasks in a cloud-edge environment, which will lead to waste of energy and latency.
[0005] In view of this, this application is filed. Summary of the invention
[0006] The present invention provides an edge computing offloading method, device, equipment and medium based on simulated annealing, which can at least partially improve the above-mentioned problems.
[0007] To achieve the above object, the present invention adopts the following technical solutions:
[0008] An edge computing offloading method based on simulated annealing, comprising:
[0009] Initialize the initial temperature, minimum temperature, maximum number of iterations and annealing cooling coefficient, and define the matrix for recording unloading decisions A and a matrix to record resource allocation B , according to the matrix of recorded resource allocation B Get the initial solution, total cost, initial optimal solution and optimal total cost;
[0010] Performing a perturbation process on the initial optimal solution within a preset maximum number of iterations, calculating the original solution after the perturbation and the new solution after the perturbation, and comparing the total cost function corresponding to the original solution and the total cost function of the new solution, and accepting the new solution or the original solution according to the comparison result;
[0011] Compare the current temperature with the lowest temperature, and continue to lower the current temperature according to the judgment result, or obtain the optimal solution corresponding to the unloading decision;
[0012] The optimal allocation scheme is obtained based on the optimal solution corresponding to each unloading decision calculated.
[0013] The present invention also provides an edge computing unloading device based on simulated annealing, which comprises:
[0014] Initialization unit, used to initialize the initial temperature, minimum temperature, maximum number of iterations and annealing cooling coefficient, and define the matrix for recording unloading decisions A and a matrix to record resource allocation B , according to the matrix of recorded resource allocation B Get the initial solution, total cost, initial optimal solution and optimal total cost;
[0015] A perturbation unit is used to perform perturbation processing on the initial optimal solution within a preset maximum number of iterations, calculate the original solution after perturbation and the new solution after perturbation, compare the total cost function corresponding to the original solution with the total cost function of the new solution, and accept the new solution or the original solution according to the comparison result;
[0016] The unloading decision optimal solution unit is used to compare the current temperature with the minimum temperature, and continue to reduce the current temperature according to the judgment result, or obtain the optimal solution corresponding to the unloading decision;
[0017] The allocation plan generating unit is used to obtain an optimal allocation plan according to the optimal solution corresponding to each unloading decision calculated.
[0018] The present invention also provides an edge computing offloading device based on simulated annealing, which includes a memory and a processor, wherein a computer program is stored in the memory, and the computer program can be executed by the processor to implement an edge computing offloading method based on simulated annealing as described in any one of the above.
[0019] The present invention also provides a computer-readable storage medium storing a computer program, wherein the computer program can be executed by a processor of a device where the computer-readable storage medium is located to implement the edge computing offloading method based on simulated annealing as described in any one of the above.
[0020] In summary, the edge computing offloading method based on simulated annealing applies and optimizes the simulated annealing algorithm for the cloud-edge-end tripartite coordination architecture, making it more suitable for the model and having better results in solving the minimum cost problem under the model. The traditional annealing framework is also optimized, and the solution is more global. For the simulated annealing algorithm, the perturbation scheme is optimized so that it can make targeted and precise perturbations for complex offloading decisions. For the total cost model of the objective function, the previous calculation method of directly adding energy consumption and delay without considering their dimensional differences is changed to ensure the rationality and accuracy of the understanding. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a flowchart of the edge computing offloading method based on simulated annealing provided by the first embodiment of the present invention;
[0022] Figure 2 It is a schematic diagram of the system model of cloud-edge-end mobile edge computing provided by the present invention;
[0023] Figure 3 It is a single edge node unloading decision process diagram provided by the present invention;
[0024] Figure 4 It is a schematic diagram of the total cost of each strategy provided by the present invention;
[0025] Figure 5 It is a schematic diagram of the effect of bandwidth on total cost provided by the present invention;
[0026] Figure 6 This is a schematic diagram of the effect of the number of terminals on the total cost provided by the present invention.
[0027] Figure 7 It is a module schematic diagram of an edge computing offloading device based on simulated annealing provided in the second embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0029] refer to Figure 1 As shown, the first embodiment of the present invention discloses an edge computing offloading method based on simulated annealing, which can be executed by an edge computing offloading device based on simulated annealing (hereinafter referred to as edge computing offloading device), and in particular, executed by one or more processors in the edge computing offloading device to implement the following method:
[0030] S101, initialize the initial temperature, minimum temperature, maximum number of iterations and annealing cooling coefficient, and define the matrix for recording unloading decisions A and a matrix to record resource allocation B , according to the matrix of recorded resource allocation B Get the initial solution, total cost, initial optimal solution and optimal total cost;
[0031] Specifically, step S101 includes: initializing the initial temperature , minimum temperature , maximum number of iterations N and annealing cooling coefficient q ;
[0032] Get multiple uninstall decisions, and traverse all uninstall decisions to get the matrix of recorded uninstall decisions A ;
[0033] Traverse the uninstallation decision and initialize the matrix that records resource allocation according to the uninstallation decision B , and get the initial solution , ;
[0034] Calculate the initial solution The corresponding total cost , and let the initial optimal solution = the initial solution , record the optimal total cost corresponding to the initial optimal solution , optimal total cost =Total Cost .
[0035] Preferably, the optimal total cost The calculation formula is:
[0036]
[0037]
[0038] in, , , is a binary variable, , , For the i The delay caused by the local execution of tasks by a terminal device, For the i The energy consumption generated by each terminal device when executing tasks locally, For the i The total delay caused by offloading the corresponding tasks of each terminal device to the edge server for computing and processing, For the i The total energy consumption generated by offloading the corresponding tasks of each terminal device to the edge server for computing and processing. For the i The terminal device is in the cloud server i The total delay caused by executing a task is For the i The terminal device is on the edge server i The total energy consumption generated by executing a task is , is the preference coefficient, , , .
[0039] In this embodiment, based on the CEL model, a matrix for recording uninstallation decisions is defined. A and a matrix to record resource allocation B Initialize the initial temperature , minimum temperature , maximum number of iterations N , annealing cooling coefficient q , traverse the unloading decision, and randomly generate the initial solution for resource allocation according to the unloading decision , and calculate the corresponding total cost , let it be the initial optimal solution = , and record the optimal total cost =
[0040] Among them, under the CEL network model, in order to comprehensively consider the costs of latency and energy consumption in combination with actual needs, a preference coefficient is configured for latency cost and energy consumption cost respectively. a and b . a and b are all non-negative values, and the sum is 1. Users can adjust the preference coefficient parameters according to actual needs. For example, when facing delay sensitivity issues, the delay preference parameter can be appropriately adjusted. aIncrease it so that the proportion of delay cost in the total cost increases, so as to fit the actual problem. Since the units of energy consumption and delay are different, the corresponding orders of magnitude are also different. If the delay count is directly added to the energy consumption count for comparison, the result will be biased towards delay or energy consumption. For example, in the calculation process, large tasks require a lot of time and energy, while small tasks can be calculated faster / more energy-efficiently. If the total cost function is designed as the direct sum of delay and energy consumption, it may lead to neglect of small tasks due to excessive focus on large tasks. Therefore, the total cost function is designed as the ratio of the delay and energy consumption costs of the offloading solution to the delay and energy consumption costs of executing tasks on the terminal device, so as to ensure its fairness. In summary, the cost of the entire system,
[0041] That is, the optimization goal is:
[0042]
[0043] in, , , , , , , , , In the total cost formula, in order to achieve the optimal total cost, the parameters that can be optimized for disturbance are: the task offloading strategy and the resource allocation schemes corresponding to the cost calculation. At the same time, each parameter should satisfy its corresponding constraints. For tasks offloaded to servers other than the terminal device for processing, the bandwidth allocated by the edge server to the terminal device The total amount shall not exceed ; For tasks offloaded to edge servers for computing and processing, the edge servers allocate computing resources to each task The total amount shall not exceed .
[0044] Specifically, the optimization objective is obtained by the following model formula:
[0045] The first network model is based on the CEL network model consisting of multiple terminal devices, an edge server and a cloud server. Each terminal device will be assigned a task, which can be directly calculated and processed on the terminal device, or transmitted from the terminal device to the edge server via wireless signals for calculation and processing on the edge server, or transmitted from the terminal device to the edge server via wireless signals, and then transmitted from the edge server to the cloud server via wired transmission for calculation and processing, such as Figure 2 shown.
[0046] In the CEL network model, the computing power of the terminal device is small and limited; the edge server has relatively abundant computing resources, which can allocate computing resources to tasks transmitted to the edge server for processing, and allocate bandwidth resources to tasks that need to be transmitted to the edge server; the total amount of computing resources owned by the cloud server is extremely large, which can be regarded as infinite compared with the other two, so it is assumed that it allocates the same computing resources to each task. Different task offloading strategies have characteristics that are consistent with their own attributes for the computing processing of tasks, as follows:
[0047] (1) Terminal device: The task is calculated directly on the terminal device. When the task data volume and calculation amount are small and the latency requirement is high, you can choose to execute the calculation task locally on the terminal device.
[0048] (2) Edge server: When the task data volume and computing volume are large, and the terminal device needs a long time to complete the task, you can choose to upload the task to the edge server via wireless transmission, and the edge server will allocate computing resources to perform the computing task.
[0049] (3) Cloud Server: When the amount of task data and the amount of computing are particularly large, the terminal device needs a long time to complete the computing task, and the edge server cannot meet the demand. You can choose to transmit the task from the terminal device to the edge server via wireless signals, and then upload it to the cloud server with super computing power via wired transmission for execution.
[0050] For the problem that tasks corresponding to multiple terminals may be calculated on different servers or terminals, we record the offloading decision. In the offloading decision, we use the binary variable to record the location of task processing, and ,exist When the value is 1, it means the task i Calculation is performed on terminal devices, edge servers, and cloud servers. Figure 3 shown.
[0051] In the second communication model, the terminal device can transmit data to the edge server through wireless communication. According to Shannon's theorem, the terminal device can i With edge servers j The transmission rate between is expressed as:
[0052]
[0053] Among them, the base station is assigned to the terminal device i The bandwidth is , the uplink transmission power of the terminal device is , Gaussian white noise is , usually -100. Channel gain It can be expressed as:
[0054]
[0055]
[0056] Among them, the distance between the terminal device and the base station is d .
[0057] The third terminal cost model, if the terminal equipment i If you choose to execute the task locally, the local execution cost includes the latency and energy consumption of the local CPU executing the task. , then the terminal device Energy consumption of local execution tasks It is expressed as:
[0058]
[0059] in, is the local CPU energy consumption parameter, generally taken as ; To handle tasks i The required computing resources can be expressed as:
[0060]
[0061] The terminal device i The latency of executing tasks locally It is expressed as:
[0062]
[0063] in, Task i The file size, defined It is the ratio of the computing resources required for a task to its file size.
[0064] The fourth edge cost model, when the task is offloaded to the edge server for processing, the total energy consumption of processing the task can be divided into two parts: one part is the transmission energy consumption, which is generated in the process of transmitting the task from the terminal device to the edge server. The other part is the standby energy consumption, which is generated after the task is uploaded to the edge server, and the terminal device is waiting for the edge server to complete the task and return the result. The two energy consumptions together constitute the total energy consumption of the edge server when processing the offloaded task. Then the terminal device i The total energy consumption generated by offloading the corresponding tasks to the edge server for computing and processing It is expressed as:
[0065]
[0066]
[0067] in, That is, the energy consumption of the terminal equipment during the task transmission period; Transmit power for the terminal device; It is the energy consumed by the terminal device when waiting for the calculation results to be returned; It indicates the time that the terminal device waits for the calculation result to be returned after transmitting the task to the edge server; It is the power level when the terminal device is waiting for the calculation result to be returned.
[0068] The task corresponding to the terminal device is transmitted to the edge server for processing. The total delay is equal to the delay required for the task to be uploaded from the terminal device to the edge server plus the delay required to wait for the task calculation to be completed. Usually, since the amount of data of the calculation result is relatively small and the transmission rate of downlink data is relatively fast, the time for the calculation result to be returned to the terminal device can be ignored. Therefore, we only need to pay attention to the delay of task transmission and the delay of waiting for the task calculation to be completed.
[0069] The terminal device i The total delay caused by offloading the corresponding task to the edge server for computing and processing It is expressed as:
[0070]
[0071]
[0072]
[0073] in, is the latency of task transmission from the terminal device to the edge server; That is, the file size of the task; Indicates that from the terminal device i The speed of uploading data to the local edge server; It is the waiting delay; Edge Server for Tasks i Allocated computing resources.
[0074] The fifth cloud cost model, when the task is offloaded to the cloud server, the total energy consumption of the terminal device can be divided into two parts: one part is the energy consumption generated when the task is transmitted from the terminal device to the cloud server, and the other part is the waiting energy consumption generated when the terminal device uploads the task and waits for the cloud server to complete the calculation task and return the result. i The total energy consumption of executing task i on the edge server It is expressed as:
[0075]
[0076]
[0077] in, Indicates terminal equipment i Waiting energy consumption for waiting for the task to complete and return the result; It is a terminal device i Total waiting time; That is, the computing time of the cloud server; Indicates that the server allocates a fixed amount of computing resources to each task; is the transmission rate from edge server to cloud server.
[0078] The tasks offloaded to the cloud server need to be first transmitted to the edge server, and then transmitted from the edge server to the cloud server for computing and processing. The cloud server has powerful computing capabilities, but it is far away, so the transmission delay is mainly considered. And because the amount of data of the calculation result is small and the rate of downlink data is high, the delay of the calculation result returning to the terminal device can be ignored. Therefore, the total delay can be expressed as the delay required for the terminal device to upload the task to the cloud server and the delay required for the cloud server to calculate the task. The delay required for uploading the task is the sum of the delay of the task from the terminal device to the edge server and the delay of the task from the edge server to the cloud server.
[0079] The terminal device i Execute tasks on cloud servers The total delay caused Expressed as
[0080]
[0081]
[0082]
[0083] in, is the latency of computing tasks on the cloud server; The task is from the terminal device i Total latency of uploading to the cloud server; It is the latency of uploading the task from the terminal device to the edge server; It is the latency of task transmission from edge server to cloud server.
[0084] Based on the above five models and model formulas, the total cost model can be obtained, and then the entire system cost formula and optimization target formula can be obtained.
[0085] S102, performing perturbation processing on the initial optimal solution within a preset maximum number of iterations, calculating the original solution after perturbation and the new solution after perturbation, and comparing the total cost function corresponding to the original solution with the total cost function of the new solution, and accepting the new solution or the original solution according to the comparison result;
[0086] Specifically, step S102 includes: perturbing the initial optimal solution within a preset maximum number of iterations to obtain a perturbed solution. n The original solution , and calculate the disturbance n The original solution The corresponding total cost function ;
[0087] In the disturbance n The original solution Based on the perturbation, we get a new solution , and calculate the new solution The corresponding total cost function
[0088] When the new solution is determined The corresponding total cost function Less than the original solution The corresponding total cost function When receiving the new solution, let m =0, m is the number of consecutive times of not accepting new solutions;
[0089] When the new solution is determined The corresponding total cost function Not less than the original solution The corresponding total cost function Calculate the probability of accepting an inferior solution when P , the calculation formula is:
[0090]
[0091] in, The probability of accepting an inferior solution for the current temperature calculation, is the current temperature, is the natural logarithm, is the current solution, is the current solution after the disturbance, For the current solution The corresponding total cost function is, is the current solution after perturbation The corresponding total cost function;
[0092] Get variables p , p The value of is [0,1]. Less than When accepting new interpretations;
[0093] When judging Not less than When the new interpretation is not accepted, m=m+1 , and judge m Is it greater than , N is the maximum number of iterations;
[0094] If so, perform the temperature increase operation to make the current temperature Rise to initial temperature , and randomly perturb the new solution and restart annealing;
[0095] If not, perform a cooling operation at the end.
[0096] In this embodiment, the original solution is perturbed within the maximum number of iterations, where Represents disturbance n The subsequent original solution, It is a new solution obtained by perturbing the original solution. Each time a new solution is perturbed, its corresponding total cost function is calculated. ,when , the new solution is better, so accept the new solution and let m =0, where m Indicates the number of consecutive times that a new solution is not accepted. When the new solution is not better than the original solution, calculate the probability of accepting the inferior solution P , probability P It is related to temperature. P The calculation formula is as follows:
[0097]
[0098] p is a random number between 0 and 1. p <P , accept the new solution, otherwise, do not accept the new solution, and m Add 1 to itself, then m Make a judgment, when m>N / 2 When , the temperature is raised to the initial temperature, and then the new solution is randomly perturbed and annealing is restarted. In other cases, the temperature is lowered at the end. The following is the temperature change formula: .
[0099] S103, comparing the current temperature with the lowest temperature, and continuing to lower the current temperature according to the judgment result, or obtaining the optimal solution corresponding to the unloading decision;
[0100] Specifically, step S103 includes: when the current temperature is determined Greater than the minimum temperature , perform another iteration and continue to refresh the solution so that the current temperature Continue to lower;
[0101] When the current temperature Less than the minimum temperature When , the loop ends, the optimal solution corresponding to the unloading decision is obtained, and the optimal solution corresponding to the next unloading decision is calculated.
[0102] S104, obtaining an optimal allocation plan according to the calculated optimal solution corresponding to each unloading decision.
[0103] In this embodiment, when When , another iteration is performed to continuously refresh the solution of the algorithm so that the current temperature continues to decrease. When the temperature is lower than the minimum temperature, the loop ends, and the optimal solution corresponding to the unloading decision is obtained, and then the quasi-annealing calculation for the next unloading decision is continued.
[0104] Specifically, in this embodiment, the logic code of the simulated annealing-based task offloading and resource allocation algorithm of the edge computing offloading method based on simulated annealing is:
[0105] Definition: Initialization , , N and q ;
[0106] Output: Uninstall decision matrix and resource allocation matrix ;
[0107] Traverse the unloading decision and initialize the resource allocation matrix according to the unloading decision , regarded as , initialize the optimal solution
[0108] , the initial optimal total cost function :
[0109] while :
[0110] for n=0 to N :
[0111] Perturb the current solution Get new ,calculate ;
[0112] If :
[0113] , (receive new solution);
[0114] m =0;
[0115] if :
[0116] Update the optimal solution and optimal fitness function, , ,
[0117] end
[0118] else:
[0119] Calculate the probability of acceptance P ;
[0120] If p <P :
[0121] , (Accept the new interpretation);
[0122] else:
[0123] Do not accept new interpretations;
[0124] m+=1 (The number of consecutive rejections of new solutions increases);
[0125] If m>N / 2 :
[0126] ;
[0127] end
[0128] end
[0129] ;
[0130] end while (enter the optimization of the next uninstall decision)
[0131] In summary, compared with the general simulated annealing algorithm, the present invention optimizes the simulated annealing algorithm based on the CEL model so as to solve the cost minimization target more precisely and more in line with actual needs. Specifically:
[0132] (1) A memory function is added to enhance the globality of the algorithm. Since there is a probability of accepting inferior solutions during the annealing process, which affects the accuracy, a new variable is defined to record the global optimal solution. When a new solution is accepted, the global optimal solution is refreshed as appropriate.
[0133] (2) A heating process is added to ensure the accuracy of the algorithm. If no new solution is received for N / 2 consecutive times, the temperature counter is set to Raise to the set maximum temperature , a new round of annealing operation is performed, and the calculation accuracy is increased through multiple rounds of loop operation. At the same time, in order to avoid repeated calculations and waste server resources, the heating process is limited to run a certain number of times M in a single algorithm.
[0134] (3) Introduce specially designed perturbation schemes to improve the accuracy of the algorithm. According to the mathematical logic of the model, make full use of available resources when initializing the perturbation scheme, and ensure that all available resources are fully utilized during the perturbation process to avoid invalid loop operations caused by inferior perturbation schemes.
[0135] (4) All unloading decisions are traversed to ensure the globality of the solution space. Since each annealing is to optimize the resource allocation after fixing the unloading decision, the optimal total cost under all unloading decisions is obtained in a complete calculation process. The optimal total cost under each unloading decision is compared to obtain the global optimal total cost, ensuring that no situation is missed.
[0136] Specifically, in this embodiment, in order to show in detail the difference between the edge computing offloading method based on simulated annealing and the prior art, 10 terminal devices are set to conduct simulation experiments. The number of tasks corresponds to the number of terminal devices is 10; the amount of data for each task is Are not the same, in 1 Random value between 10MB;
[0137] Task load coefficient Randomly distributed among 20 100; the terminal device transmission power is 0.5W; the terminal device idle power is 0.1W; the computing power of each terminal device Varies, in 300 800MHz evenly distributed; the transmission rate from each terminal device to the edge server At 0.01 The value is within 0.1 MB / s; Indicates the distance between each terminal device and the base station, which is 0.1 Randomly distributed within 1Km; Total computing capacity of edge servers 80GHz; For cloud server computing resources, its value is set to 200 GHz; channel bandwidth Equal to 10MHz; simulated annealing initial temperature The simulated annealing termination temperature is 100. is 0.01; Indicates that the annealing speed is 0.98; when continuous They do not accept the new state and start to change the temperature. is 150; the maximum number of iterations per cooling is 500; the maximum number of heating times m is set to 3.
[0138] And compare the calculated SA, i.e. the optimal offloading strategy, with the following strategies:
[0139] 1. Random offloading: Randomly select an offloading strategy and allocate resources according to specific task requirements.
[0140] 2. All terminals: All tasks are executed on the terminal device without any uninstallation operations.
[0141] 3. Full edge: All tasks are offloaded to edge servers for computing and processing.
[0142] 4. All cloud: All tasks are offloaded to the cloud server for computing and processing.
[0143] The total cost of each strategy is obtained as Figure 4 As shown. Figure 4 It can be seen that the task offloading strategy based on simulated annealing effectively reduces the system cost. Under the current parameter setting, the system cost of all terminal calculations is relatively low, mainly because the task size and the total amount of various resources are more inclined to the offloading strategy of terminal calculations. The system cost of all cloud processing is the highest, and its cost is much greater than the system cost of all terminals. This is because all tasks need to be transmitted to the cloud for processing, and the computing resources of the terminal device and the edge server are completely wasted, resulting in a significant increase in latency cost and transmission energy consumption. At the same time, the terminal device also needs to wait for the result to be transmitted back, resulting in high standby energy consumption. All edge processing also generates a high system cost, and its cost is also much greater than the system cost of all terminals. This is because the total amount of computing resources of the edge server is limited. When the edge server needs to process a large number of tasks, the computing resources allocated to each task will be reduced, so that the computing latency and computing energy consumption increase. In contrast, the task offloading strategy based on simulated annealing can integrate various scenarios and effectively utilize various resources of cloud-edge-end devices, thereby minimizing the system cost.
[0144] By controlling the variable method, we can observe the impact of different parameter changes on the system cost. The simulation experiment scenario is the same as above. The simulation selects the parameters in the table, and at the same time selects one group of parameters to change and observe the changes in the system cost curve. By controlling the changes in bandwidth and the number of terminals, we observe their impact on the system cost of different unloading strategies, and then analyze which factors mainly affect the system cost of each strategy. The impact of bandwidth changes on the total cost is as follows: Figure 5 shown.
[0145] Depend on Figure 5The analysis shows that with the increase of service area bandwidth, the total cost of different offloading schemes shows different changing trends. In the case of full-terminal computing, since the computing scheme does not involve data transmission, its total cost is not affected by bandwidth. Compared with other offloading strategies, the total cost of the full-edge and full-cloud offloading strategies decreases the fastest, and the original cost is about 1.15 times the original cost after each decrease. This is because they have more tasks to transmit and need to allocate bandwidth to multiple tasks at the same time. When bandwidth resources are not sufficient, the bandwidth resources allocated to each task are insufficient, so the total cost is highly sensitive to bandwidth changes. This can also explain why the optimal offloading strategy and random offloading are less sensitive to bandwidth changes. When bandwidth resources are sufficient, the differences between the various offloading schemes gradually decrease, and the cost reduction rate is also slowing down, which means that the benefits of optimizing the offloading strategy will gradually weaken. The impact of changes in the number of terminals on the total cost is as follows: Figure 5 shown.
[0146] Depend on Figure 6 Analysis shows that as the number of terminal devices increases, the total cost of different offloading schemes shows a roughly similar upward trend. This is because tasks are generated in terminal devices, and the increase in terminal devices leads to an increase in the total number of tasks. In the case of full-terminal computing, as the number of terminals increases, insufficient resources may occur, resulting in increased costs. Compared with other offloading strategies, the total cost of the full-edge and full-cloud offloading strategies rises the fastest, and the cost increases roughly linearly with a slope of 64. This is because as the total number of tasks increases, the resource allocation of edge servers and cloud servers is insufficient, and the amount of data transmission will also increase. Therefore, the total cost is highly sensitive to changes in the number of terminals. In comparison, the SA offloading scheme has higher flexibility and can flexibly allocate resources between cloud-edge-end according to task requirements, making resource utilization more efficient and optimizing data transmission paths, thereby reducing total costs.
[0147] In summary, the present invention proposes a random optimization algorithm based on simulated annealing algorithm to solve the problem of minimizing the total cost. The solution space of the problem solved in this paper is relatively large. The SA algorithm is often used to find the global optimal solution or local optimal solution of a function in a solution space that is relatively large, complex and difficult to solve by traditional optimization methods. Therefore, it is selected as the optimization algorithm for solving the problem. The traditional simulated annealing algorithm has accuracy. Through the cyclic proportional simulated annealing process, its solution is guaranteed to be correct; through the characteristic of probabilistic acceptance of inferior solutions, it is guaranteed not to fall into the dilemma of local optimality, and has strong global search ability; and it has stability. Since the relevant initial values are all randomly generated, it has strong ability to resist external unstable factors. In short, in order to solve the minimized total cost that comprehensively considers energy consumption and delay in the cloud-edge-end environment, this paper quotes the CEL network model, applies the optimized simulated annealing algorithm for iterative solution, and obtains the optimal unloading strategy and resource allocation plan. In the simulation experiment, it is verified that the effect of the total cost obtained by using the optimized simulated annealing algorithm is significant and the influence of related parameter changes on the total cost is analyzed. Subsequent research work will consider the impact of more variables on energy consumption and latency to further optimize the algorithm, and for problems that take a long time to solve, we will try to solve them more efficiently in polynomial time.
[0148] See also Figure 7 The second embodiment of the present invention further provides an edge computing unloading device based on simulated annealing, which includes:
[0149] Initialization unit 201 is used to initialize the initial temperature, the minimum temperature, the maximum number of iterations and the annealing temperature reduction coefficient, and define the matrix for recording the unloading decision A and a matrix to record resource allocation B , according to the matrix of recorded resource allocation B Get the initial solution, total cost, initial optimal solution and optimal total cost;
[0150] The perturbation unit 202 is used to perform perturbation processing on the initial optimal solution within a preset maximum number of iterations, calculate the original solution after perturbation and the new solution after perturbation, compare the total cost function corresponding to the original solution and the total cost function of the new solution, and accept the new solution or the original solution according to the comparison result;
[0151] The unloading decision optimal solution unit 203 is used to compare the current temperature with the minimum temperature, and continue to reduce the current temperature according to the judgment result, or obtain the optimal solution corresponding to the unloading decision;
[0152] The allocation plan generating unit 204 is used to obtain an optimal allocation plan according to the calculated optimal solution corresponding to each unloading decision.
[0153] The third embodiment of the present invention also provides an edge computing offloading device based on simulated annealing, which includes a memory and a processor, wherein a computer program is stored in the memory, and the computer program can be executed by the processor to implement an edge computing offloading method based on simulated annealing as described in any one of the above.
[0154] The fourth embodiment of the present invention also provides a computer-readable storage medium storing a computer program, wherein the computer program can be executed by a processor of a device where the computer-readable storage medium is located to implement the edge computing offloading method based on simulated annealing as described in any one of the above.
[0155] Exemplarily, the above-mentioned devices and process steps can be implemented by a computer program. The computer program can be divided into one or more units. The one or more units are stored in the memory and executed by the processor to complete the present invention.
[0156] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0157] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the present invention by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0158] Wherein, if the electronic device or printer integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0159] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.
[0160] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. An edge computing offloading method based on simulated annealing, characterized in that: include: Initialize the initial temperature, minimum temperature, maximum number of iterations and annealing cooling coefficient, and define the matrix for recording unloading decisions A and a matrix to record resource allocation B , according to the matrix of recorded resource allocation B Get the initial solution, total cost, initial optimal solution and optimal total cost; Performing a perturbation process on the initial optimal solution within a preset maximum number of iterations, calculating the original solution after the perturbation and the new solution after the perturbation, and comparing the total cost function corresponding to the original solution with the total cost function of the new solution, and accepting the new solution or the original solution according to the comparison result; Compare the current temperature with the lowest temperature, and continue to lower the current temperature according to the judgment result, or obtain the optimal solution corresponding to the unloading decision; According to the calculated optimal solution corresponding to each unloading decision, the optimal allocation plan is obtained; Initialize the initial temperature, minimum temperature, maximum number of iterations and annealing cooling coefficient, and define the matrix for recording unloading decisions A and a matrix to record resource allocation B , according to the matrix of recorded resource allocation B The initial solution, total cost, initial optimal solution and optimal total cost are obtained, specifically: Initialization initial temperature , minimum temperature , maximum number of iterations N and annealing cooling coefficient q ; Get multiple uninstall decisions, and traverse all uninstall decisions to obtain a matrix that records the uninstall decisions A ; Initialize the matrix that records resource allocation based on the offloading decision B , and get the initial solution , ; Calculate the initial solution The corresponding total cost , and let the initial optimal solution = the initial solution , record the optimal total cost corresponding to the initial optimal solution , optimal total cost =Total Cost ; The optimal total cost The calculation formula is: in, , , is a binary variable, , , For the i The delay caused by the local execution of tasks by a terminal device, For the i The energy consumption generated by each terminal device when executing tasks locally, For the i The total delay caused by offloading the corresponding tasks of each terminal device to the edge server for computing and processing, For the i The total energy consumption generated by offloading the corresponding tasks of each terminal device to the edge server for computing and processing. For the i The terminal device is in the cloud server i The total delay caused by executing a task is For the i The terminal device is in the cloud server i The total energy consumption generated by executing a task is , is the preference coefficient, , , .
2. The edge computing offloading method based on simulated annealing according to claim 1 is characterized in that: The initial optimal solution is perturbed within a preset maximum number of iterations, the original solution after perturbation and the new solution after perturbation are calculated, and the total cost function corresponding to the original solution and the total cost function of the new solution are compared, and the new solution or the original solution is accepted according to the comparison result, specifically: The initial optimal solution is perturbed within the preset maximum number of iterations to obtain the perturbation n The original solution , and calculate the disturbance n The original solution The corresponding total cost function ; In the disturbance n The original solution Based on the perturbation, we get a new solution , and calculate the new solution The corresponding total cost function ; When the new solution is determined The corresponding total cost function Less than the original solution The corresponding total cost function When receiving the new solution, let m =0, m is the number of consecutive times of not accepting new solutions; When the new solution is determined The corresponding total cost function Not less than the original solution The corresponding total cost function Calculate the probability of accepting an inferior solution when P , the calculation formula is: in, is the probability of accepting an inferior solution for the current temperature calculation, is the current temperature, is the natural logarithm, is the current solution, is the current solution after perturbation, For the current solution The corresponding total cost function is, is the current solution after perturbation The corresponding total cost function; Get variables p , p The value of is [0,1]. Less than When accepting new interpretations; When judging Not less than When the new interpretation is not accepted, m=m+1 , and judge m Is it greater than , N is the maximum number of iterations; If so, perform the temperature increase operation to make the current temperature Rise to initial temperature , and randomly perturb the new solution and restart annealing; If not, perform a cooling operation at the end.
3. The edge computing offloading method based on simulated annealing according to claim 2 is characterized in that: Compare the current temperature with the minimum temperature, and continue to lower the current temperature according to the judgment result, or obtain the optimal solution corresponding to the unloading decision, specifically: When the current temperature is determined Greater than the minimum temperature , perform another iteration and continue to refresh the solution so that the current temperature Continue to lower; When the current temperature Less than the minimum temperature When , the loop ends, the optimal solution corresponding to the unloading decision is obtained, and the optimal solution corresponding to the next unloading decision is calculated.
4. An edge computing offloading device based on simulated annealing, used to implement the edge computing offloading method based on simulated annealing as claimed in claim 1, characterized in that: include: Initialization unit, used to initialize the initial temperature, minimum temperature, maximum number of iterations and annealing cooling coefficient, and define the matrix for recording unloading decisions A and a matrix to record resource allocation B , according to the matrix of recorded resource allocation B Get the initial solution, total cost, initial optimal solution and optimal total cost; A perturbation unit is used to perform perturbation processing on the initial optimal solution within a preset maximum number of iterations, calculate the original solution after perturbation and the new solution after perturbation, compare the total cost function corresponding to the original solution with the total cost function of the new solution, and accept the new solution or the original solution according to the comparison result; The unloading decision optimal solution unit is used to compare the current temperature with the minimum temperature, and continue to reduce the current temperature according to the judgment result, or obtain the optimal solution corresponding to the unloading decision; The allocation plan generating unit is used to obtain an optimal allocation plan according to the optimal solution corresponding to each unloading decision calculated.
5. An edge computing offloading device based on simulated annealing, characterized in that: It includes a memory and a processor, wherein the memory stores a computer program, and the computer program can be executed by the processor to implement the edge computing offloading method based on simulated annealing as described in any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that: A computer program is stored, and the computer program can be executed by a processor of the device where the computer-readable storage medium is located to implement the edge computing offloading method based on simulated annealing as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Task unloading and resource allocation joint optimization method based on edge cooperation
CN111586762A
Multi-user fine-grained task unloading scheduling method and device based on cloud side-end cooperation
CN117632488A
