A workflow multi-objective scheduling method based on improved whale optimization algorithm
By improving the whale optimization algorithm and combining random difference mutation and nonlinear convergence factor, the problems of server load balancing and convergence speed in workflow scheduling are solved, realizing an efficient workflow scheduling scheme and reducing energy consumption and latency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-15
- Publication Date
- 2026-03-27
AI Technical Summary
Existing workflow scheduling algorithms fail to effectively consider server load balancing, leading to decreased server lifespan and performance. Furthermore, existing whale optimization algorithms have slow convergence speeds and are prone to getting stuck in local optima.
The improved whale optimization algorithm enhances the algorithm's global search capability and convergence speed by adding probabilistic random difference mutation operations and nonlinear convergence factors, combining weighted optimization objectives of average load, delay, and energy consumption, initializing the population using chaotic mapping, and employing fitness functions and random difference mutation.
It significantly accelerated the convergence speed of the algorithm, reduced the number of iterations, improved resource utilization and load balancing, obtained a better workflow scheduling scheme, and reduced energy consumption and latency.
Smart Images

Figure CN116305747B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of edge computing environment, and particularly relates to a workflow multi-objective scheduling algorithm based on an improved whale optimization algorithm. BACKGROUND
[0002] Workflow scheduling is a method of adjusting the execution order of tasks, and an excellent workflow scheduling can obtain high-quality user experience (QoE), achieve low delay and low power consumption, etc. In addition, with the increase in the number of edge server deployments, the load balancing of servers also rises as a problem to be solved. Most of the existing workflow scheduling algorithms do not consider the load balancing of servers, and efficient load balancing can maintain the life and performance of the server, thereby achieving the purpose of reducing time and energy consumption in another aspect.
[0003] The whale optimization algorithm (WOA) is derived from the simulation of the hunting behavior of a group of humpback whales in nature, and achieves the purpose of optimization search through the processes of whale group search, surrounding, hunting and attacking prey. The main difference between the current and other group optimization algorithms is that a random or best search agent is used to simulate the hunting behavior, and a spiral is used to simulate the bubble net attack mechanism of humpback whales, and the defect of the whale optimization algorithm is that the convergence speed is slow and it is easy to fall into a local optimal state.
[0004] In view of the above, in view of the optimization problem of workflow scheduling and the defects of the existing whale optimization algorithm, it is necessary to study and propose a method to solve the defects of the current algorithm to obtain the optimal workflow scheduling scheme. SUMMARY
[0005] In order to solve the defects in the existing workflow scheduling algorithm, the present application proposes a workflow multi-objective scheduling algorithm based on an improved whale optimization algorithm, which effectively combines the optimization objectives of average load, delay and energy consumption. By improving the linearly changing convergence factor in the original whale optimization algorithm, the convergence speed of the early population is accelerated, and in addition, compared with the original whale optimization algorithm, the random difference method mutation operation of probability selection is added to improve the ability of the algorithm to jump out of the local optimum in the later period. At the same time, the improved whale optimization algorithm is used in workflow task scheduling, and the system problem is defined as the weighted sum of average load, delay and energy consumption, so that the optimal workflow scheduling scheme can be found under the condition of meeting the user's constraint delay time and energy consumption.
[0006] In order to solve the existing technical problems, the technical scheme of the present application is as follows:
[0007] In a first aspect, the present application provides a workflow multi-objective scheduling method based on an improved whale optimization algorithm, characterized in that the method comprises the following steps:
[0008] Step (1): constructing task dependency model to determine the execution order of workflow tasks;
[0009] The directed acyclic graph DAG is used to represent the dependency relationship between tasks in the workflow, DAG = {T, E}, where T = {t1, t2, t3,... t i ,...,t n} represents the task set of the workflow, n is the total number of tasks, t i represents the i-th task, i ∈ [1, n], E = {(e jk , ed jk )|j, k ∈ [1, n]} represents the dependency relationship set between tasks, e jk is the predecessor-successor relationship between task t j and task t k , ed jk is the data passed from task t j to task t k .
[0010] Step (2): workflow scheduling scheme coding;
[0011] For each task, its corresponding server number should be determined, and the number of servers in the edge environment is known to be m; after topological sorting of the tasks in T according to the dependency relationship, it can be represented by a dimension vector X = (x i ,x i+1 ,...,x n ), X represents the scheduling scheme, representing a whale individual;
[0012] Step (3): chaotic mapping initializes whale population;
[0013] The Piecewise chaotic mapping is used to initialize the population, which is described as follows:
[0014]
[0015] Where p represents a random number in the interval (0, 0.5), which is a random generation parameter of chaotic sequence; x i represents the i-th generated initial code, x i+1 is the i+1-th initial code generated according to x i , a chaotic sequence is generated from all initial codes, then each initial code is multiplied by m and rounded up to get the corresponding server number, as follows:
[0016]
[0017] Let N be the population size, then the initial whale population W can be obtained, where each individual X 1 ,X 2,X 3 ,…,X N This represents a workflow scheduling scheme:
[0018] W = {X 1 ,X 2 ,X 3 ,…,X N Equation (3)
[0019] Step (4): Calculate the fitness of individual whales;
[0020] Step (4.1) Time calculation: The total workflow time is obtained by combining local computation time, transmission time, and server computation time; specifically:
[0021] Step (4.1.1) Local computation time calculation; Since local computation does not require communication with the edge server, communication time is saved. Workflow task t i Local processing time Specifically as follows:
[0022]
[0023] in Representing task t i Data size, f local Indicates the CPU processing frequency of the local device;
[0024] Step (4.1.2) Transmission Time Calculation: Data transfer exists between two workflow tasks, requiring the processing of related task data information. This stage consumes transmission time. Let B be the channel bandwidth between the local mobile device and the edge server k, AP be the average power of the signal transmitted in the channel, and GNP be the Gaussian noise power in the channel. The transmission rate can be calculated using these three parameters, thereby obtaining the transmission time of the workflow task. The transmission rate R local,k It can be calculated that:
[0025]
[0026] Given the transmission rate, let the local mobile device for task t... j The amount of data uploaded to edge server k is Task t is available j Upload time for:
[0027]
[0028] Let the data size of the downloaded result on the local mobile device be... Workflow task t can be obtained j Download time for:
[0029]
[0030] Step (4.1.3) Server computation time calculation:
[0031] Workflow task t j Server computation time on edge server k is:
[0032]
[0033] Wherein is the data size of task t j , f k is the cpu frequency of edge server k;
[0034] Step (4.1.4) Total time calculation;
[0035] The total time of workflow W can be represented as the sum of the above time, that is:
[0036]
[0037] Wherein LT represents the set of workflow tasks executed locally, ST represents the set of workflow tasks executed by offloading to edge servers, and BS is the set of edge servers;
[0038] Step (4.2) Energy consumption calculation, the total energy consumption of the workflow is obtained by local energy consumption calculation and offloading energy consumption calculation; Specifically:
[0039] Step (4.2.1) Local energy consumption calculation;
[0040] Let γ local be the energy consumption coefficient of each cpu cycle of the local mobile device, then the execution energy consumption of local workflow task t i can be given by the following formula:
[0041]
[0042] Step (4.2.2) Offloading energy consumption calculation;
[0043] The energy consumption of the local mobile device when offloading workflow task t j to the edge server can be calculated by the following formula:
[0044]
[0045] Wherein p tran represents the transmission power of the local mobile device;
[0046] Total energy consumption calculation of step (4.2.3) workflow W;
[0047]
[0048] Average load rate calculation of step (4.3);
[0049] For edge server k, let C k , M k , N k represent the total amount of its cpu, memory, network bandwidth resources respectively, represent the cpu resource consumption, memory consumption, bandwidth consumption of workflow task t j on edge server k, ar1, ar2, ar3 represent the proportion of resources, memory, bandwidth in the load, then the average load of edge server AVER load is calculated as follows:
[0050]
[0051] Fitness calculation of step (4.4);
[0052] Objective function f(X) of workflow scheduling scheme (that is, whale individual) fitness:
[0053]
[0054] Wherein α is the penalty coefficient of load, β is the weight factor, used to measure the user's preference degree to time and energy consumption;
[0055] Step (5): judging whether to prey on prey according to whether p1 is less than 0.5, p1 represents the selection probability of whale random behavior, if yes, step (7) is performed, if not, step (6) is performed;
[0056] Step (6): surrounding or searching for prey;
[0057] In the search space, the prey represents the current optimal workflow scheduling scheme, according to formula (16), if Each whale individual in the whale population will swim to the prey to surround it; if Each whale individual will swim to another random whale individual to search for prey, and the behavior model of the optimal workflow scheduling scheme is as follows:
[0058]
[0059]
[0060]
[0061] Wherein represents the current whale position after the t+1th iteration, represents the current iteration position, represents the position of the optimal whale in the tth iteration, represents the position of a random whale in the whale population, is a coefficient, is a distance coefficient, and is calculated by formula (16) and formula (17) respectively; the optimal workflow scheduling scheme is approached by the above formula; is generated by a random number, is a random vector in [0,1]; max_iter is the maximum number of iterations, and t is the current number of iterations, is the weight coefficient of the iteration process, and ω is the range coefficient;
[0062] Step (7): Spiral update position;
[0063] The behavior model of the optimal workflow scheduling scheme is as follows:
[0064]
[0065] where b is a constant that defines the spiral shape, and the search path is constantly iterated from the current optimal position to the global optimal position, i.e., the optimal workflow scheduling scheme is obtained, and l is a random number between 0 and 1;
[0066] Step (8): Improved random differential method mutation;
[0067] In order to speed up the search for the optimal workflow scheduling scheme, the random differential method mutation is used:
[0068]
[0069] where r1 and r2 are two random numbers, representing the optimal individual distance and the random individual distance weight proportion, respectively, represents the new individual after the random differential method mutation, and if the fitness of the new individual is better than that of the original individual, the original individual is accepted and replaced, so as to speed up the output of the optimal workflow scheduling scheme;
[0070]
[0071] If the fitness of the new individual is worse than that of the original individual, it is accepted with a probability, which is mathematically expressed as follows:
[0072]
[0073] where q r is a random number between 0 and 1, q is a variable nonlinear selection probability, and is given by the following formula:
[0074]
[0075] wherein t represents the current iteration number;
[0076] Step (9): output the optimal scheduling scheme;
[0077] If the iteration number reaches the maximum, the iteration is terminated, the optimal individual is output, and the optimal workflow scheduling scheme is obtained by decoding.
[0078] In a second aspect, the present application provides a computer readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method.
[0079] In a third aspect, the present application provides a computing device comprising a memory and a processor, wherein the memory stores executable code, and the processor executes the executable code to implement the method.
[0080] Compared with the prior art, the present application has the following characteristics:
[0081] Efficiency: the present application proposes an improved nonlinear convergence factor to solve the convergence factor in the original algorithm With the linear reduction of the iteration number from 2 to 0, the limitation problem caused by the global search ability and local optimization of the algorithm can significantly accelerate the convergence speed in the early stage of the algorithm, effectively reduce the iteration number of the algorithm, and obtain the optimal workflow scheduling scheme as soon as possible. In addition, the present application proposes an improved random difference method mutation operation after each iteration, which not only effectively improves the solution quality and obtains a better workflow scheduling scheme, but also speeds up the process of finding the optimal solution, to a certain extent, saving the time consumed by the algorithm. load , so that the overall load pressure reaches a small value, and the utilization rate of resources is obviously improved.
[0082] Robustness: the present application improves the original whale optimization algorithm, and adds an improved random difference method mutation operation after each iteration, which not only effectively improves the solution quality and obtains a better workflow scheduling scheme, but also speeds up the process of finding the optimal solution, to a certain extent, saving the time consumed by the algorithm. BRIEF DESCRIPTION OF DRAWINGS
[0083] Figure 1 A scientific workflow multi-objective scheduling algorithm flowchart based on an improved whale optimization algorithm is provided for the present application;
[0084] Figure 2 A scientific workflow multi-objective scheduling algorithm system structure diagram based on an improved whale optimization algorithm is provided for the present application;
[0085] Figure 3Initialize the distribution scatter plot for Piecewise chaotic mapping;
[0086] Figure 4 Load chart under different task quantities for comparison of Greedy algorithm, original whale optimization algorithm (WOA), PSO algorithm and the present application;
[0087] Figure 5 Throughput fold line chart in unit time for comparison of Greedy algorithm, original whale optimization algorithm (WOA), PSO algorithm and the present application;
[0088] Figure 6 Curve chart of fitness value change with increasing iteration number under the condition of task quantity being 400 for comparison of Greedy algorithm, original whale optimization algorithm (WOA), PSO algorithm and the present application. DETAILED DESCRIPTION
[0089] The following embodiments will further illustrate the present application in combination with the above-mentioned drawings.
[0090] Figure 2 The present application provides a scientific workflow multi-objective scheduling algorithm system structure diagram based on an improved whale optimization algorithm. First, the workflow tasks submitted by the mobile edge device are arranged to generate a DAG graph and form a scheduling sequence through topological sorting. Secondly, the improved whale optimization algorithm provided by the present application is applied and the fitness function generated by system modeling is used to determine the output optimal scheduling scheme. Finally, the workflow tasks are scheduled to the corresponding edge server for running according to the scheduling scheme.
[0091] In combination with Figure 1 The flowchart shown in the present application has the following specific steps:
[0092] Step (1): Construct a task dependency model; infrastructure such as PC, mobile phone, etc. will submit workflow tasks after dividing the mobile application, and there is a dependency relationship between the workflow tasks, which is represented by a directed acyclic graph DAG, DAG={T,E}., wherein T={t1,t2,t3,...t i ,...,t n} represents the task set of the workflow, n is the total number of tasks, t i represents the i-th task, wherein i∈[1,n], E={(e jk ,ed jk )|j,k∈[1,n]} represents the dependency relationship set between the workflow tasks, e jk is the predecessor-successor relationship of task t j and task t k , ed jk is the task t j transferred to task t kdata; workflow tasks are topologically sorted according to the dependencies between tasks, forming a task execution sequence that satisfies the dependencies, for example {t1, t2, t3, t4, t5, t8, t6, t7, t9, t 10}.
[0093] Step (2): workflow scheduling scheme encoding; for each task, its corresponding server number should be determined, given the task set of workflow DAG as T, the total number of tasks as n, and the number of servers in the edge environment as m. After topologically sorting the tasks in T according to the dependencies, the scheduling scheme represented by the whale individual can be represented by an n-dimensional vector X = (x i ,...,x n ), where x i = a indicates that task t i is assigned to server number a.
[0094] Step (3): initialize the whale population with chaotic mapping; the effectiveness of population initialization has a certain impact on the execution time of the algorithm, and good initialization can improve the global search ability of the algorithm and reduce the search time for the optimal workflow scheduling scheme. Therefore, the Piecewise chaotic mapping is used to initialize the population, which is described as follows:
[0095]
[0096] The mathematical form of the Piecewise chaotic mapping is simple, as shown in Figure 3 , which can generate a uniform initial whale population. A more uniform initial population can effectively improve the convergence speed of the algorithm and save part of the time in workflow scheduling.
[0097] where p represents a random number in the interval (0, 0.5), representing the random generation range of the chaotic sequence, the starting value x1 is a random number between 0 and 1, x i represents the initial encoding generated the i-th time, and x i+1 is the initial encoding generated the i+1-th time according to x i . After generating the chaotic sequence, multiply each value by m and take the integer part, to get the corresponding server number, as shown below:
[0098]
[0099] Let N be the population size, then the initial whale population W can be obtained as follows, where each individual X 1 ,X 2 ,X 3 ,…,X N represents a workflow scheduling scheme:
[0100] W = {X1 X 2 X 3 X N} Equation (3) Step (4): Whale individual fitness calculation; including time calculation, energy consumption calculation, average load rate calculation;
[0101] Step (4.1) Time calculation, the total consumption time of workflow is obtained by local calculation time, transmission time and server calculation time;
[0102] Step (4.1.1) Local operation time calculation; since local calculation does not need to communicate with edge server, communication time is saved, and the local operation time of workflow task t i can be given as:
[0103]
[0104] represent the data size of task t i , f local represents the cpu processing frequency of local device.
[0105] Step (4.1.2) Transmission time calculation; there is data transfer between two tasks, which needs to process the data information of related tasks, and transmission time needs to be consumed in this stage. Let B be the channel bandwidth between local mobile device and edge server k, AP be the average power of signal in the channel, and GNP be the Gaussian noise power in the channel. Transmission rate can be calculated by these three parameters, and then the transmission time of workflow task is obtained. Transmission rate R local,k can be calculated as:
[0106]
[0107] Given the transmission rate, let the data amount uploaded by local mobile device to edge server k for workflow task t j be the upload time j of workflow task t is:
[0108]
[0109] Let the data amount downloaded by local mobile device for result be the download time j of workflow task t is:
[0110]
[0111] Step (4.1.3) Server computation time calculation: workflow task t j Server computation time on server k is:
[0112]
[0113] Data size of task t j is f k , and cpu frequency of server k is f.
[0114] Step (4.1.4) Total time calculation; total time can be represented as the sum of the above-mentioned times, that is:
[0115]
[0116] Where LT represents the set of workflow tasks executed locally, ST represents the set of workflow tasks executed on servers, and BS represents the set of edge servers. Less total time can to some extent reflect the feasibility of the workflow scheduling scheme.
[0117] Step (4.2) Energy consumption calculation, the total energy consumption of the workflow is obtained through local energy consumption calculation and offloading energy consumption calculation, including step (4.2.1), step (4.2.2), step (4.2.3);
[0118] Step (4.2.1) Local energy consumption calculation; let γ local be the energy consumption coefficient of each cpu cycle of the local mobile device, then the execution energy consumption of local workflow task t i is given by the following formula:
[0119]
[0120] Step (4.2.2) Offloading energy consumption calculation; the local mobile device needs to consume energy when offloading workflow task t j to edge servers can be calculated by the following formula:
[0121]
[0122] p tran represents the transmission power of the local mobile device.
[0123] Step (4.2.3) Total energy consumption calculation; the total energy consumption E total of workflow W is obtained by accumulating step (4.2.1) and step (4.2.2), as follows:
[0124]
[0125] It is generally required that the scheduling of workflow tasks makes the total energy consumption reach a smaller value, so the present application also takes reducing energy consumption as an optimization goal.
[0126] Step (4.3) average load rate calculation;
[0127] For edge server k, let C k , M k , N k represent the total amount of its cpu, memory, network bandwidth resources respectively, represent the cpu resource consumption, memory consumption, bandwidth consumption of workflow task t j on edge server k, and ar1, ar2, ar3 represent the proportion of resources, memory, bandwidth in the load, then the average load AVER load of edge server is calculated as follows:
[0128]
[0129] The smaller the average load is, the better the adjustment effect of the workflow scheduling scheme at the load level is.
[0130] Step (4.4) fitness calculation; the method for calculating the objective function f(X) of the fitness of the whale individual represented by the workflow scheduling scheme is as follows by integrating step (4.1), step (4.2) and step (4.3):
[0131]
[0132] α is the penalty coefficient of load, and β is the weight factor, which is used to measure the degree of user's preference for time and energy consumption. The larger β is, the higher the requirement for time is, and vice versa, the higher the requirement for energy consumption is. By changing the parameters, the user's demand for load or time energy consumption of workflow task scheduling can be adjusted, and the direction of the optimization of the workflow scheduling scheme is further improved.
[0133] Step (5) contraction and spiral update; when the whale population finds prey, the whale individual performs contraction and spiral update with a probability of 50%, and the other 50% of the probability, so as to constantly determine the position of the optimal workflow scheduling scheme and approach it, and improve the spatial search ability of the algorithm. According to whether p1 is less than 0.5, it is judged whether the prey is caught, and p1 represents the selection probability of the random behavior of the whale. Its behavior model is:
[0134]
[0135] is the position of the whale individual in the next iteration, It represents the position of the optimal whale individual or a random whale individual in the current iteration. The specific discrimination method is reflected in step (6), where b is a constant that limits the spiral shape, and l is a random number between [0,1]. The two behaviors correspond to steps (6) and (7) respectively.
[0136] Step (6): Surround or search for the prey;
[0137] In the search space, the prey represents the current optimal workflow scheduling scheme, if Each individual whale in a whale pod will swim towards its prey to surround it. If Each individual whale will randomly swim towards another individual whale to search for prey. The behavioral model of the optimal workflow scheduling scheme is as follows:
[0138]
[0139]
[0140]
[0141] in This represents the position of the whale after the (t+1)th iteration. Indicates the current iteration position. This represents the position of the optimal whale in the t-th iteration. This indicates the location of a random whale in the whale population. It represents the coefficient. It is the distance coefficient, and is calculated using equations (16) and (17) respectively; the above formulas are used to approach the optimal workflow scheduling scheme; It is by Generated random numbers, It is a random vector in [0,1]; max_iter is the maximum number of iterations, and t is the current iteration number. These are the weighting coefficients for the iterative process, and ω is the range coefficient.
[0142] Due to the original algorithm As the number of iterations is linearly reduced from 2 to 0, the algorithm's global search capability and local optimization become limited, making it impossible to effectively adjust the convergence speed. Therefore, it is necessary to propose an improved nonlinear convergence factor to accelerate the algorithm's global convergence speed. The improved convergence operator is calculated as follows:
[0143]
[0144] Where max_iter is the maximum number of iterations, and t is the current iteration number. is the weight coefficient of the iterative process, ω is the range coefficient. The improved convergence factor can accelerate the convergence speed, and the optimal workflow scheduling scheme is obtained in fewer iterations.
[0145] Step (7): spiral update position;
[0146] Behavior model of the optimal workflow scheduling scheme:
[0147]
[0148] The spiral update diagram is shown in Figure 2 , wherein b is a constant that defines the spiral shape, and the search path is iterated from the current optimal position to the global optimal position, i.e., the optimal workflow scheduling scheme is obtained, and l is a random number between 0 and 1.
[0149] Step (8): improved random differential method mutation; compared with the original whale optimization algorithm, this step is added to generate new individuals by random differential method mutation of new solutions generated in each iteration of the whale population Compared with the original whale optimization algorithm, the advantage of this is that global optimization can be performed after each iteration, so that it can quickly converge in the early stage of solving, jump out of the local optimum in the later stage of solving, effectively improve the global search ability, and accelerate the search for the optimal workflow scheduling scheme. The formula of the random differential method mutation is as follows:
[0150]
[0151] wherein r1 and r2 are two random numbers, respectively representing the optimal individual distance and the random individual distance weight proportion, represent the new individual after random differential method mutation, if the fitness of the generated new individual is better than that of the original individual, then accept and replace the original individual, so as to accelerate the output of the optimal workflow scheduling scheme.
[0152]
[0153] If the fitness of the new individual is worse than that of the original individual, then accept it with a probability, which is mathematically expressed as follows:
[0154]
[0155] wherein q r is a random number between 0 and 1, q is a variable nonlinear selection probability, and is given by the following formula:
[0156]
[0157] By accepting the probability of poor solution, the application can not only enrich the means of jumping out of local optimum compared with the original whale optimization algorithm, obtain a better workflow scheduling scheme, but also weaken the influence of the convergence speed in the later stage of the algorithm, and ensure that the optimal workflow scheduling scheme is obtained within a certain number of iterations.
[0158] Step (9) outputs the optimal scheduling scheme; if the number of iterations reaches the maximum, the iteration is terminated, the optimal individual is output, and the optimal workflow scheduling scheme is decoded.
[0159] In order to embody the practicability of the application, the Greedy algorithm, the original whale optimization algorithm (WOA) and the PSO algorithm are selected in this paper, and they are compared with the application under different task quantities.
[0160] The experiment is run on a desktop computer configured as i5-12600KF, 32GB, win11, 64-bit, and uses the WorkFlowSim workflow simulation software running on Intellij IDEA as the simulation platform. The Montage workflow is generated with task numbers of 200, 400, 600 and 800, the channel bandwidth B=6Mbps, the average power of the signal in the channel AP=80mW, the local device cpu processing frequency is 1600MHz, the edge server cpu processing frequency is 5500MHz, the data sending / receiving power is 90mW, the designed penalty coefficient a is 1, the weight coefficient b is 0.4, ar1, ar2 and ar3 are 0.3, 0.3 and 0.4 respectively, and the maximum number of iterations of the algorithm is 50.
[0161] Figure 4 The Greedy algorithm, the original whale optimization algorithm and the application are shown in the case of fixed server quantity of 50, and the average load changes with the increase of the task quantity. It can be seen that under the influence of the task quantity, the workflow task scheduled by the Greedy algorithm quickly makes the load reach a large value, and compared with the other three algorithms, it cannot achieve good load balancing effect. On this basis, the application can effectively reduce the load compared with the original whale optimization algorithm and the PSO algorithm, because the whale population can quickly spiral upward under the adjustment of the nonlinear change of the convergence factor a, capture the optimal individual in each iteration, and further optimize the iteration result by using the random difference method in the later stage, and at the same time, find the potential better whale individual in a random search way, get the optimal scheduling scheme of the weighted sum of time energy consumption and average load, so the application has better load balancing effect compared with the other three algorithms under the premise of the same server quantity, and it can be seen that the application can play a good role in adjusting the load.
[0162] Figure 5The throughput of each algorithm in unit time under different server node numbers is compared, and the throughput in a certain time The amount of data of each task in the executed task set AST The cumulative calculation shows that the throughput of the four algorithms is improved with the increase of the number of server nodes, but the present application makes load balancing in the form of fitness Figure 4 The described related processing can more effectively adjust the load and allocate tasks, so under the adjustment of the algorithm of the present application, higher throughput can be obtained compared with the other three algorithms, which shows that the present application can process more tasks in unit time.
[0163] Figure 6 Table 1 shows the change of fitness value of the four algorithms with the increase of iteration number when the number of tasks is 400. In the first few iterations, the four algorithms have little difference, but after the iteration number reaches 20 times, the fitness value curve of the present application presents a nonlinear rapid decline compared with the other three algorithms, because the present application improves the convergence operator a, which can quickly converge in the early stage of the algorithm. When the iteration proceeds to 40 times, the fitness of the optimal solution of the Greedy algorithm is still not ideal, because the Greedy algorithm is prone to fall into local optimum in the later stage of the algorithm, so the optimal solution found is not the global optimal solution. Although the original WOA algorithm and PSO algorithm provide some means to jump out of local optimum, the effect is not significant, and there is also a risk of falling into local optimum. The present application adopts the method of random difference mutation and probability acceptance to ensure that global optimization can be performed after each iteration, so it can quickly converge in the early stage of solving and jump out of local optimum in the later stage of solving, improving the global search ability. Therefore, the solution quality and solving speed are better than Greedy algorithm, PSO algorithm and original WOA algorithm, which shows that the generated scheduling scheme consumes less system cost.
[0164] Table 1 comparison table of fitness of each algorithm under different iteration numbers
[0165]
Claims
1. A workflow multi-objective scheduling method based on an improved whale optimization algorithm, characterized in that The method comprises the following steps: Step (1): constructing a task dependency model to determine the execution order of the workflow tasks; Using a directed acyclic graph denotes a dependency between tasks in a workflow, wherein denotes a set of tasks of the workflow, is the total number of tasks, denotes the th task , denotes a set of dependencies between tasks, is the predecessor-successor relationship of task and task , is the data passed from task to task ; Step (2): workflow scheduling scheme coding; For each task, its corresponding server number should be determined, and the number of servers in the edge environment is known ; after the tasks in are topologically sorted according to the dependency relationship, the task can be represented by a dimension vector , indicates the scheduling scheme, representing a whale individual; Step (3): initializing the whale population by chaotic mapping; The population is initialized by Piecewise chaotic mapping, which is described as follows: Formula (1) wherein represents a random number of an interval, is a random generation parameter of the chaotic sequence; represents the initial encoding generated for the time, is the initial encoding generated for the time according to all initial encodings, a chaotic sequence is generated, and then each is multiplied by and rounded up to obtain a corresponding server number, as follows: Formula (2) Let For the population quantity, the initial workflow whale population where each individual represents a workflow scheduling scheme: Equation (3) Step (4): calculating the fitness of the whale individual; Objective function of fitness : Formula (4) wherein is a penalty coefficient for the load, is a weight factor, denotes the average load of the edge server, denotes the total time consumed by the workflow, denotes the total energy consumed by the workflow; Step (5): If the result of step (4) is less than 0.5, then go to step (6), else go to step (7). whether the prey is less than 0.5, a selection probability representing a random behavior of the whale; if yes, go to step (7), if no, go to step (6). Step (6): surrounding or searching for prey; In the search space, the prey represents the current best workflow scheduling solution, and if each whale individual will swim towards the prey to encircle it; if each whale individual will swim towards another random whale individual to search for the prey, and the behavior model of the optimal workflow scheduling solution is as follows: Formula (5) Equation (6) Equation (7) wherein denotes the position of the current whale after the th iteration, denotes the current iteration position, denotes the position of the best whale in the th iteration, denotes the position of a random whale in the whale population, is a coefficient, is a distance coefficient; is a random number generated by is a random vector in is a random vector in ; Improved convergence operator is computed by ; wherein is the maximum number of iterations, is the current number of iterations, is the weight coefficient of the iteration process, is the range coefficient; Step (7): spiral updating position; The behavior model of the optimal workflow scheduling scheme is as follows: Formula (8) wherein is a constant that defines the spiral shape, and from the current best position iterates to the global best position according to the search path, i.e. obtains the optimal workflow scheduling scheme, is a random number between Step (8): improving the random difference method mutation; In order to speed up the search for the optimal workflow scheduling scheme, the random difference method mutation is used: Formula (9) wherein , are two random numbers, respectively representing the optimal individual distance and the random individual distance weight proportion, represents a new individual after mutation by the random difference method, and if the fitness of the new individual is better than that of the original individual, the new individual is accepted and replaces the original individual, thereby accelerating the output of the optimal workflow scheduling scheme. Formula (10) If the fitness of the new individual is worse than that of the original individual, it is accepted with a probability, which is mathematically expressed as follows: Formula (11) wherein is a random number between is a varying non-linear selection probability and is given by the equation below: Formula (12) wherein denotes the current iteration number; Step (9): output the optimal scheduling scheme; If the number of iterations reaches the maximum, the iteration is terminated, the optimal individual is output, and the optimal workflow scheduling scheme is decoded.
2. The method of claim 1, wherein In step (4), the total time of the workflow W is obtained by local calculation time, transmission time and server calculation time, which is calculated as follows: ① Local operation time calculation; Since the local computation does not require communication with the edge server, communication time is saved, the task local computation time is as follows: Formula (13) in Represents workflow tasks The size of the data, Indicates the CPU processing frequency of the local device; ② Transmission time calculation; Data transfer exists between two workflow tasks, requiring the processing of related task data, which consumes transmission time at this stage; let... For local mobile devices and edge servers Channel bandwidth between The average power of the signal transmitted within the channel. The Gaussian noise power within the channel is used as the basis for calculating the transmission rate, which in turn allows us to obtain the transmission time of workflow tasks. It can be calculated that: Formula (14) Given the transmission rate, assume the local mobile device is able to handle the task. Upload to edge server The amount of data is Workflow tasks can be obtained. Upload time for: Formula (15) Let the data volume of the download result of the local mobile device be The download time of the workflow task is: Formula (16) ③ Server operation time calculation: Workflow task Server computation time on edge servers is: Formula (17) wherein is the size of the data volume for the task is the cpu frequency of the edge server is the size of the data volume for the task is the cpu frequency of the edge server ④ Total time calculation; Workflow The total time of the workflow can be expressed as the sum of the above times, i.e. Formula (18) wherein represents a set of workflow tasks executed locally, represents a set of workflow tasks executed on an edge server, is a set of edge servers.
3. The method of claim 1, wherein Workflow in step (4) The total energy consumption of the workflow is obtained by the local energy consumption calculation and the offloading energy consumption calculation. Specifically: ① Local energy consumption calculation; Let is the energy consumption coefficient for each cpu cycle of the local mobile device, then the local workflow task The execution energy consumption at the local can be given by the following equation: Equation (19) ② Unloading energy consumption calculation; A local mobile device will workflow tasks Energy is consumed when offloading to an edge server This can be calculated by the following equation: Equation (20) wherein represents the transmission power of the local mobile device; iii. Workflow Total energy consumption calculation; Equation (21).
4. The method of claim 1, wherein Average load of edge server in step (4) The calculation is as follows; For edge server , the total amount of resources of cpu, memory, network bandwidth respectively, , the total amount of resources of cpu, memory, network bandwidth respectively, , the total amount of resources of cpu, memory, network bandwidth respectively, , the total amount of resources of cpu, memory, network bandwidth respectively, , the total amount of resources of cpu, memory, network bandwidth respectively, , , , the total amount of resources of cpu, memory, network bandwidth respectively, , the total amount of resources of cpu, memory, network bandwidth respectively, Formula (22).
5. A computer readable storage medium having stored thereon a computer program, which, when executed in a computer, causes the computer to perform the method of any one of claims 1-4.
6. A computing device comprising a memory and a processor, wherein the memory stores executable code, and the processor executes the executable code to implement the method of any one of claims 1-4.
Citation Information
Patent Citations
A method for solving low-carbon workshop scheduling based on an improved whale optimization algorithm
CN109886589A
Particle swarm optimization workflow scheduling method based on directional search
CN113806039A