Abstract
For the problem of slow scheduling speed and poor load balancing of agricultural information resource scheduling in the current cloud computing, an agricultural information resource scheduling algorithm based on firefly algorithm is proposed in this paper. In cloud computing, according to the idea of earliest completing resource scheduling and using the least cost, the agricultural information resource scheduling model with time constraint is constructed. The minimum completion time and scheduling cost of resource scheduling are determined and the objective function of resource scheduling is built. The chaos algorithm is used to optimize the firefly algorithm to solve the objective function and improve the convergence speed of resource scheduling. Agricultural information resource scheduling is achieved according to the convergence results and by using Lagrangian relaxation function. Experimental results show that the proposed algorithm is faster in scheduling agricultural information resources and higher in load balancing.
Introduction
Cloud computing has been proposed as a new business computing model. With the continuous progress of academia and industry, cloud computing is gradually moving from theory to practice. The state also invested huge manpower and resources to promote cloud computing landing in China [27]. In the cloud computing, there are many different forms of cloud computing, and the cloud computing task has the characteristics of large scale and resource isomerism [19]. It is a hot and difficult point in the research of cloud computing to better realize cloud computing information resource scheduling [17, 18]. The essence of cloud computing resource scheduling is complex combination optimization problem, and swarm intelligence algorithm achieves the desired result after solving complex function optimization problem [20]. The scheduling efficiency of virtual resources will directly affect the performance of the whole cloud environment [2, 6]. Therefore, finding a better resource scheduling algorithm is of great significance to the research of cloud computing, and also facing challenges at present [9]. In order to better realize cloud computing information resource scheduling, experts and scholars have made a lot of research [21, 24–27]. This problem has also become a key topic of research and some more mature theories and applications have been generated [8].
In the literature [15], a resource scheduling algorithm in cloud computing based on membrane computing bat algorithm is proposed. Using the bat algorithm and introducing the concept of membrane computing, a resource scheduling model in cloud computing environment is established [4, 30]. The membrane system is decomposed into the main membrane and the auxiliary membrane. Individual local optimization of the bat is carried out in the auxiliary membrane [5, 35]. The optimized individual is sent to the main membrane for global optimization to achieve the optimal scheduling requirement of cloud computing resource [9, 22]. However, the computation process of this algorithm is rather complex, resulting in a long scheduling time. In the literature [23], a resource scheduling algorithm based on improved ant colony algorithm in cloud computing is proposed. Based on the latest ant colony algorithm, the time cost load is introduced into the pheromone updating to realize resource scheduling. However, this algorithm does not build the corresponding models, resulting in poor balance of resources. In the literature [7], a resource scheduling algorithm based on priority queuing theory and network delay in cloud computing is proposed. Aiming at the problem that different data need different priority output under different conditions in the actual application environment for virtual machine, the M/M/1 queuing model in operational research is adopted to make network delay analysis on the request of virtual machine and improve the traditional sequential output method. Combined with the Map-Reduce model of data resource in cloud computing environment, information scheduling is realized. However, the delay time of this algorithm is long, which affects the scheduling speed. In the literature [1], a resource scheduling algorithm based on improved chaotic firefly algorithm in cloud computing is proposed. A cloud computing resource scheduling model is established from 3 aspects of completion time, completion efficiency, and completion security. Ant colony algorithm is introduced into the firefly algorithm to improve resource scheduling speed. In the literature [15], a resource scheduling algorithm in cloud computing based on cat swarm optimization algorithm is proposed. A mathematical model is built according to the optimization objective of virtual machine resource scheduling. With the consideration of the shortest time and optimal load, fitness function of cat swarm optimization algorithm is constructed. By simulating the daily behaviors of the cat, the optimized scheme of virtual machine resource scheduling is achieved, and the resource scheduling is completed. But this algorithm has poor effect on scheduling process and affects resource complexity and balance.
To address these problems, an agricultural information resource scheduling algorithm based on firefly algorithm in cloud computing is proposed in this paper. The rest of this paper is organized as follows.
By using the idea of the earliest completion time and the least cost of the information resource scheduling, the objective function of the agricultural information resource scheduling is determined by constructing the agricultural information resource scheduling model under the time constraint.
The agricultural information resource rescheduling in cloud computing is realized based on firefly algorithm, and chaos algorithm and Lagrangian relaxation function are introduced to improve the scheduling effect [31–33].
Experimental results and analysis, experimental data verify the feasibility and effectiveness of the agricultural information resource scheduling algorithm based on firefly algorithm in cloud computing.
The prospect is put forward on the basis of the existing research.
Materials and methods
Resource scheduling model building
Agricultural information resource scheduling refers to the process of extracting agricultural information according to user’s requirements. Under the premise of meeting user’s requirements, the minimum cost of scheduling agricultural information resources is achieved. In order to meet user’s requirements in time, the optimal scheme with the earliest scheduling task and the best scheduling task cost is chosen [34]. In this way, the resource requirements of the whole scheduling process are satisfied, and the delay of one link will not affect the whole scheduling process.
Assume the agricultural information resource scheduling scheme set Ψ which meets the requirements. Each element φ ∈ Ψ is a feasible scheme for agricultural information resource scheduling. The completion time of each scheduling scheme φ is t
φ
and the completion cost is Z
φ
. Then the mathematical expression of the problem of agricultural information resource scheduling can be expressed as
By building the mathematical programming model of agricultural information resource scheduling, the optimal agricultural information resource scheduling scheme satisfying requirements is determined. The detailed process is described as follows.
In the cloud computing, assume there are n users who need agricultural information resources in a certain period. Each user needs an information resource scheduling path, and there is time limit for information resource reaching the user’s location. The number of paths that can now be used for scheduling is l (l > n) [28, 29]. The type of information resources is the same. The location of each information resource and the time information providing user services are known. t
ij
represents the time used by the i
th
path for providing services to the j
th
user. After proper processing, the scheduling problem is transformed into a balanced information scheduling problem, that is, l = n. Then the integer programming model is established under the initial conditions, given by
Where
The objective function of the model is to optimize the scheduling time of agricultural information resource. Then the constraint coefficient matrix of the constraint equations of the model is given by
The feasible solution of the model is x = (x11, ⋯ , x1n, ⋯ xl1, ⋯ x
ln
)
T
. For the constraint coefficient matrix, each row and column has one and only one element of 1, and the remaining elements are 0. The matrix also becomes a solution matrix. In order to determine the scheduling scheme of agricultural information resources, the coefficient matrix of the model is established and given by
In order to achieve the fastest agricultural information resource scheduling, the integer programming model is solved and the optimal solution of integer programming model is obtained, which is x0 = (x11, ⋯ , x1n, ⋯ xl1, ⋯ x ln ) T . The optimal value is z0. The largest element t jk in the corresponding coefficient matrix of the optimal solution of the model with element 1is found out, and then t0 = t jk is the earliest completion time of the scheme. z0 is the optimal scheduling cost. A new coefficient matrix T1 is obtained by transforming all the elements greater than or equal to t0 = t jk of the above coefficient matrix into a large number. By solving the problem after changing the coefficient matrix, a new solution is obtained and the corresponding earliest scheduling time t1 = t jk is found out. The above procedure is repeated until a new changed coefficient matrix T k is obtained. The objective function value of the model is large enough or T k =+ ∞, that is, no new optimal solution can be found. Then the calculation is terminated and xk-1 = (x11, ⋯ , x1n ⋯ , xl1 ⋯ , x ln ) T k =+ ∞ is the optimal solution of this problem. The shortest completion time of this scheduling scheme is tk-1 = t jk and the cost is zk-1.
Through the above discussion, the agricultural information resource scheduling model in cloud computing is described as
Assume M
tv
is allocated by the computing center according to the user’s task. M
vd
is required to be scheduled by schedulers to the corresponding physical device. Therefore, resource scheduling is mainly to solve the scheduling of resources to physical device. Assume a task t
i
is mapped through M
vd
to the resource v
j
and the task allocated on the resource v
j
is scheduled to execute on the physical device d
k
. According to the corresponding relationship between the resource and the task, the expected execution time of task t
i
executed on the physical device t
i
is ETC (T
i
, d
k
). Then all distribution matrices of T to D are called ETC matrices, given by
The earliest completion time of task t
i
on the physical device d
k
is given by
The total execution time of all the tasks T = {t1, t, …, t
m
} is given by
In order to ensure the fastest speed of agricultural information resource scheduling, the goal of cloud computing resource scheduling is to make the above equation minimum. Then the objective function of agricultural information resource scheduling in cloud computing is built as
From the above discussion, according to the idea of the earliest completion time and the least cost of the information resource scheduling, the agricultural information resource scheduling model under the time constraint is constructed, the completion time and the scheduling cost of the agricultural information resource scheduling are determined, and the objective function of the agricultural information resource scheduling is established.
The GSO algorithm (Firefly algorithm) [15] is applied to realize agricultural information resource scheduling. The location of the firefly is a potential solution to the objective function to be solved. The fluorescein value depends on the target function value of the location. The higher the fluorescein, the better the location of the firefly, that is, the better the objective function [25]. GSO algorithm does not consider the sex of firefly individuals. Assume the attraction of each firefly in information resources depends only on the perceived radius of the individual and the fluorescein value of the surrounding individuals. By comparing each individual’s fluorescein value, the purpose of exchanging information with each other is achieved and the optimization in the solution space is realized.
Assume m is the population size, that is, there are m fireflies, N is the dimension of the function to be solved, t is the current time, l i (t) is the fluorescein value of the i th firefly at the time t. At the initial time, m fireflies have the same fluorescein value, that is, l i (t) = C (C is a constant).
In the N-dimensional space, for the firefly (1 ≤ i ≤ m), the position vector X
i
is defined as
The position vector is a potentially feasible solution of the function to be solved. The quality of the potential feasible solution depends on the size of the objective function value.
The definition of the perception radius of the firefly individual: In the process of information resource scheduling by GSO algorithm, m fireflies are randomly distributed in n -dimensional solution space. Each firefly transmits a certain amount of fluorescein, attracting the surrounding fireflies. Each firefly has its own perceptual region, and the perception region is determined by the perception radius. To detect multiple peaks of multimode functions, the perceptual region should be a variable parameter. In GSO algorithm, assume the perceptual region of the firefly i is
The individual perception radius of firefly is affected by the number of fireflies in the neighborhood. When the number of fireflies in the neighborhood is small, the perception radius of the firefly will increase to find more individuals. Conversely, the perception radius of the firefly should be reduced. Finally, when the program ends, most fireflies should be clustered in multiple positions. At the initial time, all fireflies have the same perception radius.
The GSO algorithm can be divided into the following stages: the stage of fluorescein updating, the stage of search for the better individual, the stage of the firefly location updating, and the stage of sensing radius updating [33].
Fluorescein updating, the firefly fluorescein value in agricultural information resource is updated according to the following equation. The fluorescein value shows the fitness of a potential solution in the function solution space. The higher the value of fluorescein, the better the potential objective function. The greater the attraction of firefly individuals to other fireflies in the neighborhood, the higher the probability that other individuals in the neighborhood move to it.
Searching for the better individual. Each firefly individual in agricultural information resource can be attracted to individuals with higher fluorescein. However, restricted by the individual’s perception radius, the individual can only find individual with higher fluorescein within its perception range and choose an individual to move to it.
If the distance ∥x
i
-x
j
∥ between the individual i and the individual j is less than
Where d
ij
is the Euclidean distance between the individual i and the individual j. The meaning of the neighborhood set N
i
(t) is: If the distance of the firefly i and the firefly j is smaller than the perception radius
Firefly location updating. The individual i selects an individual by calculating the fluorescein probability of the excellent individuals in his neighborhood. Assume the individual is the firefly i. If the individual i moves to the individual j, the location updating is given by
Perception radius updating, when the location of the firefly is updated, the fluorescein value has changed, which results in the perception radius must be updated. In order to search for more local optima, the global optimum is needed to be determined. The updating of the perception radius is related to the neighborhood set N
i
(t) of the firefly i. When a large number of excellent individuals exist in the perception radius of the firefly i, that is, |N
i
(t) | is larger, the perception radius of the firefly i should be reduced, which is beneficial to improving the precision of the local optimal solution to be searched. When less excellent individuals exist in the perception radius of the firefly i, that is, |N
i
(t) | is smaller, the perception radius of the firefly i should be expanded to find more excellent individuals and move in a better direction. The perception radius of the individual is expressed as
Assume the population of fireflies is N, the position of the firefly i is (x
i
, y
i
), the objective function of the firefly i is (x
i
, y
i
), the fluorescein value of the firefly i is l
i
, x
j
(t) is the position of the tth generation firefly j, l
j
(t) is the fluorescein value of the tth generation firefly j. The perception range updating of the firefly is given by
The position updating of the firefly is given by
The result of chaos optimization is to add chaotic state to the optimization variables and extend the chaotic scope to the range of the optimal variables. With the number of iterations increases, the firefly individual is closer to x
j
(t), which results in that the difference between individuals will be lost. In order to prevent this phenomenon, chaos is carried out for individuals with the worst position in fireflies. Logistic mapping is used as the chaotic optimization model. The iterative equation of the chaotic optimization model [36] is given by
The process of chaotic optimization of firefly algorithm strategy is described as follows.
Assume x
i
= (xi1, xi2, ⋯ , x
in
), x
i
is mapped to the range of optimization variable of the firefly algorithm. xmin and xmax are the minimum and maximum value of the variable, respectively.
According to the principle of inverse mapping, the feasible solution set is obtained as
After chaotic mapping, some individuals of firefly individuals with the probability q are obtained. The calculation of q is given by
The Lagrangian relaxation function is used to construct the agricultural information resource allocation model in cloud computing [8], which is expressed as
In order to simplify the resource allocation model in cloud computing, the Lagrangian relaxation function is used to simplify Equation (29), then
The updating of Lagrangian factor μ is given by
Where s k is the iteration step, and g k is the iteration coefficient. According to the above equation, the global optimal individual of the firefly algorithm is chaotically optimized, and the global optimal solution is updated in time, and then the implementation process of the agricultural information resource scheduling algorithm is obtained, as shown in Fig. 1.

Implementation of agricultural information resource scheduling algorithm based on firefly algorithm in cloud computing.
Through the above discussion, the realization process of the firefly algorithm is analyzed. By introducing the chaos algorithm into the firefly algorithm and disturbing the individual, the convergence speed of the agricultural information resource scheduling is improved, and the Lagrangian relaxation function is used to construct the agricultural information resource allocation model in cloud computing, and the agriculture information resource scheduling in the cloud computing is realized.
To prove the effectiveness and feasibility of the agricultural information resource scheduling algorithm based on firefly algorithm in cloud computing, experiment is carried out. Experimental development software and toolkit are as shown in Table 1. The Cloud Sim simulation flow is shown in Fig. 2.
Development software and toolkit
Development software and toolkit

Cloud Sim simulation flow.
In Fig. 2, the Cloud Sim simulation flow is expressed as follows. Datacenter first registers its information with CIS and releases its own service resources to users. Datacenter Broker (data agent) provides Datacenter of service resources through CIS query, obtains the characteristics of the data center, and creates virtual resources. Meanwhile, it allocates users’ task needs to Datacenter and completes users’ tasks. Finally, Datacenter feeds back the completed information to Datacenter Broker.
In the experiment, under the same condition, the proposed algorithm is compared with the agricultural information resource scheduling algorithm based on the improved genetic algorithm and the chaos ant colony algorithm, respectively. Comparison results are described as follows.
The execution time span of scheduling tasks of the three algorithms is compared. In the experiment, the number of scheduling tasks is set from 30 to 150, and the number of computation nodes is 8. The resource scheduling algorithms based on the firefly algorithm, the improved genetic algorithm, and the chaotic ant colony algorithm are executed 10 times to take the average value. The results are shown in Fig. 3.

Comparison of execution time span of scheduling tasks of three algorithms.
As can be seen from Fig. 3, the time span of task scheduling results of this scheduling algorithm is shorter than that of resource scheduling algorithm based on improved genetic algorithm and chaos ant colony algorithm. With the increase of the number of tasks, the difference of the execution time span of the algorithm increases. When the number of tasks is 150, the difference is the largest. The resource scheduling algorithm based on the improved genetic algorithm only considers the computing power of the resource. The scheduling algorithm based on the chaos ant colony algorithm has better global search ability, and the scheduling result is better than the improved genetic algorithm. However, the scheduling algorithm in this paper has good load balance and the best global search ability.
The load balancing degree of resource scheduling algorithm based on firefly algorithm is tested. On the basis of the comparison experiment of scheduling task execution time, the task allocation on each virtual machine node is counted. According to the number of tasks of each node, the load balancing degree of the resource is analyzed, and the results are shown in Fig. 4. The number of the virtual machine node is a constant and the unit is o. A represents the resource scheduling algorithm based on improved genetic algorithm. M represents the resource scheduling algorithm based on chaotic ant colony algorithm. P represents the resource scheduling algorithm based on firefly algorithm.

Task allocation results on each virtual machine node.
In order to analyze the balancing degree of task allocation more intuitively, the variance of the balancing degree of node allocation is introduced, which is given by Equation (32).
Where z1, z2, ⋯ , z8 are the number of the tasks on 8 virtual machine nodes, respectively.
The variance of the balancing degree of the nodes allocation of different algorithms is shown in Table 2. The unit of variance of the balancing degree of resource scheduling is a constant.
Variance of the balancing degree of node allocation of different algorithms
From Table 2, it can be seen that, the variance of the load balancing of the resource scheduling algorithm based on firefly algorithm is smallest, which indicates that the resource load balancing of the resource scheduling algorithm based on firefly algorithm is better. In the resource scheduling algorithm based on firefly algorithm, the resource scheduling model is constructed in the process of resource scheduling for agricultural information, The main reason is that the attraction of each firefly in the information resources of GSO algorithm only depends on the perception radius of the individual and the fluorescence value of the surrounding individual. By comparing the fluorescein value of each individual, the purpose of information exchange is achieved, and the optimization of understanding space is realized, which improves the load balancing of resource scheduling.
The scheduling algorithm of agricultural information resources in cloud computing requires timely retrieval and transmission of user demand information, in order to ensure the timeliness of information utilization. According to the iteration number of the algorithm, the convergence speed of the algorithm is analyzed. Comparisons of iteration number between the resource scheduling algorithm based on firefly algorithm, the resource scheduling algorithm based on improved genetic algorithm, and the resource scheduling algorithm based on chaotic ant colony algorithm are carried out and the results are shown in Table 3.
Convergence performance of different algorithms
From Table 3, it can be seen that the number of iterations of agricultural information resource scheduling algorithm based on firefly algorithm is less, which shows that the algorithm converges faster. The resource scheduling algorithm based on firefly algorithm is simple and fast in scheduling process, and has less scheduling time consuming. In the process of resource scheduling based on firefly algorithm, the disturbance of agricultural information resources is improved by using chaos algorithm, and the convergence speed is enhanced.
In cloud computing environment, how to allocate resources more rationally has always been a hot topic. For the problem of poor load balancing and long scheduling time in current agricultural information resource scheduling, agricultural information resource scheduling based on firefly algorithm in cloud computing is proposed this paper. Experiments results show that the algorithm is faster for agricultural information resource scheduling, and the load balancing degree is better. It provides a theoretical basis for further research and development of the subject. However, cloud computing resource scheduling is a complex system problem. There are still some shortcomings in the current research work. The research of agricultural information resource scheduling algorithm based on firefly algorithm in cloud computing needs to be carried out in the following three aspects.
Further improving the scheduling model, in the next, we should integrate the agricultural information resources in the cloud environment, optimize the registration structure of the data center virtual resources, and promote the standardized management of cloud computing resources. By fully mining the demand of cloud users, a set of flexible cloud computing agricultural information resource scheduling model is built to achieve accurate, efficient, and timely resource scheduling and improve the quality of cloud computing services.
Continuing to improve the firefly algorithm, on the basis of the firefly algorithm, we should optimize the updating rules of population content, improve the accuracy of parameter adjustment, and solve the premature problem.
Improving the content of the experiment, the performance of the algorithm should be verified in a real cloud computing environment. In the algorithm test and performance verification, the simulation software neglects the factors that need to be considered in the actual resource scheduling environment, and has different effects on the experimental results and the related conclusions.
Footnotes
Acknowledgments
This research is supported by Science Research Project of Hunan Provincial Education Department (No. 16C0434); Science and Technology Planned Project of Hengyang City (No. 2016KF08); Social Science Research Project of Hengyang City (No. 2016D082).
