**Electric Power System Operation Mechanism with Energy Routers Based on QoS Index under Blockchain Architecture**

#### **Gangjun Gong 1, Zhening Zhang 1,\*, Xinyu Zhang 1, Nawaraj Kumar Mahato 1, Lin Liu 2, Chang Su <sup>1</sup> and Haixia Yang <sup>1</sup>**


Received: 19 December 2019; Accepted: 13 January 2020; Published: 15 January 2020

**Abstract:** With the integration of highly permeable renewable energy to the grid at different levels (transmission, distribution and grid-connected), the volatility on both sides (source side and load side) leading to bidirectional power flow in the power grid complicates the control mechanism. In order to ensure the real-time power balance, energy exchange, higher energy utilization efficiency and stability maintenance in the electric power system, this paper proposes an integrated application of blockchain technology on energy routers at transmission and distribution networks with increased renewable energy penetration. This paper focuses on the safe and stable operation of a highly penetrated renewable energy grid-connected power system and its operation. It also demonstrates a blockchain-based negotiation model with weakly centralized scenarios for "source-network-load" collaborative scheduling operations; secondly, the QoS (quality of service) index of energy flow control and energy router node doubly-fed stability control model were designed. Further, it also introduces the MOPSO (multi-objective particle swarm optimization) algorithm for power output optimization of multienergy power generation; Thirdly, based on the blockchain underlying architecture and load prediction value constraints, this paper puts forward the optimization mechanism and control flow of autonomous energy coordination of b2u (bottom-up) between router nodes of transmission and distribution network based on blockchain.

**Keywords:** high permeability renewable energy; blockchain technology; energy router; QoS index of energy flow; MOPSO algorithm; scheduling optimization

#### **1. Introduction**

Extensively distributed renewable energy is well-known for its diverse advantages, such as its wide availability and clean power, which adjures human society to switch the existing energy structure in order to set up a clean, efficient, safe and sustainable modern energy system [1,2]. Renewable energy refers to the energy that is not depleted when used and generally comprises wind, solar, hydro, biomass, tidal and geothermal sources [3]. Among them, (1) in the long run, biomass power generation and geothermal power generation are relatively less affected by natural factors such as seasons, day and night and cloudy weather [4]; (2) over a certain period of time, hydropower generation is also less affected by natural environmental factors; (3) in the short term, power generation sources such as tidal, wind and solar, are also greatly affected by environmental factors [5]. At present, the large scale integration of renewable energy power generation in the source side has been achieved by the centralization of wind, photovoltaic and hydropower generation, and some areas are assisted by biomass, tidal, geothermal and other methods of generating electricity [6]. Meanwhile, the load side also transfers excess energy to the power grid in the form of distributed wind and photovoltaic micro-grid.

With the large-scale access of highly permeable renewable energy, the diversity and uncertainty of energy forms increase the complexity of power output and distribution [7]. Simultaneously, the phenomenon of "abandoning or curtailing wind, solar and hydro," in some areas leads to poor coordination and matching ability between the source side and the grid side [8,9]. Moreover, the dual overlaying of source and load volatility under renewable energy access leads to the bidirectionalization of power flow and complicating the control mechanism. Therefore, it is difficult to realize real-time, efficient and intelligent control of transmission and distribution networks by unified centralized scheduling. Hence, it is urgent to improve the level of collaborative optimization, so as to enhance the autonomous decision-making ability and autonomous coordination ability of transmission and distribution network nodes at all levels. Being a distributed and decentralized peer-to-peer network, a blockchain has the technical characteristics of distributive decision making, cooperative autonomy, traceability and tamper resistance [10], making it suitable for the cooperative optimization of transmission and distribution network under the access of renewable energy in terms of topology and collaborative scheduling [11,12]. This can fairly well guarantee the safe operation of the transmission and distribution network.

References [13–15] analyze the technical requirements of energy Internet for blockchain and its applicability. Reference [16] combined different scenarios in the energy internet, such as carbon emission rights certification, illustrating the specific application of blockchain. Article [17–19] has proposed the mathematical model and relevant optimization methods of transmission network structure optimization along with emergency demand-side response strategy in transmission network planning. Reference [20] uses the distributed ledger technology of the blockchain for the demand response of the smart grid can improve the accuracy of signal tracking. Reference [21] describes to the interconnection between smart devices of the Internet of Things and the interconnection of blockchain nodes, and analyzes the feasibility of device operation and data management. In reference [22], block chain technology is used to solve the security problem of communication between different types of machines in Cyber-Physical Systems (CPS). Therein, block chain for M2M secure communication is designed to ensure that the communication data between machines is tamperproof. Reference [23] proposes a security solution that applies blockchain technology to smart grid and multienergy interactions, and uses digital signature technology to ensure high security of the solution. The above articles respectively study and analyze the blockchain technology and renewable energy access requirements from the application mode of blockchain under the energy Internet together with transmission and distribution network optimization techniques. Apart from this, they lack the combination of the "source–grid–load" operation scenario under renewable energy access, analyzing the collaborative optimization mechanism and control flow of the energy distribution router in the transmission and distribution network, and the information interaction and constraints between different levels of energy routers under the weakly centralized scheduling. To overcome those issues, realizing the application of blockchain this paper puts forward a novel idea of technology integration supporting the energy router application scenario on the top with blockchain technology with access to highly permeable renewable energy.

The main contributions made of this research paper are as follows:


and a distribution network under a weakly centralized scheduling is realized through the b2u (bottom-up) negotiation mechanism based on a master-slave multichain. This will lead to autonomous decision-making capability, and autonomous coordination of transmission and distribution networks will be realized.

c. The energy router is used as a network node, and the master-slave multichain negotiation mechanism is used to realize the information exchange between the energy routers, which improves the interoperability between the energy nodes with increased security of blockchain architecture; through the optimization algorithm of the blockchain smart contract, joint output schemes of different power plants can be obtained, which improves the ability of the power transmission and distribution network to mitigate wind and light loss.

#### **2. The Energy Router Operating Scenario with Highly Permeable Renewable Energy Access**

#### *2.1. Prerequisites of Weakly Centralized Collaborative Scheduling*

The normal and stable operation of the transmission and distribution network and the power plants are under the unified control of the dispatch control system. The power dispatch system mainly incorporates the below listed four functions:


The four-function modules guarantee the safe and stable operation of the electric power system. However, under the new situation of high-permeability renewable energy access, regardless of the more serious phenomenon of "abandoning wind and solar" and the bidirectionalization of energy trends in transmission and distribution networks, it is essential to strengthen the autonomous operating capacity of intelligent energy node equipment, such as energy routers [24]. And some functions of the scheduling system are required to be implemented locally; i.e., from the strong centralization of unified scheduling to the weak centralization of distributed coordination [25]. Some of the existing scheduling functions that the energy router node can undertake are shown in Table 1:


**Table 1.** The existing scheduling functions which the energy router/switch node can perform.

*2.2. Application Scenario of Energy Router Based on Blockchain under "Source–Grid–Load" Cooperative Operation*

The energy router here refers to the core equipment of the energy Internet architecture. It is a smart agent capable of computing, communication, precise control, remote coordination, autonomy and plug-and-play access to the power grid. It has functions such as energy interaction, information

interaction and intelligent distribution. Among them, information exchange is realized through software platforms such as server clusters and power consumption information collection equipment; energy interaction is realized through hardware platforms such as power electronic transformers with voltage transformation and current transformation functions. In order to support highly permeable renewable energy access to the grid, the power dispatch center can decentralize some functions to the energy routing nodes at all levels, and realize intelligent control of energy routing nodes in terms of cooperative autonomy, decision-making efficiency, collaborative operation and data security based on blockchain technology. The collaborative operation model is shown in Figure 1.

**Figure 1.** The "source–grid–load" operation model for renewable energy access.

In the context of widespread access to renewable energy sources, the "source–grid–load" cooperative operation model shown in Figure 1 focuses on the different problems from the source side, grid side and load side. The blockchain technology and energy flow QoS index is introduced on the basis of power and load prediction from the source side and load side, which can ensure the cooperative autonomy and cooperative operation of energy nodes at all voltage levels. The brief explanation of operation and working of source side, grid side and load side energy nodes in the model is as follows:


capacity and geographical differences. (2) The particularities of and complementarity between different energy forms. (3) Time sensitivity of renewable energy and volatility of energy supply. Therefore, the energy router not only needs to share some functions of the dispatch control system [26], but also needs to optimize the QoS indicators of the energy nodes of the local level for maintaining the output level of the local renewable energy. Simultaneously, in order to ensure that the energy router can access data at any time and participate in data interaction, record management, etc., to achieve peer-to-peer power demand negotiation in a trusted environment, energy routers at different voltage levels are to be used as network nodes to build different types of energy router negotiation chains to complete energy demand negotiation; authenticating and registering [27]; storing and managing an energy router's intelligent optimization algorithms and QoS indicator data in a smart contract; and building a weakly centralized trusted transmission and distribution environment. In addition, through the analysis of the previous block data, it can guide the next stage of energy complementary allocation and the formation of transmission and distribution plans [28–30].

Due to the variation of renewable energy generation capacity in different regions, according to the different amount of storage data of each substation in the transmission and distribution network and based on its own power calculation, the energy routers in the peer-to-peer transmission and distribution network can be divided into nodes with different rights according to the voltage levels. In Figure 1, relating to China, the voltage level above 100 kV is considered as transmission line and 110 kV and lower is considered the distribution line. Here, the transmission levels denote the configuration set up for above 110 kV with the energy routers at different nodes being given higher authority, which can independently implement all block functions, such as recording block, broadcast communication, encryption and decryption. Likewise, the distribution level refers to the configuration set, with energy routers at 110 kV and below being given lower authority. They only need to retain a part of the data of the blockchain and participate in the negotiation of transmission and distribution planning; despite their limited storage capacity and computing power, their limited data storage with low maintenance costs are beneficial.

Load side: Figure 1 defines a variety of roles for the load side with distinct divergence: (1) Traditional loads include residential users, industrial and commercial users, etc., acting as energy consumers. (2) As a typical power flexible load, electric vehicles can actively participate in the operation of the grid and interact with the grid; usually, when the power demand is at the peak, the electric vehicle can transfer its excess power to the grid. (3) The distributed power source mainly includes power generation and energy storage devices, which can reduce the pressure of the power grid; the generated power is preferentially consumed nearby, and the surplus power generates a power flow reversal. Considering the above types of loads, the dispatch control system needs to obtain the output data of various types of loads and distributed energy, and carry out corresponding load forecasting; simultaneously, the load side should also interact with the information exchanged by the network to further realize the load-network cooperation.

#### **3. Energy Router Node Model Based on Energy Flow QoS Index and Blockchain Architecture**

In the coordinated scheduling of the "source–grid–load" three-tier architecture, all energy nodes and energy router nodes negotiate among themselves through the blockchain. Compared with the source node and the load node, the collaborative optimization of the transmission and distribution network is most complicated by the fusion control involving energy flow and information flow. Therefore, this paper combines the blockchain technology, the energy flow QoS index and the physical node structure to establish an optimization model of the energy router node in the transmission and distribution network, as demonstrated in Figure 2.

**Figure 2.** Node model of transmission and distribution network energy router.

This model adopts a three-tier architecture consisting of a physical node layer, a blockchain negotiation layer and a QoS indicator layer. It ensures a relatively balanced output of energy nodes at different levels under renewable energy access with the physical and information perspective. The energy router node model is constituted from the following functions:


of the system, storing the negotiation data and recording the expected output value for the source side from the dispatch control system.

• QoS index layer is an evaluation system layer coupled with the optimization strategy. With renewable energy sources with fluctuating output power to further share the load demand, and in order to ensure the quality of power transmission under the requirements of power balance between renewable energy and traditional power generations, it is necessary to refer to the existing information flow transmission QoS indicators to construct an energy node QoS evaluation system that matches the physical node layer. Based on this, the equalization coefficient, line loading rate, loss and loss-to-loss ratio are defined as optimization indicators of the QoS evaluation system. It can provide clear optimization targets for energy router nodes, reduce power transmission loss and improve renewable energy utilization under the condition of ensuring the balanced output of different power generation units.

#### **4. Definition and Evaluation Mechanism of the QoS Index Layer**

The specific definitions of the four types of QoS indicators are as follows:

(a) Equilibrium coefficient: The local renewable energy power generation needs to control its own power generation according to its own weight ω*<sup>i</sup>* and the transmission capacity limit *Plim*. The ω*<sup>i</sup>* is defined as the ratio of the predicted output of different renewable energy power generation to the predicted total output of local energy, as shown in Equation (1):

$$\omega\_{i} = P\_{i} / \sum\_{i \in \mathcal{N}\_{\text{Rx}}} P\_{i} \tag{1}$$

where *Pi* is the predicted output of different energy power plants and *NRe* is the collection of local power generations of different energy types.

Under the condition of a certain transmission capacity, in order to ensure the balanced output of different renewable energy power generations in the locality, the equalization coefficient μ is introduced, and the value is as small as possible to indicate whether the power plant meets the optimization index of output fairness, as shown in Equation (2):

$$\mu = \frac{\left|P\_{\text{real}\_i} - P\_{\text{lim}} \times \omega\_i\right|}{P\_{\text{lim}} \times \omega\_i} \times 100\%\_\prime \,\text{i} \in \text{N}\_{\text{Re}\_{\prime}}\tag{2}$$

where *Plim* is the transmission capacity limit of the line; *Preali* is the actual delivery capacity of the local renewable energy power generations.

(b) Line loading rate: In order to minimize the energy loss caused by the overhead transmission line and promote the economic operation of transmission and distribution network, the line loading rate is defined as the ratio of actual transmission capacity to transmission capacity limit given by Equation (3).

$$\phi\_{\rm av} = \left(\sum\_{i \in \mathcal{N}\_{\rm Rx}} P\_{\rm real} / P\_{\rm lim} \right) \times 100\%. \tag{3}$$

Considering all aspects of factors and setting aside for load fluctuations, this paper sets the line loading rate from 50% to 75%.

(c) Degree of loss: Combined with the electric energy surplus of the local wind and solar renewable energy power generations, the degree of loss (*Q*) is defined as the degree of abandoned wind and solar, which is related to the power loss and the duration of wind and solar abandonment. Degree of loss can be defined by the following Equations (4) and (5):

$$Q\_{loss\_i} = \left[P\_{renl\_i} - (P\_{lim} \times \omega\_i)\right] \times \Delta t, \ i \in N\_{Rx} \tag{4}$$

$$Q\_{\text{loss}(\text{xk}V)} = \sum\_{i} Q\_{\text{loss};i} \tag{5}$$

where Δ*t* is the duration of wind and solar abandonment; *x* ∈ {35, 110, 220, 330}; that is, different voltages.

(d) Input-loss ratio (*ILR*): The energy loss generated by the substation during the transformation process occupies a considerable proportion of the total loss. The *ILR* is defined by Equation (6).

$$ILR = 10 \times \log\_{10}(P\_{input}/P\_{loss}),\tag{6}$$

where *Ploss* is the energy loss during the substation transformation process of the corresponding grade energy node. *Pinput* is the total energy received by the upper node. According to the actual demands, cost and other factors for comprehensive consideration, the *ILR* can be set within an acceptable range, and the *ILR* value can directly measure the working capacity of the substation.

There are two main roles in the above four types of indicators. Firstly, after the blockchain intelligent contract finds the joint output plan of different power generations through the multiobjective optimization algorithm, the optimization result can be evaluated. Secondly, each energy router node competes for the quality of power transmission through the evaluation result of the energy flow QoS index to form a consensus mechanism in the blockchain.

#### **5. Blockchain-Based Transmission and Distribution Network Negotiation Model**

#### *5.1. Blockchain Hierarchical Negotiation Mapping Architecture*

By analyzing and defining the inter-constraint relationship between the various levels in the transmission and distribution network node model, the blockchain hierarchical negotiation mapping architecture shown in Figure 3 can correspond to it [32].

**Figure 3.** Node model of transmission and distribution network energy router.

The mapping relationship is listed as follows:


For example, the 330 kV node needs to have the functions of recording the overall QoS indicator value of the system at the same time, while other low-voltage level nodes do not need to record additional data but have higher real-time requirements for uploading their own data. Therefore, a reasonable choice of block capacity will improve the overall operating efficiency of the system.

#### *5.2. Transmission and Distribution Network Negotiation Mechanism Based on the Master-Slave Multichain Structure*

In the transmission and distribution network, under highly permeable renewable energy access, the energy router nodes at all levels have complex roles, such as dealing with different types of power generation and energy routers with different functions. Among them, the energy router should not only realize energy control but also manage and optimize the actual outputs of multienergy power plants at this level [33]. At the same time, realizing the information guarantee, that is, providing a stable and efficient information interaction environment for consultation and information transmission between nodes, is also one of the functions of the energy router [34]. Therefore, this paper designs the transmission and distribution network negotiation mechanism based on the master-slave multichain, as demonstrated in Figure 4. Information flow in this mechanism is bidirectional. The downstream information flow is emitted by the main chain of the 330 kV energy router to perform the negotiation results. Upstream information flow is b2u power negotiation information flow, it is issued by the network 35 kV energy router slave chain, which is used to pass the power consumption prediction value step by step. Through this mechanism, the dispatch control system is weakly centralized and the grid prediction accuracy is improved. With the energy flow QoS index, the master-slave chain is used to evaluate the negotiation results and optimize the energy nodes at all levels. After the negotiation is reached, all information involved in the result is stored in the 330 kV energy router main blockchain, and the information is periodically updated to generate a new block [35–37].

In the energy node QoS evaluation system proposed in this paper, all levels of energy routers should implement the negotiation results under the premise of satisfying the equalization coefficient μ and line loading rate φ*w*. The local total loss *Qloss*(*xkV*) and input-loss ratio *ILR*(*xkV*) were used to evaluate the final negotiating results. At the beginning of the negotiation, the *Qloss*(*xkV*) and *ILR*(*xkV*) of the previous phase are set to the acceptable lower limit of QoS to ensure that the QoS value of the negotiation mechanism is within an acceptable range. The data involved are regularly stored by the corresponding level of the block. The information transmission process uses asymmetric encryption technology to ensure security at the same time.

The local predicted output value *Plocal*(*xkV*) of the energy nodes at all levels in this mechanism needs to comprehensively consider the total amount of actual output *Preal*(*xkV*) and the transmission capacity limit *Plim*(*xkV*) of each line. Where *x* ∈ {35, 110, 220},

$$P\_{\text{real}(\text{xk}V)} > P\_{\text{lim}(\text{xk}V)}, \text{ then } P\_{\text{local}(\text{xk}V)} = P\_{\text{lim}(\text{xk}V)}\tag{7}$$

**Figure 4.** Blockchain-based transmission and distribution network consultation mechanism.

The total actual output *Preal*(*xkV*) is the sum of various types of energy generation output.

$$P\_{\text{real}(\text{xk}V)} = \sum\_{i \in N\_{\text{Rx}}} P\_{\text{real}\_i} + P\_{\text{thermal}\_i} \tag{9}$$

where *Preali* is the actual delivery capacity of the renewable energy power generation in each energy router node, and *Pthermal* is the actual output of the thermal power generation.

The transmission and distribution network negotiation mechanism based on the blockchain mainly includes the following three steps:

	- i. Starting at time *t*, the 35 kV energy router slave chain collects the load current reverse power value *PREV* and the load predicted value *PLP*, and calculates the total power required *PL* at the load side. Combined with the local output predicted value *Plocal*(35*kV*), the *Pin*(35*kV*) is calculated and uploaded to the 110 kV energy router slave chain by the 35 kV slave chain. This step takes time Δ*t*. Where *Pin*(35*kV*) is the power value required by the 35 kV energy router, which is obtained from the 110 kV energy router:

$$P\_{\rm in(35kV)} = P\_L - P\_{\rm local(35kV)} = (P\_{LP} - P\_{\rm REV}) - P\_{\rm local(35kV)}.\tag{10}$$

ii. Starting at time *t* + Δ*t*, the 110 kV energy router slave chain derives the *Pin*(110*kV*) according to *Pin*(35*kV*) and *Plocal*(110*kV*), and then uploads the data to the 220 kV energy router slave chain before time *t* + 2Δ*t*. *Plocal*<sup>110</sup>*kV* is the predicted value of the local output and *Pin*<sup>110</sup>*kV* is the value of the power that the 110 kV energy router needs to obtain from the upper 220 kV energy router. Starting at time *t* + 2Δ*t*, the 220 kV energy router slave chain performs the same steps as the 110 kV energy router slave chain, ending at time *t* + 3Δ*t*.

$$P\_{\rm in(110kV)} = P\_{\rm in(35kV)} - P\_{\rm local(110kV)} \tag{11}$$

$$P\_{\rm in(220kV)} = P\_{\rm in(110kV)} - P\_{\rm local(220kV)}.\tag{12}$$


$$P\_{\dot{m}(220kV)} = P\_{b2u}.\tag{13}$$

At the same time, the main chain of the 330 kV energy router acquires the *PE*, and calculates *Qloss*(*xkV*) and *ILR*(*xkV*) according to the *Qloss*(*total*) and *ILR*(*total*) uploaded by the energy routers at all levels. Among them, *PE* is the expectation value of the dispatch control system to the source power generation in the short term. The length of time required for this step is Δ*t*.

$$\begin{cases} Q\_{\text{loss}(\text{total})} = \sum\_{\mathbf{x}} Q\_{\text{loss}(\text{xk}V)} \\ \text{ILR}\_{\text{(total)}} = \sum\_{\mathbf{x}} \text{ILR}\_{(\text{xk}V)} \end{cases}, \mathbf{x} \in \{35, 110, 220, 330\}. \tag{14}$$

At this point, the energy routers at all levels have basically clarified their respective power conversion value, and the energy negotiation based on *b*2*u* is basically completed.

(b) At time *t* + 4Δ*t*, the 330 kV energy router main chain compares *Pb*<sup>2</sup>*<sup>u</sup>* with *PE*, and checks whether *Qloss*(*tatal*) and *ILR*(*total*) met the requirements of the previous preset values or not.

$$\begin{cases} \quad (1 - \mathfrak{F}\%) P\_E \le P\_{\mathfrak{h}2\mathfrak{u}} \le (1 + \mathfrak{F}\%) P\_E\\ \quad \text{others} \end{cases} \begin{array}{c} \quad \text{ $\mathfrak{F}$ } \end{array} \tag{15}$$

The *Pb*<sup>2</sup>*<sup>u</sup>* floating range is set to ±5%. When the values of *Pb*<sup>2</sup>*u*, *Qloss*(*tatal*), and *ILR*(*total*) satisfies the condition, the entire system performs the task according to the b2u power negotiation results. Otherwise, the prediction accuracy of the energy routers at all levels is calibrated according to the preset requirements and renegotiated until the conditions are met to determine the negotiation results. If the negotiation proceeds smoothly, the negotiation result is finally determined at *t* + 5Δ*t*.

(c) At time *t* + 5Δ*t*, the 330 kV energy router's main chain delivers the results to the energy routers' slave chains at all levels, and executes negotiation results. Simultaneously, the hash value generated by the result is stored in the main chain block of the 330 kV energy router. This can ensure that the problem caused by the unreasonable negotiation mechanism can be traced back to the source. This step ends at time *t* + 6Δ*t*.

The transmission and distribution network negotiation mechanism based on the master-slave multichain structure takes the *b*2*u* power negotiation as the core, and combines the energy flow QoS index and power prediction. This mechanism ensures the high security of the negotiation environment and the traceability of the negotiation result under the function of achieving high integration of energy flow and information flow.

#### **6. Feasibility Verification**

#### *6.1. Simulation of Intelligent Contract Example and Evaluation of QoS Index Based on Multiobjective Particle Swarm Optimization*

Introducing the blockchain architecture and energy flow QoS indicators in the optimization model of the energy router node in the transmission and distribution network can provide optimization strategies and ensure a weakly centralized trusted transmission and distribution environment, but further analysis of the actual power output of renewable energy power generations at each energy node in the physical node layer is also needed. In the cooperative optimization mechanism of transmission and distribution network under the blockchain architecture, the conclusions of joint output schemes of different power generations in energy nodes, and reducing the excess of photovoltaic and wind power uploading to transmission lines with its maximum possible utilization, are the core solution goal of blockchain smart contract. Therefore, this paper integrates the MOPSO (multiobjective particle swarm optimization) algorithm into the intelligent contract of blockchain, taking the physical node layer in Figure 2 as an example to solve the optimal schemes for the output of different power generation units. The data routers that provide the data are the energy routers of the power plants of this voltage class and the energy routers of the next voltage class. The inputs to the simulation process are: the output goal of each power plants, i.e., its output proportion being infinitely close to its own installed proportion; upper and lower limit of output limit of each power plant; upper and lower limits of the total loading rate of the transmission line; and the energy demand of the next voltage class energy router. The output of the simulation process is: after the multiobjective optimization, the amount of power required to be sent to the energy router of the next voltage level, *Qloss*(*xkV*) and *ILR*(*xkV*), is sent to 330 kV master chain after being evaluated by QoS index. Other nodes in the transmission and distribution network can refer to the optimization strategy of the node, and change or add the constraints in the smart contract according to different voltage levels and various environmental factors.

The MOPSO algorithm introduces an adaptive mesh method (estimating the information density of particles), a search mechanism for Pareto optimal solutions that balance global and local search capabilities and a pruning technique for archive sets that reject poor quality particles [38–40]. It has the characteristics of fewer control parameters, easy implementation and a certain degree of parallelism [41, 42]. MOPSO updates the position and velocity of particles in a population-based on inertia weights and learning factors in order to reduce the renewable input or increase hydro and thermal generation. In order to maximally utilize renewable sources with least disturbances in the power grid, the algorithm is optimized, and the disturbance or mutation operator is executed to prevent the particles from falling into the local Pareto front end. After the optimization is performed by MOPSO algorithm, the energy router feeds the final result to the power generation units of the same level through the secondary feedback line in the transmission and distribution network routing model (refer to Figure 2), ensuring the intelligence and efficiency based on the blockchain negotiation process. The energy flow QoS indicator will evaluate the negotiation results of the optimized energy routers at the same level, and upload the evaluation results step by step to help further optimize the transmission and distribution plan.

In this paper, MATLAB is used to simulate the MOPSO algorithm, taking the electric power system power generation data of northwest region of China with abundant solar and wind energy resources as an example, in order to analyze the output of the four types of power generations based on the energy flow QoS indicator, while setting the maximum output of clean energy and the actual output of each power generation units as close as possible to the transmission capacity limit of the objective

function; and setting the transmission line loading rate to reasonable, photovoltaic and wind power relative to the hydropower and thermal power adjustment ability, to ensure the least disturbances in output as constraints. The specific experimental data are as follows:

The simulation selected the installed capacity limit in the northwest region of china as an idealized model, in which the proportions of wind, solar and hydrothermal power plants are 19%, 15%, 13% and 53% respectively. In order to alleviate the problem of wind and solar curtailment to grid integration, the actual transmission capacity of the two power plants should be as close as possible to the transmission capacity limit, but the transmission line loading rate at its energy node will affect the maximum output. This limitation will be backed up by the relatively strong thermal and hydro power regulation capacity; the difference between the upper and lower limits for setting the thermal and hydro output limit is greater than the limits for photovoltaic and wind power. Simultaneously, in order to minimize the fluctuation of the local renewable generations output, the difference between the upper and lower limits of the thermal power output limit is greater than that of renewable energy. Thus, the thermal and hydro power generation helps to compensate the disturbances created by higher integration of renewable power generations to the grid. The limits for different power generation sources are as shown in Table 2.

**Table 2.** The objective function and constraint conditions based on the quality of service (QoS) index of energy flow.


The data obtained from the northwest region of China comprised of the maximum generation output proportions of wind, solar, hydro and thermal power plants in a certain region at different times (samples at different times were recorded, 500 data was selected for simulation) are shown by matrix *Q* in Equation (16); the data are of the 2019 China power supply and demand situation analysis and forecast report, combined with relevant reports on the increase in the proportion of new energy installed capacity.


According to the constraints in Table 2, Using the search mechanism of Pareto's optimal solution and the trimming technique of the Archive set, which removes the poor quality particles, the simulation results of the optimal output of the renewable energy power plant in the energy node of the selected area can be obtained. The simulation results of the optimal output of the renewable energy power generations from their energy nodes in the selected area are shown in Figure 5a,b, where the actual transmission capacities of wind, solar, hydro and thermal account for 17%, 14%, 13% and 29%, thereby showing the area incorporating higher uses of renewable sources. Figure 5b shows the actual delivery capacity and transmission capacity limit when the power required by the next level energy router is 2000 (MW) in a certain period of time.

**Figure 5.** (**a**) Simulation results of the optimal scheme of the actual output of each energy plant; (**b**) the optimal output scheme for each power plant when the power demand is 2000 (MW).

The simulation results of the optimal output scheme obtained by Figure 5a,b shows that: due to the limitation of the transmission line load rate of the local energy node if it is necessary to reduce the degree of abandonment of wind and solar while ensuring the minimum fluctuation in the power grid, it needed to increase the output level of hydropower and thermal power generation with strong regulation ability to enhance the complementarity of high permeability renewable energy. With the application maximum, clean energy utilization can be attained, making the thermal and hydro power more flexible with the demand and supply and availability of renewable power generation. But still, thermal power generation remains the main energy supplier for making the power grid more flexible to accepting more renewable integration by limiting fluctuations.

After the optimization algorithm obtains the optimal output scheme of the energy router, as demonstrated in the example, the energy flow QoS index is used to optimize the evaluation of the routing node in the transmission and distribution network. The evaluation of the simulation results is shown in Table 3.


**Table 3.** Energy flow QoS index evaluation results.

It can be observed in Table 3 that the total transmission line loading rate is 74.8%, which meets the loading rate requirement. It can also be seen that among the renewable energy sources in the region, the photovoltaic and wind power output are relatively balanced and with minimal loss. But in order to adjust the wind and solar loss and grid stability, the appropriate thermal and hydro power outputs need to be ensured. The *ILR* needs to be evaluated according to the situation of its power transformation at this node. Based on the above data, the output of the energy routing node in the example is relatively good.

Taking the energy routing nodes in the simulation results as an example, due to regional differences, other nodes in the transmission and distribution network can change the upper and lower limits of the conventional and renewable generations according to the resource conditions and load demand characteristics of different regions to meet different targets, and using the energy flow QoS index to evaluate the optimization results. Different nodes have different requirements for energy plants under the access of renewable energy, which leads to some minor, and also may lead to major complications in the mutual energy and information interaction of energy nodes. Therefore, it is necessary to

simulate and analyze the negotiation mechanism of energy distribution router based on a master-slave multichain structure.

#### *6.2. Simulation of a Master-Slave, Multichain Negotiation Mechanism Based on a Multichain Platform*

The blockchain based transmission and distribution grid energy router negotiation mechanism shown in Figure 4 has a multichain structure, including a 330 kV main chain and three 35 kV–220 kV slave chains. In the process of information exchange between links, the interaction data consists of QoS values and power prediction values of each generation node. Therefore, the feasibility simulation of the negotiation process needs to be authenticated and analyzed in two aspects, including the construction of the multichain structure and the simulation of information interaction.

Based on multichain technology, the multichain demo document was configured, and the PHP runtime environment built based on the xampp platform, thereby configuring the software and the blockchain environment. The minimum specification required for the blockchain platform is mentioned in Appendix A. The four-system configuration was set up on a windows 7 personal computer with 64-bit 4 GB random access memory to realize the operation and connection of the master-slave multichain, the configuration of the rights and the transmission of information in the form of assets, so as to verify the feasibility of building the multichain structure. The specific operations were as follows: during xampp operation, the blockchain network environment of four computers were configured respectively, along with creating and configuring multiple chains through the command window. The four configured chains were named: Chain330kV, Chain220kV, Chain110kV, and Chain35kV. The Chain330kV was selected as the full-node chain; i.e., the main chain with the rights of block publishing, administration, connection, sending, receiving, asset issuance and flow management. Simultaneously, the other three computers were configured as the slave node chain. The slave chain, the 35 kV slave chain node (Chain35kV, IP:192.168.1.2:5597) and the 110 kV slave node (Chain110kV, IP:192.168.1.2:7324) were taken as examples. The two slave chains respectively issued an application for interconnection with the main chain Chain330kV through the instruction "multichaindTestChain@192.169.1.1:2781." The main chain received instructions to complete the interconnection and give the slave chain the right to connect, send, receive and release the asset. The main chain reserves all the permissions of all the node and also reserves the right to configure the slave chain permissions. The main operations are shown in Appendix B (Figures A1–A3).

The main-slave multichain information interaction was mainly verified from two aspects: the transfer of QoS values between the main chain and the slave chain, and the transmission of the predicted value of the electrical quantities between the slave chains. Taking the 110 kV slave chain (Chain110kV, IP:192.168.1.2:7324) as an example, when the *b*2*u* power negotiation mechanism proceeds to *t* + Δ*t*, the chain receives the data information from the Chain35kV and downloads it, calculates *Pin* (110*kV*) and uploads it to Chain220kV. And the QoS indicator, after the smart contract is optimized, is submitted to the Chain330kV from the node; the main operations are as in Appendix C (Figures A4–A6). The computation process includes the simulation of MOPSO within the smart contract. For more clarifying the swiftness, 10 simulations were conducted and Appendix A demonstrates the computational cost of blockchain intelligent contract based on MOPSO algorithm showing its feasibility for the practical application.

By constructing a master-slave multichain platform and simulating the information interaction process between multiple chains, it is possible to verify the feasibility of an energy router negotiation mechanism based on master-slave multichain structure; i.e., it authenticates the feasibility of the blockchain technology applied to the energy router control mechanism based on QoS indicators. However, the construction of the complete platform based on blockchain technology is temporarily unable to complete due to the high-end hardware requirements. In the near future, the construction of model scenarios will be further improved, and the obstacles to applying blockchain technology to energy router negotiation will be explored.

#### **7. Conclusions**

This paper studied the operations of energy routers for transmission and distribution networks with high permeability renewable energy access, and the application of blockchain technology integrating the energy flow QoS index with the independent cooperative mode of the energy router node. The energy flow QoS index was integrated with the independent cooperative mode of the energy router node, and the transmission and distribution network was optimized from the four constraints of equilibrium coefficient, line loading rate, loss degree and input loss ratio. Observing the characteristics of renewable energy access to the transmission and distribution network, and based on the weakly centralized system architecture of distributed energy router nodes, this paper proposes a "source–grid–load" collaborative scheduling operation scenario model based on blockchain. Combined with the functions of energy routers in the transmission and distribution network, the energy router node doubly-fed stability control model was considered to ensure the balance output and stability of the output power of each power generation unit. The MOPSO algorithm is introduced into the intelligent contract of the blockchain for optimization of amount of energy integration from different sources. The optimal output scheme of each power generation unit in the example was obtained, improving the ability of the transmission and distribution network to mitigate the loss of wind and solar, and the evaluability of the energy flow QoS index was verified. Due to the complexity of renewable energy access to the transmission and distribution network, there are many complications in the power mutual aid of energy nodes at all levels. In order to resolve those complications, this paper drafts an autonomous energy collaborative optimization mechanism and control process of the router nodes at the transmission and distribution network with the blockchain as the technical support. Through the mechanism purposed in this paper, the weak centralization of the dispatch control system was realized: the energy router was used as the node, and the master-slave multichain negotiation mechanism was used to realize the information exchange between the energy routers, improving the interoperability between the energy nodes. At the same time, the prediction accuracy and optimization level of the high-permeable renewable energy access to the transmission and distribution network has been improved. Finally, the power transmission and distribution mode of the autonomous decision-making ability and autonomous coordination ability of the energy router nodes were attained.

**Author Contributions:** Conceptualization, methodology and formal analysis, G.G., Z.Z., X.Z. and N.K.M.; data curation and writing—original draft preparation, Z.Z., X.Z. and N.K.M.; writing—review and editing, N.K.M., G.G., L.L., C.S. and H.Y.; resources, supervision and project administration, G.G., L.L., C.S. and H.Y. All authors have read and agreed to the published version of the manuscript.

**Funding:** This project is supported by the Science and Technology Project of National Energy Administration, under Grant 2017BJ0166.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **Nomenclature**

The following nomenclatures are used in this paper:



#### **Appendix A**

**Table A1.** Computation cost of MOPSO as a smart contract.


**Table A2.** Specifications required for blockchain platform.


#### **Appendix B**

*Appendix B.1 Establishment of Multichain Nodes*

**Figure A1.** The establishment of multichain nodes.

*Appendix B.2 The Slave Node Sending a Connection Request to the Primary Node*

**Figure A2.** Making a connection request.

*Appendix B.3 The Master Node Accepting the Application and Setting the Slave Node Permissions*

**Figure A3.** Setting the permissions of the slave node.

#### **Appendix C**

*Appendix C.1 Chain330kV, Chain220kV, Chain110kV, and Chain35kV Connection Display (Multichain Connection Display)*




#### *Appendix C.2 Chain35kV's Scheduling Data Upload and Chain11kV Receiving*

**Figure A5.** Chain35kV releasing scheduling data, and data asset information downloading.

*Appendix C.3 Chain110kV's Scheduling Data Upload, and Chain330kV Receiving Data*

**Figure A6.** Chain110kV releasing scheduling data, and data asset information downloading.

#### **References**


© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
