# Cloud Computing Task Scheduling Model Based on Improved Whale Optimization Algorithm

Authors: LiWei Jia; Kun Li; Xiaoming Shi
Journal: Wireless Communications and Mobile Computing
 (2021)

---

## Abstract

The efficiency of task scheduling under cloud computing is related to the effectiveness of users. Aiming at the problems of long scheduling time, high cost consumption, and large virtual machine load in cloud computing task scheduling, an improved scheduling efficiency algorithm (called the improved whale optimization algorithm, referred to as IWC) is proposed. Firstly, a cloud computing task scheduling and distribution model with time, cost, and virtual machines as the main factors is constructed. Secondly, a feasible plan for each whale individual corresponding to cloud computing task scheduling is to find the best whale individual, which is the best feasible plan; in order to better find the optimal individual, we use the inertial weight strategy for the whale optimization algorithm to improve the local search ability and effectively prevent the algorithm from reaching premature convergence; we use the add operator and delete operator to screen individuals after each iteration which is completed and updated to improve the quality of understanding. In the simulation experiment, IWC was compared with the ant colony algorithm, particle swarm algorithm, and whale optimization algorithm under a different number of tasks. The results showed that the IWC algorithm has good results in terms of task scheduling time, scheduling cost, and virtual machine. The application is in cloud computing task scheduling.


---

## Body

## 1. Introduction

The allocation of resources between users and enterprises is currently a concern of people from all walks of life. Task scheduling is a key technology in cloud computing to control resources and improve system stability, which directly affects user experience. So far, the design of many task scheduling algorithms has become a hot topic. Effective combination in the existing task scheduling algorithm can save the task completion time, meet the user’s service quality requirements, and improve the load balance of the system. Cloud computing follows the principle of on-demand allocation [1, 2], by establishing a huge resource pool, and then selecting the most appropriate resource for the user according to the user’s needs. It uses virtualization technology to centralize various resources and then uses specialized software to automatically manage the resources, so that users do not have to worry about other problems besides tasks. In this mode, the relationship between user task processing time and cost will be inseparable. Cloud computing often has to deal with a huge number of tasks, and resource scheduling has become a core issue. In scheduling, issues like cost, load balancing, and service quality are all unavoidable factors [3].The whale optimization algorithm (WOA) is one of the relatively new metaheuristic algorithms. It can provide good global search capabilities and can be widely used in various engineering problems. In this article, we try to use the whale optimization algorithm to solve the task scheduling in cloud computing. The experimental results show that the algorithm has a better scheduling effect under different number of tasks. Literature [4] merges Min–Min and Max–Min into a genetic algorithm and uses this algorithm for cloud computing task scheduling. In cloud computing scheduling, a given task optimizes the task execution time, load, and cost price of cloud computing; maps the task scheduling scheme to the whale algorithm model; and obtains the optimal solution by using WOA. We propose an advanced method called IWC (improved whale optimization algorithm), which is mainly used to improve the search ability of the best solution of the WOA algorithm. The contributions of this paper are as follows: (1) in order to improve the efficiency of cloud computing task scheduling, a multiobjective optimization model for task scheduling is proposed, and WOA is used to solve the entire problem; (2) an IWC algorithm is proposed, which improves the convergence and accuracy of the WOA-based method which improves the efficiency of task scheduling; (3) describes the implementation process of the IWC algorithm and compares it with the ACO, PSO, and WOA algorithms. The experimental results show that the algorithm works under different task quantity conditions. Down has a better scheduling effect.The rest of this article is organized as follows. The second section introduces the related work. The third section describes our scheduling system model. The fourth section introduces IWC; the fifth section proposes the implementation details of the improved IWC; in the sixth section, we simulated the algorithm and explained the scheduling effect; and the seventh section is the end of this article.


## 2. Related Work

For task scheduling under cloud computing, many scholars first established cloud computing task scheduling models from different perspectives and then used metaheuristic algorithms to solve the scheduling models and achieved good scheduling results. Due to space limitations, this article only elaborates on commonly used metaheuristics. Literature [5] uses the Genetic Algorithm to optimize task scheduling with energy consumption as the main goal; Literature [4] merges Min–Min and Max–Min into the Genetic Algorithm for the cloud computing task scheduling. The above results show that the use of the Genetic Algorithm in cloud computing tasks can reduce task completion time, reduce energy consumption, and improve resource utilization. Literature [6] used Ant Colony Optimization to handle the node load in the cloud in order to bring users a better user experience; Literature [7] used Ant Colony Optimization in the green cloud computing. The above results show that cloud computing effectively reduces the completion time, improves the efficiency of the node load, and reduces operating costs. Literature [8] used Particle Swarm Optimization based on two different inertial weights in cloud computing task scheduling to reduce task completion time; Saleh et al. [9] used the improved Particle Swarm Optimization for cloud computing task scheduling with the goal of average task length and scheduling success rate. Literature [10] proposed a binary-based Artificial Bee Colony for grid computing; Literature [11] used the Artificial Bee Colony to handle the allocation of energy-aware resources under cloud computing. The above results show that using Artificial Bee Colony can effectively reduce energy consumption and save user costs. Literature [12] proposed the use of a hybrid Shuffled Frog Leaping Algorithm for resource and workflow scheduling in cloud computing; Literature [13] proposed a cloud computing task scheduling algorithm based on ACO and PSO. Experiments show that this algorithm can help improve the efficiency of cloud computing scheduling. Literature [14] proposed a cloud computing task scheduling algorithm based on a mixture of ACO and WOA. Simulation experiments show that this algorithm is indeed better than ACO and WOA in cloud computing scheduling. Literature [15] proposed a QoS-aware scheduling algorithm (QoS-DPSO); experimental results show that QoS-DPSO can effectively improve the performance and obtain the high reliability; Literature [16] proposed a cloud computing task scheduling algorithm based on game theory. Simulation experiments show that the algorithm has better performance. Literature [17, 18] proposed the Huffman coding method and the whale optimization algorithm used in wireless sensor networks, which provide a new idea for cloud computing resource scheduling.


## 3. Cloud Computing Task Scheduling Model

In cloud computing, the task scheduling strategy will directly affect the resource utilization efficiency of the underlying system. Therefore, how to allocate tasks has become a key issue in cloud computing scheduling. This article mainly focuses on the performance of different scheduling algorithms. Therefore, assuming that all tasks submitted by users are logically independent of each other, the task scheduling process in the cloud environment can be summarized as the following three steps. First, we input the detailed information of the task and the available computing resources. Secondly, the tasks and resources will be mapped according to certain strategies, and the operation will be performed according to the mapping. The task plan of the control layer will generate an optimized task execution plan to meet certain assigned requirements (that is, the optimization goal). Finally, the optimized plan is delivered to the underlying task processing layer for execution, and the output result is sent to the user. The advantage of adopting this mode is that it can reduce the calculation delay, reduce the calculation cost, and improve the user experience effect. This article takes load balancing, completion cost, and execution time as the reference basis for users to evaluate cloud computing (Quality of Service, QoS) services [19].Let the task set beT=T1,T2,⋯TN and the resource node collection is N=N1,N2,⋯NM, in which N>M. Task scheduling under cloud computing can be represented by the following matrix:
(1)A=a11a12⋯a1Ma21a22⋯a2M⋯⋯⋱⋯aN1aN2⋯aNM.In the matrixA, aij is 1, which means the task i is performed on task j, or aij is 0, i∈1,N, j∈1,M. This article defines the attributes of each resource node including processing capacity (that is, processing time), initial memory (that is, the load of response processing), and resource bandwidth (that is, reflecting the cost of processing). Therefore, the three vectors of virtual machine resources are the processing power vector En, load capacity vector Sn, and resource bandwidth vector Cn. At the same time, each task corresponds to three matrices, which are the processing power vector Et, load capacity vector St, and resource bandwidth vector Ct; P are the unit prices. Therefore, the time target function time, load target function load, and cost target function cost are shown as follows.
(2)time=∑i=1N∑j=1MaijEt,iEn,j,(3)load=∑i=1N∑j=1MaijSt,iSn,j,(4)cost=∑i=1N∑j=1MaijEt,iEn,j×Ct,iCn,j×P.In the formula,Et,i refers to the Et value of the i task, En,j refers to the En value of the j virtual machine, St,i refers to the St value of the i task, Sn,j refers to the Sn value of the j virtual machine, Ct,i refers to the Ct value of the i task, and Cn,j refers to the Cn value of the j virtual machine. For our presentation in the following, we use the notations as listed in Table 1.Table 1
Main notes in the task scheduling model.
SymbolMeaningNNumber of tasks processedMNumber of virtual machinesaijIndicates that thei-th task corresponds to the j-th virtual machineEnEtVM (task) processing power vectorSnStVM (task) load capacity vectorCnCtResource bandwidth vector of VM (task)PUnit priceω1, ω2, ω3Weighting factorSince the results represented in the three matrices of resource nodes and task nodes have different standards, they need to be normalized, so the above three objective functions are expressed as follows:(5)Exetime=1N∑i=1N∑j=1MaijEt,i/En,jmax∀i,jEt,i/En,j,(6)Vmload=1N∑i=1N∑j=1MaijSt,i/Sn,jmax∀i,jSt,i/Sn,j,(7)Execost=1N∑i=1N∑j=1MaijPEt,iCt,i/En,jCn,jmax∀i,jPEt,iCt,i/En,jCn,j.Therefore, the task function set in this article is(8)Fi=ω1×Exetimei+ω2×Vmloadi+ω3×Execosti.In the formula,α, β, and γ are the weight values of Exetimei, Vmloadi, and Execosti, respectively, and ω1+ω2+ω3=1. Therefore, minFi is the optimal scheme for cloud computing task scheduling.


### 3.1. Whale Optimization Algorithm

In 2016, Mirjalil and Lewis [20] proposed a whale optimization algorithm (WOA) based on the behavior of whales’ preying in the sea. In the WOA algorithm, the humpback whale in the search space is a candidate solution in the optimization problem, also called the “search agent.” The WOA algorithm utilizes a set of search agents to determine the global optimal solution to the optimization problem. The search process for a given problem begins with a set of random solutions, and the candidate solution is updated by the optimization rules until the end condition is met. The whale optimization algorithm is divided into three stages: surrounding preying, bubble attack, and food search.


### 3.2. Surrounding Prey

In the initial stage of the algorithm, humpback whales do not know where the food is. They find the location of food by group work. Therefore, the whale closest to the food is equivalent to the current local optimal solution, and other individual whales may approach this position and gradually surround the food. So, it can be expressed in the following mathematical model:(9)D⟶=C⟶×X∗⟶t−X⟶t,(10)X⟶t+1=X∗⟶t−A⟶×D⟶,whereD⟶ indicates the distance vector from the search agent to the target food, t is the current iteration number, C⟶ and A⟶ are the coefficient vectors, X∗ is the local optimal solution, X⟶ is the position vector, and C⟶ and A⟶ are expressed as follows:
(11)C⟶=2×r⟶,(12)A⟶=2a⟶×r⟶−a⟶,wherea⟶ represents a linear decrement vector from 2 to 0 and r is a random number between 0 and 1.


### 3.3. Bubble Attack

At this stage, it is simulated that the humpback whales carry out a bubble attack, and the behaviors of whales’ preying and bubbling are designed by shrinking the surrounding and spiral position updating to achieve the purpose of local optimization of the whale.(1)
Principle of shrinking the surrounding. According to formula (10), the humpback whales are shrinking the surrounding. When ∣A∣<1, the individual whales are approaching the whale at the current best position; the larger ∣A∣ is, the bigger the steps the whales are taking, and vice versa.(2)
Spiral position updating. The individual humpback whale firstly calculates the distance from the current optimal whale and then swims in a spiral mode. When the food is being searched, the mathematical model of the spiral swimming is(13)X⟶t+1=D′⟶×elb×cos2πl+X∗⟶t,whereD′⟶=∣X∗⟶t−X⟶t∣ indicates the distance vector from the individual whale to the best whale distance, b is a constant, and l is a random vector between 0 and 1. In order to be able to maintain shrinking the surrounding circle and swim along the spiral path to the food, the following position updating equation is established:
(14)X⟶t+1=X∗⟶t−A⟶×D⟶,D⟶×elb×cos2πl+X∗⟶t.


### 3.4. Food Searching Stage

By controlling the∣A∣ vector, the humpback whales swim to get food. When ∣A∣>1, the individual humpback whales are approaching the position of the reference humpback whale and they swim towards the updated position of the humpback whale randomly selected, which ensures that the individual humpback whales can perform a global search to obtain a global optimal solution, and its mathematical model is expressed as follows:
(15)D⟶=C⟶×Xrand⟶−X⟶t,(16)X⟶t+1=Xrand⟶−A⟶×D⟶,whereXrand⟶ is a position vector of the randomly selected reference humpback whale.


## 3.1. Whale Optimization Algorithm

In 2016, Mirjalil and Lewis [20] proposed a whale optimization algorithm (WOA) based on the behavior of whales’ preying in the sea. In the WOA algorithm, the humpback whale in the search space is a candidate solution in the optimization problem, also called the “search agent.” The WOA algorithm utilizes a set of search agents to determine the global optimal solution to the optimization problem. The search process for a given problem begins with a set of random solutions, and the candidate solution is updated by the optimization rules until the end condition is met. The whale optimization algorithm is divided into three stages: surrounding preying, bubble attack, and food search.


## 3.2. Surrounding Prey

In the initial stage of the algorithm, humpback whales do not know where the food is. They find the location of food by group work. Therefore, the whale closest to the food is equivalent to the current local optimal solution, and other individual whales may approach this position and gradually surround the food. So, it can be expressed in the following mathematical model:(9)D⟶=C⟶×X∗⟶t−X⟶t,(10)X⟶t+1=X∗⟶t−A⟶×D⟶,whereD⟶ indicates the distance vector from the search agent to the target food, t is the current iteration number, C⟶ and A⟶ are the coefficient vectors, X∗ is the local optimal solution, X⟶ is the position vector, and C⟶ and A⟶ are expressed as follows:
(11)C⟶=2×r⟶,(12)A⟶=2a⟶×r⟶−a⟶,wherea⟶ represents a linear decrement vector from 2 to 0 and r is a random number between 0 and 1.


## 3.3. Bubble Attack

At this stage, it is simulated that the humpback whales carry out a bubble attack, and the behaviors of whales’ preying and bubbling are designed by shrinking the surrounding and spiral position updating to achieve the purpose of local optimization of the whale.(1)
Principle of shrinking the surrounding. According to formula (10), the humpback whales are shrinking the surrounding. When ∣A∣<1, the individual whales are approaching the whale at the current best position; the larger ∣A∣ is, the bigger the steps the whales are taking, and vice versa.(2)
Spiral position updating. The individual humpback whale firstly calculates the distance from the current optimal whale and then swims in a spiral mode. When the food is being searched, the mathematical model of the spiral swimming is(13)X⟶t+1=D′⟶×elb×cos2πl+X∗⟶t,whereD′⟶=∣X∗⟶t−X⟶t∣ indicates the distance vector from the individual whale to the best whale distance, b is a constant, and l is a random vector between 0 and 1. In order to be able to maintain shrinking the surrounding circle and swim along the spiral path to the food, the following position updating equation is established:
(14)X⟶t+1=X∗⟶t−A⟶×D⟶,D⟶×elb×cos2πl+X∗⟶t.


## 3.4. Food Searching Stage

By controlling the∣A∣ vector, the humpback whales swim to get food. When ∣A∣>1, the individual humpback whales are approaching the position of the reference humpback whale and they swim towards the updated position of the humpback whale randomly selected, which ensures that the individual humpback whales can perform a global search to obtain a global optimal solution, and its mathematical model is expressed as follows:
(15)D⟶=C⟶×Xrand⟶−X⟶t,(16)X⟶t+1=Xrand⟶−A⟶×D⟶,whereXrand⟶ is a position vector of the randomly selected reference humpback whale.


## 4. Task Scheduling in Cloud Computing Based on Improved Whale Optimization Algorithm

Compared with other advanced algorithms, the WOA algorithm has the advantages of simple operation and few parameters, but it has the problems of slow convergence, easily falling into the local optimum, and low convergence precision. Therefore, it was improved from two aspects of local search and global search in this dissertation.


### 4.1. Introduce Inertial Weight to Improve Local Search Ability

In Ref. [21], the inertial weight adopted in the PSO algorithm was beneficial to the local development of the algorithm and accelerated the convergence speed. Therefore, the inertial weight had an important influence on the convergence speed and local optimum. The inertial weight had a great influence on the WOA algorithm. Generally speaking, the WOA algorithm was to introduce the inertial weight, which decreased linearly with the increase of the number of iterations. This method satisfied that the algorithm required a large inertial weight in the early iteration but a small weight in the later period. However, if the global optimal value appeared in the early iteration of the algorithm and the inertial weight could not be efficiently and quickly reduced, then it might affect the tracking speed and accuracy of the algorithm; if it only depended on the inertial weight, of which the number of iterations was linearly decreasing, then it was difficult to effectively jump out of the local optimum for the local convergence of the algorithm. In order to make the inertial weight effectively adjusted, an adaptive inertial weight was proposed, which not only could depend on the change of the iteration number but also needs to consider the influence of the concentration of humpback whales, so as to achieve the purpose of improving the convergence speed and the optimal solution accuracy.In the adaptive WOA algorithm, an iteration number factorλ and a humpback whale clustering factor γ are introduced. λ indicates the relationship between the current iteration and the total number of iterations. The formula for calculating the iteration factor is as follows:
(17)λ=expt/QK,wheret indicates the number of current iterations, Q is the maximum number of iterations, and K is a constant greater than 1. Obviously, the curve of this iterative factor is a decreasing function related to t, and a larger weight can be obtained in the early iteration of the algorithm but a smaller weight in the later iteration. However, when the iterative period reaches the optimal value of the problem to be optimized, the inertial weight cannot be effectively reduced. In this paper, γ is used to adjust the aggregation degree of humpback whales, and the fitness function is used to represent the value of γ. Although the average cost of the IWC algorithm is lower than the other three algorithms, overall, the difference between the four algorithms is very small. When γ is relatively larger, it means that a large inertial weight is needed. On the contrary, it means that a smaller weight is needed. Therefore, the γ calculation formula is as follows:
(18)favg=∑k=1NfPkN,(19)E=1N−1∑k=1NfPk−favg2,(20)γ=sinarttanE.In (18)–(20), favg is the average value of the adaptive value, fPk indicates the adaptive value of the humpback whale k, E is the variance of the adaptive function value, and N is the total number of humpback whales.Therefore, in the adaptive adjustment process of inertial weight in the WOA algorithm, it should be fully considered for the influence of iteration factorλ and humpback whale clustering γ on inertial weight, so that the whale group can quickly converge to the global optimal position by adjusting the inertial weight with λ and γ to improve the accuracy of the algorithm. So, the adaptive weight formula is as follows:
(21)w=wmin+wmax−wmin×λ×γ,wherewmax and wmin indicate maximum and minimum values of the adaptive weights, respectively. In this dissertation, wmax was selected as 0.9 and wmin as 0.2. Therefore, formula (17) in the whale optimization algorithm is improved to obtain the following formula:
(22)X⟶t+1=w×D′⟶×elb×cos2πl+X∗⟶t.


### 4.2. Add Operator and Delete Operator

After each iteration of IWC, there is a lack of screening of individuals, which affects the effect of the next individual iteration, thus affecting the performance of the algorithm as a whole. Therefore, this paper uses the addition and deletion of operators to update the individuals after each iteration, so as to select individuals with better quality. This paper uses the trigger rules in literature [22] for the use of the operator. The rules are as follows.Rule 1: if the optimal individual is continuously updated in the generation 2GP, and ps>PSmin, then the delete operator is executed to delete ndec individuals;Rule 2: if the optimal individual is not continuously updated in the generation GP, and ps=PSmax, then the delete operator is executed to delete ndec individuals;Rule 3: if the optimal individual is not continuously updated in the generation GP, and ps<PSmax, then the increase operator is executed to add ndec individualswherePSmin is the initial clustering scale, PSmax is the largest clustering scale, and GP is the growth cycle.


#### 4.2.1. Design of Increased Operator

By adding operators to increase new individuals in the clustering, new information about current optimal individuals can be shared so as to avoid excessive greed and thus reduce the diversity of the clustering as follows:(1)
Determine the number of individuals to increase:(23)ninc=ps×PSmax−ps2×PSmax−2,whereps indicates the individuals of current clustering.
(2)
Generation of parent individual set: the current clustering is divided into ninc classes according to Algorithm 1, and the optimal individuals of all groups are selected to form an S1 set.Algorithm 1: Establishment of the S1 set.
Step 1: generate a reference pointR within the search range;Step 2: among the current clustering individualsP, select the point X′ closest to R;Step 3: inP\X′, find out the points closest to M−1 and X′ to form a subcluster;Step 4: deleteM individuals in P;Step 5: repeat step 2–step 4 until the cluster has been divided intoNp\M classes.According to Algorithm2, generate ninc/2 individuals to form S2.Algorithm 2: Establishment of the S2 set.
Step 1: initialization: generate individual pointsn and the search area xmin,xmax;Step 2: generate initial points (r1,r2,⋯rNd), ri=2cos2πi/p, 1≤i≤Nd, and p is a minimum prime number meeting p−3/2≥Nd;Step 3: generaten points: xk′=k⋅r1,k⋅r2,⋯k⋅rNd, k=1,⋯,n; ⋅ indicates the fractional part.Step 4: map the spawn point to the search domainxk=xmin+xkxmax−xmin.Select the valueR between 0 and 1: Ud=c1×xmax, Ld=c2×xmin(24)ΔdR=Ud−Ld2R2+LdUd−Ld,0<R<0.5,Ud−Ld1−2R−12+LdUd−Ld,0.5≤R≤1,wherex=xbest+ΔdR, in which xbest is the optimal individual in the current cluster; ninc−ninc/2 individuals are generated to make up S3.We generate the parent individual setS=S1∪S2∪S3.(3)Generation of new individuals: randomly selected two individuals x1 and x2 from S according to the following method
(25)xnew=α0.5x1+1−αx2.Therefore, according to the above description, the individual setS1 was generated by Algorithm 1 in this dissertation, which avoided the excessive greed caused by directly selecting the ninc individuals with the highest fitness and accordingly protected the diversity of the cluster. Then, the individual set S2 generated by Algorithm 2 could be more evenly distributed in the search area than the individuals randomly generated by obeying the uniform part, so that the areas not randomly developed could be better searched. The individual set S3 focused on learning of the optimal individual. By adding new individuals around the optimal one, the accuracy of the current optimal solution could be improved and the effectiveness of the algorithm could be protected. Therefore, by increasing the operator, the diversity of the cluster could be improved and the overall development capability of the algorithm was enhanced.


### 4.3. Design of Delete Operator

When the cluster is evolving, some individuals may be redundant inevitably. In order to further improve the efficiency of the algorithm, the delete factor should be designed to delete some redundant individuals. The design steps are as follows:(1)
Determine the number of individuals to be deleted(26)ninc=ps2×PSmax−ps×PSmax−2.(2)
Divide the cluster intondec classes according to Algorithm 1, and delete the worst individuals in each class. In this way, the deleted individuals are evenly distributed in the cluster, which is beneficial to preserve the diversity of the clusterTherefore, when the cluster has not fully evolved during the evolution process and its size reaches the upper limit, it indicates that the cluster may fall into the local optimum, and if the size reaches the upper limit, it is impossible to add new individuals to improve the diversity. Then, the delete operator should be performed to remove thendec individuals with the least fitness and reserve a space for new individuals produced.


### 4.4. Algorithm Flow

The algorithm flow is shown in Figure1.Figure 1
Algorithm flowchart.


## 4.1. Introduce Inertial Weight to Improve Local Search Ability

In Ref. [21], the inertial weight adopted in the PSO algorithm was beneficial to the local development of the algorithm and accelerated the convergence speed. Therefore, the inertial weight had an important influence on the convergence speed and local optimum. The inertial weight had a great influence on the WOA algorithm. Generally speaking, the WOA algorithm was to introduce the inertial weight, which decreased linearly with the increase of the number of iterations. This method satisfied that the algorithm required a large inertial weight in the early iteration but a small weight in the later period. However, if the global optimal value appeared in the early iteration of the algorithm and the inertial weight could not be efficiently and quickly reduced, then it might affect the tracking speed and accuracy of the algorithm; if it only depended on the inertial weight, of which the number of iterations was linearly decreasing, then it was difficult to effectively jump out of the local optimum for the local convergence of the algorithm. In order to make the inertial weight effectively adjusted, an adaptive inertial weight was proposed, which not only could depend on the change of the iteration number but also needs to consider the influence of the concentration of humpback whales, so as to achieve the purpose of improving the convergence speed and the optimal solution accuracy.In the adaptive WOA algorithm, an iteration number factorλ and a humpback whale clustering factor γ are introduced. λ indicates the relationship between the current iteration and the total number of iterations. The formula for calculating the iteration factor is as follows:
(17)λ=expt/QK,wheret indicates the number of current iterations, Q is the maximum number of iterations, and K is a constant greater than 1. Obviously, the curve of this iterative factor is a decreasing function related to t, and a larger weight can be obtained in the early iteration of the algorithm but a smaller weight in the later iteration. However, when the iterative period reaches the optimal value of the problem to be optimized, the inertial weight cannot be effectively reduced. In this paper, γ is used to adjust the aggregation degree of humpback whales, and the fitness function is used to represent the value of γ. Although the average cost of the IWC algorithm is lower than the other three algorithms, overall, the difference between the four algorithms is very small. When γ is relatively larger, it means that a large inertial weight is needed. On the contrary, it means that a smaller weight is needed. Therefore, the γ calculation formula is as follows:
(18)favg=∑k=1NfPkN,(19)E=1N−1∑k=1NfPk−favg2,(20)γ=sinarttanE.In (18)–(20), favg is the average value of the adaptive value, fPk indicates the adaptive value of the humpback whale k, E is the variance of the adaptive function value, and N is the total number of humpback whales.Therefore, in the adaptive adjustment process of inertial weight in the WOA algorithm, it should be fully considered for the influence of iteration factorλ and humpback whale clustering γ on inertial weight, so that the whale group can quickly converge to the global optimal position by adjusting the inertial weight with λ and γ to improve the accuracy of the algorithm. So, the adaptive weight formula is as follows:
(21)w=wmin+wmax−wmin×λ×γ,wherewmax and wmin indicate maximum and minimum values of the adaptive weights, respectively. In this dissertation, wmax was selected as 0.9 and wmin as 0.2. Therefore, formula (17) in the whale optimization algorithm is improved to obtain the following formula:
(22)X⟶t+1=w×D′⟶×elb×cos2πl+X∗⟶t.


## 4.2. Add Operator and Delete Operator

After each iteration of IWC, there is a lack of screening of individuals, which affects the effect of the next individual iteration, thus affecting the performance of the algorithm as a whole. Therefore, this paper uses the addition and deletion of operators to update the individuals after each iteration, so as to select individuals with better quality. This paper uses the trigger rules in literature [22] for the use of the operator. The rules are as follows.Rule 1: if the optimal individual is continuously updated in the generation 2GP, and ps>PSmin, then the delete operator is executed to delete ndec individuals;Rule 2: if the optimal individual is not continuously updated in the generation GP, and ps=PSmax, then the delete operator is executed to delete ndec individuals;Rule 3: if the optimal individual is not continuously updated in the generation GP, and ps<PSmax, then the increase operator is executed to add ndec individualswherePSmin is the initial clustering scale, PSmax is the largest clustering scale, and GP is the growth cycle.


### 4.2.1. Design of Increased Operator

By adding operators to increase new individuals in the clustering, new information about current optimal individuals can be shared so as to avoid excessive greed and thus reduce the diversity of the clustering as follows:(1)
Determine the number of individuals to increase:(23)ninc=ps×PSmax−ps2×PSmax−2,whereps indicates the individuals of current clustering.
(2)
Generation of parent individual set: the current clustering is divided into ninc classes according to Algorithm 1, and the optimal individuals of all groups are selected to form an S1 set.Algorithm 1: Establishment of the S1 set.
Step 1: generate a reference pointR within the search range;Step 2: among the current clustering individualsP, select the point X′ closest to R;Step 3: inP\X′, find out the points closest to M−1 and X′ to form a subcluster;Step 4: deleteM individuals in P;Step 5: repeat step 2–step 4 until the cluster has been divided intoNp\M classes.According to Algorithm2, generate ninc/2 individuals to form S2.Algorithm 2: Establishment of the S2 set.
Step 1: initialization: generate individual pointsn and the search area xmin,xmax;Step 2: generate initial points (r1,r2,⋯rNd), ri=2cos2πi/p, 1≤i≤Nd, and p is a minimum prime number meeting p−3/2≥Nd;Step 3: generaten points: xk′=k⋅r1,k⋅r2,⋯k⋅rNd, k=1,⋯,n; ⋅ indicates the fractional part.Step 4: map the spawn point to the search domainxk=xmin+xkxmax−xmin.Select the valueR between 0 and 1: Ud=c1×xmax, Ld=c2×xmin(24)ΔdR=Ud−Ld2R2+LdUd−Ld,0<R<0.5,Ud−Ld1−2R−12+LdUd−Ld,0.5≤R≤1,wherex=xbest+ΔdR, in which xbest is the optimal individual in the current cluster; ninc−ninc/2 individuals are generated to make up S3.We generate the parent individual setS=S1∪S2∪S3.(3)Generation of new individuals: randomly selected two individuals x1 and x2 from S according to the following method
(25)xnew=α0.5x1+1−αx2.Therefore, according to the above description, the individual setS1 was generated by Algorithm 1 in this dissertation, which avoided the excessive greed caused by directly selecting the ninc individuals with the highest fitness and accordingly protected the diversity of the cluster. Then, the individual set S2 generated by Algorithm 2 could be more evenly distributed in the search area than the individuals randomly generated by obeying the uniform part, so that the areas not randomly developed could be better searched. The individual set S3 focused on learning of the optimal individual. By adding new individuals around the optimal one, the accuracy of the current optimal solution could be improved and the effectiveness of the algorithm could be protected. Therefore, by increasing the operator, the diversity of the cluster could be improved and the overall development capability of the algorithm was enhanced.


## 4.2.1. Design of Increased Operator

By adding operators to increase new individuals in the clustering, new information about current optimal individuals can be shared so as to avoid excessive greed and thus reduce the diversity of the clustering as follows:(1)
Determine the number of individuals to increase:(23)ninc=ps×PSmax−ps2×PSmax−2,whereps indicates the individuals of current clustering.
(2)
Generation of parent individual set: the current clustering is divided into ninc classes according to Algorithm 1, and the optimal individuals of all groups are selected to form an S1 set.Algorithm 1: Establishment of the S1 set.
Step 1: generate a reference pointR within the search range;Step 2: among the current clustering individualsP, select the point X′ closest to R;Step 3: inP\X′, find out the points closest to M−1 and X′ to form a subcluster;Step 4: deleteM individuals in P;Step 5: repeat step 2–step 4 until the cluster has been divided intoNp\M classes.According to Algorithm2, generate ninc/2 individuals to form S2.Algorithm 2: Establishment of the S2 set.
Step 1: initialization: generate individual pointsn and the search area xmin,xmax;Step 2: generate initial points (r1,r2,⋯rNd), ri=2cos2πi/p, 1≤i≤Nd, and p is a minimum prime number meeting p−3/2≥Nd;Step 3: generaten points: xk′=k⋅r1,k⋅r2,⋯k⋅rNd, k=1,⋯,n; ⋅ indicates the fractional part.Step 4: map the spawn point to the search domainxk=xmin+xkxmax−xmin.Select the valueR between 0 and 1: Ud=c1×xmax, Ld=c2×xmin(24)ΔdR=Ud−Ld2R2+LdUd−Ld,0<R<0.5,Ud−Ld1−2R−12+LdUd−Ld,0.5≤R≤1,wherex=xbest+ΔdR, in which xbest is the optimal individual in the current cluster; ninc−ninc/2 individuals are generated to make up S3.We generate the parent individual setS=S1∪S2∪S3.(3)Generation of new individuals: randomly selected two individuals x1 and x2 from S according to the following method
(25)xnew=α0.5x1+1−αx2.Therefore, according to the above description, the individual setS1 was generated by Algorithm 1 in this dissertation, which avoided the excessive greed caused by directly selecting the ninc individuals with the highest fitness and accordingly protected the diversity of the cluster. Then, the individual set S2 generated by Algorithm 2 could be more evenly distributed in the search area than the individuals randomly generated by obeying the uniform part, so that the areas not randomly developed could be better searched. The individual set S3 focused on learning of the optimal individual. By adding new individuals around the optimal one, the accuracy of the current optimal solution could be improved and the effectiveness of the algorithm could be protected. Therefore, by increasing the operator, the diversity of the cluster could be improved and the overall development capability of the algorithm was enhanced.


## 4.3. Design of Delete Operator

When the cluster is evolving, some individuals may be redundant inevitably. In order to further improve the efficiency of the algorithm, the delete factor should be designed to delete some redundant individuals. The design steps are as follows:(1)
Determine the number of individuals to be deleted(26)ninc=ps2×PSmax−ps×PSmax−2.(2)
Divide the cluster intondec classes according to Algorithm 1, and delete the worst individuals in each class. In this way, the deleted individuals are evenly distributed in the cluster, which is beneficial to preserve the diversity of the clusterTherefore, when the cluster has not fully evolved during the evolution process and its size reaches the upper limit, it indicates that the cluster may fall into the local optimum, and if the size reaches the upper limit, it is impossible to add new individuals to improve the diversity. Then, the delete operator should be performed to remove thendec individuals with the least fitness and reserve a space for new individuals produced.


## 4.4. Algorithm Flow

The algorithm flow is shown in Figure1.Figure 1
Algorithm flowchart.


## 5. Algorithm Complexity Analysis

Time complexity refers to the computational workload required in the execution of the algorithm, which mainly depends on the number of repeated executions of the problem. In the basic whale optimization algorithm, the time complexity is mainly influenced by the population sizeN, the number of iterations T, and the search dimension D, and the time complexity of the basic WOA is ON∗T∗D. On the basis of the WOA, the complexity of the IWOA proposed in this paper has been increased as follows. The improved inertial weight to improve local search ability the complexity of OT.The addition operators and deletion operators increase the complexity of OT∗D. Therefore, the total complexity of the IWOA is ON∗T∗D+OT+OT∗D. The overall time complexity is higher than that of the WOA.


## 6. Experimental Simulation

In order to further verify the task scheduling effect of the algorithm in cloud computing, the algorithm IWC is compared with ACO, PSO, and WOA algorithms. The parameters required by the algorithm are shown in Table1. Select CPU as Core i3, memory is 4 G DDR3, hard disk capacity is 1000 G, operating system is Windows 7, and software is MATLAB 2012. The experiment is divided into small-scale tasks and large-scale task cloud computing tasks. The comparison indicators are cost value, time value, and memory load value. In order to explain the effect of better scheduling, this paper sets the number of small-scale tasks to [0, 1000] and sets the number of large-scale tasks to [1000, 10000].In order to further illustrate the efficiency of the algorithm in cloud computing task scheduling, the ant colony algorithm (ACO), Particle Swarm Optimization (PSO) algorithm, and whale optimization algorithm(WOA) were selected from the classical algorithms and compared with the algorithm proposed herein for task scheduling in cloud computing. Then, the cloud computing environment was simulated on the CloudSim simulation platform. The main parameters required by the algorithm here are shown in Table2. Combined with the characteristics of the tasks in cloud computing, the tasks were divided into small-scale tasks and large-scale tasks, which were compared from time and cost in the QoS indicators, respectively.
(1)
Time comparison. In this paper, 7 test functions from CEC2017 (shown in Table 3) are selected to evaluate the performance of the proposed algorithm. These test functions have both high dimensions (30, 50, 100) and low dimensions (2, 5, 10) that can be compared with the ACO, PSO, WOA in all aspects at time comparison (shown in Table 4).Table 2
Relevant parameters of comparison algorithm.
AlgorithmParameterValueDescriptionACOτ0.0005Pheromonesρi0.01Pheromone coefficientp0.5Path selection probabilityw0.5Inertial weightPSOc10.5Learning factor of particle swarmc20.5Learning factor of particle swarmWOAF0.5Follower numberrand0.5Random numberα0.5Random weightIWCwmax0.9Maximum weightwmin0.2Minimum weightK5Control number of clusteringL1000IWOA parameterPSmax10Upper limit of clusteringPSmin1Lower limit of clusteringTable 3
Test functions.
No.Function nameTest functionF1Spherefx=∑i=1nxi2F2Schwefel2.22fx=∑i=1n∣xi∣+∏i=1n∣xi∣F3Schwefel1.2fx=∑i=1n∑j=1ixjF4Schewfel2.21fx=maxabsxiF5Rosenbrockfx=∑i=1n−1100xi+1−xi22+xi−12F6Stepfx=∑i=1nxi+0.52F7Rastriginfx=∑i=1nxi2−10cos2πxi+10Table 4
Time comparison of 4 algorithms in test functions.
AlgorithmDimensionF1F2F3F4F5F6F7ACO20.0840.0860.7010.0730.2460.0720.09850.080.11.6660.0810.4410.0840.134100.1020.1213.7170.1020.8530.0920.199300.1550.18211.8910.1462.2190.1530.507500.2210.25722.1190.2282.8020.2190.6831000.3370.39758.0070.3164.1890.3321.064PSO20.0460.0450.0800.0410.0480.0330.04350.0950.1120.3150.0930.1810.0920.114100.1860.2230.9000.1880.4230.1910.261300.5950.7066.6730.6022.1210.6011.201501.0541.25017.8001.0544.9811.0712.7121002.4632.94276.7392.47319.6472.5028.952WOA20.0250.0180.03510.0140.0170.0130.01750.0340.0410.1330.0310.0720.0320.042100.0810.0920.4400.0760.1890.0820.116300.4330.4783.5100.4281.1590.4310.783501.1301.1919.8591.1013.1241.1612.1171004.2384.46141.1514.59012.9674.4818.720IWC20.0340.0210.0410.0160.0270.0120.01250.0330.0380.1430.0310.0740.0280.029100.0740.1760.4360.0750.1920.0730.084300.4510.5023.7130.4341.1830.4320.481501.1761.31210.6181.1123.0671.1151.2631004.2114.51641.0944.26312.1724.2364.741Table4 show a comparison of the usage times of the 4 algorithms in different dimensions under the 7 test functions. It is found that the usage time of this algorithm is longer than those of ACO, PSO, and WOA in all dimensions. This shows that the algorithm in this paper has good performance.
(2)
Cloud task scheduling normalization index. Figures 2–4 show the comparison of the four algorithms for normalized cost values, normalized time values, and normalized load values. Figure 2 shows the normalized cost of the four algorithms. The normalized value of the ACO algorithm is much larger than the other three algorithms, and the cost normalized values between the PSO, WOA, and IWC algorithms are not much different. When the number of tasks is between [0, 65], the normalized result of the IWC algorithm is lower than the WOA algorithm which is higher than the PSO algorithm, and when the task exceeds 65, the normalized result of the IWC algorithm is lower than the PSO and WOA algorithms. From the overall effect, the cost normalization values of the four algorithms tend to be stable. Compared with the ACO algorithm, the PSO algorithm, and the WOA algorithm, the IWC algorithm is reduced by 31.32%, 13.48%, and 9.57%, respectively. This shows that the IWC algorithm can effectively reduce the task scheduling cost under cloud computing. Figure 3 shows the normalized time comparison of the four algorithms. The normalized time result of the ACO algorithm is much larger than the other three algorithms. When the number of tasks is between [0, 65], the normalization result of the IWC algorithm is lower than the WOA algorithm which is higher than the PSO algorithm. When the number of tasks exceeds 65, the normalization result of the IWC algorithm is lower than that of the PSO algorithm and the WOA algorithm. From the overall effect, the normalization time of the four algorithms tends to be stable. Compared with the ACO algorithm, the PSO algorithm, and the WOA algorithm, the IWC algorithm is reduced by 18.29%, 4.88%, and 3.05%, respectively. Figure 4 shows the normalized load values for the four algorithms. After the number of tasks is greater than 60, the ACO algorithm tends to a fixed value. After the number of tasks is greater than 18, the PSO algorithm tends to a fixed value. After the number of tasks is greater than 20, the algorithm curve tends to a fixed value. The IWC algorithm tends to a fixed value after the number of tasks is greater than 70. Overall, the load value of the IWC algorithm is lower than 15.99%, 0.44%, and 0.14%, respectively, compared to the ACO algorithm, PSO algorithm, and WOA algorithm.(3)
Comparison of the number of small-scale tasks. Figures 5–7 show the cost, time consumption, and load comparison of the four algorithms for small-scale tasks. The cost consumption of the four algorithms is illustrated in Figure 5. The curves of four algorithms are gradually increasing with the increase in the number of tasks, but the curve of the IWC algorithm is relatively flat, although the average cost is numerically lower than the other three algorithms, but the overall difference between the four algorithms is small. Figure 6 shows the completion time of the four algorithms. It is found from the figure that as the number of tasks increases, the time consumption of the four algorithms becomes larger, but the overall four algorithms are not much different. However, the IWC algorithm has certain advantages in terms of time. Figure 7 shows the comparison of the load values of the four algorithms. From the curve in the figure, the load value curves of the four algorithms are basically consistent. This shows that the four algorithms have similar effects on the load.(4)
Comparison of the number of large-scaled tasks. Figures 8–10 show the cost, time consumption, and load comparison of the four algorithms for large-scale tasks. Figure 8 shows the cost of the four algorithms. Along with the increasing number of tasks, the curves of the four algorithms are gradually increasing, and the cost of ACO, PSO, and WOA algorithms is not much different. The cost curve of the IWC algorithm is obviously better than that of the other three algorithms. IWC is reduced by 52.94%, 47.06%, and 45.88% compared with ACO, PSO, and WOA, respectively, which shows that the IWC algorithm can effectively reduce the task cost. Figure 9 shows the completion time of the four algorithms. It is found from the figure that as the number of tasks increases, the time consumption of the four algorithms becomes larger, and IWC is better than ACO, PSO, and WOA. And the time spent was reduced by 39.29%, 32.14%, and 30%, respectively. This shows that there is a certain advantage in terms of time completion. Figure 10 shows the comparison of the load values of the four algorithms. From the figure, the load values of the four algorithms will be slightly different with the increasing number of tasks, but the overall difference is not large.Figure 2
Comparison of the four algorithms’ normalized cost.Figure 3
Time value of the four algorithms’ normalized cost.Figure 4
Load value of the four algorithms’ normalization.Figure 5
Comparison of the four algorithms’ cost in small-scaled task.Figure 6
Time comparison of the four algorithms’ cost in small-scaled task.Figure 7
Load comparison of the four algorithms’ cost in small-scaled task.Figure 8
Cost comparison of four algorithms under large-scale tasks.Figure 9
Time comparison of four algorithms under large-scale tasks.Figure 10
Load comparison of four algorithms under large-scale tasks.From the comparison of the above three experiments, the IWC algorithm proposed in this paper has obvious advantages in task cost and completion time and is more suitable for task scheduling under cloud computing. However, the effect on the memory load value is not very obvious, which shows that the IWC algorithm has more room for server memory optimization.


## 7. Conclusion

This article introduces a WOA-based task scheduling method in cloud computing task scheduling, mainly to improve the effect of task scheduling under cloud computing. In order to further improve the scheduling performance based on the WOA algorithm, on the basis of the WOA algorithm, two optimization strategies of the IWC algorithm are proposed. The experimental results show that compared with some commonly used metaheuristic algorithms, it can be used in system load and system resource utilization. In terms of cost, the efficiency of cloud computing systems is greatly improved. In future work, in order to obtain better convergence speed and accuracy in task scheduling, we will consider proposing more advanced strategies to further improve the balance between exploration and development in the IWC method. At the same time, to reduce the scheduling cost and time of this method in the face of a large number of virtual machine workloads, we will use some more advanced features to extend the proposed performance model and method. Our long-term goal is to develop a cloud computing efficient scheduling system suitable for various task workloads.



---

*Source: 4888154-2021-12-13.xml*