Next Article in Journal
Classification and Review of Pump-Controlled Differential Cylinder Drives
Next Article in Special Issue
Trusted Transactions in Micro-Grid Based on Blockchain
Previous Article in Journal
On-Board Energy Storage Devices with Supercapacitors for Metro Trains—Case Study Analysis of Application Effectiveness
Previous Article in Special Issue
Distributed State Estimation of Multi-region Power System based on Consensus Theory
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Microgrid Group Trading Model and Solving Algorithm Based on Blockchain

1
Automation engineering college, Northwestern Polytechnical University, Xi’an 710072, China
2
College of Information and Electrical Engineering,China Agricultural University, Bejing 100083, China
*
Author to whom correspondence should be addressed.
Energies 2019, 12(7), 1292; https://doi.org/10.3390/en12071292
Submission received: 18 February 2019 / Revised: 30 March 2019 / Accepted: 1 April 2019 / Published: 4 April 2019
(This article belongs to the Special Issue Intelligent Decentralized Energy Management in Microgrids )

Abstract

:
With the development of the energy Internet and the integration of multi-type energy situations, it is of great significance to study the competition game of a multi-agent microgrid group system for its development. As an emerging distributed database technology, blockchain technology has great application potential in the field of energy trading. Firstly, blockchain technology is coupled with the microgrid group transaction, and the information flow transaction model of a microgrid group based on blockchain technology is established. Aiming at this complex multi-objective optimization problem, an improved ant colony optimization algorithm is proposed to solve the model. Finally, the competitive trading model and solving algorithm are simulated and analyzed. The relevant results show that the near global optimum price strategy of each time based on the proposed model can effectively balance the efficiency of each subject in the market. In addition, the model ensures that there is no high-income and low-cost phenomenon in the trading process, therefore the security and quality of the market are guaranteed.

1. Introduction

At present, primary energy consumption is too fast. With access to new forms of energy, the emergence of the energy Internet provides solutions for various kinds of energy access, environmental deterioration, and other issues [1]. With the development of energy storage technology and diversification of energy forms, there will be new market subjects (such as distributed storage companies mentioned in this paper) in the power market of microgrid groups. This makes the market subjects participating in transaction competition diversified and multiple. The identity of each subject is no longer a single consumer or producer [2], but a "source-sale" integration. Because of the flexibility of the main types of power market involved in market trading, competitive trading in the power market is becoming more and more complex. In the new energy market environment, how to coordinate the relationship between the needs and benefits of various market subjects and improve the proportion of renewable energy use has become a problem that must be solved in the development of microgrid group system construction. Therefore, it is of great theoretical and practical significance for the development of distributed energy absorption and energy Internet technology to construct a market competition model for microgrid group.
The competition strategy of microgrids under the conditions of the power market was analyzed by using game theory in [3]. The microgrid was regarded as a small low-voltage distribution network system, which was studied from two aspects of bidding strategy and economic operation. Reference [4] explored the multi-level microgrid structure in a distribution network. Users, investment developers represented by energy service companies, and power companies were selected as participants, and economic models based on different investors are established. Based on game theory, a multi-level microgrid optimal allocation model in distribution network was proposed. In [5], the electricity price function of the spot market was presented. Meanwhile, various bidding strategies in the microgrid power market were discussed. The spot market and electricity price mechanisms were considered comprehensively, and it was applied to predict and guarantee the economy of the microgrid. Based on the transaction impact between microgrid and distribution network, a non-cooperative game model and its solution process are established. Besides, the formation conditions and influencing factors of transactions between microgrid were solved [6]. Reference [7] addressed a double-layer optimization model of multi-microgrid operators in the previous power market game competition model and the market operator’s optimal economic scheduling model. In addition, the Nash equilibrium point of power market on distribution network side was calculated based on dynamic game method under complete information and double-layer optimization solution model. In [8], a multi-micro-network alliance control game model was proposed, and the formation process and algorithm of alliance cooperation were analyzed. The principal aim of reference [9] is to devise a combined market operator and a distribution network operator structure for multiple home-microgrids (MH-MGs) connected to an upstream grid. For modeling the interactions among partakers and implementing this comprehensive structure, a multi-objective function problem is solved by using a static, non-cooperative game theory. Reference [10] presents a smart Transactive energy framework. In addition, considering demand fluctuations, energy production based on renewable resources in the multiple H-MG can be accomplished by demand-side management strategies that try to establish mechanisms to allow for a flatter demand curve.
All of the above studies have achieved good results. However, most of them are limited to the transaction competition between the generation side or demand side. In addition, they have not yet been involved in the study of the trading competition between the multiple subjects in the microgrid group system. With the reform of the electricity market, along with the application of advanced metrology and information and communication technology, the frequency of energy trading will obviously increase. Hour-ahead or even real-time energy trading is emerging, peer-to-peer (P2P) energy trading offers a new option for decentralized energy market designs.
The idea of using blockchain technology to solve the transactions of the energy Internet is first proposed [11]. The application prospect of blockchain in the energy field is proposed [12]. A method to use blockchain technology for settlement in multi-energy complementary systems is proposed [13].
In the existing reference, most of the research on blockchain in the energy Internet stays at the theoretical research stage. As a distributed database storage technology, blockchain technology is the most typical application to reflect the characteristics of blockchain technology. In this paper, a P2P energy market is proposed, in which multi-directional energy trading of the multiple subjects in a microgrid group is achieved in the form of non-cooperative bidding supported by blockchain.
The rest of this paper is organized as follows. In Section 2, by introducing the definition and basic characteristics of the blockchain, the blockchain technology is coupled with the microgrid group transaction in three aspects, which proves the rationality and feasibility of establishing the microgrid group transaction system based on the blockchain technology. The establishment of the information flow transaction model based on blockchain technology is introduced in Section 3. Meanwhile, the establishment of physical flow transaction model depending on mathematical modeling are introduced. In Section 4, the algorithm for solving the transaction model of microgrid based on blockchain technology is introduced, that is, the improved ant colony algorithm is used to solve the near global optimum bidding strategy of the model. The model through a specific example is solved in Section 5 to verify the feasibility of the model. Conclusions and future work are given in Section 6.

2. Coupling Analysis of the Microgrid Group Trading and Block Chain Technology

2.1. Blockchain Technology

2.1.1. Definition of Blockchain

In 2008, the concept of blockchain is first proposed in a groundbreaking paper on cryptography: "Bitcoin: A Peer-to-Peer Electronic Cash System". Hereafter, the technology of Bitcoin’s digital cryptocurrency system which uses blockchain as the fundamental element was widely provided.
In a narrow sense, blockchain is a decentralized distributed database which makes different data blocks into the form of a ‘chain’ in a chronological order. Then, relying on asymmetric cryptography, it could be ensured that the data in the blockchain cannot be forged and cannot be falsified. Additionally, the transaction process, transaction data and information of the blockchain are fully and safely recorded. In addition, the transaction data can be traced back in timestamp and be verified in the system [14]. In a generalized sense, blockchain technology is a new distributed paradigm for computing and a ‘decentralized’ basic architecture. It relies on the consensus algorithm of distributed nodes to generate or update data. At the same time, it can realize verifying and storing data by using the encrypted chain block structure. Blockchain technology relies on automated script code (smart contract) to program and manipulate data [15].

2.1.2. Characteristic of the Blockchain

The key technologies of blockchain involves data blocks, chain structure, P2P network, timestamp, Merkel tree, hash function, asymmetric encryption propagation mechanism, consensus mechanism (PoW, Pos, DPos), etc. [16]. Combining the definition, technology, and basic architecture of the blockchain, its basic characteristics could be summarized as follows:
(1) Decentralization
By using distributed storage and computing methods, the blockchain system can build up mutual trust through mathematical methods rather than mandatory centralized hardware or management structures. Consequently, the data modules in the network are maintained by all nodes with maintenance functions in the entire system. In this situation, the incompleteness of the entire network caused by the loss of data in a single node cannot happen. Hence, decentralized distributed network systems can greatly enhance the network’s anti-interference ability.
(2) Information Security and Transparency
As the core technology to ensure information security, the data encryption technology of blockchain originates from asymmetric encryption technology. A pair of asymmetric passwords: “Public Key” and “Private Key” are used in it to meet the security and ownership verification requirements [17]. Although the information is secure and reliable as it has been effectively encrypted, the network can still be open and transparent. Except the private information of the transaction parties which is protected by the encryption mechanism, data is disclosed to all nodes (users), which means that every node on the entire blockchain network can query data and supervise the generation of new blocks [12].
(3) Intelligent Contract
Blockchain has a transformable programming system. The efficient smart contract mechanism which satisfies the execution conditions of both parties could be established at each node. When both transaction parties meet the execution conditions and are willing to perform the ‘contract’ obligation, the ‘contract’ can be automatically executed without the mutual trust of the transaction parties, nor the need of a supervisor or a third-party’s restriction. Since both transaction parties can complete the transaction anonymously, the efficiency could be improved and the waste of resources could be reduced.
(4) Verifiability
The verifiability and traceability of the data stored in the blockchain are mainly derived from the ‘timestamp’ technique. Since the time nodes can be added to the blockchain by this technique, which means all the recorded transactions and data are encoded with time information. The verifiability of the information recorded on the database could be guaranteed for every transaction has trading time [18]. Therefore, the ‘timestamp’ technology is also called as proof-of-existence of the block data. The existence of this technology makes the blockchain database unforgeable and falsified. Besides, any node (user) can obtain detailed information of any transaction data in history through the chain structure.

2.1.3. Basic Architecture Model of Blockchain

The basic architecture of blockchain consists of six levels: data layer, network layer, consensus layer, incentive layer, contract layer, and application layer, which is shown in Figure 1.

2.2. Coupling Analysis

2.2.1. Subject Coupling

In the market environment, all the entities will generate a large amount of electricity purchase and sale information, such as the system’s power generation, demand, bidding strategy, etc. For the traditional market trading model, all the information will be packaged and fed back to the control center of grid trading, and then be sorted and published to the market. After that, bidding begins in each market and the dispatching center will unify the economic dispatching when the bidding is finished [19]. This process is cumbersome and time-consuming, which badly affects the timeliness of information transmission. At the same time, rights of the consumers are limited to purchasing electricity, and the electricity price market is completely controlled by the power grid center.
However, the ‘decentralization’ of the blockchain can effectively improve this problem for it provides a peer-to-peer platform for electricity market transactions. Each market entity can openly bid. Therefore, the fairness of market competition and the rationality of electricity price quotes could be improved. Also, the direct trade between each entity means that the information can be processed quickly and in time, which means that the efficiency of information circulation can be promoted. Since blockchain technology and the distributed management of microgrid group information resources are proposed based on the idea of decentralization, the information exchange rights and information storage rights of each transaction subject are equal, and the same obligations are also required. Therefore, it could be seen that there is a coupling relationship between the blockchain technology and microgrid group transaction, which is shown in Figure 2.

2.2.2. Trading Mechanism Coupling

There are many competitions between various market subjects in the microgrid group. Problems such as opportunity cost and information leakage could be made due to the lack of trust, transparent information transmission, and unsafe transaction process. However, the decentralized information mechanism in blockchain technology can realize transaction recorded accurately and reduce opportunity cost due to lack of trust.
Additionally, blockchain technology uses asymmetric encryption mechanism to ensure the security and reliability of data transmission. An asymmetric encryption mechanism not only makes the transaction data real and effective but also reduces the rent-seeking behavior. Security issues such as leakage of transaction data can be solved. At the same time, the chain can be used to check the traceback transaction information at any time because of timestamp, which provides the maximum price selection for each subject. It can be seen that there is a coupling relationship between the two on the trading mechanism, as shown in Figure 3.

2.2.3. Smart Contract Coupling

It is possible that every two subjects in the microgrid market can trade. When the transactions meet the preset conditions, the contract executes automatically using smart contract. Malicious factors that interfere with the normal execution of the contract can be avoided and execution efficiency can be increased.
In addition, there is a punishment mechanism in the blockchain technology. Microgrid group trading is a competitive game market. It can improve the utilization rate of clean energy and maximize the utilization of renewable energy. Meanwhile, carbon emissions and environmental pollution can be reduced. It can be seen that there is a coupling relationship between the two on the smart contract, as shown in Figure 4.

3. Microgrid Group Transaction Model

3.1. Information Flow Trading Model

The trading system of the microgrid group includes many market entities. The each of them has its corresponding purchase and sale information and bidding strategy for each period. Hence, it could be seen that for this system which has a large amount of information and strong timeliness, ensuring the transaction data and the transaction records are accurate is of prime importance. Based on the basic framework of the blockchain, an information flow transaction model is established. Transaction information is passed between points in the form of a blockchain and is permanently entered. In the basic awareness data layer, each block on the blockchain represents a market entity. The system nodes are linked into a network to form the data path. In this situation, even part of the data path is attacked by malicious factors, the information can still be transferred through the transfer. In the network layer, the nodes are responsible for finding the next block, and the next linked block body could only be truly generated after the verifications of the entire network nodes are accepted by the node with authorization. In the consensus layer, the agreement between distributed data and block data is efficiently made. In the incentive layer, the using ratio of clean energy has been improved by the reward and punishment mechanism of the blockchain. In the contract layer, the efficiency of the execution is enhanced for the transactions could be automatically made in the form of smart contract. Besides, the microgrid group system which is the field applied in this paper, belongs to the application layer. Therefore, it is clear that the blockchain-based microgrid group information flow transaction model has the characteristics of security, confidentiality, anti-interference, timeliness, etc. The information flow microgrid transaction model based on the blockchain is shown as Figure 5.

3.2. Physical Flow Trading Model

3.2.1. Basic Structure of Microgrid

The power market structure of the microgrid group studied in this paper is as shown in the Figure 6. In that structure, the market entity mainly includes microgrid operators (MOs), distributed storage (DS), and power consumers (PCs). The entities are independent of each other and they all want to maximize their own interests by competition. It could be seen from Figure 6 that the market entities are connected by physical flow to realize energy transfer and transaction. In this figure, each entity has its own function. For the microgrid operators, generating and trading power is their main responsibility. When a power shortage occurs with other entities and the operator’s power is abundant, the electricity is sold to obtain profits. For the distributed storage operators, the power provided by distributed users is collected and when the system is short of power, they can still act as power sellers and earn profits through the price difference. For the large power users, ‘consumers’ are the only role they play. According to their own conditions, getting the maximum power at the lowest cost is the most preferable transaction. In this model, large power users do not sell electricity. Based on Figure 6, it could be seen that each market entity is treated as a block. Consequently, the transactions made between market entities in different periods are equivalent to the new blocks’ searching and linking. Ultimately, a large blockchain network will be formed. In the large energy blockchain network, each market entity’s identity information, the purchasing and selling situation of the electricity, energy form, and bidding strategy will be released to the network. In the wider environment, when the markets begin to trade, every market entity could select the trading object in view of the information released on the internet provided by other entities. In this situation, according to the quotation, the trading object could be determined during the competition. For example, if the sales information is published on a blockchain network at a certain time by a distributed storage company, and other market entities are notified by broadcasting. After a period of time, the immediate electricity quantity and electricity price of other market entities will also be published on the network to make the information of each block transparent. Then, each entity could judge whether or not to make the transaction according to its own demand and the acceptable value of the electricity price. If the transaction requirements of the both sides are satisfied, the contract and transaction will be automatically made and recorded.

3.2.2. Mathematical Model of Microgrid Group Subject

In this paper, the microgrid group consists of three main bodies and each of them will make great efforts to maximize its own interests according to the practical situation. In the process of electricity trading, decentralization, and transparency of the blockchain are the most significant technologies. For the former one, decentralization guarantees that during the bidding and trading process, monitoring from third parties is not needed. For the latter one, transparency could make the transactions fair and reasonable to protect the rights of the consumers by making the previous transaction price and transacted electricity quantity be searchable. For every entity, how to maximize their own interests in the competition is the most paramount issue. Therefore, the building of the mathematical model of the microgrid group main body is of great significance.
(1) Mathematical Model of the Microgrid Operators ( M O S )
There are many new energy resources among microgrid operators, such as wind energy, solar energy, etc. Accordingly, it cannot be guaranteed that there would be excess electricity to be sold at any time. However, as the main body of electricity sales, when surplus power exists, microgrid operators will sell the surplus power to the other subjects who need electricity during such periods to obtain the profit P s e l l M O ( t ) . When the operation cannot be supplied by itself, electricity purchasing is needed and the cost is C b u y M O ( t ) . Besides, the strict punishment mechanism is embedded in the incentive. Later, extra bonus R b o n u s M O ( t ) will made available when the clean energy utilization ratio increases, and extra punishment P C e x t r a M O ( t ) will be applied when the pollutant emissions increase. The mathematical description is as follows:
(a) The profit from selling electricity to other subjects P s e l l M O ( t ) :
P s e l l M O ( t ) = i = 1 n 1 p s e l l M t o M i ( t ) q s e l l M t o M i ( t ) + j = 1 n 2 p s e l l M t o S j ( t ) Q s e l l M t o S j ( t ) + m = 1 n 3 p s e l l M t o C m ( t ) q s e l l M t o C m ( t )
where, P s e l l M t o M j ( t ) , P s e l l M t o S j ( t ) and P s e l l M t o C m ( t ) respectively represent the selling price of electricity to i th MO, j th DS, and m th PC at t time; similarly, q s e l l M t o M i ( t ) , q s e l l M t o S j ( t ) and q s e l l M t o C m ( t ) respectively represent the sales volume of electricity to i th MO, j th DS, and m th PC at t time. Besides, n 1 + 1 , n 2 and n 3 respectively represent the number of MO, DS, and PC.
(b) The cost by electricity purchasing from other subjects C b u y M O ( t ) :
C b u y M O ( t ) = i = 1 n 1 c b u y M i t o M ( t ) q b u y M i t o M ( t ) + j = 1 n 2 c b u y S j t o M ( t ) q b u y S j t o M ( t )
where, c b u y M i t o M ( t ) and c b u y S j t o M ( t ) respectively represent the unit cost of electricity purchase from i th MO, and j th DS at t time. Also, q b u y M i t o M ( t ) and q b u y S j t o M ( t ) respectively represent the purchased electric quantity from i th MO and j th DS at t time.
(c) Incentive rewards and penalty costs
R b o n u s M O ( t ) = ( i i 0 ) R b o n u s ( t )
P e x t r a M O ( t ) = p e x t r a ( t ) [ H C O 2 ( t ) H C O 2 ( t 0 ) ]
where, R b o n u s M o ( t ) , i , i 0 , and R b o n u s ( t ) respectively represent the value of incentive rewards, instant use ratio of new energy, standard use ratio of new energy and the system incentive reward value per unit of clean energy. The unit of R b o n u s M o ( t ) is yuan/%. P e x t r a M O ( t ) , H c o 2 ( t ) , H c o 2 ( t 0 ) , and respectively represent the punishment cost at t time, instant carbon emission, and acceptable standard carbon emission. p e x t r a ( t ) indicates the punishment cost for per unit of carbon emissions which unit is yuan/kg. Only when R b o n u s M O ( t ) > P e x t r a M O ( t ) , can the utilization factor of clean energy be increased.
(2) Mathematical Model of Big Power Uses ( B U S )
Distributed big users are the consumers in large microgrid group systems. Its goal is to solve the energy demand problems with the minimum cost. In this paper, that entity does not have the capacity to produce and sell electricity. Consequently, its power purchase target is microgrid operators (MOs) and distributed storage vendors (DS). The specific mathematical expressions are as follows:
(a) Purchase cost (from MOs)
C b u y M t o C ( t ) = i = 1 n 1 + 1 c b u y M i t o C ( t ) q b u y M i t o C ( t )
Among them, c b u y M i t o C ( t ) and Q b u y M i t o C ( t ) respectively represent the unit cost of electricity purchase and value of it at t time from i th microgrid operator.
(b) Purchase cost (from DS)
C b u y S t o C ( t ) = j = 1 n 2 c b u y S j t o C ( t ) q b u y S j t o C ( t )
where, c b u y S j t o C ( t ) and q b u y S j t o C respectively represent the unit cost of electricity purchase and value of it at t time from j th distributed storage vendors.
(3) Mathematical Model of Distributed Storage Vendors (DS)
By signing smart contract agreements with distributed energy users, distributed storage vendors (DS) can centralize, integrate, re-manage, and store the distributed renewable energy to maximize the reuse of energy. In this situation, not only the use ratio of renewable energy could be increased but also a large amount of ‘chicken rib’ energy can be reserved, thereby providing more energy sources and purchasing channels for the market. Therefore, profits could be obtained by distributed storage vendors through the price difference. When the large market lacks electricity, the stored electric energy will be sold to obtain profits P s e l l A ( t ) . Simultaneously, electricity will be purchased at the lowest cost C b u y o u t ( t ) . The mathematical form is described as follows:
(a) Purchase cost
Purchase cost (from MOs):
C b u y M t o S ( t ) = i = 1 n 1 + 1 c b u y M i t o S ( t ) q b u y M i t o S ( t )
where, c b u y M i t o S ( t ) and q b u y M i t o A ( t ) respectively represent the unit cost and volume of electricity purchase from i th MOs at t time.
Purchase cost (from DS):
C b u y S t o S ( t ) = j = 1 n 2 c b u y S j t o S ( t ) q b u y S j t o S ( t )
where, c b u y S j t o S ( t ) and q b u y S j t o S ( t ) respectively represent the unit cost and volume of electricity purchase from j th DC at t time.
(b) Electricity selling profit
Electricity selling profit (to M O S ):
P s e l l S t o M ( t ) = i = 1 n 1 + 1 p s e l l S t o M i ( t ) q s e l l S t o M i ( t )
where, p s e l l S t o M i ( t ) and q s e l l S t o M i ( t ) respectively represent the price and volume of electricity selling to microgrid operators i at t time.
Electricity selling profit (to M O S ):
P s e l l S t o C ( t ) = m = 1 n 3 p s e l l S t o C m ( t ) q s e l l S t o C m ( t )
where, P s e l l A t o C m ( t ) and Q s e l l A t o C m ( t ) respectively represent the price and volume of electricity selling to BUs m at t time.
Electricity selling profit (to other DS):
P s e l l S t o S ( t ) = j = 1 n 2 p s e l l S t o S j ( t ) q s e l l S t o S j ( t )
where, p s e l l S t o S j ( t ) and q s e l l S t o S j ( t ) respectively represent the price and volume of electricity selling to other DS j at t time.

4. Transaction Model Solution of Microgrid Group Based on Blockchain Technology

4.1. Traditional Ant Colony Algorithm

Using the ant colony optimization algorithm to solve the multi-objective problem has the same characteristics as using blockchain technology to achieve ‘decentralization’.
For the ant colony algorithm, individual ant finds the city in a special way to achieve the near global optimum path. Similarly, the blockchain ensures the security of the transmission process through the information communication among the blocks. It could be seen clearly that both of them are ‘point-to-point’ communication and that through the collaborative communication between individuals or between modules, the system’s overall optimization could be achieved. Therefore, it is feasible to use the ant colony algorithm to solve the microgrid group trading model based on blockchain technology. The schematic diagram is shown as Figure 7.
Ant colony algorithm is a process to solve the problem that how does the ants in the natural world use pheromones to effectively search for food and find the shortest path. The ant colony releases a kind of pheromone called ‘biologic incretion’ in the process of finding the next path, and determines the choice based on the pheromone concentration. If one of the various paths is repeatedly selected by different ants, then the pheromone volatilization rate cannot keep up with the accumulation speed. Therefore, the transition probability of moving to this path will become larger, which also means that this path will be continuously selected by different ants. In this situation, a positive feedback loop will be built and eventually all ants will choose a near global optimum path to find food [20].
The algorithmic mechanism of the ant colony algorithm will be illustrated by using it to deal with the traveling salesman problem (TSP) which is the most typical application of the ant colony algorithm. The traveler needs to travel all the given cities without repeating and go back to the starting city in the shortest path. Assuming that m ants are randomly assigned to one of the n cities as the starting point, the specific rules are shown as follows:
Each ant will release the pheromone according to the length of the selected path, and then select the next city to visit based on the corresponding transition probability. Besides, ants have the ability to remember and do not repeat the same path. Finally, the pheromone will be updated when every ant completes a loop.
It could be assumed that between the city i and j at t moment, τ i j ( t ) is the pheromone and d i j is the distance. When t = 0 , the pheromone concentration on each path is the same, which means τ i j ( 0 ) = c ( c is an arbitrary constant). For any ant k , the concentration of the pheromone on each path determines the direction of the transfer during the movement. In this case, p i j k ( t ) is the transition probability of the ant k to transfer from the city i to the city j at t moment.
p i j k ( t ) = { τ i j α η i j β k a l l o w e d k τ i k α η i k β , j a l l o w e d k 0 , o t h e r s
where, a l l o w e d k = { 0 , 1 , 2 , n 1 } is the collection of the next city that could be chosen by the ant. Also, α and β are the accumulation of the pheromone released by the ant in the movement process. Besides, η i j = 1 d i j and when all ants complete a cycle, the pheromone concentration will be updated as
τ i j ( t + n ) = ( 1 ρ ) τ i j ( t ) + Δ τ i j ( t , t + n )
where, ρ is the volatilization factor, 1 ρ indicates the degree of residue and ρ ( 0 , 1 ) .
Δ τ i j ( t , t + n ) is the pheromone increment between the city i and j from t to t + n . Therefore, at the initial moment ( Δ τ i j ( 0 ) = 0 ), Δ τ i j k ( t , t + n ) is the volume of the pheromone released by ant k between the city i and j from t to t + n and its expression is
Δ τ i j k ( t , t + n ) = { Q L k i f a n t k p a s s e d r o u t e i j 0 i f a n t k d i d n t p a s s r o u t e i j
where, Q is a constant and L k is the total length of the path taken by the ant in this cycle. After all the ants complete a cycle, the near global optimum path and the shortest distance of the cycle will be recorded. Then, this process will be repeat and iterated to the predetermined number of times. During this process, the near global optimum path and the shortest distance obtained in each cycle will be compared to select the optimal value which will finally converge to the ultimately near global optimum path and the shortest distance.

4.2. Improvement of the Ant Colony Algorithm

4.2.1. Improvement of Pheromone Concentration

The studies and analyses provided by predecessors indicate that the ant colony algorithm is liable to fall into the local optimal solution and the problem of stagnation in the search process is also likely to happen. This situation could be mainly attributed to the actual path information not accurately being reflected by the pheromone concentration [21].
To solve the problem provided above, the original ant colony algorithm is improved from the aspects of initial pheromone and pheromone volatilization based on the basic ant colony algorithm. The specifics will be illustrated as follows:
In the classical ant colony algorithm, for all the initial pheromone concentrations are equal, the ants have no target direction when they start searching. Accordingly, a large number of unrelated paths will be produced in the search which could mislead the local update of the pheromone concentration. In this case, not only the initial search time will become longer, because of the pheromone concentration of the irrelevant path is strengthened, the search process of the near global optimum path will also be hindered to make the algorithm move into local optimum. Therefore, in this paper, directional guidance is added at the initial pheromone concentration, and the formula of the initial pheromone information is modified as:
τ i j ( 0 ) = Q / ( d S i + d j E )
where, d S i and d j E are the linear distance from node j to the starting point S and the ending point E (the paths between j and S(E) are not necessarily exist), and Q is a given parameter which represents the total pheromone allocated for each search. It is obvious that the shortest distance between the initial point S and the end point E is the line distance between them. From (15), it could be seen that when the node j tends to the line SE, ( d S i + d j E ) will become smaller which means τ ij ( 0 ) will be larger. When τ ij ( 0 ) becomes larger, the ant will tend to select this node as the moving direction. With the help of the improvement of the algorithm, different weights are introduced to the node at the beginning of the search, therefore, a reasonable direction guidance could be produced for the search and the search for unrelated paths could also be suppressed. Thus, the process of finding the near global optimum solution will be accelerated.

4.2.2. Amendment of Parameters

In power network planning, if the parameters are not selected properly, it will directly affect the speed and effect of solving the model. In order to improve the efficiency of ant colony algorithm, the parameters can be defined as [22]
α = 1 + e 0.1 N max
β = 2.5 e 1 α + 1
where, N max is the maximum number of iterations. Two parameters can be controlled by controlling one parameter, which increases the linkage between parameters.

4.3. Algorithm Implementation

When using ant colony algorithm to solve the microgrid group transaction model and traveling salesman problem (TSP) respectively, the differences could be specifically reflected in two aspects.

4.3.1. “Closed Problem”

In that model, when the bidding strategies are selected by the market entities (from 1 to n), only one kind of bidding strategies could be chosen by each of them. In this case, a decision set which contains all bidding strategies will be formed and called as a “closed path” [23].

4.3.2. Calculation of Heuristic Function η i j

Unlike the basic ant colony algorithm, the problem solved by this model is to achieve the goal maximization rather than the goal minimization.
In this model, let η i j ( t ) = d i j ( t ) , d i j ( t ) denotes the total transaction price of the bidding strategy selected by the market subject.

5. Analysis of Examples

In order to verify the relevant characteristics of the constructed model, a microgrid group trading system based on the blockchain technology is built by PyCharm software and Python 3.6 language. Also, three microgrid operators ( M O S ), two distributed storage vendors ( D S ), and three power consumers ( P C S ) are integrated to make up this system.
Besides, to simplify the setting of the bidding strategy matrix, it is regulated that the purchased electricity price is consistent with the selling price of the subject. The bidding strategy interval for each type of market subject is shown in Table 1 [24].
In this paper, it is stipulated that the power consumers can only buy electricity but not sell electricity. For each subject, the 24-h power demand is shown in Figure 8. In addition, the electricity sales of the microgrid operators and distributed storage vendors are shown in Figure 9.
In this model, set the maximum number of iterations N max = 100 (through repeated testing), the number of market subject n = 8 , the minimum volatilization coefficient ρ min = 0.1 , and the constant Q = 1 . Beyond that, each subject randomly generates ant numbers in the scope of the bidding strategy m = 10 (10 kinds of bidding strategy). As the model belongs to the multigoal and multistage optimization problem, the microgrid operators and the distributed storage vendors are taken as examples to verify the feasibility of the model in this paper. Since the power consumers are similar to the microgrid operators and the distributed storage vendors, the feasibility of this model will be verified by the latter two of them.

5.1. Example 1

Example 1 is based on the maximum profit of the microgrid operators as the objective function. Running the simulation system, the results of the bidding strategy between subjects that can trade at a different time are shown in the Figure 10.
Taking t = 12 : 00 as an example, the near global optimum bidding strategy for this period is obtained through competition as shown in Table 2.
As shown in Figure 10, not all market subjects will have the near global optimum bidding within 24 h, which means that smart contracts are not generated between any two market players within 24 h. This also directly reflects the obvious competitive relationship between the various subjects. In this transaction, maximizing the profit of the microgrid operators should be the first consideration.
The electricity price of power consumers to purchase electricity from two major power subjects at 12:00 is taken as an example. In the Table 2, the electricity price purchased by power consumers from microgrid operators is p ( B _ M ) = 0.91 , and the power bidding from distributed storage vendor to power consumers is p ( B _ D ) = 0.84 . Microgrid operators sell electricity to power consumers at high prices to gain their own interests.

5.2. Example 2

Example 2 is based on the maximum profit of the distributed storage vendors as the objective function. Running the simulation system, the results of the bidding strategy between subjects that can trade at different times as shown in the Figure 11.
Taking t = 12 : 00 as an example, the near global optimum bidding strategy for this period is obtained through competition as shown in Table 3.
In this transaction, maximizing the profit of the distributed storage vendors should be first consideration. Similarly, the electricity price of power consumers to purchase electricity from two major power subjects at 12:00 p.m. is taken as an example. It can be seen from the Figure 11, the price of power consumers purchasing electricity from distributed storage vendors are higher than the price of electricity purchased from microgrid operators. That is, ( p ( B _ D ) = 0.95 ) > p ( B _ M ) = 0.87 ) . Distributed storage vendors use this bidding strategy to maximize their own interests.
From the analysis results of the example 1 and the example 2, it can be clearly seen that the near global optimum bidding strategy obtained is completely different when the objective function is different.

5.3. Pareto Near Global Optimum Scatter Diagram

In order to prove to prove that the model is a competitive game model, the Pareto near global optimum value scatter diagram generated after each iteration of the improved ant colony algorithm is shown in Figure 12.
As can be seen from Figure 12, there is no Pareto near global optimum point in the areas where both microgrid operators and distributed storage vendors are high benefit, and power consumers are low-cost. The results show that interest conflict between the three types of market subjects is explained, and the objective function is contradictory. What is more, there is only a competitive game relationship among the subjects, and there is no collusion cooperation. There is no near global optimum bidding strategy that allows the three parties to meet the conditions in high-income and low-cost regions. In this kind of competitive game trading model, mutual restriction in the relationship among the various market subjects can be realized. In the ‘decentralized’ blockchain environment, it is still able to maintain market harmony and effectively eliminate the use of low cost to complete high income. Thus, the safety and reasonableness of market operations can be guaranteed, and the operational efficiency of the market can be improved.

6. Discussion

When the pairing of each subject in the transaction model is successful, transaction settlement link begins. The purchaser signs the electricity selling information with the private key using the public key address as the flow account of electricity using the blockchain technology. Then the purchaser uploads the signed contract to the blockchain. The electricity purchase agreement is reached between the seller and the buyer once the confirmation is completed. After that, the smart contract stage is entered. Its transaction information is recorded in the form of a Merkle tree in the blockchain. Transactions are stored in new blocks in the form of Merkle tree and linked to the end of the blockchain through security checking. The untouchable modification of the Merkle tree ensures the security and credibility of transactions.

6.1. Peer-to-Peer Network in Trading System

The peer-to-peer(P2P) network works relying on the computing power and broadband of each participant in the network. It is not controlled by only a few servers. The distributed feature of a P2P network increases the reliability of fault prevention by replicating data on multiple nodes. In addition, there will be no single point crash because the P2P network does not need to rely on a central index server to discover data. When it refers to the microgrid group trading system proposed in this paper, peer-to-peer trading is supervised by the market participants to ensure the reliability and integrity of data.

6.2. Transaction Settlement Based on Blockchain

When the buyer and the seller have reached a transaction in the microgrid electricity trading, the transaction funds need to be settled. In order to avoid the problem of untimely and unfair settlement of electricity charges, the smart contract can be used to complete the settlement of electricity charges between the buyer and the seller based on blockchain technology. The smart contract is a kind of transaction protocol that uses a computer to deal with executable contract terms. It can cooperate well with blockchain technology to realize the unification of energy flow, information flow, and capital flow in the process of power transaction [25]. Figure 13 is a model of smart contract for transaction settlement of a microgrid. Its implementation steps are as follows:
(1)
Contract signing: Each power selling and purchasing transaction node predefines an electronic commitment, which includes the electronic signature of both subjects, the amount of electricity and virtual tokens needed by power exchanges, power trading rules, and a complete state machine.
(2)
Writing block: smart contracts with electronic signatures spread to the whole network through P2P in the process of transaction. After consensus verification, they are written into distributed accounts of each node in the blockchain.
(3)
Trigger conditions: judging whether all triggering conditions are met in power trading.
(4)
Contract execution: If a power transaction meets the conditions in (3), it will be verified by pushing out of the blockchain to the queue. When it passes the verification as well as agreed by most nodes, the smart contract is activated and executed to complete the settlement of the transaction funds automatically.

6.3. Prospect

A new type of microgrid market competition game model is constructed in this paper, which realizes the power trading within the microgrid group. The model is a multi-agent and multi-objective optimization model. This paper uses ant colony algorithm to solve the model, and the correctness and rationality of the model have been verified. However, there are many other optimization algorithms besides the ant colony algorithm. In the future work, other algorithms will be chosen to solve and improve the model.
In the paper, we attempted to find the solution with the strongest global search ability, the best convergence performance, and the highest operational efficiency through comparative analysis.

7. Conclusions

Based on the analysis of the characteristics and structure of the blockchain technology, this paper couples microgrid group transaction and blockchain technology to establish a microgrid group information flow transaction model based on blockchain technology. By analyzing the needs of the three major types market subjects, the microgrid group physical flow transaction model is constructed, and the competition relationship and respective goals between the three subjects are fully considered. At the same time, a method based on improved ant colony algorithm for solving the microgrid group transaction model is proposed by using the decentralization feature shared by blockchain technology and ant colony algorithm. Finally, by plotting the Pareto near global optimum scatter diagram, there is a contradiction between the three, and there is obvious competition. A win-win relationship among them cannot be realized.

Author Contributions

The paper was a collaborative effort between the authors. The authors contributed collectively to the theoretical analysis, modeling, programming, simulation, and manuscript preparation.

Funding

This research was funded in part by the National Nature Science Foundation of China (Grant No. 51407144, 51777169); in part by the Aeronautical Science Foundation of China (Grant No. 20164053029); in part by the Fundamental Research Funds for the Central Universities (Grant No. 3102017ZY027 3102017GX08001).

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Zhou, K.; Yang, S.; Shao, Z. Energy Internet: The business perspective. Appl. Energy 2016, 178, 212–222. [Google Scholar] [CrossRef]
  2. Liu, D.N.; Zeng, M.; Huang, R.L. Business models and market mechanisms of E-Net. Power Syst. Technol. 2015, 11, 2057–2063. [Google Scholar]
  3. Chen, P. Power Market Transaction and Economic Operation Based on Microgrid. Ph.D. Thesis, Beijing Jiaotong University, Beijing, China, 2011. [Google Scholar]
  4. Chen, J.; Liu, Y.T.; Zhang, W. Analysis of multi-level microgrid optimal allocation in distribution network based on game theory. Power Syst. Autom. 2016, 1, 45–52. [Google Scholar]
  5. Sinha, A.; Lahiri, R.N.; Neogi, S. Analysis of market price for distributed generators (DGs) in Microgrid. In Proceedings of the 2009 International Conference on the European Energy Market, Leuven, Belgium, 27–29 May 2009; pp. 1–5. [Google Scholar]
  6. Zhao, M.; Shen, C.; Liu, F. A Game-theoretic Approach to Analyzing Power Trading Possibilities in Multi-microgrids. Proc. CSEE 2015, 4, 848–857. [Google Scholar]
  7. Liu, Y.; Guo, L.; Wang, C.S. Optimal Bidding Strategy for Microgrids in Electricity Distribution Market. Power Syst. Technol. 2017, 8, 2469–2476. [Google Scholar]
  8. Li, H.L.; Liu, C.Q. A Study on the Model and Control Algorithm for Coalitional Game of Microgrid. Smart Grid 2016, 3, 291–296. [Google Scholar]
  9. Javadi, M.; Marzband, M.; Akorede, M.F. A Centralized Smart transactive energy framework in grid-connected multiple home microgrids under independent and coalition operations. Renew. Energy 2018, 11, 95–106. [Google Scholar]
  10. Marzband, M.; Azarinejadian, F.; Savaghebi, M.; Pouresmaeil, E.; Guerrero, J.M.; Lightbody, G. Smart transactive energy framework in grid-connected multiple home microgrids under independent and coalition operations. Renew. Energy 2018, 126, 95–106. [Google Scholar] [CrossRef]
  11. Tai, X.; Sun, H.B.; Guo, Q.L. Electricity transactions and congestion management based on blockchain in energy internet. Power Syst. Technol. 2016, 12, 3630–3638. [Google Scholar]
  12. Wang, A.P.; Fan, J.G.; Guo, Y.L. Application of blockchain in energy interconnection. Electr. Power Inf. Commun. Technol. 2016, 9, 1–6. [Google Scholar]
  13. Mihaylov, M.; Jurado, S.; Avellana, N. NRGcoin: virtual currency for trading of renewable energy in smart grids. In Proceedings of the 2014 International Conference on the European Energy Market, Krakow, Poland, 28–30 May 2014; pp. 1–6. [Google Scholar]
  14. Bitcoin: A Peer-to-Peer Electronic Cash System. Available online: https://genius.com/Satoshi-nakamoto-bitcoin-a-peer-to-peer-electronic-cash-system-annotated (accessed on 1 January 2008).
  15. Ji, Z.D. Blockchain and Practice of Business Process Reengineering. Inf. Technol. Stand. 2017, 3, 22–24. [Google Scholar]
  16. Xie, Q.H. Research on blockchain technology and financial business innovation. Financ. Dev. Res. 2017, 5, 77–82. [Google Scholar]
  17. Wang, C.L.; Wang, Y.D.; Qin, Q. Supply chain logistics information ecosystem model based on blockchain. Intell. Theory Pract. 2017, 7, 115–121. [Google Scholar]
  18. Wang, Z.M. A Text Similarity Metrics Method Using TF-IDF Method Combined with Lexical Semantic Information. Ph.D. Thesis, Jilin University, Changchun, China, 2015. [Google Scholar]
  19. Yuan, Y.B.; Liu, Y.; Wu, B. Improved Ant Colony Algorithm for Solving Shortest Path Problem. Comput. Eng. Appl. 2016, 6, 8–12. [Google Scholar]
  20. Shah, S.; Kothari, R.; Chandra, S. Debugging ants how ants find the shortest route. In Proceedings of the 2011 Communications and Signal Processing, Singapore, 13–16 December 2011; pp. 1–5. [Google Scholar]
  21. Sun, W.; Ma, T. The power distribution network structure optimization based on improved ant colony algorithm. J. Intell. Fuzzy Syst. 2014, 6, 2799–2804. [Google Scholar]
  22. Liu, L.; Wang, J.X.; Qin, S.S. A Kind of Application of Improve Ant Colony Algorithm in Power Distribution Network Optimization Planning. Sci. Technol. Eng. 2011, 24, 5801–5803. [Google Scholar]
  23. Zeng, B. Research on Efficiency Evaluation of Electricity Market Economy Based on Improved Ant Colony Algorithm. Shaanxi Electr. Power 2008, 2, 6–10. [Google Scholar]
  24. Ma, T.N.; Peng, L.L.; Du, Y. Competition game model and algorithm for local multi-microgrid market under blockchain technology. Power Autom. Equip. 2018, 5, 1–12. [Google Scholar]
  25. Shen, X.; Pei, Q.Q.; Liu, X.F. Survey of block chain. Chin. J. Netw. Inf. Secur. 2016, 11, 11–20. [Google Scholar]
Figure 1. Basic architecture model of blockchain.
Figure 1. Basic architecture model of blockchain.
Energies 12 01292 g001
Figure 2. Subject coupling diagram.
Figure 2. Subject coupling diagram.
Energies 12 01292 g002
Figure 3. Trading mechanism coupling.
Figure 3. Trading mechanism coupling.
Energies 12 01292 g003
Figure 4. Smart contract coupling.
Figure 4. Smart contract coupling.
Energies 12 01292 g004
Figure 5. Information flow trading model.
Figure 5. Information flow trading model.
Energies 12 01292 g005
Figure 6. Basic structure of microgrid group.
Figure 6. Basic structure of microgrid group.
Energies 12 01292 g006
Figure 7. Analogy diagram of ant colony algorithm and microgrid group trading model.
Figure 7. Analogy diagram of ant colony algorithm and microgrid group trading model.
Energies 12 01292 g007
Figure 8. Electricity demand of various market players.
Figure 8. Electricity demand of various market players.
Energies 12 01292 g008
Figure 9. Electricity supply of various market subjects.
Figure 9. Electricity supply of various market subjects.
Energies 12 01292 g009
Figure 10. Power bidding of various market subject within 24-h.
Figure 10. Power bidding of various market subject within 24-h.
Energies 12 01292 g010
Figure 11. Power bidding of various market subject in 24-h.
Figure 11. Power bidding of various market subject in 24-h.
Energies 12 01292 g011
Figure 12. Pareto near global optimum scatter diagram of various subjects.
Figure 12. Pareto near global optimum scatter diagram of various subjects.
Energies 12 01292 g012
Figure 13. Model diagram of a smart contract for transaction and settlement of a microgrid
Figure 13. Model diagram of a smart contract for transaction and settlement of a microgrid
Energies 12 01292 g013
Table 1. Bidding strategy interval for each type of market subject
Table 1. Bidding strategy interval for each type of market subject
Various Market SubjectBidding Strategy Interval
Microgrid operators0.5~1.1 yuan/(kWh)
Distributed storage vendors0.5~0.95 yuan/(kWh)
Power consumers0.5~1.05 yuan/(kWh)
Table 2. Near global optimum bidding strategy at 12:00 p.m.
Table 2. Near global optimum bidding strategy at 12:00 p.m.
Two Trading PartiesElectricity Price (yuan/kWh)Two Trading PartiesElectricity Price (yuan/kWh)
p ( M _ M ) 0.91 p ( M _ D ) 0.84
p ( M _ B ) 0.85 p ( D _ M ) 0.84
p ( D _ D ) 0.84 p ( D _ B ) 0.69
p ( B _ M ) 0.91 p ( B _ D ) 0.84
Table 3. Near global optimum bidding strategy at 12:00 p.m.
Table 3. Near global optimum bidding strategy at 12:00 p.m.
Two Trading PartiesElectricity Price (yuan/kWh)Two Trading PartiesElectricity Price (yuan/kWh)
p ( M _ M ) 1.07 p ( M _ D ) 1.02
p ( M _ B ) 1.07 p ( D _ M ) 0.79
p ( D _ D ) 0.82 p ( D _ B ) 0.72
p ( B _ M ) 0.87 p ( B _ D ) 0.95

Share and Cite

MDPI and ACS Style

Xu, Z.; Yang, D.; Li, W. Microgrid Group Trading Model and Solving Algorithm Based on Blockchain. Energies 2019, 12, 1292. https://doi.org/10.3390/en12071292

AMA Style

Xu Z, Yang D, Li W. Microgrid Group Trading Model and Solving Algorithm Based on Blockchain. Energies. 2019; 12(7):1292. https://doi.org/10.3390/en12071292

Chicago/Turabian Style

Xu, Zixiao, Dechang Yang, and Weilin Li. 2019. "Microgrid Group Trading Model and Solving Algorithm Based on Blockchain" Energies 12, no. 7: 1292. https://doi.org/10.3390/en12071292

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop