# Research on Optimization Algorithm of Cloud Computing Resource Allocation for Internet of Things Engineering Based on Improved Ant Colony Algorithm

Authors: Qiao Zhou
Journal: Mathematical Problems in Engineering
 (2022)

---

## Abstract

Considering the inability to use genetic algorithms, increased total execution time of tasks, and low user satisfaction and resource utilization based on existing algorithms, an improved ant colony algorithm optimization method for cloud computing resource allocation based on the mobile Internet of Things project is designed in order to better complete the allocation of cloud computing resources. In the mobile Internet of Things engineering environment, the tasks are classified by the characteristics of cloud computing resource allocation, and then, the justice distributive principle of the Berger model is analyzed through modeling by the human metamodel. Based on this, the global search capability of genetic algorithm is introduced into the initial information allocation process so as to integrate the genetic algorithm and ant colony algorithm and then apply them in the cloud computing resource allocation process. As can be learned from the simulation results, the proposed method can comprehensively improve user satisfaction and resource utilization while shortening the total execution time of tasks.


---

## Body

## 1. Introduction

The rapid development of computer technology has facilitated the extensive application of virtualization technology, which enables users to not only effectively realize resource sharing but also obtain different types of integrated services [1]. In the process of resource sharing, cloud computing technology is the foundation [2, 3].As a new business computing model that emerged at the right moment, cloud computing has brought about changes and convenience on the Internet, but it also generated more hidden data security problems [4]. In a complex cloud computing environment, the actual distribution of resources is so complicated that it is prone to problems such as insufficient resource utilization and overestimated resource requirements. Therefore, to allocate cloud resources reasonably is quite essential, and a lot of research studies have been conducted on this aspect. For example, Jiang Donghan et al. [5] first elaborated on the development prospects of cloud computing in different fields and analyzed the basic concepts as well as role settings of cloud computing. Based on the traditional framework, they finally realized resource allocation by dividing resource allocation into three stages: resource scheduling, resource mapping, and resource adjustment. According to the three different designed constraints and objective functions, of which the objective functions contain two optimization goals of resource utilization and migration coefficient, Cai Linyi [6] solved through particle swarm algorithm and finally realized resource allocation. In spite of better application effects achieved by the above methods, the user satisfaction and resource utilization of traditional methods will inevitably decrease with the increasing amount of network resources. To this end, an improved ant colony algorithm optimization method for cloud computing resource allocation based on the mobile Internet of Things project is designed in this study.


## 2. Method Design

### 2.1. Task Classification

As a new type of computing model, cloud computing mainly includes resource computing and resource storage. With the responsibility for providing computing and storage and other related services for users, data service center of cloud computing is mainly composed of servers and software resources.An effective resource allocation strategy needs to comprehensively consider the load and network conditions of the virtual machine at current stage, so as to fully exert resources in cloud computing, improve resource utilization, and reduce the total execution time of tasks [7, 8].Set the task set toT=t1,t2,…,ti,…,tn and the virtual machine resource set in the cloud computing system to V=v1,v2,…,vj,…,vm, where ti represents the ith task, i=1,2,…,n; vj represents the jth virtual machine resource, and j=1,2,…,m. Resource allocation is to use a reasonable algorithm to allocate i tasks to j virtual machines for execution [9]. Assuming that the expected execution time of ith task in the jth virtual machine node is Ei,j and the estimated earliest start execution time is Timei,j, then the estimated completion time of the task i can be expressed as(1)ETimei=Ei,j+Timei,j.During cloud computing, Qos parameters are mainly used to calculate the degree of satisfaction of different users with cloud computing services. In the actual allocation process, resources need to be classified in combination with Qos parameters [10] to allocate more appropriate resources based on different needs. The Qos parameter can be divided into the following forms:(1)
RAM: it is necessary to prioritize the RAM parameters of Qos if the user has high requirements for the computer’s memory during calculation.(2)
Network bandwidth: when the network bandwidth has a greater impact on users, multimedia is required for data transmission, and also, the network bandwidth parameters of Qos are prioritized.(3)
Cost: when the price issue has a greater impact on users, the cost parameters of Qos need to be considered as priority.(4)
Completion time: if users have requirements for the task completion time, the completion time parameters of Qos shall be considered seriously to ensure the rapid execution of the task [11, 12].(5)
Network delay: if users have high real-time requirements, network delay shall be avoided in the actual application process. At this time, the network delay parameters of Qos need to be carefully considered to better meet the needs of different users.According to the abovementioned classification of Qos parameters, more satisfactory services can be offered directing at different types of customer needs. Meanwhile, the task classification can be effectively realized through combining the characteristics of cloud computing resources with Qos parameters.


### 2.2. Resource Allocation Based on the Berger Model

The modeling of the task model is completed through the Berger model. The research foundation of the Berger model is the theory of expectation state, which mainly describes the process of social individuals establishing goal expectations through the surrounding environment. The expected value formed in the modeling process will affect the behavior mechanism of the model itself.From multiple perspectives, the Berger model analyzes the social status axiology and the expected state to establish a theoretical model of distributive justice.In order to quantitatively describe the resources in computer,c is set to represent the actual characteristics of individual social individuals. Cx is set to represent the characteristics acquired by the reference structure model built by the individual cx, gox is set to represent the distribution amount actually acquired by the individual society, and Gox is set to represent the social distribution value formed by reference structure Cx through justice distribution, which is also called as the expected distribution under the Berger model.Whereof, the formal justice evaluation function of the Berger model can be expressed as follows:(2)JEF=θInARER,where AR represents the actual distribution amount, ER represents the target expected distribution amount, and θ represents the defined constant. When AR=ER and the value of JEF is 0, it means that the two are completely matched and can complete the justice distribution, which is the best distribution state. When AR>ER and JEF>0, it is obvious that distribution justice cannot be achieved in the actual application, so excessive distribution is allowed.In order to make full use of the Berger model in the cloud resource allocation process, the modeling of resource allocation and job scheduling in cloud environment is needed. Among them, the Berger model in the cloud environment has a double constraint relationship: due to the structural similarity between the task entitycx and the reference model Cx, the allocation of Gox to gox can provide a certain theoretical basis for subsequent research [13]. Then, when both gox and Gox tend to justice distribution, both gox and Ex can reach a fair state.The task can be completed reasonably only when there are enough resources available for allocation in the cloud system. On the basis of realizing resource allocation, it is necessary to optimize the entire process to ensure that the algorithm completes the allocation in the shortest time. For anyTi, the actual resource obtained is ARi, and the resource allocation expected by its own characteristics is ERi. When these two achieve coordination and unity, it means that the justice distribution of the task is met. Therefore, the fairness evaluation of the task can be expressed as follows:(3)Ji=θInARiERi.As can be learned from the above analysis, the fairness evaluation function of a single task allocation result enables it to judge the overall allocation result of the system. If the task set in the system isT and the corresponding resource allocation result is J, then the fairness of the system can be set as follows:(4)J=∑i=1nJi.


### 2.3. Improved Ant Colony Algorithm for Cloud Computing Resource Allocation

Compared with other evolutionary models, ant colony algorithm is a kind of random search that uses some randomly formed groups of initial solutions to obtain relatively optimal solutions. The whole process consists of two different phases, namely, the adaptation phase and the coordination phase. In the adaptation phase, each solution is adjusted and changed mainly through the change of information in the evolution process; in the coordination phase, the information exchange method between each solution is mainly used to obtain the relatively optimal solution.The number of cities is set ton and ants to m. First, the following settings are designed aiming at the behavior of each ant:(1)
Probability functionτijαt is the main basis for selecting the next city j with ants, where there is correlation among the probability function, the distance to the known city i, and the pheromone ηijβt on the path [14].(2)
Ants make path selection through established rules, which rules are mainly controlled by the taboo table. Ants cannot set off to other cities unless they have experienced a cycle.(3)
During the movement, ants will leave a certain amount of pheromone on the path it passes, so the probability function is set as(5)pkij=τijαt⋅ηijβtdk.After all the ants complete the cycle, all pheromone on the path is updated by the following formula, namely,(6)τijt+n=1−p×τijt×pkij,where t represents the ants’ moving time. However, in the actual application of ant colonies, the following problems will occur, such as(1)
Slow initial solution speed(2)
Prone to stagnation in the calculation process(3)
Decreased efficiency when the system scale is largeIn the following, genetic algorithm is introduced into the ant colony algorithm because it has fast and random global search capability. These two algorithms are combined to comprehensively improve the convergence speed while ensuring the accuracy of the original algorithm. In addition, the reverse transformation strategy is introduced to effectively reduce the risk that the algorithm falls into a local optimal solution and maintain as well as increase the diversity of species.Due to the less accumulation of pheromone on each path and small difference during the initial iteration of ant colony algorithm, there is certain degree of blindness in the initial search stage. However, in view that genetic algorithm has the ability of fast global search, the genetic algorithm is used for search and the initial allocation so that the better solution obtained by the genetic algorithm is converted into the initial information distribution of the ant colony algorithm. In this way, the initial information distribution of the ant colony algorithm can be quickly obtained, which effectively compensates for the insufficient search ability of the ant colony algorithm in the early stage and improves the convergence speed of the algorithm. After obtaining the initial pheromone distribution formed by the genetic algorithm, the ant colony algorithm is applied for searching.In the genetic algorithm, the quality of each individual in the population is evaluated through a certain evaluation standard called the fitness function. The specific calculation formula is(7)fi=∑k=1Mttimek−min+1M⋅ttimek−min+12,where M represents the size of the population, ttimek represents the maximum completion time of the ith task allocation plan. and min represents the minimum completion time in the task allocation plan.There are many coding methods for genetic algorithm, and the real number coding technology is adopted for coding as follows. When the initial population is generated, the chromosomes with better performance are selected through certain rules. At the same time, the formation of new individuals in genetic algorithm is mainly realized by crossover as well as mutation operation.In the actual application, the solution obtained by the genetic algorithm is set as the initial factor of the ant colony algorithm [15], and then, the number of ants on each resource point is converted into the initial pheromone on pheromone path of the resource point by means of pheromone conversion factor.The specific operating process of this algorithm is shown below:(a)
Set the initial parameters of genetic algorithm and ant colony algorithm, which mainly include population number and evolutionary algebra.(b)
Form the initial population and set the initial evolution times to 0.(c)
Perform crossover, mutation, and copy operations and increase all the evolutionary algebra by 1.(d)
Determine whether step (d) can reach the maximum number of iterations; if it meets the requirements, skip to step (e); otherwise, skip to step (c).(e)
Convert the solution obtained by genetic algorithm into initial pheromone.(f)
Placem ants on n vertices, that is, place m resources on n resource points.(g)
Place the starting point in the taboo table, improve each ant, and move to the next vertexj, that is, set up the mapping between tasks and resources, and modify the taboo table.(h)
Modify all pheromone concentrations to determine whether the ant has completed a task assignment. If the task assignment is completed, skip to step (i); otherwise, skip to step (g).(i)
Update the overall pheromone intensity.(j)
Perform mutation operation on all pheromone concentrations, and increase the number of iterations by one.(k)
Judge whether the maximum number of iterations is reached; if the requirements are met, skip to step (g); otherwise, skip to step (l).(l)
Judge the output of the optimal solution at current stage through the objective function.


## 2.1. Task Classification

As a new type of computing model, cloud computing mainly includes resource computing and resource storage. With the responsibility for providing computing and storage and other related services for users, data service center of cloud computing is mainly composed of servers and software resources.An effective resource allocation strategy needs to comprehensively consider the load and network conditions of the virtual machine at current stage, so as to fully exert resources in cloud computing, improve resource utilization, and reduce the total execution time of tasks [7, 8].Set the task set toT=t1,t2,…,ti,…,tn and the virtual machine resource set in the cloud computing system to V=v1,v2,…,vj,…,vm, where ti represents the ith task, i=1,2,…,n; vj represents the jth virtual machine resource, and j=1,2,…,m. Resource allocation is to use a reasonable algorithm to allocate i tasks to j virtual machines for execution [9]. Assuming that the expected execution time of ith task in the jth virtual machine node is Ei,j and the estimated earliest start execution time is Timei,j, then the estimated completion time of the task i can be expressed as(1)ETimei=Ei,j+Timei,j.During cloud computing, Qos parameters are mainly used to calculate the degree of satisfaction of different users with cloud computing services. In the actual allocation process, resources need to be classified in combination with Qos parameters [10] to allocate more appropriate resources based on different needs. The Qos parameter can be divided into the following forms:(1)
RAM: it is necessary to prioritize the RAM parameters of Qos if the user has high requirements for the computer’s memory during calculation.(2)
Network bandwidth: when the network bandwidth has a greater impact on users, multimedia is required for data transmission, and also, the network bandwidth parameters of Qos are prioritized.(3)
Cost: when the price issue has a greater impact on users, the cost parameters of Qos need to be considered as priority.(4)
Completion time: if users have requirements for the task completion time, the completion time parameters of Qos shall be considered seriously to ensure the rapid execution of the task [11, 12].(5)
Network delay: if users have high real-time requirements, network delay shall be avoided in the actual application process. At this time, the network delay parameters of Qos need to be carefully considered to better meet the needs of different users.According to the abovementioned classification of Qos parameters, more satisfactory services can be offered directing at different types of customer needs. Meanwhile, the task classification can be effectively realized through combining the characteristics of cloud computing resources with Qos parameters.


## 2.2. Resource Allocation Based on the Berger Model

The modeling of the task model is completed through the Berger model. The research foundation of the Berger model is the theory of expectation state, which mainly describes the process of social individuals establishing goal expectations through the surrounding environment. The expected value formed in the modeling process will affect the behavior mechanism of the model itself.From multiple perspectives, the Berger model analyzes the social status axiology and the expected state to establish a theoretical model of distributive justice.In order to quantitatively describe the resources in computer,c is set to represent the actual characteristics of individual social individuals. Cx is set to represent the characteristics acquired by the reference structure model built by the individual cx, gox is set to represent the distribution amount actually acquired by the individual society, and Gox is set to represent the social distribution value formed by reference structure Cx through justice distribution, which is also called as the expected distribution under the Berger model.Whereof, the formal justice evaluation function of the Berger model can be expressed as follows:(2)JEF=θInARER,where AR represents the actual distribution amount, ER represents the target expected distribution amount, and θ represents the defined constant. When AR=ER and the value of JEF is 0, it means that the two are completely matched and can complete the justice distribution, which is the best distribution state. When AR>ER and JEF>0, it is obvious that distribution justice cannot be achieved in the actual application, so excessive distribution is allowed.In order to make full use of the Berger model in the cloud resource allocation process, the modeling of resource allocation and job scheduling in cloud environment is needed. Among them, the Berger model in the cloud environment has a double constraint relationship: due to the structural similarity between the task entitycx and the reference model Cx, the allocation of Gox to gox can provide a certain theoretical basis for subsequent research [13]. Then, when both gox and Gox tend to justice distribution, both gox and Ex can reach a fair state.The task can be completed reasonably only when there are enough resources available for allocation in the cloud system. On the basis of realizing resource allocation, it is necessary to optimize the entire process to ensure that the algorithm completes the allocation in the shortest time. For anyTi, the actual resource obtained is ARi, and the resource allocation expected by its own characteristics is ERi. When these two achieve coordination and unity, it means that the justice distribution of the task is met. Therefore, the fairness evaluation of the task can be expressed as follows:(3)Ji=θInARiERi.As can be learned from the above analysis, the fairness evaluation function of a single task allocation result enables it to judge the overall allocation result of the system. If the task set in the system isT and the corresponding resource allocation result is J, then the fairness of the system can be set as follows:(4)J=∑i=1nJi.


## 2.3. Improved Ant Colony Algorithm for Cloud Computing Resource Allocation

Compared with other evolutionary models, ant colony algorithm is a kind of random search that uses some randomly formed groups of initial solutions to obtain relatively optimal solutions. The whole process consists of two different phases, namely, the adaptation phase and the coordination phase. In the adaptation phase, each solution is adjusted and changed mainly through the change of information in the evolution process; in the coordination phase, the information exchange method between each solution is mainly used to obtain the relatively optimal solution.The number of cities is set ton and ants to m. First, the following settings are designed aiming at the behavior of each ant:(1)
Probability functionτijαt is the main basis for selecting the next city j with ants, where there is correlation among the probability function, the distance to the known city i, and the pheromone ηijβt on the path [14].(2)
Ants make path selection through established rules, which rules are mainly controlled by the taboo table. Ants cannot set off to other cities unless they have experienced a cycle.(3)
During the movement, ants will leave a certain amount of pheromone on the path it passes, so the probability function is set as(5)pkij=τijαt⋅ηijβtdk.After all the ants complete the cycle, all pheromone on the path is updated by the following formula, namely,(6)τijt+n=1−p×τijt×pkij,where t represents the ants’ moving time. However, in the actual application of ant colonies, the following problems will occur, such as(1)
Slow initial solution speed(2)
Prone to stagnation in the calculation process(3)
Decreased efficiency when the system scale is largeIn the following, genetic algorithm is introduced into the ant colony algorithm because it has fast and random global search capability. These two algorithms are combined to comprehensively improve the convergence speed while ensuring the accuracy of the original algorithm. In addition, the reverse transformation strategy is introduced to effectively reduce the risk that the algorithm falls into a local optimal solution and maintain as well as increase the diversity of species.Due to the less accumulation of pheromone on each path and small difference during the initial iteration of ant colony algorithm, there is certain degree of blindness in the initial search stage. However, in view that genetic algorithm has the ability of fast global search, the genetic algorithm is used for search and the initial allocation so that the better solution obtained by the genetic algorithm is converted into the initial information distribution of the ant colony algorithm. In this way, the initial information distribution of the ant colony algorithm can be quickly obtained, which effectively compensates for the insufficient search ability of the ant colony algorithm in the early stage and improves the convergence speed of the algorithm. After obtaining the initial pheromone distribution formed by the genetic algorithm, the ant colony algorithm is applied for searching.In the genetic algorithm, the quality of each individual in the population is evaluated through a certain evaluation standard called the fitness function. The specific calculation formula is(7)fi=∑k=1Mttimek−min+1M⋅ttimek−min+12,where M represents the size of the population, ttimek represents the maximum completion time of the ith task allocation plan. and min represents the minimum completion time in the task allocation plan.There are many coding methods for genetic algorithm, and the real number coding technology is adopted for coding as follows. When the initial population is generated, the chromosomes with better performance are selected through certain rules. At the same time, the formation of new individuals in genetic algorithm is mainly realized by crossover as well as mutation operation.In the actual application, the solution obtained by the genetic algorithm is set as the initial factor of the ant colony algorithm [15], and then, the number of ants on each resource point is converted into the initial pheromone on pheromone path of the resource point by means of pheromone conversion factor.The specific operating process of this algorithm is shown below:(a)
Set the initial parameters of genetic algorithm and ant colony algorithm, which mainly include population number and evolutionary algebra.(b)
Form the initial population and set the initial evolution times to 0.(c)
Perform crossover, mutation, and copy operations and increase all the evolutionary algebra by 1.(d)
Determine whether step (d) can reach the maximum number of iterations; if it meets the requirements, skip to step (e); otherwise, skip to step (c).(e)
Convert the solution obtained by genetic algorithm into initial pheromone.(f)
Placem ants on n vertices, that is, place m resources on n resource points.(g)
Place the starting point in the taboo table, improve each ant, and move to the next vertexj, that is, set up the mapping between tasks and resources, and modify the taboo table.(h)
Modify all pheromone concentrations to determine whether the ant has completed a task assignment. If the task assignment is completed, skip to step (i); otherwise, skip to step (g).(i)
Update the overall pheromone intensity.(j)
Perform mutation operation on all pheromone concentrations, and increase the number of iterations by one.(k)
Judge whether the maximum number of iterations is reached; if the requirements are met, skip to step (g); otherwise, skip to step (l).(l)
Judge the output of the optimal solution at current stage through the objective function.


## 3. Simulation Experiment and Result Analysis

For the sake of verifying the comprehensive effectiveness of the above designed improved ant colony algorithm for cloud computing resource allocation based on the mobile Internet-of-Things project, MATLAB is used for simulation experiment.The methods in [5] and [6] are, respectively, selected for comparison. The performance of the methods is mainly verified in terms of the total execution time of tasks, resource utilization, and user satisfaction. The setting of experimental parameters is shown in Table 1.Table 1
Setting of experimental parameters.
Name of parametersSpecific valueNumber of ant colony iterations800 timesMaximum number of iteration times30 timesMinimum number of iteration times20 timesCrossover probability0.8%Population size50Mutation probability0.07%Minimum evolution rate5%Hardware environment400G hard disk, 8G RAMOperating systemWindows 10RAM512G


### 3.1. Total Time of Task Execution

Figure1 shows the total time of task execution used by three different methods.Figure 1
Comparison of total time of task execution used by different methods.According to the analysis of experimental data in Figure1, the total task execution time used by the proposed method is significantly lower than that used by the other two methods. Meanwhile, as can be seen from the simulation results of different task numbers, the proposed method is not very advantaged when the number of tasks is small, but as the number of tasks increases, the gap of the total execution time of each method gets greater. This is mainly because the proposed method introduces genetic algorithm to improve the ant colony algorithm, which helps play a better role in large-scale resource allocation problems.


### 3.2. User Satisfaction

Table2 shows the comparison of user satisfaction with the three methods.Table 2
Comparison of user satisfaction with different methods.
Number of experiments (times)Customer satisfaction (%)Proposed methodMethod in [5]Method in [6]1098.3697.8594.851597.1295.3392.582096.8594.1791.412596.4793.4790.283095.2292.2688.943595.0290.3687.144095.0089.6685.174594.5887.2584.565094.2386.3683.20Analysis of the experimental data in Table2 finds that the user satisfaction of each method varies due to the different number of experiments. However, the overall user satisfaction of the proposed method is kept relatively stable and significantly higher thanks to the introduction of genetic algorithm.


### 3.3. Resource Utilization

Figure2 shows the comparison of the resource utilization of three different methods.Figure 2
Comparison of resource utilization of different methods.As can be learned from analyzing the experimental data in Figure2, with the number of tasks increases, the resource utilization of the proposed method has more advantage, which also proves that the introduction of genetic algorithm into ant colony algorithm is correct. After improvement, the resource utilization rate of the whole method is greatly improved and obviously superior to the other two methods.


## 3.1. Total Time of Task Execution

Figure1 shows the total time of task execution used by three different methods.Figure 1
Comparison of total time of task execution used by different methods.According to the analysis of experimental data in Figure1, the total task execution time used by the proposed method is significantly lower than that used by the other two methods. Meanwhile, as can be seen from the simulation results of different task numbers, the proposed method is not very advantaged when the number of tasks is small, but as the number of tasks increases, the gap of the total execution time of each method gets greater. This is mainly because the proposed method introduces genetic algorithm to improve the ant colony algorithm, which helps play a better role in large-scale resource allocation problems.


## 3.2. User Satisfaction

Table2 shows the comparison of user satisfaction with the three methods.Table 2
Comparison of user satisfaction with different methods.
Number of experiments (times)Customer satisfaction (%)Proposed methodMethod in [5]Method in [6]1098.3697.8594.851597.1295.3392.582096.8594.1791.412596.4793.4790.283095.2292.2688.943595.0290.3687.144095.0089.6685.174594.5887.2584.565094.2386.3683.20Analysis of the experimental data in Table2 finds that the user satisfaction of each method varies due to the different number of experiments. However, the overall user satisfaction of the proposed method is kept relatively stable and significantly higher thanks to the introduction of genetic algorithm.


## 3.3. Resource Utilization

Figure2 shows the comparison of the resource utilization of three different methods.Figure 2
Comparison of resource utilization of different methods.As can be learned from analyzing the experimental data in Figure2, with the number of tasks increases, the resource utilization of the proposed method has more advantage, which also proves that the introduction of genetic algorithm into ant colony algorithm is correct. After improvement, the resource utilization rate of the whole method is greatly improved and obviously superior to the other two methods.


## 4. Conclusions

For the sake of solving the series of problems in traditional methods, an improved ant colony algorithm method is designed for cloud computing resource allocation based on mobile Internet-of-Things project. According to the experimental results, the proposed method can effectively reduce the total task execution time, improve user satisfaction, and enhance resource utilization. However, the proposed method still has some deficiencies due to the limited effective research time and energy. The future research will make some improvements from the following aspects, including(1)
Applying the proposed method to the actual environment for testing and improvement due to differences between the experimental data and the real data(2)
Further optimizing the parameters in order to minimize the impact on the entire method(3)
Introducing more optimized algorithms into the future research for the sake of meeting the development needs of cloud computing(4)
Optimizing the general task model so as to ensure the quality of resource allocation(5)
Comprehensively enhancing the resource allocation efficiency of the proposed method to complete the resource allocation within the shortest time



---

*Source: 5632117-2022-04-26.xml*