# Cloud-Fog Computing-Based Distributed Event-Triggered Consensus Predictive Compensation for Optimal Energy Management in Microgrid under DoS Attack

Authors: Lvhang Wang; Yongheng Pang; Bowen Zhou; Shuowei Jin
Journal: Mathematical Problems in Engineering
 (2020)

---

## Abstract

A cloud-fog computing-based event-triggered distributed energy optimization management method based on predictive attack compensation is proposed to address the problem of denial of service (DoS) attack, the complexity of computation, and the bandwidth constraint on the communication network in microgrids. Firstly, in order to optimize the energy supply of microgrid and maximize the profit, the minimum cost function of maintaining the balance of supply and demand is given considering the power loss of microgrid. Secondly, considering the problem of bandwidth-constrained communication, a distributed event-triggered consensus algorithm is proposed based on fog computing. Thirdly, a model predictive compensation algorithm based on cloud computing is proposed, which uses the mismatched power between supply and demand at the historical time before the attack to predict and compensate the missing data of the agent power at the current time and many times after attack. Finally, the effectiveness of the proposed method is verified by simulation results.


---

## Body

## 1. Introduction

Due to the energy structure adjustment caused by the slowly draining away of traditional energy, microgrids that integrate traditional energy (electric generator), renewable energy (wind energy and photovoltaic power), energy storage device (battery), and load and control equipment into a compositive grid system have become an important way to improve energy efficiency and reduce energy consumption. However, the randomness, intermittency, volatility, and other drawbacks of not only the renewable energy itself but also energy storage systems pose significant challenges to traditional energy management [1]. Besides, the security problem and the bandwidth constraint on the communication network in microgrids have also attracted a lot of attention [2].To solve the problem of energy management in the microgrid, a distributed economic dispatch algorithm with communication delay is proposed in [3], and the coupling equality constraint is also considered. The study in [4] proposes a distributed event-triggered optimization algorithm for the first time to solve the bandwidth-constrained communication in the process of distributed dispatch, but the impact of intermittent new energy is not considered. The study in [5] tries to use a distributed consensus algorithm to solve the economic dispatch problem without considering power loss. The authors of [6, 7] improve the power transfer rate and the robustness of the balance of supply and demand by using multiple objectives with particle swarm optimization algorithm and model predictive control algorithm. In [8–10], the disadvantages of high computation and poor performance caused by centralized control are considered. Decentralized or distributed control mode is adopted to effectively reduce the computation and improve the performance of the system. The distributed cooperative control strategy has many advantages such as high flexibility and high expansibility, which make it become the mainstream in the study of hierarchical control structure in microgrids [11].The characteristics of the Cyber-Physical Systems (CPS) that microgrids possess make the microgrid inherit the weakness of CPS, which means that the microgrid is also vulnerable to malicious network attacks. For now, the field of network attacks on the power system mainly consists of three branches, which are the Denial of Service (DoS) attack, replay attack, and False Data Injection (FDI) attack [12]. Among them, the DoS attack as a highly destructive attacking method brings about huge adverse impact on the security and stability of the microgrids. The study in [13] proposes a self-triggered consensus algorithm under the DoS attack. The proposed method can achieve the recovery of microgrid voltage and the equal distribution of reactive power, but the research is restricted to the perspective of energy. The study in [14] proposes a rule-based fallback control strategy using the SoC (state of charge) of the distributed managed energy storage system to enhance the recovery capability when microgrids are under the DoS attack. However, the distributed structure results in the lack of communication among subsystems. From the perspective of attack and defense, [15, 16] lucubrate the optimal attack and dynamic attack energy distribution of the system. However, the proposed method lacks optimal management of the system’s energy. Based on the event-triggered communication method, [17, 18] enhance the capacity of energy management of microgrids and at the same time alleviate the problem of bandwidth constraint on the communication network.It is worth noting that the above literatures do not consider the problem of the system’s computing capability. The smart grid always distributes a large number of sensors. This results in the generation of large-scale data from grid systems, while traditional hardware systems have difficulty in providing large-capacity data storage and computing capacity [19]. Since cloud computing can solve the above problems, it is welcomed by many researchers. However, most cloud computing models use centralized management methods to transmit and deal with data, which makes them unable to meet the requirements of the system boundary area for the minimum delay in real-time and semi-real-time applications and the model is limited by the bandwidth of communication. Besides, these methods also have the problems of large energy consumption and insufficient use of computing capability. The characteristics of the fog computing model for calculation analysis in the boundary network, such as low latency and high efficiency and scalability, complement the disadvantages of cloud computing. Therefore, the combination of fog computing and cloud computing can effectively improve the stability of the smart grid [20].To address the microgrid’s energy optimization management problem in the case of DoS attack, this paper proposes a cloud-fog computing based distributed event-triggered consensus energy optimization management method based on predictive attack compensation. The main work is as follows:(1)
This paper proposes a distributed event-triggered consensus predictive compensation algorithm. The communication bandwidth of the system is reduced by the event-triggered method, and the missing data of microgrid is predicted by the prediction algorithm. We convert the missing communication data in microgrid into the power loss of the grid unit, which receives this data so that the power at the next moment can be predicted by tracking the history power data of unbalance between supply and demand before the attacking moment, and then the missing data caused by the attack can be obtained. By doing so, the consistency of each unit in the smart grid can be achieved.(2)
This paper proposes a three-layered cloud-fog-object smart grid data processing architecture, which uses the cloud computing model to calculate the prediction data of the smart grid and the fog computing model to calculate the consistency of the smart grid to obtain the energy supply-demand balance of the smart grid as well as the minimum cost of optimization.


## 2. Microgrids Modeling

### 2.1. Microgrids Model

The topology of a microgrid based on cloud-fog computing is shown in Figure1. From the topology, we can see that the system contains the cloud layer, the fog layer, and the microgrid. The microgrid consists of generator system, energy storage system, renewable energy system, load, and other parts. The fog layer is used to manage the simple calculation of the microgrid, and the cloud layer is used for predicting the parameters of microgrid and big-data calculation. In this paper, we use the multiagent framework to model the microgrid and regard each part as an agent. By building communication between the adjacent agents, agents can interact with each other and then the energy optimization management of microgrids can be realized. The communication network and multiagent interaction technique that the microgrid contains make it inherit the characteristics of Cyber-Physical Systems (CPS). Such characteristics make the microgrids vulnerable when the communication channels between agents are under DoS attack. Once the networks are attacked, communication between adjacent agents will be cut off and the performance of the energy optimization management will degrade significantly.Figure 1
Topology of a microgrid based on cloud-fog computing.


### 2.2. Graph Theory

In the microgrids, each subsystem corresponds to an agent in the multiagent system. Regarding each agent as a node and establishing communication channels between adjacent agents, a communication graph can be established. The communications between agents are bidirectional so that the communication graph based on the network is undirected. In this paper, we useG=V,Ξ to represent the communication graph that connects to N agents including both energy supply systems and fan loads. In graph G, V=v1,…,vn represents the set of agents and Ξ⊆V×V represents the set of edges, where each edge εij≜i,j∈Ξ is defined as the communication between agent i and agent j. Here, we define the adjacent matrix of G as Ζ=wij∈ℜn×n, where wii=0 and wij=1 when νj,νi∈Ξ or else wij=0. The Laplacian matrix of G is defined as L = D-Z, where D=diagϖ1,ϖ2,…,ϖn represents the degree matrix of G and ϖi=Lii.


### 2.3. Energy Optimization Management

In this paper, we try to solve the energy optimization management problem from the perspective of economy. By regarding each part of the microgrid as an agenti in multiagent framework, consistency between agents can be achieved. Then, we translate the energy management problem into an optimization problem and solve it. Specifically, we try to find the solution of the following objective function, which can maximize the total gain of the microgrid.(1a)maxJ=∑i1∈NGWi1Pi1+∑i2∈NSWi2Pi2+∑i3∈NRWi3Pi3+∑i4∈NLWi4Pi4,(1b)s.t.∑i1∈NGPi1+∑i2∈NSPi2+∑i3∈NRPi3=∑i4∈NLPi4,(1c)Pijm≤Pij≤PijM,j=1,…,4,where NG, NS, NR, and NL are the sets of generator, energy storage system, renewable energy, and load, respectively; Wi1, Wi2, Wi3, and Wi4 are the welfare function of generator, energy storage system, renewable energy, and load, respectively; Pi1, Pi2, Pi3, and Pi4 are the power consumption of generator, energy storage system, renewable energy, and load, respectively; Pijm and PijM represent the minimum boundary and maximum boundary of power, respectively. Note that during the power transmission there exists power loss caused by many factors, for example, the reactance of a transmission line. We define the transmission efficiency of generator, energy storage system, renewable energy, and load as follows:(2)ηi1=∂Pi1,passPi1,ηi2=∂Pi2,passPi2,ηi3=∂Pi3,passPi3,ηi4=∂Pi4,passPi4.Since renewable energy is stochastic and intermittent, and as a kind of energy that is renewable, it is reasonable to assume that the price of it is stable. Considering these reasons, in this paper, we regard renewable energy as nondispatchable energy and consider its welfare as constant. Besides, the electrovalence of load in a power grid does not change correspondingly with power consumption. As a result, in this paper, we take the load as nondispatchable energy as well and its welfare is also set to constant. In this paper, we only consider the energy dispatch optimization problem of generator and energy storage system.The welfare function of a generator is(3)Wi1Pi1=ρ1tηi1Pi1−Ci1Pi1,where ρ1t is the power-on time of a generator and Ci1Pi1 is the generator’s manufacturing cost, which can be expanded into(4)Ci1Pi1=12ai1Pi12+bi1Pi1+ci1,where ai1, bi1, and ci1 are positive parameters of the manufacturing cost of a generator.The welfare function of energy storage system is(5)Wi2Pi2=ρ2tηi2Pi2−Ci2Pi2,where ρ2t is the power-on time of the energy storage power and Ci2Pi2 is the charge-discharge energy consumption and degradation cost of the energy storage power, which can be expanded into(6)Ci2Pi2=12ai2Pi22+bi2Pi2+ρc×Pi2,where ai2 and bi2 are the cost coefficients of charge-discharge energy consumption of the energy storage power; ρc is the degradation cost of the energy storage power.Substituting equations (3) and (5) into equations (1a)–(1c), we can transform the final objection from maximizing the welfare of the microgrid system into minimizing the cost of the generator and energy storage system. The objective function then turns into(7a)minJ=∑i∈NCiPi,(7b)s.t.∑i∈NηiPi=∑i∈NPi¯,Pim≤Pi≤PiM,where N=NG,NS is the element set of the generator and energy storage system; Pi¯=∑i3∈NRηi3Pi3+∑i4∈NLηi4Pi4 is the power difference between renewable energy and load, which is a constant.With Karush–Kuhn–Tucker (KKT) conditions, the incremental Lagrange objective function of equations (7a) and (7b) can be written as(8)Γ=∑i∈NCiPi+τ∑i∈NηiPi−∑i∈NPi¯,where τ is the KKT multiplier.By differentiating equation (8), we can know that equations (7a) and (7b) must have a constant solution τ∗ that satisfies(9)∇CiPi∗+τ∗ηi=0,∑i∈NηiPi∗=∑i∈NPi¯,where ∇Ci⋅ is the derivative of Ci⋅.


## 2.1. Microgrids Model

The topology of a microgrid based on cloud-fog computing is shown in Figure1. From the topology, we can see that the system contains the cloud layer, the fog layer, and the microgrid. The microgrid consists of generator system, energy storage system, renewable energy system, load, and other parts. The fog layer is used to manage the simple calculation of the microgrid, and the cloud layer is used for predicting the parameters of microgrid and big-data calculation. In this paper, we use the multiagent framework to model the microgrid and regard each part as an agent. By building communication between the adjacent agents, agents can interact with each other and then the energy optimization management of microgrids can be realized. The communication network and multiagent interaction technique that the microgrid contains make it inherit the characteristics of Cyber-Physical Systems (CPS). Such characteristics make the microgrids vulnerable when the communication channels between agents are under DoS attack. Once the networks are attacked, communication between adjacent agents will be cut off and the performance of the energy optimization management will degrade significantly.Figure 1
Topology of a microgrid based on cloud-fog computing.


## 2.2. Graph Theory

In the microgrids, each subsystem corresponds to an agent in the multiagent system. Regarding each agent as a node and establishing communication channels between adjacent agents, a communication graph can be established. The communications between agents are bidirectional so that the communication graph based on the network is undirected. In this paper, we useG=V,Ξ to represent the communication graph that connects to N agents including both energy supply systems and fan loads. In graph G, V=v1,…,vn represents the set of agents and Ξ⊆V×V represents the set of edges, where each edge εij≜i,j∈Ξ is defined as the communication between agent i and agent j. Here, we define the adjacent matrix of G as Ζ=wij∈ℜn×n, where wii=0 and wij=1 when νj,νi∈Ξ or else wij=0. The Laplacian matrix of G is defined as L = D-Z, where D=diagϖ1,ϖ2,…,ϖn represents the degree matrix of G and ϖi=Lii.


## 2.3. Energy Optimization Management

In this paper, we try to solve the energy optimization management problem from the perspective of economy. By regarding each part of the microgrid as an agenti in multiagent framework, consistency between agents can be achieved. Then, we translate the energy management problem into an optimization problem and solve it. Specifically, we try to find the solution of the following objective function, which can maximize the total gain of the microgrid.(1a)maxJ=∑i1∈NGWi1Pi1+∑i2∈NSWi2Pi2+∑i3∈NRWi3Pi3+∑i4∈NLWi4Pi4,(1b)s.t.∑i1∈NGPi1+∑i2∈NSPi2+∑i3∈NRPi3=∑i4∈NLPi4,(1c)Pijm≤Pij≤PijM,j=1,…,4,where NG, NS, NR, and NL are the sets of generator, energy storage system, renewable energy, and load, respectively; Wi1, Wi2, Wi3, and Wi4 are the welfare function of generator, energy storage system, renewable energy, and load, respectively; Pi1, Pi2, Pi3, and Pi4 are the power consumption of generator, energy storage system, renewable energy, and load, respectively; Pijm and PijM represent the minimum boundary and maximum boundary of power, respectively. Note that during the power transmission there exists power loss caused by many factors, for example, the reactance of a transmission line. We define the transmission efficiency of generator, energy storage system, renewable energy, and load as follows:(2)ηi1=∂Pi1,passPi1,ηi2=∂Pi2,passPi2,ηi3=∂Pi3,passPi3,ηi4=∂Pi4,passPi4.Since renewable energy is stochastic and intermittent, and as a kind of energy that is renewable, it is reasonable to assume that the price of it is stable. Considering these reasons, in this paper, we regard renewable energy as nondispatchable energy and consider its welfare as constant. Besides, the electrovalence of load in a power grid does not change correspondingly with power consumption. As a result, in this paper, we take the load as nondispatchable energy as well and its welfare is also set to constant. In this paper, we only consider the energy dispatch optimization problem of generator and energy storage system.The welfare function of a generator is(3)Wi1Pi1=ρ1tηi1Pi1−Ci1Pi1,where ρ1t is the power-on time of a generator and Ci1Pi1 is the generator’s manufacturing cost, which can be expanded into(4)Ci1Pi1=12ai1Pi12+bi1Pi1+ci1,where ai1, bi1, and ci1 are positive parameters of the manufacturing cost of a generator.The welfare function of energy storage system is(5)Wi2Pi2=ρ2tηi2Pi2−Ci2Pi2,where ρ2t is the power-on time of the energy storage power and Ci2Pi2 is the charge-discharge energy consumption and degradation cost of the energy storage power, which can be expanded into(6)Ci2Pi2=12ai2Pi22+bi2Pi2+ρc×Pi2,where ai2 and bi2 are the cost coefficients of charge-discharge energy consumption of the energy storage power; ρc is the degradation cost of the energy storage power.Substituting equations (3) and (5) into equations (1a)–(1c), we can transform the final objection from maximizing the welfare of the microgrid system into minimizing the cost of the generator and energy storage system. The objective function then turns into(7a)minJ=∑i∈NCiPi,(7b)s.t.∑i∈NηiPi=∑i∈NPi¯,Pim≤Pi≤PiM,where N=NG,NS is the element set of the generator and energy storage system; Pi¯=∑i3∈NRηi3Pi3+∑i4∈NLηi4Pi4 is the power difference between renewable energy and load, which is a constant.With Karush–Kuhn–Tucker (KKT) conditions, the incremental Lagrange objective function of equations (7a) and (7b) can be written as(8)Γ=∑i∈NCiPi+τ∑i∈NηiPi−∑i∈NPi¯,where τ is the KKT multiplier.By differentiating equation (8), we can know that equations (7a) and (7b) must have a constant solution τ∗ that satisfies(9)∇CiPi∗+τ∗ηi=0,∑i∈NηiPi∗=∑i∈NPi¯,where ∇Ci⋅ is the derivative of Ci⋅.


## 3. Distributed Optimization Algorithm under DoS Attack

### 3.1. DoS Attack

Considering the problem of bandwidth constraint in communication between agents in microgrid, in this paper, we reduce the quantity of information to be transferred with an event-triggered manner. As a result, the communication between agents is discretized. DoS attack as a simple and efficient attacking method has drawn massive attention. In real-world scenario, in view of attackers trying to remain hidden and the energy being used for attack is limited, DoS attack is set to a random sequential form. Here, we useθit, which is a white noise random variable sequence that follows the Bernoulli distribution to represent whether the communication channel is under DoS attack. Without losing generality, we define θit=1, which means that the system has not been attacked, while θit=0 means the opposite. The mathematical probability of it satisfies(10)Probθit=1=Εθit=βi,Probθit=0=1−Εθit=1−βi,where βi∈0,1 is a known constant, and all θit are independent from each other.


### 3.2. Distributed Event-Triggered Predictive Compensation Control Scheme Designment

To solve the data-missing problem of communication between agents caused by DoS attack, in this paper, we try to mitigate the impact on agents caused by data missing from another perspective. The failure of receiving data from agentj will lead to the inability of agent i to calculate its control parameter τi, which will further break the balance of power supply and demand of agent i. To avoid the coupling problem between agents caused by directly predicting the data of agent j, in this paper, we use the history data of agent i instead. To be specific, the history data being used here is the last moment’s power data Pi and unbalance parameter of supply and demand P¯i. In this paper, we use a cloud computing based predictive compensation algorithm to predict the power of agent i and then obtain its control parameter τ^i. Therefore, the problem of balance between power supply and demand of agent i and the problem of the transmission of control parameter τ^i can be simultaneously solved. As for the small-scale data computing in the microgrid, we use fog computing to replace cloud computing to reduce the system’s power consumption and delay.As shown in Figure2, the proposed distributed event-triggered predictive compensation control scheme is mainly made up of three parts, which are the power solving (fog computing), control parameter solving (fog computing), and model predictive control compensation (cloud computing), where the model predictive control compensation is made up of controller, predictor, and compensator. The control parameter obtains trigger parameter with event-triggered detector and the power solving chooses its control parameter τAi according to whether the DoS attack happens.Figure 2
Distributed event-triggered predictive compensation control scheme based on cloud and fog computing under DoS attacks.


### 3.3. Fog Computing-Based Distributed Event-Triggered Predictive Compensation Control Scheme Algorithm

To address the problems in microgrids such as (1) the bandwidth constraint on communication between agents, (2) privacy information of subsystems being hard to obtain, and (3) communication between agents being easy to be attacked by DoS attack, in this paper, we propose an event-triggered distributed consensus energy management optimizing algorithm based on attack compensation.(11a)P˙Ai=∏ΛiPAi,−∇CiPAi+ηiτAi,(11b)τ˙i=−∑j∈Nwijτ^i−τ^j−zi+Pi¯−PAi,(11c)z˙i=∑j∈Nwijτ^i−τ^j,where ∏​Λi is the projection operator and τi is the KKT multiplier that represents the price parameter of each unit in microgrids; τ^i=τitki, ∀t∈tki,tk+1i, represents the latest updated event-triggered signal of each agent i; tki|k=1,2,… represents the event-triggered time when agent i passes status information to its neighbours. τAi=θikτ^i+1−θikτ^ci, where τ^ci is the control parameter obtained by the predictive compensation control algorithm when agent i is under attack. When τ^j which is data transferring from agent j to agent i is under attack, the proposed algorithm will convert the goal from predicting τ^j to predicting agent i’s power PAi to ensure the balance between supply and demand of agent i and obtain the control input τAi according to the predictive model. It is worth noting that, in this paper, all θik are synchronous.To mitigate the bandwidth constraint of the system’s communication, we design the event-triggered function as follows:(12)fit=4ϖiτ^it−τit2−∑j∈NwijτAi−τ^j2,where ϖi is the degree of agent i.When trigger functionfit≥0, agent i obtains information τ˜j from its neighbour agent j and then updates information ∑i∈Nwijτ^i−τ^j. At the same time, agent i broadcasts its status information to its neighbours. The proposed distributed algorithm only needs to pass τ^i between agents. The quantity of information to be transmitted is much fewer, which can reduce the cost of communication and improve the communication efficiency of the system.


### 3.4. Cloud Computing-Based Model Predictive Algorithm

To obtain the missing data caused by the attack, we propose a cloud computing based predictive compensation control algorithm. The proposed predictive cloud control mainly consists of predictive controller and compensator. The predictive controller can predictr control sequences after the present moment k∗ and then the compensator chooses the latest predictive control sequence as the missing control input data at moment k.By reason of agenti being event-triggered, we predict the missing data discretely. Setting τci as uik, Pi as xik, and Pi¯ as ydik, the multiagent model can be represented as(13)xik+1=Aixik+Biuik,yik+1=ηixik+1,where Bi=ηi and Ai=ai2Pi2+bi2+ρcsignPi2+1 when i represents generator; else Ai=ai1Pi1+bi1+1.Supposing that the latest updated moment received by the present controller isk∗, the agent can successfully output and the corresponding output is updated from yik to yik∗. The predictive output of yik∗ is yik|k∗, where k=k∗+l>k∗ and l=1,2,…,r. Supposing that all the agents are observable, to predict the information of agents on moment k, the system predicts the information from moment k∗+1 to moment k as(14)x^ik|k∗=Aix^ik−1|k∗+Biuik−1|k∗,y^ik|k∗=ηix^ik|k∗.To make outputyik|k∗ track ydik, here, we introduce a set of dynamic variables:(15)s1k+1=s1k+y^1k|k∗−ydi,sik+1=sik+y^ik|k∗−y^1k|k∗.The cloud computing based predictive control can be represented as(16)u^ik|k∗=Misik+Li∑j∈Nwijy^jk|k∗−y^ik|k∗,where Mi and Li are gain matrices with corresponding dimension. The predicted control input is(17)uik=u^ik|k∗.As a result, the predicted control input of the systemτ^it is obtained. Agent i can track the difference value of supply and demand balance mismatching Pi¯ with the proposed predictive compensation control algorithm and then obtain its actual power Pcomi. The corresponding input τ^cit can be further obtained and the communication between agents is successfully achieved. From equation (11a), we know that if the target power Pi¯ is constant, τ^it is also constant, which ensures the status of agent i not affected by attacks.


### 3.5. Convergence Analysis

To prove the convergence of the proposed cloud-fog computing based event-triggered distributed consensus predictive compensation algorithm in the section titled “Fog Computing Based Distributed Event-Triggered Predictive Compensation Control Scheme Algorithm,” we rewrite equations (11a)–(11c) as a compact set.(18a)P˙A=∏Λ¯PA,−∇CPA+ητA,(18b)τ˙=−L⊗Iιτ⌢A−z+P¯−ηPA,(18c)z˙i=L⊗Iιτ⌢A,where Λ¯=Λ1×⋯×Λn, τ, τ⌢A, z, η, PA, and ∇CP are the stacked volume vectors of τi, τ⌢Ai, zi, ηi, PAi, and ∇CiPi, respectively; τ⌢Ai=τAi−τ^j. The equilibrium point of equation (18a)–(18c) is(19a)0=∏Λ¯PA∗,−∇CPA∗+ητA∗,(19b)0=−L⊗Iιτ⌢A∗−z∗+P¯−ηPA∗,(19c)0=L⊗Iιτ⌢A∗,where PA∗,z∗,τA∗ is the equilibrium point of the proposed algorithm. Because the communication graph is connected, by premultiplying both sides of (19a) with 1nT⊗Iι, we can have the following equation:(20)1nT⊗IιP¯−1nT⊗IιηPA∗=0,PA∗∈Λ¯.With respect to differential projection, we can know from equation (19a) that(21)−∇CPA∗+ητA∗∈φΛ¯PA∗,which means that the equilibrium point of algorithm (18a)–(18c) is equivalent to the optimization in (7a) and (7b).According to the differential projection, we have(22a)∏ΛiPAi,−∇CiPAi+ηiτAi=−∇CiPAi+ηiτAi−πiPAiniPAi,(22b)∇CiPAi∗−ηiτAi∗+πiPAi∗niPAi∗=0,(22c)πiPAi∗PAi−PAi∗TniPAi∗≤0,(22d)πiPAiPAi∗−PAiTniPAi≤0,where niPAi∈φΛiPA, niPAi∗∈φΛiPAi∗, πiPAi≥0, and πiPAi∗≥0.Converting the equilibrium point of equations (19a)–(19c) to the original point, we have(23)P⌣=PA−PA∗,z⌣=ΓTz−P¯−ηPA,τ⌣=ΓTτ−τ∗,where Γ=r,R is an orthogonal matrix; with rTR=0, RTR=In−1, RRT=In−rrT, r=1/n,1n∈ℝ, and R∈ℝn×n−1, we have(24a)P⌣˙=−ΔPA,PA∗+ηΓTτ˘A,(24b)τ⌣˙1=−rTηP⌣,(24c)τ⌣˙2:n=−RTLR⊗Iιτ˜2:n−z⌣2:n−RTηP⌣,(24d)z⌣˙1=0,(24e)z⌣˙2:n=RTLR⊗Iιτ˜2:n,where τ˜=τ⌢A−τ⌢A∗:=τ⌢A, ΔPA,PA∗=∇CP⌣+PA∗, and −∇CPA∗−πPA∗nPA∗+πPAnPA.To prove the convergence of equations (24a)–(24e), here, we define a Lyapunov function as follows:(25)V=12h+1P⌣TP⌣+τ⌣1Tτ⌣1+12hτ⌣2:nTτ⌣2:n+12τ⌣2:n+z⌣2:nTτ⌣2:n+z⌣2:n,where h > 0.Differentiating equation (25) and combining it with equations (24a)–(24e), we have(26)V˙=−h+1P⌣TΔPA,PA∗−h+1τ⌣2:nTz⌣2:n−z⌣2:nTz⌣2:n−z⌣2:nTηRTP⌣−hτ⌣2:nTRTLR⊗Iιτ˜2:n=−h+1P⌣TΔPA,PA∗−h+1τ⌣2:nTz⌣2:n−z⌣2:nTz⌣2:n−z⌣2:nTηRTP⌣−h2τ⌣2:nTRTLR⊗Iιτ⌣2:n+h2Φ,where Φ=−τ⌣2:nTRTLR⊗Iιτ⌣2:n−2τ⌣2:nTRTLR⊗Iιe2:n, e2:n=τ˜2:n−τ⌣2:n.According to the differential projection, we have−P⌣TΔPA,PA∗≤−γP⌣TP⌣, γ>0. According to connected graph, we have the inequation −h/2τ⌣2:nTRTLR⊗Iιτ⌣2:n≤−h/2μτ⌣2:nTτ⌣2:n. Then, by using Young’s inequality, we have(27)V˙≤−h+1γP⌣TP⌣−h+1τ⌣2:nTz⌣2:n−z⌣2:nTz⌣2:n−z⌣2:nTηRTP⌣−h2μτ⌣2:nTτ⌣2:n+h2Φ≤−h+1γP⌣TP⌣+h+12τ⌣2:n2−14z⌣2:n2+η2RTRP⌣2−h2μτ⌣2:nTτ⌣2:n+h2Φ,and, because τ⌣2:n=RTτ⌣, τ˜2:n=RTτ˜, we have(28)Φ=−τ˜−eTLτ˜−e−2τ˜−eTLe=eTLe−τ˜TLτ˜=eTLe−τ⌢ATLτ⌢A,because wij=wji, we have(29)eTLe=∑i=1N∑j=1NwijeiTei−ej≤2∑i=1Ndiei2,and, because the random variable τ⌢Ai=τAi−τ^j, we have(30)Eτ⌢TLτ⌢=12E∑i=1N∑j=1NwijτAi−τ^j2=12E∑i=1N∑j=1Nwijθikτ^i+1−θikτ^ci−τ^j2=12E∑i=1N∑j=1Nwijθik−βiτ^i−θik−βiτ^ci+βiτ^i−βiτ^ci+τ^ci−τ^j2≤12∑i=1N∑j=1Nwijτ^j2+βjτ^i2+1+βjτ^ci2,and when Φ=1/2∑i=1N4diei2−∑j=1NwijτAi−τ^j2≤0, we have(31)Φ=12∑i=1N4diei2−∑j=1Nwijτ^jt2+βiτ^i2+1+βiτ^ci≤0,and then(32)V˙≤−h+1P⌣TP⌣−h+1τ⌣2:nTz⌣2:n−z⌣2:nTz⌣2:n−z⌣2:nTηRTP⌣−h2μτ⌣2:nTτ⌣2:n+h2Φ≤−h+1γP⌣TP⌣+h+12τ⌣2:n2−14z⌣2:n2+η2RTRP⌣2−h2μτ⌣2:nTτ⌣2:n+h2Φ=−ΧT∑Χ+h2Φ,besides, Σ=diagh+1γ−η2IN,h/2μ−h+12IN,1/4IN and Χ=P⌣,τ⌣2:n,z⌣2:n. As a result, when Σ≥0 and fit≤0, we can know that V˙<0, which means that the algorithm converges to the optimum of optimization problem 7, and the proposition has been proved.


## 3.1. DoS Attack

Considering the problem of bandwidth constraint in communication between agents in microgrid, in this paper, we reduce the quantity of information to be transferred with an event-triggered manner. As a result, the communication between agents is discretized. DoS attack as a simple and efficient attacking method has drawn massive attention. In real-world scenario, in view of attackers trying to remain hidden and the energy being used for attack is limited, DoS attack is set to a random sequential form. Here, we useθit, which is a white noise random variable sequence that follows the Bernoulli distribution to represent whether the communication channel is under DoS attack. Without losing generality, we define θit=1, which means that the system has not been attacked, while θit=0 means the opposite. The mathematical probability of it satisfies(10)Probθit=1=Εθit=βi,Probθit=0=1−Εθit=1−βi,where βi∈0,1 is a known constant, and all θit are independent from each other.


## 3.2. Distributed Event-Triggered Predictive Compensation Control Scheme Designment

To solve the data-missing problem of communication between agents caused by DoS attack, in this paper, we try to mitigate the impact on agents caused by data missing from another perspective. The failure of receiving data from agentj will lead to the inability of agent i to calculate its control parameter τi, which will further break the balance of power supply and demand of agent i. To avoid the coupling problem between agents caused by directly predicting the data of agent j, in this paper, we use the history data of agent i instead. To be specific, the history data being used here is the last moment’s power data Pi and unbalance parameter of supply and demand P¯i. In this paper, we use a cloud computing based predictive compensation algorithm to predict the power of agent i and then obtain its control parameter τ^i. Therefore, the problem of balance between power supply and demand of agent i and the problem of the transmission of control parameter τ^i can be simultaneously solved. As for the small-scale data computing in the microgrid, we use fog computing to replace cloud computing to reduce the system’s power consumption and delay.As shown in Figure2, the proposed distributed event-triggered predictive compensation control scheme is mainly made up of three parts, which are the power solving (fog computing), control parameter solving (fog computing), and model predictive control compensation (cloud computing), where the model predictive control compensation is made up of controller, predictor, and compensator. The control parameter obtains trigger parameter with event-triggered detector and the power solving chooses its control parameter τAi according to whether the DoS attack happens.Figure 2
Distributed event-triggered predictive compensation control scheme based on cloud and fog computing under DoS attacks.


## 3.3. Fog Computing-Based Distributed Event-Triggered Predictive Compensation Control Scheme Algorithm

To address the problems in microgrids such as (1) the bandwidth constraint on communication between agents, (2) privacy information of subsystems being hard to obtain, and (3) communication between agents being easy to be attacked by DoS attack, in this paper, we propose an event-triggered distributed consensus energy management optimizing algorithm based on attack compensation.(11a)P˙Ai=∏ΛiPAi,−∇CiPAi+ηiτAi,(11b)τ˙i=−∑j∈Nwijτ^i−τ^j−zi+Pi¯−PAi,(11c)z˙i=∑j∈Nwijτ^i−τ^j,where ∏​Λi is the projection operator and τi is the KKT multiplier that represents the price parameter of each unit in microgrids; τ^i=τitki, ∀t∈tki,tk+1i, represents the latest updated event-triggered signal of each agent i; tki|k=1,2,… represents the event-triggered time when agent i passes status information to its neighbours. τAi=θikτ^i+1−θikτ^ci, where τ^ci is the control parameter obtained by the predictive compensation control algorithm when agent i is under attack. When τ^j which is data transferring from agent j to agent i is under attack, the proposed algorithm will convert the goal from predicting τ^j to predicting agent i’s power PAi to ensure the balance between supply and demand of agent i and obtain the control input τAi according to the predictive model. It is worth noting that, in this paper, all θik are synchronous.To mitigate the bandwidth constraint of the system’s communication, we design the event-triggered function as follows:(12)fit=4ϖiτ^it−τit2−∑j∈NwijτAi−τ^j2,where ϖi is the degree of agent i.When trigger functionfit≥0, agent i obtains information τ˜j from its neighbour agent j and then updates information ∑i∈Nwijτ^i−τ^j. At the same time, agent i broadcasts its status information to its neighbours. The proposed distributed algorithm only needs to pass τ^i between agents. The quantity of information to be transmitted is much fewer, which can reduce the cost of communication and improve the communication efficiency of the system.


## 3.4. Cloud Computing-Based Model Predictive Algorithm

To obtain the missing data caused by the attack, we propose a cloud computing based predictive compensation control algorithm. The proposed predictive cloud control mainly consists of predictive controller and compensator. The predictive controller can predictr control sequences after the present moment k∗ and then the compensator chooses the latest predictive control sequence as the missing control input data at moment k.By reason of agenti being event-triggered, we predict the missing data discretely. Setting τci as uik, Pi as xik, and Pi¯ as ydik, the multiagent model can be represented as(13)xik+1=Aixik+Biuik,yik+1=ηixik+1,where Bi=ηi and Ai=ai2Pi2+bi2+ρcsignPi2+1 when i represents generator; else Ai=ai1Pi1+bi1+1.Supposing that the latest updated moment received by the present controller isk∗, the agent can successfully output and the corresponding output is updated from yik to yik∗. The predictive output of yik∗ is yik|k∗, where k=k∗+l>k∗ and l=1,2,…,r. Supposing that all the agents are observable, to predict the information of agents on moment k, the system predicts the information from moment k∗+1 to moment k as(14)x^ik|k∗=Aix^ik−1|k∗+Biuik−1|k∗,y^ik|k∗=ηix^ik|k∗.To make outputyik|k∗ track ydik, here, we introduce a set of dynamic variables:(15)s1k+1=s1k+y^1k|k∗−ydi,sik+1=sik+y^ik|k∗−y^1k|k∗.The cloud computing based predictive control can be represented as(16)u^ik|k∗=Misik+Li∑j∈Nwijy^jk|k∗−y^ik|k∗,where Mi and Li are gain matrices with corresponding dimension. The predicted control input is(17)uik=u^ik|k∗.As a result, the predicted control input of the systemτ^it is obtained. Agent i can track the difference value of supply and demand balance mismatching Pi¯ with the proposed predictive compensation control algorithm and then obtain its actual power Pcomi. The corresponding input τ^cit can be further obtained and the communication between agents is successfully achieved. From equation (11a), we know that if the target power Pi¯ is constant, τ^it is also constant, which ensures the status of agent i not affected by attacks.


## 3.5. Convergence Analysis

To prove the convergence of the proposed cloud-fog computing based event-triggered distributed consensus predictive compensation algorithm in the section titled “Fog Computing Based Distributed Event-Triggered Predictive Compensation Control Scheme Algorithm,” we rewrite equations (11a)–(11c) as a compact set.(18a)P˙A=∏Λ¯PA,−∇CPA+ητA,(18b)τ˙=−L⊗Iιτ⌢A−z+P¯−ηPA,(18c)z˙i=L⊗Iιτ⌢A,where Λ¯=Λ1×⋯×Λn, τ, τ⌢A, z, η, PA, and ∇CP are the stacked volume vectors of τi, τ⌢Ai, zi, ηi, PAi, and ∇CiPi, respectively; τ⌢Ai=τAi−τ^j. The equilibrium point of equation (18a)–(18c) is(19a)0=∏Λ¯PA∗,−∇CPA∗+ητA∗,(19b)0=−L⊗Iιτ⌢A∗−z∗+P¯−ηPA∗,(19c)0=L⊗Iιτ⌢A∗,where PA∗,z∗,τA∗ is the equilibrium point of the proposed algorithm. Because the communication graph is connected, by premultiplying both sides of (19a) with 1nT⊗Iι, we can have the following equation:(20)1nT⊗IιP¯−1nT⊗IιηPA∗=0,PA∗∈Λ¯.With respect to differential projection, we can know from equation (19a) that(21)−∇CPA∗+ητA∗∈φΛ¯PA∗,which means that the equilibrium point of algorithm (18a)–(18c) is equivalent to the optimization in (7a) and (7b).According to the differential projection, we have(22a)∏ΛiPAi,−∇CiPAi+ηiτAi=−∇CiPAi+ηiτAi−πiPAiniPAi,(22b)∇CiPAi∗−ηiτAi∗+πiPAi∗niPAi∗=0,(22c)πiPAi∗PAi−PAi∗TniPAi∗≤0,(22d)πiPAiPAi∗−PAiTniPAi≤0,where niPAi∈φΛiPA, niPAi∗∈φΛiPAi∗, πiPAi≥0, and πiPAi∗≥0.Converting the equilibrium point of equations (19a)–(19c) to the original point, we have(23)P⌣=PA−PA∗,z⌣=ΓTz−P¯−ηPA,τ⌣=ΓTτ−τ∗,where Γ=r,R is an orthogonal matrix; with rTR=0, RTR=In−1, RRT=In−rrT, r=1/n,1n∈ℝ, and R∈ℝn×n−1, we have(24a)P⌣˙=−ΔPA,PA∗+ηΓTτ˘A,(24b)τ⌣˙1=−rTηP⌣,(24c)τ⌣˙2:n=−RTLR⊗Iιτ˜2:n−z⌣2:n−RTηP⌣,(24d)z⌣˙1=0,(24e)z⌣˙2:n=RTLR⊗Iιτ˜2:n,where τ˜=τ⌢A−τ⌢A∗:=τ⌢A, ΔPA,PA∗=∇CP⌣+PA∗, and −∇CPA∗−πPA∗nPA∗+πPAnPA.To prove the convergence of equations (24a)–(24e), here, we define a Lyapunov function as follows:(25)V=12h+1P⌣TP⌣+τ⌣1Tτ⌣1+12hτ⌣2:nTτ⌣2:n+12τ⌣2:n+z⌣2:nTτ⌣2:n+z⌣2:n,where h > 0.Differentiating equation (25) and combining it with equations (24a)–(24e), we have(26)V˙=−h+1P⌣TΔPA,PA∗−h+1τ⌣2:nTz⌣2:n−z⌣2:nTz⌣2:n−z⌣2:nTηRTP⌣−hτ⌣2:nTRTLR⊗Iιτ˜2:n=−h+1P⌣TΔPA,PA∗−h+1τ⌣2:nTz⌣2:n−z⌣2:nTz⌣2:n−z⌣2:nTηRTP⌣−h2τ⌣2:nTRTLR⊗Iιτ⌣2:n+h2Φ,where Φ=−τ⌣2:nTRTLR⊗Iιτ⌣2:n−2τ⌣2:nTRTLR⊗Iιe2:n, e2:n=τ˜2:n−τ⌣2:n.According to the differential projection, we have−P⌣TΔPA,PA∗≤−γP⌣TP⌣, γ>0. According to connected graph, we have the inequation −h/2τ⌣2:nTRTLR⊗Iιτ⌣2:n≤−h/2μτ⌣2:nTτ⌣2:n. Then, by using Young’s inequality, we have(27)V˙≤−h+1γP⌣TP⌣−h+1τ⌣2:nTz⌣2:n−z⌣2:nTz⌣2:n−z⌣2:nTηRTP⌣−h2μτ⌣2:nTτ⌣2:n+h2Φ≤−h+1γP⌣TP⌣+h+12τ⌣2:n2−14z⌣2:n2+η2RTRP⌣2−h2μτ⌣2:nTτ⌣2:n+h2Φ,and, because τ⌣2:n=RTτ⌣, τ˜2:n=RTτ˜, we have(28)Φ=−τ˜−eTLτ˜−e−2τ˜−eTLe=eTLe−τ˜TLτ˜=eTLe−τ⌢ATLτ⌢A,because wij=wji, we have(29)eTLe=∑i=1N∑j=1NwijeiTei−ej≤2∑i=1Ndiei2,and, because the random variable τ⌢Ai=τAi−τ^j, we have(30)Eτ⌢TLτ⌢=12E∑i=1N∑j=1NwijτAi−τ^j2=12E∑i=1N∑j=1Nwijθikτ^i+1−θikτ^ci−τ^j2=12E∑i=1N∑j=1Nwijθik−βiτ^i−θik−βiτ^ci+βiτ^i−βiτ^ci+τ^ci−τ^j2≤12∑i=1N∑j=1Nwijτ^j2+βjτ^i2+1+βjτ^ci2,and when Φ=1/2∑i=1N4diei2−∑j=1NwijτAi−τ^j2≤0, we have(31)Φ=12∑i=1N4diei2−∑j=1Nwijτ^jt2+βiτ^i2+1+βiτ^ci≤0,and then(32)V˙≤−h+1P⌣TP⌣−h+1τ⌣2:nTz⌣2:n−z⌣2:nTz⌣2:n−z⌣2:nTηRTP⌣−h2μτ⌣2:nTτ⌣2:n+h2Φ≤−h+1γP⌣TP⌣+h+12τ⌣2:n2−14z⌣2:n2+η2RTRP⌣2−h2μτ⌣2:nTτ⌣2:n+h2Φ=−ΧT∑Χ+h2Φ,besides, Σ=diagh+1γ−η2IN,h/2μ−h+12IN,1/4IN and Χ=P⌣,τ⌣2:n,z⌣2:n. As a result, when Σ≥0 and fit≤0, we can know that V˙<0, which means that the algorithm converges to the optimum of optimization problem 7, and the proposition has been proved.


## 4. Simulation and Analysis

In this paper, we perform experiments on the IEEE-14 bus system to verify the effectiveness of the proposed cloud-fog computing based event-triggered distributed consensus predictive compensation algorithm. The microgrid is a kind of island mode grid, and its communication network topology is shown in Figure3. The simulation of the microgrid is composed of two Distributed Generators (DG) and three Energy Storage Systems (ESS). The parameters of each component are shown in Table 1. The cost of batteries is ρc=0.058 $/kW.Figure 3
Topology of the communication network.Table 1
Parameters of the microgrid.
aibiPimin (kW)Pimax (kW)ηiDG10.0862.48220700.958DG20.0932.68825650.935ESS10.4890.081−20450.949ESS20.20920.072−20500.96ESS30.22470.061−15450.937To study the effectiveness of the compensation when the microgrid is under DoS attack, in this paper, we compare the corresponding condition of the system when the attack happens with or without compensation. The experimental results are as follows.


### 4.1. Without Compensation under DoS Attack

When the system is under DoS attack, the power generation will decline sharply. In this paper, we set a random attacking moment between the 2nd and the 5th seconds. As shown in Figure 4, great fluctuation can be observed during the period of attacking, which makes the microgrid system unstable.Figure 4
Power generation under attacks without predictive compensation.As shown in Figure4, the average local power generation of the microgrid system drops to 20 kW. Besides, when the load power increases, the generated power of the microgrid stays at a low level. Therefore, the energy supply ability of the system becomes insufficient. In Figure 5, we can see that the marginal cost of agents also decreases to about 30. Figure 6 shows that the balance between supply and demand is broken under DoS attack. The final supplied power is only 150 kW, which is far lower than the load’s demand, which is 275 kW. Such phenomena may result in the imbalance of supply and demand of the microgrid system and then can lead to instability and low power level of the whole grid. As shown in Figure 7, with the help of the proposed event-triggered sampling method, the sampling rate of the system decreases with a great margin, thus solving the problem of bandwidth constraint in the system.Figure 5
Marginal cost under attacks without predictive compensation.Figure 6
Estimation of the supply-demand mismatch under attacks without predictive compensation.Figure 7
Triggering instants of each agent.


### 4.2. With Predictive Compensation under DoS Attack

To address the instability and performance degradation of the microgrid caused by DoS attack, in this paper, we use the proposed cloud-fog computing based predictive compensation algorithm to take data compensation for the agent that has been attacked. As shown in Figure8, the power of each unit in the grid increases to 50 kW. Compared with power without predictive compensation, the proposed algorithm boosts the system’s efficiency of the power supply. Figure 9 shows that the marginal cost increases from 31 in Figure 5 to 58 when it reaches consensus. Such a phenomenon proves that the proposed method can improve the economic benefit of the microgrid system. From Figure 10, we can see that the balance between supply and demand of the microgrid system is achieved. Besides, when the load power changes, the system can track the change in real time.Figure 8
Power generation under attacks with predictive compensation.Figure 9
Marginal cost under attacks with predictive compensation.Figure 10
Estimation of the supply-demand mismatch under attacks with predictive compensation.In a word, the proposed compensation algorithm can not only mitigate the economic impact caused by the attack but also keep the balance between supply and demand of the attacked system and moreover keep the energy optimization performance.As shown in Figures11 and 12, we conduct tracking prediction of generator 1’s power data with the proposed cloud computing based predictive compensation algorithm. From the result, we can see that the actual power of generator 1 can well track its unbalance power (reference power). Compared with fog computing, the tracking response of cloud computing is faster and the marginal cost is better.Figure 11
Tracking performance for DG1 under attacks with predictive compensation.Figure 12
Marginal cost for DG1 under attacks with predictive compensation.Based on the above experimental results, the cloud-fog computing based distributed event-triggered predictive compensation energy optimization management of microgrid under DoS attack is achieved.


## 4.1. Without Compensation under DoS Attack

When the system is under DoS attack, the power generation will decline sharply. In this paper, we set a random attacking moment between the 2nd and the 5th seconds. As shown in Figure 4, great fluctuation can be observed during the period of attacking, which makes the microgrid system unstable.Figure 4
Power generation under attacks without predictive compensation.As shown in Figure4, the average local power generation of the microgrid system drops to 20 kW. Besides, when the load power increases, the generated power of the microgrid stays at a low level. Therefore, the energy supply ability of the system becomes insufficient. In Figure 5, we can see that the marginal cost of agents also decreases to about 30. Figure 6 shows that the balance between supply and demand is broken under DoS attack. The final supplied power is only 150 kW, which is far lower than the load’s demand, which is 275 kW. Such phenomena may result in the imbalance of supply and demand of the microgrid system and then can lead to instability and low power level of the whole grid. As shown in Figure 7, with the help of the proposed event-triggered sampling method, the sampling rate of the system decreases with a great margin, thus solving the problem of bandwidth constraint in the system.Figure 5
Marginal cost under attacks without predictive compensation.Figure 6
Estimation of the supply-demand mismatch under attacks without predictive compensation.Figure 7
Triggering instants of each agent.


## 4.2. With Predictive Compensation under DoS Attack

To address the instability and performance degradation of the microgrid caused by DoS attack, in this paper, we use the proposed cloud-fog computing based predictive compensation algorithm to take data compensation for the agent that has been attacked. As shown in Figure8, the power of each unit in the grid increases to 50 kW. Compared with power without predictive compensation, the proposed algorithm boosts the system’s efficiency of the power supply. Figure 9 shows that the marginal cost increases from 31 in Figure 5 to 58 when it reaches consensus. Such a phenomenon proves that the proposed method can improve the economic benefit of the microgrid system. From Figure 10, we can see that the balance between supply and demand of the microgrid system is achieved. Besides, when the load power changes, the system can track the change in real time.Figure 8
Power generation under attacks with predictive compensation.Figure 9
Marginal cost under attacks with predictive compensation.Figure 10
Estimation of the supply-demand mismatch under attacks with predictive compensation.In a word, the proposed compensation algorithm can not only mitigate the economic impact caused by the attack but also keep the balance between supply and demand of the attacked system and moreover keep the energy optimization performance.As shown in Figures11 and 12, we conduct tracking prediction of generator 1’s power data with the proposed cloud computing based predictive compensation algorithm. From the result, we can see that the actual power of generator 1 can well track its unbalance power (reference power). Compared with fog computing, the tracking response of cloud computing is faster and the marginal cost is better.Figure 11
Tracking performance for DG1 under attacks with predictive compensation.Figure 12
Marginal cost for DG1 under attacks with predictive compensation.Based on the above experimental results, the cloud-fog computing based distributed event-triggered predictive compensation energy optimization management of microgrid under DoS attack is achieved.


## 5. Conclusion

In this paper, a cloud-fog computing based distributed event-triggered predictive compensation energy optimization management algorithm is proposed. Considering the loss of power transmission of microgrid, the profit can be maximized by optimizing the power supply of microgrid. As for the problem of bandwidth constraint and the inconsistent problem of the microgrid, we take advantage of the properties of fog computing such as low latency and high efficiency and propose a distributed event-triggered consensus predictive compensation algorithm. Besides, we also utilize a cloud computing based predictive model compensation algorithm to enhance the computational efficiency of the prediction of the parameters in the grid. The proposed algorithm can track the history power data of the unbalance between supply and demand before the attacking moment and use it to predict and compensate the power missing data of the agent on the current moment and subsequent moments. Experimental results show that the proposed cloud-fog computing based distributed event-triggered consensus predictive compensation microgrid energy management algorithm can efficiently solve the performance degradation, mismatch of supply and demand, weak computing capacity, and transmission delay caused by DoS attack.



---

*Source: 5401298-2020-11-18.xml*