ACPEC: A Resource Management Scheme Based on Ant Colony Algorithm for Power Edge Computing

With the development of power IoTs (Internet of Things) technology, more and more intelligent devices access the network. Cloud computing is used to provide the resource storage and task computing services for power network. However, there are many problems with traditional cloud computing such as the long-time delay and resource bottleneck. Therefore, in this paper, a two-level resource management scheme is put forward based on the idea of edge computing. Furthermore, a new task scheduling algorithm is presented based on the ant colony algorithm, which realized the resource sharing and dynamic scheduling. The data of simulation show that this algorithm has a good eﬀect on the performance of task execution time, power consumption, and so on.


Background
With the rapid development of smart grid, plenty of power equipment accesses into the Internet. e demand for power services shows exponential growth trend. For cloud computing technology, it not only can provide computing service but also has many advantages such as scalability, flexibility, and security [1].
Cloud computing can provide technical support and theoretical support for power design, data storage, disaster recovery, intelligent power consumption, and power grid simulation analysis system. Furthermore, cloud data center can integrate and manage the data and resources coming from different business systems in power grid uniformly, and these data and resources are the basic of resource sharing for smart grid. However, the total cost of a cloud will increase when the scale decreases, as shown in a survey of Microsoft [2]. ough the computational resource in the edge node is generally limited and the resource in the remote cloud is abundant [3], the resource features between edge cloud and the remote are different.
Edge computing can reduce the distance between user demand and computing servers [4,5]. With edge computing, not only the computation latency of these tasks can be shortened but also the requirements of users on computation capability and power supply can be reduced [6]. erefore, the computation tasks especially the latencysensitive ones can be uploaded to edge nodes. e computation task can be received and executed locally, and the computation result can be sent to the users directly [7].
Heterogeneous cloud is suggested to better serve users with different Quality of Service (QoS) requirements [8]. Furthermore, to some computation-intensive tasks, tasks need to be divided into some subtasks and be executed by resource cooperation. In this paper, a new two-level resource management scheme is proposed based on edge computing. For the new resource management scheme, the computing tasks can be executed in local nodes, and the time delay can be decreased compared with cloud computing. Furthermore, according to the characteristic of edge computing, we present a task allocation algorithm based on the ant colony algorithm in this paper. e resources of the local edge nodes can be used for providing computation-intensive tasks by resource sharing and cooperation.

Related Work
A rational resource management and task assignment scheme is very important to ensure the efficiency and stability of the power cloud computing system. ere are many researchers who studied the resource management of cloud computing [9,10]. For the resource management schemes on saving energy consumption, the authors in [11] proposed a new method to reduce the power consumption by decreasing the processor speed. e balance of load is considered in [12] and realized by effective virtual machine migration strategy; Furthermore, the authors proposed a new scheme for intelligent load migration and resource allocation by machine learning. For the resource management schemes of increasing resource utilization, the authors in [13] designed a two-level resource scheduling scheme and realized a new resource allocation algorithm by the heuristic algorithm. Furthermore, the authors in [14] proposed a new resource scheduling procedure which can realize a real-time vehicle cloud service. e authors in [15] proposed a QoSbased mobile cloud resource scheduling algorithm, which can minimize the communication and computing consumption. In addition, the genetic algorithm has also been used for saving energy consumption resource scheduling in [16,17]. Furthermore, based on NOMA technology, the authors in [18,19] introduced the resource allocation methods for cluster-based cognitive industrial and multibeam satellite industrial.
For edge computing, one main service requirement is to have a low service delay, which would be the output of its request, i.e., the time it takes for the user to receive its results [20]. e authors of [21] proposed that the problem of time delay can be addressed by executing task applications on resource providers external to the edge device. In addition, to control the data transmission of computation tasks effectively according to the channel information, a delay-optimal problem is studied through adopting a Markov decision process approach [22]. e authors in [23] proposed an effective computation offloading strategy and investigated a green edge computing system with rechargeable devices. Furthermore, the authors in [24,25] considered the balance between the cost of the system and the mean offloading delay, which studied the workload sharing between the edge and the remote cloud. For communication elements, one existing technique called access point scheduling is considered, in [26,27], which can associate the user and the closest cloudlet in order to minimize transmission distance and improve signal quality and propagation time. In addition, in [28,29], transmission power control is proposed where the transmission power of the cloudlets is carefully set with the final goal of lowering the latency. e authors in [30,31] considered to provide fair services by allocating the available resources, such as channel bandwidth.
For the optimization of the QoS in the edge computing system, there are many research studies. e authors in [32] considered the joint optimization of radio and computational resources to minimize the overall energy consumption of mobile users in edge computing. To minimize the total energy consumption of users, the authors proposed an algorithm for uplink and downlink beamforming and computational resource allocation [33]. In [34], the authors derived the optimal radio and computational resource allocation policy considering the scenario of TDMA networks. e authors in [35] designed a task offloading algorithm to study the energy-delay tradeoff in edge computing.
Such computing paradigm, called edge computing, has drawn extensive attention from both academy and industry [36,37]. With the help of edge computing, application tasks running on the devices can be offloaded to the edge servers in edge computing to get better service. Generally speaking, the computing resources at the edge computing system are still limited compared with remote cloud data centers. erefore, an edge computing is customarily backed by a remote back-end cloud via the Internet [38].
To a certain extent, above research studies solve some resource management problems. However, for the problem of the resource management power information system, there is not much research in the existing literature. erefore, in this paper, a power resource management scheme based on edge computing is studied.

The Power Resource Management Scheme Based on Edge Computing
With the rapid development of cloud computing, more and more intelligent terminals access into the network. For traditional cloud computing, computing resource and storage resource are in the cloud data center and all tasks will be transferred to the cloud. For the power network, the power equipment includes a large amount of data information. erefore, in power network, resource bottleneck of traditional cloud computing cannot be avoided, and the realtime performance cannot be ensured.
In the edge of power network, there are a lot of devices which include considerable resources. If the resources of these devices can be used for providing computing services, the computing energy of data center can be effectively supplemented [39]. In this paper, a new power cloud resource management scheme based on edge computing is proposed. In this scheme, some computing tasks in cloud servers will be sank to the edge devices, and the local computing tasks will also be performed in local edge devices.
In the new resource management scheme, as shown in Figure 1, there are two-level computing nodes: the first level includes the analysis control nodes which are in the cloud servers and the second level includes computing nodes which are in the edge devices. e first-level nodes are used to perform computation-intensive tasks and manage the second-level nodes, and the second-level nodes are used to perform local computational tasks. e resources in secondlevel nodes should be subjected to the scheduling of the firstlevel nodes. e application scenarios of this new resource management scheme can be the power supply service command system and big data platform, the hot spot location, and so on. And the task requirement of this new resource management scheme can be fault diagnosis, protective relaying, intelligent patrol, line loss computation, and so on.
In this resource management scheme, the resource in the second-level nodes is limited and some tasks will be divided into many subtasks and be assigned to different edge nodes. e tasks will be executed by resources sharing and node cooperation.
In this paper, we consider an actual application scenario. As shown in Figure 2, this area represents a distribution power supply area, which includes many transformers, some intelligent terminals, and some users. In this situation, the intelligent terminals are set as the edge nodes to provide task computing services.

The Task Scheduling Method Based on Ant
Colony Algorithm e ant colony algorithm is an intelligent optimization algorithm, which is an optimization process for solving complex problems. e ant colony algorithm can be used for resolving resource allocation problem. In the paper, the edge nodes are always resource-limited to execute a computationintensive task alone. erefore, the computation-intensive tasks will be divided into many subtasks and be allocated on many different edge nodes. In this paper, we presented a new tasks allocation algorithm based on the ant colony algorithm to allocate appropriate resources for subtasks.

Introduction of Ant Colony Algorithm.
e ant colony algorithm is a novel simulated evolvement algorithm solving complicated combinatorial optimization problem, and its typical feature is swarm intelligence. For the ant colony algorithm, a colony consisting of many ants is considered to perform a highly complex task that an ant alone cannot accomplish. e ant regulates their behavior through collaboration and information exchange. For the ant colony algorithm, pheromones play a very important role, which can help ants judge the next direction of transfer by sensing the presence and concentration of pheromones. e ant colony algorithm is a random search algorithm evolved from the behavior of ants foraging. In the process of simulating ant foraging, positive feedback and distributed cooperation are mainly used to find the optimal path. ere are some characteristics in the behaviors of ant foraging shown as follows: firstly, the pheromone concentration along the path will change over time and the ant will choose the path according to the pheromone concentration of different paths. Secondly, to avoid the process of path choosing getting trapped in local optimality, the paths that have already been chosen before will not be allowed to be selected again. irdly, the pheromone of paths will decrease over time, and the length of the path will affect pheromone concentration.

4.2.
e Detailed Design of Task Scheduling Algorithm. Recently, the task scale in power network increases rapidly, so the issue of task resource scheduling is increasingly complex. However, the rational scheduling among resources and tasks is very important for increasing the resource utilization and task completion rate.
For the resource management scheme proposed in this paper, the resources in the edge nodes are limited to complete some computation-intensive tasks along. e computation-intensive tasks will be often divided into some subtasks and be assigned to different edge nodes. erefore, it is a very key issue that how to assign the tasks among the different edge nodes, which will be solved in this section. e ant colony algorithm is an intelligent optimization algorithm, which is used to solve complicated combinatorial optimization problem. For the ant colony algorithm, distributed computing is relatively easy to implement and it is easy to merge with other algorithms to become a new algorithm. Because of these advantages, the ant colony algorithm will usually be applied to resolve resource-task scheduling and optimization problem.

Security and Communication Networks
For example, in [40], a task scheduling algorithm is proposed, named "DSFACO," which is assigned to decrease the execution time for several tasks on the same scheduling queue. is algorithm improves the running efficiency of virtual machine resources.
In the second-level nodes, the computation-intensive tasks will be usually divided into many subtasks and the edge nodes will complete the tasks by cooperation with each other. erefore, in this paper, the ant colony algorithm is considered to realize the resource sharing among the edge nodes.

Mathematical Model.
For the ant colony algorithm, some parameters are introduced in Table 1. Furthermore, in this section, we introduced the computational model for pheromones, the update model for pheromones, and the state transition probability model of nodes.
(1) Computational Model for Pheromones. In this model, the pheromone of resource node can be calculated by its attribute values. Some attributes are considered: CPU utilization, power consumption, memory utilization, external storage utilization, and node security. In this paper, the pheromone of a resource node can be calculated as follows: where z 1 , z 2 , z 3 , z 4 , and z 5 represent the important degree of resource attributes on node pheromones. In addition, Ph cu i (t), Ph pc i (t), Ph mu i (t), Ph su i (t), and Ph ns i (t) represent the CPU utilization, power consumption, memory utilization, external storage utilization, and node security grade of node i after normalization. At the beginning, τ i (0) � C. Furthermore, the power consumption of edge node i can be expressed as follows: where PC no (i) is the power consumption when there is no task assigned on this edge node. PC max (i) is the power consumption when this edge node is full load. f i,j is the processing speed of task i on edge node j. f max i is the max value of processing speed.
To resign a unified computing method of node pheromone, the values of attribute are normalized before being integrated. erefore, the SAW (simple additive weighting) technology is used in this paper [41]. e attributes are divided into two categories: the first kind of attribute values is positively correlated with node pheromones, which means that the value of node pheromones will increase with the value of attribute, such as node security grade; the second kind of attribute values is negatively correlated with node pheromones, which means that the value of node pheromones will decrease with the value of attribute, such as CPU utilization, power consumption, memory utilization, and external storage utilization. e normalization process of the first kind of attribute can be expressed as formula (2), and the normalization process of the second kind of attribute can be expressed as formula (3). Furthermore, l + x (Ph x i ) and l − x (Ph x i ) represent the normalized value of x-th attribute. On the contrary, p x (Ph x i ) represents the initial value before normalization. In addition, max p x and min p x represent the maximum value and the minimum value of x-th attribute.
(2) Update Model for Pheromones. In the ant colony algorithm, effective nodes are those useful nodes searched by the ant, and the effective nodes are used to perform computational tasks. In this paper, the effective node is defined as a node whose pheromone is not less than a certain threshold after being assigned tasks. When a node is assigned tasks, its CPU utilization, memory utilization, and external storage utilization will increase. erefore, to ensure the load balance of each resource node, the node pheromone should be decreased whose resource utilizations are relatively high. In that case, the nodes whose resource utilizations are high will have lower probability to be assigned tasks. erefore, the pheromone update model can be expressed as follows: where δ is the pheromone persistence coefficient, that is, the affect degree of existing pheromone to pheromone update process. In addition, when node i is assigned task, the probability it will be assigned tasks next time can be changed, so ΔPh k i is the pheromone variation to node i when it is assigned tasks by ant k, and ΔPh i � m k�1 ΔPh k i is the sum of pheromone affect. e pheromone incremental effect of task i when it is assigned task k can be expressed as follows: (3) Probability Model for State Transition. When selecting the next transition node, ants always tend to choose the neighbor node with the highest transfer probability. e transfer probability calculation formula can be expressed by wherer λ is the importance degree of pheromones and χ is the importance degree of heuristic factor. In addition, j k (i) is the node set which can be selected in next step for ant k.
Heuristic factor θ ij can be calculated as follows: where d ij means the distance of node i and node j. When ant k selects the next transfer node, the smaller d ij is, the less the communication cost between node i and node j is, and the bigger probability that node j is selected as the next transfer node. In addition, θ ij (t) is expectation level of ant k moving from node i to node j.

Algorithm Flow.
In this section, we will introduce the specific flow of the proposed resource management algorithm. e specific flow is shown in Figure 3.
(2) e ants are placed, and the timer is started.
(3) e ant will select the next transfer node according to the state transition probability and determine whether that node is a valid node. If the selected node is a valid node, the node information will be recorded and returned; if the selected node is not the valid Pheromone increment when ant k assigns task to node i P k ij (t) Transfer probability when ant k transfers from node i to node j at time t d ij Distance between node i and nodej θ ij Heuristic factor, the inspired degree from i to j δ Pheromone persistence (the residual coefficient), 0 < ρ < 1 τ i Pheromones in nodei node, the ant will continue to choose the next transfer node and determine if it is a valid node. (4) e tasks are assigned for the valid nodes, and the node pheromone is updated. (5) e timer ends.

Simulations
In the new resource management scheme based on the idea of edge computing, we propose a task scheduling algorithm based on the ant colony algorithm. In this section, we will simulate the performance of the new algorithm. Without loss of generality, all the data are the average values of ten experiments. In the experiments, z 1 , z 2 , z 3 , z 4 , and z 5 are set as 0.25. e simulation parameters are expressed in Table 2, and we set some contrast algorithms to verify the effectiveness of the new algorithm. In this section, two comparing algorithms are set. One is the modified round robin algorithm, and the other is the generalized priority algorithm.

(i) Modified Round Robin Algorithm (RRA, for Short).
is algorithm is proposed in [42], which can randomly assign free resources for task execution (ii) Generalized Priority Algorithm (GPA, for Short).
is algorithm is proposed in [43], which is an efficient optimal algorithm of task scheduling in cloud computing environment (iii) Ant Colony Algorithm in Power Edge Computing (ACPEC, for Short). is algorithm is the resource scheduling algorithm proposed in this paper In this section, we simulate the performance of RRA, GPA, and ACPEC on the task execution time with different number of tasks. As shown in Figure 4, we can find that the task execution times of ACPEC are always shorter than those of GPA and RRA. With the increase in task scale, the advantages become more and more obvious. When the number of task reaches 320, the advantage of ACPEC is very obvious, as shown in Figure 4. e task wait delay is a key factor affecting the real-time response of the system. As shown in Figure 5, the task waiting time always increases with the increase in task scale. Compared with GPA and RRA, the ACPEC algorithm is more complex, so the required time for task assigning is always longer slightly. However, compared with the total amount of time for task execution, a small increase in task wait time is acceptable for users. e performances on power consumption cost are shown in Figure 6. For the ACPEC algorithm, the tasks can be assigned to different resource nodes according to the purpose of reducing power consumption. erefore, when the task scale is the same, the power consumption with ACPEC is always less than the power consumption with FSFC and RRA. And as the task scale increases, the advantage tends to be obvious.    When the number of tasks is 100, the CPU utilization with 20 edge nodes and the memory utilization with 50 nodes are simulated as shown in Figures 7 and 8. We can find that the CPU utilization and memory utilization of some nodes fluctuate greatly when using GPA and RRA. Furthermore, some nodes are under low load state when using GPA and RRA. When using the ACPEC algorithm, the CPU utilization and memory utilization among different nodes have become average. Compared with RRA, the average CPU utilization increased from 38.8% to 69.9%, and the average memory utilization increased from 38% to 68%.
In this section, we will evaluate the performance of these task scheduling algorithms on load imbalance. In this section, M DI (degree of imbalance) represents the level of load imbalance, which can be calculated as follows:

Security and Communication Networks
where M max , M min , and M avg represent the longest time, the shortest time, and the average time for task performing. e load imbalance levels of different algorithms are shown in Figure 9. We can find that the load imbalance levels decrease gradually with the increase in task scale. is is because the assigning of tasks is gradually balanced with the increase in task scale. Compared with GPA and RRA, the values of M DI with ACPEC are lower. e performance of ACPEC on load balance is better than that of GPA and RRA as shown in Figure 9.

Conclusion
To ensure the efficient and stable operation of the power cloud computing system and make full use of the advantages of edge nodes, in this paper, we propose a new resource management scheme based on edge computing. In this scheme, the computing tasks can be executed in local edge nodes instead of uploading to the cloud. In this new scheme, although the resources of single edge node are limited, the resource among edge nodes can cooperate with each other to complete the computation-intensive task. To realize the optimal allocation between edge nodes and tasks, in this paper, a task allocation algorithm based on the ant colony algorithm is proposed. is algorithm has good performance in task execution time, waiting delay, CPU utilization, memory utilization, and load balancing. e communication overhead is greatly affected by network environment; therefore, the communication overhead of data transmission and the difference of system power consumption should be considered in resource management issue, which may become our future work.

Data Availability
e simulation data used to support the findings of this study are included within the supplementary information file.

Conflicts of Interest
e authors declare that they have no conflicts of interest.