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.

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 [810], 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 Figure 1. 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.

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 use to represent the communication graph that connects to N agents including both energy supply systems and fan loads. In graph G, represents the set of agents and represents the set of edges, where each edge is defined as the communication between agent and agent . Here, we define the adjacent matrix of G as , where and when or else . The Laplacian matrix of G is defined as L = D-Z, where represents the degree matrix of G and .

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 agent i 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.where , , , and are the sets of generator, energy storage system, renewable energy, and load, respectively; , , , and are the welfare function of generator, energy storage system, renewable energy, and load, respectively; , , , and are the power consumption of generator, energy storage system, renewable energy, and load, respectively; and 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:

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 iswhere is the power-on time of a generator and is the generator’s manufacturing cost, which can be expanded intowhere , , and are positive parameters of the manufacturing cost of a generator.

The welfare function of energy storage system iswhere is the power-on time of the energy storage power and is the charge-discharge energy consumption and degradation cost of the energy storage power, which can be expanded intowhere and are the cost coefficients of charge-discharge energy consumption of the energy storage power; 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 intowhere is the element set of the generator and energy storage system; 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 aswhere is the KKT multiplier.

By differentiating equation (8), we can know that equations (7a) and (7b) must have a constant solution that satisfieswhere is the derivative of .

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 , 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 , which means that the system has not been attacked, while means the opposite. The mathematical probability of it satisfieswhere is a known constant, and all 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 agent j will lead to the inability of agent i to calculate its control parameter , 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 and unbalance parameter of supply and demand . 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 . Therefore, the problem of balance between power supply and demand of agent i and the problem of the transmission of control parameter 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 Figure 2, 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 according to whether the DoS attack happens.

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.where is the projection operator and is the KKT multiplier that represents the price parameter of each unit in microgrids; , , represents the latest updated event-triggered signal of each agent i; represents the event-triggered time when agent i passes status information to its neighbours. , where is the control parameter obtained by the predictive compensation control algorithm when agent i is under attack. When which is data transferring from agent j to agent i is under attack, the proposed algorithm will convert the goal from predicting to predicting agent i’s power to ensure the balance between supply and demand of agent i and obtain the control input according to the predictive model. It is worth noting that, in this paper, all are synchronous.

To mitigate the bandwidth constraint of the system’s communication, we design the event-triggered function as follows:where is the degree of agent i.

When trigger function , agent i obtains information from its neighbour agent j and then updates information . At the same time, agent i broadcasts its status information to its neighbours. The proposed distributed algorithm only needs to pass 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 predict r control sequences after the present moment and then the compensator chooses the latest predictive control sequence as the missing control input data at moment k.

By reason of agent i being event-triggered, we predict the missing data discretely. Setting as , as , and as , the multiagent model can be represented aswhere and when i represents generator; else .

Supposing that the latest updated moment received by the present controller is , the agent can successfully output and the corresponding output is updated from to . The predictive output of is , where and . Supposing that all the agents are observable, to predict the information of agents on moment k, the system predicts the information from moment to moment k as

To make output track , here, we introduce a set of dynamic variables:

The cloud computing based predictive control can be represented aswhere and are gain matrices with corresponding dimension. The predicted control input is

As a result, the predicted control input of the system is obtained. Agent i can track the difference value of supply and demand balance mismatching with the proposed predictive compensation control algorithm and then obtain its actual power . The corresponding input can be further obtained and the communication between agents is successfully achieved. From equation (11a), we know that if the target power is constant, 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.where , , , , , , and are the stacked volume vectors of , , , , , and , respectively; . The equilibrium point of equation (18a)–(18c) iswhere is the equilibrium point of the proposed algorithm. Because the communication graph is connected, by premultiplying both sides of (19a) with , we can have the following equation:

With respect to differential projection, we can know from equation (19a) thatwhich means that the equilibrium point of algorithm (18a)–(18c) is equivalent to the optimization in (7a) and (7b).

According to the differential projection, we havewhere , , , and .

Converting the equilibrium point of equations (19a)–(19c) to the original point, we havewhere is an orthogonal matrix; with , , , , and , we havewhere , , and .

To prove the convergence of equations (24a)–(24e), here, we define a Lyapunov function as follows:where h > 0.

Differentiating equation (25) and combining it with equations (24a)–(24e), we havewhere , .

According to the differential projection, we have , . According to connected graph, we have the inequation . Then, by using Young’s inequality, we haveand, because , , we havebecause , we haveand, because the random variable , we haveand when , we haveand thenbesides, and . As a result, when and , we can know that , 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 Figure 3. 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  $/kW.

To 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.

As shown in Figure 4, 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.

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 Figure 8, 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.

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 Figures 11 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.

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.

Data Availability

The microgrid data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Acknowledgments

This work was partially supported by the National Natural Science Foundation of China (61703081 and U1908217), the Fundamental Research Funds for the Central Universities (N2004030), the Liaoning Revitalization Talents Program (XLYC1801005 and XLYC1902055), the State Key Laboratory of Alternate Electrical Power System with Renewable Energy Sources (LAPS19005), and the National Key Research and Development Project (2018YFB1700500).