Design of Virtual Power Plant System Model under Master-Slave Multi-chain

The emergence and development of new technology provides a new way of thinking for solving the problems in the traditional energy industry. Introducing block chain technology into virtual power plant can solve the problems existing in virtual power plant such as. to improve the safety, reliability and operation efficiency of virtual power plant. At present, the research on the application of block chain technology in virtual power plants is mostly based on single-chain structure, which makes the system not extensible. Based on this problem, a virtual power plant model with main and multi-chain structure is presented, which improves the scalability of virtual power plant with block chain technology. The use of block chain technology improves the security and fairness of power transactions. It can allocate power more efficiently to improve energy utilization.


Introduction
With the optimization of the world's energy structure, clean energy is gradually replacing traditional energy as the most important primary energy. The virtual power plant connects distributed generator through advanced communication methods on the premise of not changing the existing grid connection mode, through higher-level system integration to form a power generation as a whole to output electric energy. DG is characterized by small capacity, large quantity, uneven distribution, and high cost of single machine access. At present, virtual power plant (VPP) has become the mainstream of future power generation.
Blockchain technology is one of the most popular technologies in recent years, it has received extensive attention from many scholars due to its decentralization, traceability of transaction information, and privacy protection. Many scholars have done a lot of research on the application of blockchain in the power industry. Literature [1] improved the traditional virtual power plant and added the energy blockchain network to the original model to improve the operating efficiency and safety. Literature [2] analyzed the practicality of the combination of blockchain and virtual power plant and proposed a virtual power plant commercial price and power transaction mode based on blockchain technology.
The above documents have analyzed the feasibility of the application of blockchain technology in virtual power plants, but most of the existing schemes adopt the single-chain method. The single-chain structure and single-chain scalability are not suitable for the actual application requirements of complex multi-regional power grids. Therefore, this paper draws on the existing virtual power plant model and improves it and proposes a master-based model.

Blockchain Technology
The concept of blockchain originated from the first decentralized cryptocurrency system-the Bitcoin system [3,4]. The underlying technology it relies on is a combination of existing technologies based on system characteristics. In essence, the blockchain system is an encrypted distributed database, which is jointly managed by everyone through certain rules. The block in the blockchain is composed of a block header and a block body. The block header contains a lot of data. Taking Bitcoin as an example, the data in the block has the hash value, timestamp, and Merkel of the previous block and root and block height, etc. The data in the block header is used to connect individual blocks into a chain. Since the later generated block contains the hash value of the previous block, when the length of the blockchain reaches a certain value in the Bitcoin system, the previous data cannot be changed.
At present, many researches on the application of blockchain technology are based on the singlechain structure of the public chain or consortium chain, but there are structural shortcomings in the single-chain structure in some aspects, such as performance capacity, privacy, isolation, scalability, etc. [5]. The master-slave multi-chain structure of the blockchain system is to package multiple new consensus single-chain data blocks in the same cycle to form a main chain block and connect to the main chain. Compared with the single-chain master-slave multi-chain structure Blockchain is more suitable for use in distributed power systems than single chains.
The more critical part in the architecture of the blockchain system is the consensus algorithm, which is the key to achieving system self-trust. Through the consensus algorithm, each node can quickly reach a consensus with other nodes in the system. The algorithm design of the master-slave multi-chain virtual power plant must ensure the following conditions: (1) Ensure the priority supply of clean energy. (2) When local clean energy generation is insufficient, use the clean energy of the distribution network (3) Reduce traditional energy generation.

Virtual Power Plant
The virtual power plant is proposed to integrate various distributed energy sources, including distributed power sources, controllable loads and energy storage devices, etc. Due to the characteristics of electricity, if the generated electricity cannot be used in time, the generated electricity will be wasted. The virtual power plant can comprehensively coordinate various power facilities. In practical applications, it can rationally allocate power and play a role in peak-shaving and valley-filling. The entities in the virtual power plant include: new energy power generation facilities, centralized energy storage, power users, new energy vehicles, and controllable loads [6].
The traditional virtual power plant has two control methods. One is centralized control. The control coordination center (CCC) communicates with each part of the virtual power plant and optimizes the power generation plan based on the exchanged information. The centralized control method is easy to realize the optimal operation of VPP, but there are limitations in scalability. The other is a decentralized control structure. The decentralized control mode removes the coordination control center and ensures the reliable operation of the system through advanced communication means. Compared with the centralized virtual power plant distributed structure, it has better scalability and openness.

Construction of the Main Chain Model
According to the characteristics of the development of the virtual power plant and the characteristics of the blockchain，this paper designs a multi-chain virtual power plant (MC-VPP)，it is based on blockchain technology and refers to the virtual power plant with a distributed control structure to form a VPP management area with a large-scale controllable power generation facility as the center of the distribution network. The jurisdiction includes distributed power sources, distributed energy storage, controllable loads, electric vehicles, etc. Different VPP Management area exchange information through the network. Grid companies act as supervisors and managers to participate in the generation and maintenance of the main chain. After the distribution plan is generated, power is transmitted through the high-voltage or UHV transmission grid. The basic structure of the VPP jurisdiction is shown in figure 1. The data stored in the main chain block is the complete data of the entire blockchain system. Since virtual power plants are more based on overall considerations, there will also be a need for power transmission through long-distance transmission grids between different VPPs. Therefore, in the structural design of the main chain block, this article will block Body is divided into two parts. The data structure of the main chain block is shown in figure 2.  The slave chain data is uploaded to the master node by each slave chain consensus node for packaging, and then the packaged block is broadcast to the entire network. The main chain data stores the records generated by the communication between VPPs.

Construction of the Slave Chain Model
According to the model structure of the main chain in section 2.1, the model of the slave chain will be designed below. All the power generation facilities in the slave chain and the power demand side are located in the same virtual power plant. Due to regional restrictions and the instability of some clean energy power generation, it may happen that the power demand of the power demand side in a region is greater than that of the power demand side. Literature [7] believes that the composition of a virtual power plant can have at least one fully generatable power generation to ensure the stability of power output. Therefore, when designing the slave chain model, this article includes at least one power facility that can generate stable power in addition to the high-voltage distribution network in each VPP to ensure the stability of the local power supply network. Figure 3 shows the structural model of the virtual power plant from the chain.

Consensus Process of Master-slave Multi-chain Virtual Power Plant
According to the MC-VPP power plant model proposed in Chapter 2 of this article and the above conditions, a consensus algorithm suitable for virtual power plants under a master-slave multi-chain structure is designed. Among them, the slave chain and the main chain use different consensus algorithms. The master node on the slave chain is served by a large power generation facility. In order to ensure a certain degree of decentralization, multiple master nodes are set up in the slave chain, but at least one controllable power generation facility is required. As the virtual power plant incorporates a large number of new energy power stations, such as wind power stations and photovoltaic power stations. These power stations have the characteristics of intermittent and random output, which makes the power grid likely to appear unstable [8,9]. By using large-scale controllable power stations as the main node of the blockchain, the uncertain impact of new energy power generation on the power grid can be eliminated, and the stable operation of the power grid can be guaranteed.
The specific consensus process of the MC-VPP slave chain is as follows:  First, select multiple large-scale power supply facilities as the master node in the slave chain VPP.
 Each distributed energy node in the slave chain sends their relevant information including ID, maximum power generation quota, energy type, electricity price, etc. to the master node. Since there are multiple master nodes, ordinary energy nodes only submit their information to one of the master nodes when submitting their own information, so each master node cannot store the complete energy node information in the slave chain.
 The master node in the VPP jurisdiction of the slave chain aggregates and packs the power generation information submitted by each node through a consensus algorithm to form a block broadcast network.
The master node is a special node in MV-VPP. In addition to participating in the generation of the slave chain block, the master node in the slave chain will also participate in the generation of the main chain block as the main chain node. Therefore, after each slave chain completes the block generation, each master node in the slave chain VPP generates the master chain block together with the master nodes in other VPP jurisdictions using the block data in the period through the main chain consensus algorithm. In the slave chain VPP, the large power plant is used as the main chain node by default. Therefore, there is no need to consider the issue of consensus node election. The following will introduce the consensus process of the main chain nodes.
The specific consensus process of the MC-VPP main chain is as follows:  The master node obtains a scientific power demand through calculations based on the power demand submitted by the local node, and then packages the local power generation plan and power demand data.
 After each master node has packaged the local power information, the main chain block is generated through the PBFT consensus algorithm.
 After the new main chain block is generated, each master node packs the new slave chain block and enters the next round of main chain consensus.  The slave chain nodes C 11 and C 12 in the experiment first register the network information of the node in the network to join the blockchain network, after each slave chain node selects its corresponding area, energy type, and maximum power generation, the slave chain node submits relevant power generation information to the blockchain network. The master node M i packs and generates blocks after receiving the power generation information sent by each slave node. When the

Experiment Analysis
In order to simplify the process and facilitate the calculation of the experiment, it is assumed that the generated block size is the same as 100 bytes, this experiment involves a total of 6 nodes and generates a total of 1000 blocks. In the single-chain structure, each node needs to use 600,000 bytes of space to store blockchain data, and the total data size is 3,600,000 bytes; Under the master-slave multichain structure, ordinary nodes in the same area only need to store the blockchain data of the area's slave chain. Take the network structure of figure 4 as an example, under the same assumptions, the storage space required for node C ij is 300,000 bytes, Mi requires at least 600,000 bytes of storage space, and the storage space required for overall system data is 2,400,000 bytes. Compared with the single chain structure, ordinary nodes can save 50% of storage space, and the total amount of system data can be reduced by 33.3%. Based on the above analysis, this article combined with the model to do actual verification.

Conclusion
This paper studies the feasible scheme of introducing the master-slave multi-chain mechanism of the blockchain into the virtual power plant, and constructs a virtual power plant model under the masterslave multi-chain. Compared with the traditional virtual power plant with single-chain and multi-chain structure, it is more suitable for application in large-scale, multi-node virtual power plants. It provides new ideas for the application of blockchain technology in virtual power plants.