iconOpen Access


A Blockchain-Based Game Approach to Multi-Microgrid Energy Dispatch

Zhikang Wang#, Chengxuan Wang#, Wendi Wu, Cheng Sun, Zhengtian Wu*

School of Electronic and Information Engineering, Suzhou University of Science and Technology, Suzhou, 215123, China

* Corresponding Author: Zhengtian Wu. Email: email

(This article belongs to the Special Issue: The Bottleneck of Blockchain Techniques: Scalability, Security and Privacy Protection)

Computer Modeling in Engineering & Sciences 2024, 138(1), 845-863. https://doi.org/10.32604/cmes.2023.029442


As the current global environment is deteriorating, distributed renewable energy is gradually becoming an important member of the energy internet. Blockchain, as a decentralized distributed ledger with decentralization, traceability and tamper-proof features, is an important way to achieve efficient consumption and multi-party supply of new energy. In this article, we establish a blockchain-based mathematical model of multiple microgrids and microgrid aggregators’ revenue, consider the degree of microgrid users’ preference for electricity thus increasing users’ reliance on the blockchain market, and apply the one-master-multiple-slave Stackelberg game theory to solve the energy dispatching strategy when each market entity pursues the maximum revenue. The simulation results show that the blockchain-based dynamic game of the multi-microgrid market can effectively increase the revenue of both microgrids and aggregators and improve the utilization of renewable energy.


1  Introduction

With global warming, serious land desertification, biodiversity reduction, water environment pollution and other problems increasingly prominent, traditional energy is not enough to meet the needs of modern social production and development, and the use of renewable energy sources gradually become the focus of energy reform. At the same time, due to the rapid development of the economy, the demand for electricity from all walks of life is constantly increasing, although China’s power facilities and equipment are gradually improving, the situation of continuous shortage of power supply has been alleviated, but in the peak load period China’s power grid is still facing enormous pressure. How to use power resources more efficiently is of great importance to relieve the power supply tension and protect the ecological environment.

A microgrid is an energy supply system based on distributed generation and energy storage technology, which enables energy to be generated, transmitted, and stored in different locations, providing a new solution for the efficient use of energy. However, when each MG participates in the market, the problem of interest game between MG and the main network will arise, thus, Microgrid Aggregator (MA) is introduced into the multi-microgrid system to achieve a win-win situation between different interest subjects through the coupling decision-making role of MA and main network [14]. However, because of its centralised system, it generates problems such as high operating costs, the inability to guarantee the information security of participating subjects and the lack of a central supervisory mechanism, thus requiring the exploration of a path that can effectively reduce costs, improve efficiency and protect the information security of users [5].

Blockchain technology is a distributed and decentralized database technology that achieves decentralized verification and confirmation of transactions through the consensus mechanism between network nodes [6]. The emergence of blockchain technology has brought new changes to the energy industry. With blockchain technology, energy transactions can be decentralized and secure, making energy supply more transparent and trustworthy. The introduction of blockchain technology into the transaction between microgrid aggregator, main network and multi-microgrid has the following advantages:

1)   Strong confidentiality: the decentralized feature of blockchain makes the transaction between microgrid aggregator, main network and multi-microgrid can be completed directly without the third-party trading platform, avoiding the risk of information leakage caused by the improper operation of the third-party trading platform. This feature ensures that transactions between microgrid aggregators, the main grid, and multiple microgrids are more secure.

2)   Anti-tampering: the decentralized nature and consensus mechanism of blockchain make it almost impossible for attackers to manipulate the data in a block without challenging over 50% of the network’s computing power. This high threshold makes it extremely difficult for attackers to carry out such an attack in practice [7].

3)   Intelligent: the use of smart contracts in the blockchain to automatically complete transactions effectively reduces labor costs and third-party trust maintenance costs [8].

In recent years, there has been significant research in multi-microgrid gaming schemes. One such proposal, Zhao et al. [9] proposed a double-layer framework for energy trading in multi-microgrids based on blockchain technology. Utilizing a continuous double auction mechanism, this approach aims to achieve fair and free trading between nodes while effectively improving energy utilization. Another proposal, discussed in Yang et al. [10], presented a PoS-based public blockchain peer-to-peer energy trading model. This model enhances producer revenue and consumer cost savings, eliminates price gaps, and reduces mining difficulty and energy consumption. Through a case study and numerical results, the feasibility and effectiveness of this approach are demonstrated. Okoye et al. [11] combined licensing and shortening the consensus reaching time authorization, parallel processing of transactions, and off-chain processing into a blockchain Internet to improve transaction speed. Meanwhile, Rezaei et al. [12] proposed a framework for demand-side integration based on smart microgrids, which supports efficient power consumption through Nash bargaining games and dynamic tariff schemes. This framework aims to achieve smart grid goals and customer needs. Additionally, Mensin et al. [13] proposed an optimal peer-to-peer energy trading model based on prioritization techniques, which seeks to maximize self-consumption for prosumers. Through real-time energy trading and real-time pricing, the approach addresses energy sharing problems in P2P energy trading to achieve payoff fairness for all groups. Another proposal, Mengelkamp et al. [14] proposed a framework for designing microgrid energy markets based on blockchain technology, evaluated with the Brooklyn microgrid case study. This literature also summarizes seven necessary components to design efficient microgrid energy markets. Finally, Noor et al. [15] combined blockchain with microgrids and proposes a demand side management pricing game model. However, there is a lack of effective incentives to attract microgrids to the blockchain.

In this paper, based on the existing research, the distributed bookkeeping and de-centralized processing of blockchain are used to determine the optimal trading price and electricity consumption strategy in peak and valley hours from the MA side through the design of smart contract. The efficiency loss caused by the fluctuation of flexible load in multi-microgrid and the preference of microgrid users for electricity are fully considered as the measures to attract users to the blockchain. The blockchain is used as a measure to attract users to access the blockchain and achieve efficient utilization and highly reliable trading of new energy in the multi-microgrid.

2  Blockchain-Enabled Multi-Microgrid Marketplace Framework Design

In recent years, the hotness of Bitcoin has attracted attention, and blockchain technology, the underlying technology that underpins Bitcoin, is slowly attracting attention. As a decentralized distributed ledger, blockchain technology can solve the problem of attribution in the transaction process by using a consensus algorithm, hash encryption algorithm, asymmetric key mechanism and peer-to-peer (P2P) network carrier without the supervision of third-party regulators, effectively solving the problem of information asymmetry in the transaction process.

2.1 Blockchain Technology

A block consists of two parts: the block header and the block body, as shown in Fig. 1. The block header contains the hash of the previous block used for linking and the target hash pointing to the next block, the random number used for mining, the version number, the timestamp, and the Merkle root, and the block body consists of the main transaction information of this block and the hash of this block. The current block is linked to the previous block by finding the hash of the previous block connected to it, forming a blockchain with a chain structure. In the process of microgrid energy trans-actions, if the transaction information is maliciously modified, it can be traced through the Merkle tree, thus ensuring the security and transparency of the transactions.


Figure 1: Blockchain structure

In this study, the blockchain is used to store information related to multi-microgrid transactions, such as generation unit IDs, power lines, energy types and electricity prices. This transaction information is stored on the blockchain, which ensures transparency, security and immutability of transactions.

2.2 Blockchain-Based Transaction Model for Microgrid Aggregators

The blockchain multi-microgrid market transaction model involved in this paper is shown in Fig. 2, which contains the main network, microgrid aggregators, multiple microgrids, Hyperledger-based microgrid blockchain smart management platform, and each microgrid contains energy storage devices, power-using devices (e.g., electric vehicles, industrial users, residential users, commercial users, etc.) and capacity devices (e.g., wind power generation, PV power generation, thermal power generation, hydroelectric power generation, etc.). When there is excess capacity, the microgrid will sell electricity to the microgrid aggregator through the blockchain intelligent management platform to obtain benefits; when there is insufficient capacity, the microgrid will purchase energy from the microgrid aggregator through the blockchain intelligent management platform to relieve the load pressure. Meanwhile, considering that the multiple microgrids (i.e., producers and consumers) in the microgrid aggregator trading model will switch between power sources and users, the strategy of separate peak and valley pricing in the blockchain open market can effectively incentivize multiple microgrid users to reasonably allocate their power consumption time and alleviate the tight power consumption of multiple microgrids during peak periods [16]. Based on the open and transparent characteristics of blockchain, the time-of-use tariff can be developed according to the actual electricity consumption in the market to guide the energy production and consumption of each microgrid user, and the peak-valley time-of-use tariff model can be defined as:


Figure 2: Microgrid energy storage strategy based on blockchain


where Pf, Pp represent the peak electricity price, off-peak electricity price, and valley electricity price, respectively, and Pf>Pp>Pg; Tf, Tp and Tg represent the time periods of peak electricity price, off-peak electricity price, and valley electricity price, respectively. The multi-microgrid in the blockchain reasonably allocates the energy production and consumption moments according to the peak and valley hour electricity prices in the open market, which also reflects the guiding role of the blockchain market for electricity.

2.3 Blockchain-Based Multi-Microgrid Market

The multi-microgrid market is a mechanism in which buyers and sellers interact to determine production and prices. Its market players mainly include local grid companies for infrastructure construction, microgrid aggregators for buying excess capacity and selling electricity, multi-microgrid users for obtaining the minimum cost, and blockchain networks for regional energy trading. Compared to platforms such as Ethereum, Substrate, Ripple, and IBM, Hyperledger Fabric uses a unique system architecture that separates the automatic execution of contracts from the consensus mechanism, achieving modular and plug-and-play consensus and membership services. This architecture allows developers to customize blockchain networks to better meet the needs of different scenarios [17]. Furthermore, compared to competitors like Ethereum, Hyperledger Fabric has higher applicability in blockchain energy trading. Therefore, this article selects Hyperledger Fabric as the blockchain energy trading platform. At the same time, the practical Byzantine fault tolerance (PBFT) algorithm is used as the consensus mechanism, which uses mathematical calculations and does not require mining to achieve consensus on the blockchain management platform in the shortest possible time, thereby improving the transaction speed of the blockchain to meet the efficiency requirements of the microgrid market. In the transaction process, participants need to register on the blockchain intelligent platform and submit the necessary information, such as the organization name, node name, and node type. The certificate issuance authority Fabric CA (CA) will verify this information and generate a digital certificate, then encrypt and store the “individual” ID that meets the admission market conditions in the corresponding blockchain. The microgrid is connected to the main grid through a public coupling point. When the microgrid’s electricity production cannot meet the needs of local users, the main grid will provide power. When the microgrid produces excess electricity, it will sell it to the main grid. The price that the microgrid purchases from the main grid should be lower than the local electricity price, and the price reported by consumers should be higher than the local electricity price, stimulating both buyers and sellers to trade through this incentive mechanism. To prevent collusion pricing from disrupting the market order, a closed interval declaration price mechanism is set up. At the beginning of each round of the microgrid’s game, the management platform broadcasts real-time information on electricity quantity and price to various system nodes. The public sharing, distributed ledger, tamper resistance, open transparency, and traceability features of blockchain can effectively improve the current problems caused by the centralized mode in energy trading, such as untraceable transactions and unreliable trading partners. Smart contract technology can also promote mutual cooperation among entities. Blockchain technology can effectively ensure the accuracy and timeliness of energy transactions and thus improve the quality and efficiency of comprehensive services [18]. In summary, Table 1 compares the performance of traditional electricity market transactions and blockchain-based multi-microgrid energy transactions in four aspects: transaction method, information trustworthiness, energy selection, and data security.


1)   Transaction method: Traditional electricity market relies on trusted third-party institutions, while blockchain provides a storage and broadcasting platform for all users participating in the market, and all participants can access direct P2P transactions.

2)   Information trustworthiness: Traditional electricity market relies on trusted third-party institutions as credit guarantees, while blockchain, as a distributed ledger, has the characteristics of openness, transparency and non-comparability of transactions.

3)   Energy choice: Users can use the traceability feature in blockchain to know the source of energy they buy, such as wind power, thermal power and hydropower, thus having more opportunities to choose energy.

4)   Data security: The data in traditional electricity market transactions are stored in the database of the central institution, which is difficult to recover after an attack. Blockchain database adopts distributed storage method, and when the data is damaged, it can be recovered in time using copies.

2.4 Degree of Preference of Blockchain Multi-Microgrid Users for Energy Type

Based on the traceability of blockchain, users of multi-microgrid can freely choose the type of energy in the blockchain compared to purchasing electricity from the main network. Although different types of energy can eventually meet the final electricity demand of users, the different costs, output and stability of different energy types lead to differences in energy selection and therefore there is a preference for energy types. Secondly, the open and transparent feature of blockchain enables users to grasp timely and accurate information on power supply in the multi-microgrid system, thus increasing the willingness of microgrid users to access the blockchain. It can be seen that the degree of information interoperability of blockchain networks greatly affects the preference of users to use blockchain networks for electricity trading, and the preference degree is shown in Eq. (2):


where δi,m0k is the initial degree of preference of user i for electricity m when blockchain technology is not applied; θϵ[0,1] denote the degree of blockchain application, i.e., whether each microgrid is on the chain or not, and the higher the degree of chain, the higher the degree of blockchain application. φϵ[0,1] denote the coefficient of blockchain influence on the degree of user preference; mϵ[2,M], M denotes the microgrid access to the number of blockchain networks, and m denotes that the power comes from the capacity equipment in the m-th microgrid. Since the main grid has the characteristic of stability and irreplaceability, for m = 1, φ=0 and δi,1k=δi,10k.

3  Blockchain-Based Multi-Microgrid Model

3.1 Multi-Microgrid Revenue Function Model

The revenue of the multi-microgrid is composed of the profit of power sales from MG to MA, the cost of power purchase by MG from MA and the operating cost of MG’s own energy storage equipment, whose function model can be defined as:


where Uih is the revenue function of the i-th MG at moment h; αi,sath is the satisfaction coefficient of electricity consumption of the i-th MG at moment h; qih is the load of the i-th MG at moment h; Pmg,shouh, Pmg,buyh are the sale and purchase prices of the MG at moment h moment in the blockchain open market for selling and buying electricity; Ei,chh is the genset capacity of the i-th MG at moment h; βch is the cost coefficient of electrical energy loss during the operation of energy storage equipment; Nch and Ndc are the charging and discharging efficiency of the energy storage device, respectively; Mi,chh and Mi,dch are the charging and discharging power of the i-th energy storage device at moment h, respectively; Δh is the operating time of the energy storage device.

The upper equation in the segment function indicates that when the capacity of the generator set in MG is larger than the MG’s electricity load, i.e., excess capacity, MG chooses to charge the energy storage device first to relieve the load pressure at the peak of electricity consumption, and then chooses to sell the remaining capacity to MA through the blockchain open market when the storage capacity of the energy storage device reaches its limit.

The following equation in the segmentation function indicates that when the capacity of the generating units in the MG is less than the MG’s electricity load, i.e., the capacity is insufficient, the MG first releases the electricity stored in the storage device to relieve the load pressure, and when it is still insufficient to cope with the load pressure at the peak moment, it chooses to purchase electricity from the MA through the blockchain open market.

3.2 Microgrid Aggregator Revenue Function Model

The return of MA consists of the trading spread between the main, multi-microgrid network, and its functional model can be defined as:


where Ymah is the revenue function of MA at moment h; Pma,buyh, Pma,shouh are the purchase price and sale price of electricity in the blockchain open market for the main grid at moment h, respectively.

3.3 Binding Conditions

3.3.1 Constraint of MA

In order to enable the blockchain multi-microgrid system to operate stably and at the same time speed up the response time of MA and each MG, the price set needs to satisfy the following conditions:



where Mi,kh is the power purchased and sold between the k-th MG and the MA at moment h. Mimin and Mimax are the upper and lower bounds of Mi,kh, respectively. Each MG can purchase or sell electricity from the MA on the open market, but cannot be in a position to purchase and sell electricity at the same time [3].

3.3.2 Constraint of MG

The blockchain multi-microgrid system is internally bounded by both flexible loads and energy storage devices.

Flexible loads facilitate demand-side management [19], and multi-microgrid users can reasonably allocate electricity consumption periods for appliances based on time-of-day tariffs in the blockchain open market. In order to reduce multi-microgrid users’ deviation from desired consumption of electricity due to the actual consumption of electricity, the operation of flexible loads needs to satisfy the following constraints:


where eimin is the lower limit of flexible load use; eimax is the upper limit of flexible load use.

In daily use, in order to prevent loss problems caused by improper use of energy storage equipment, it is necessary to control its active power and state of charge within certain limits, the constraints of which satisfy Eq. (8):


where SOCih is the charge state of the i-th energy storage device at the moment h; SOCimin and SOCimax are the lower and upper limits of the charge state of the energy storage device, respectively; γca is the capacity of the energy storage equipment; Mi,chmax is the upper limit of charging power of the i-th energy storage device; Mi,dcmax is the upper limit of the discharge power of the i-th energy storage device.

4  Multi-Microgrid and Microgrid Aggregator Game Model

The concept of the master-slave game was first proposed by the German economist Heinrich Von Stackelberg, and later many scholars did related studies on Stackelberg’s model. Basar and Olsder based on Stackelberg’s theoretical research proposed the definition of a two-player and multiplayer master-slave game and the existence of the equilibrium point of the master-slave game proposition [20].

4.1 Blockchain-Based Multi-Microgrid One-Master-Multi-Slave Stackelberg Game Model

In the game process, MA first generates the electricity price curve according to the contract signed with the power grid to maximize its own profit published in the open market. MG decides the optimal electricity purchase and sale plan according to the price in the blockchain open market intending to maximize its own benefit, which constitutes a typical Stackelberg game model [3]. In this paper, we take MA as the leader and each MG as different followers, and establish a Stackelberg game model with one master and many followers, whose game model can be expressed as follows:


There are 3 elements in the model: participants, strategies and benefits, which are expressed as:

1)   Participants: the participants of all games are denoted as {MG}{MA}.

2)   Strategies: {Qn}nϵG, {Mch,n}nϵG and {Mdc,n}nϵG denote the set of strategies of MG; {Pbuy} and {Pshou} denote the set of strategies of MA.

3)   Benefit: {Un}nϵG denotes the set of benefit functions of MG; R denotes the benefit function of MA.

4.2 Objective Function

(1) The objective function of MA


(2) The objective function of MG


The game reaches a Stackelberg equilibrium solution (both sides gain the maximum benefit) when all followers respond optimally according to the leader’s decision and the leader accepts this optimal response, subject to the following conditions:





4.3 Blockchain Microgrid Aggregator Revenue Model

Microgrid aggregators provide a trading platform to microgrid users and profit by charging a proportional service fee. The benefit of the aggregator gaming process is the operating revenue, and the revenue function can be expressed as follows:


where δ is the ratio coefficient of the service fee charged by the blockchain microgrid aggregator; N1 and N2 are the number of power sources and loads in the multi-microgrid market, respectively.

When the service fee ratio coefficient is certain, the aggregator and the participating operating entities in the multi-microgrid system have the same benefits, and at this time, the optimal economic benefit of the blockchain microgrid aggregator is the result of the power bidding game. In addition, the aggregator influences the power supply and user in the multi-microgrid market benefits and tariffs by adjusting the values of δi and δj in the pricing strategy, so as to maximize the obtained benefits [21].

4.4 Energy Scheduling Strategy

Before the energy dispatch of the day, the Microgrid Aggregator (MA) updates the daily main network electricity price prediction information, while each Microgrid (MG) updates the predicted load data, generation equipment predicted capacity, and energy storage equipment predicted state of charge for the day. The MA determines the internal electricity prices for the multi-microgrid system based on the main network electricity prices in each time period on the blockchain open market. The resulting information is then published in a block structure on the open market.

Subsequently, each MG responds to the received price information as a target, adjusting the charging and discharging power of flexible loads and energy storage equipment by calling optimization algorithms. Simultaneously, the MG feeds back the price signal to the MA. Upon receiving feedback information from the MG, the MA calls the optimization algorithm again, adjusts the electricity prices, and publishes them again on the blockchain open market. This iterative process continues between the MA and MGs until their interests are maximized. Specifically, the MGs adjust their electricity consumption based on the published electricity prices, while the MA adjusts the prices based on the feedback received from the MGs. The specific flowchart of this process is illustrated in Fig. 3.


Figure 3: Multi-microgrid pricing Dynamic Game Process based on blockchain

In the game process, there is a deviation value between the flexible load ei and the optimal load ei, and the fluctuation of the load will lead to the deviation of the power bought and sold in the blockchain multi-microgrid system from the optimal strategy, resulting in the loss of benefits to MA in the transaction process. In this regard, the impacts and countermeasures brought by the deviation values are discussed separately for the two cases of overcapacity and understaffing in the system.

(1) Microgrid users with excess capacity in the system

When MG sells less electricity to MA than the optimal strategy, i.e., qihqih,0, MG is positive benefit; and when MG sells more electricity to MA than the optimal strategy, i.e., qihqih,<0, MG is negative benefit, and in order to ensure the leader’s benefit, the benefit will be compensated to MA, at which time the benefit contributed by MG to MA is:


(2) Microgrid users with insufficient capacity in the system

When MG buys more power from MA than the optimal strategy, i.e., qihqih,0, MA is a positive benefit; and when MG sells more power to MA than the optimal strategy, i.e., qihqih,0, MG is the negative benefit, and in order to ensure the leader’s benefit, the benefit will be compensated to MA, at which time the benefit contributed by MG to MA is:


Combining Eqs. (15) and (16), the combined benefit function of MA can be derived as:


In summary, MG sends the deviation value to MA after each game, and MA receives the deviation and updates the benefit function according to the above countermeasures, which in turn compensates for the impact on MA caused by the fluctuation of the flexible load during the game [22].

5  Example Analysis

This article designs an optimization cycle T of 24 h, optimizing every hour. Compared with traditional particle swarm algorithms, the improved adaptive particle swarm algorithm can solve problems faster by constraining the problem. In the simulation process, the solution of the nonlinear utility function involves using the YALMIP toolbox to call the CPLEX solver. The improved adaptive particle swarm algorithm is used to solve Eqs. (10) and (11) within the MA and MG. In the game process, the pursuit of a globally optimal solution is achieved, thus the optimal utility of {MG}{MA} is used as the objective function for experimental analysis.

5.1 Basic Data

In this paper, we assume that the multi-microgrid system contains 3 microgrids and 1 microgrid aggregator. The initial state of charge (SOC) is taken as 0.3, the maximum state of charge is taken as 0.85, and the minimum state of charge is taken as 0.2; the electricity consumption satisfaction factor αi,sath for the i-th MG at moment h is taken as 95; the maximum charging power Mi,chmax of the energy storage device is 50 kW, maximum discharge power Mi,dcmax of 50 kW; the charging efficiency Nch and discharging efficiency Ndc of the energy storage equipment are taken as 0.9; the operating loss cost factor βch of the energy storage equipment is taken as 0.03; the capacity of the energy storage device γca is 96 kW·h; the optimization time interval Δh for energy storage devices is 0.2 h. The predicted tariff information is temporarily taken as a reference for a city’s time-of-day tariff, as shown in Fig. 4, and the load and capacity of each microgrid are shown in Fig. 5. The capacity, load, and battery basic parameter data of each microgrid are obtained from the literature [23,24].


Figure 4: Tou price curve


Figure 5: Capacity and load curves

5.2 Internal Tariff Optimization Results

As can be seen from Fig. 5, during 11:00–17:00, the internal power generation of the multi-microgrid system is smaller than the load demand, showing a trend of supply exceeding demand, at this time, MA can increase the electricity purchase price to guide MG to sell the excess capacity to MA, to meet the demand response of MA’s power purchase; while during 00:00–10:00 and 18:00–24:00, the internal power generation of the multi-microgrid system is larger than the load demand, showing a trend of supply exceeding demand, at this time, MA can reduce the electricity sale price to meet the demand response of MG’s power purchase, to protect the environment and ensure its revenue at the same time. At 00:00–10:00 and 18:00–24:00, the power generation within the multi-microgrid system is larger than the load demand, showing the state of oversupply, at this time, MA can meet the demand response of MG’s power purchase by reducing the electricity sales price, to consume more renewable energy and protect the environment while ensuring its revenue. The internal tariff of the multi-microgrid after the optimization game is shown in Fig. 6.


Figure 6: Microgrid post-game price

5.3 Contrast Analysis

5.3.1 Multi-Microgrid Benefit Analysis

The comparison of microgrid revenue for each period is shown in Fig. 7. After the game, the revenue of microgrid in each period has slightly increased. Meanwhile, MG1 at 11:00, 13:00, 15:00; MG2 at 09:00–17:00: MG3 at 10:00, 14:00–16:00, because the microgrid capacity is larger than the load demand, by selling the excess capacity There is a significant increase in the revenue obtained by selling the excess capacity to MA, and in the other hours, with the help of energy storage equipment thus reducing the amount of electricity purchased from MA and thus improving the overall revenue, thus verifying the effectiveness of this optimization strategy.


Figure 7: Multi-microgrid revenue curve based on blockchain

5.3.2 Microgrid Aggregator Revenue Analysis

The comparison of profits for microgrid aggregators is shown in Fig. 8. Before optimization, since the multi-microgrid has not started its capacity at 0:00–6:00, the multi-microgrid can only purchase electricity from the main network through the blockchain open market, and the revenue of the microgrid aggregator is 0. At 11:00–17:00, the microgrid aggregator acquires surplus electricity and sells energy that exceeds the capacity of the storage device at the same time, and at 19:00–22:00, the capacity in the system is much smaller than the load. At 19:00–22:00, the capacity in the system is much less than the load demand, at this time, the microgrid aggregator sells to the microgrid at a lower price than the main network, reaching the peak stage of revenue, while at 23:00–24:00, all the electricity purchased by the aggregator is sold out, and the multi-microgrid buys electricity from the main network again, based on which the real-time game is added to expand the revenue obtained by the aggregator while reducing the impact of the load deviation value on the MA revenue.


Figure 8: Revenue curve of microgrid aggregator based on blockchain

5.3.3 Load Curve Comparison Analysis

According to Fig. 9, after optimized scheduling, the load curves within the multi-microgrid system changed at different time periods. During peak hours (such as 8:00–13:00 and 18:00–22:00), the system’s load significantly decreased, indicating that the microgrid aggregator successfully implemented peak shaving, i.e., purchasing more energy from the main grid during peak periods to meet user demand and selling excess energy back to the main grid during off-peak periods. This strategy can reduce internal load fluctuations and improve energy utilization efficiency. In contrast, during off-peak hours (such as 15:00–17:00 and 22:00–next day 7:00), the system’s load increased slightly. This may be because the microgrid aggregator purchased more energy from the main grid to meet user demand response. Although there was more internal generation capacity at this time, purchasing more energy from the main grid was necessary to ensure supply due to lower user demand.


Figure 9: Improvement of load curve in each period

5.3.4 Smart Contract Trading Details

In the simulation of smart contract trading, there are two energy producers q and v, and three energy consumers x, y, and z. Tables 2 and 3 show the entire trading process and results of the multi-microgrid using smart contracts. As shown in Table 2, before the game, the lowest bid of producer v was higher than the highest bid of consumer x. All participants in the multi-microgrid adjusted their bids in turn based on the APSO algorithm. After multiple rounds of adjustments, the true bid of producer v became lower than the true bid of consumer x, so both sides began to trade. After the transaction, producer v still had surplus energy, and consumer x′s true bid for selling energy was lower than consumer y′s bid, so both consumers reached a consensus to trade. After the transaction, consumer y did not receive enough energy. Although producer q′s bid met the conditions of consumer y′s bid, they failed to match multiple times due to not meeting the dynamic constraint conditions. After submitting the true bid, consumer z′s bid was lower than the bids of consumer y and producer q, but consumer y′s bid was higher than producer q′s bid, so consumer z was matched with producer q for the transaction. However, at this point, both q and z still had surplus energy, and y did not receive enough energy, so q, y, and z re-bid for the next round of trading until the end of the transaction. The final trading results are as follows: consumers x, y, and z transferred 31.43, 34.24, and 39.99 ether respectively from their accounts, and the corresponding energy was added to their accounts. Producer q and v sold 62 and 99 kW·h of energy respectively and received 42.51 and 63.15 ether.



5.3.5 Comparison with Existing Solutions

Table 4 shows the different functionalities provided by recent representative solutions, including the use of peer-to-peer networks, blockchain-based technology, support for smart contracts, availability to the public, use of aggregation mechanisms, and support for gaming.


The literature [9] and [15] provided a solution based on blockchain technology, but they do not choose a suitable transaction method, such as smart contracts, which not only makes the transaction system lack a certain degree of flexibility and security, but also prevents further reduction of transaction costs. The literature [10] used a suitable auction method but does not introduce an aggregator mechanism on top of it, which prevents the integration of multiple decentralized microgrid systems into a whole with the participation of multiple consumers, thus allowing for unified management and improved economic efficiency. In addition, literature [9,10] and [15] did not use a game mechanism, making it impossible to maximize the benefits of both sides of the energy auction. Although the literature [12] used peer-to-peer trading and a suitable trading method, it is not aided by a reliable trading platform and security is greatly reduced. In contrast, the solution proposed in this paper uses a smart contract-based energy scheduling gaming method for multi-microgrid aggregators, which not only maximizes the revenue for both sides of the transaction but also keeps the transaction information from leaking, ensuring a secure and reliable system.

6  Conclusions

In this paper, we have proposed a blockchain-based mathematical model for the revenue of multiple microgrids and microgrid aggregators. By utilizing automated transactions of smart contracts and combining the stackelberg game method of one master and many slaves, we aim to maximize profits between multiple microgrids and microgrid aggregators while also taking into account the degree of preference of microgrid users for electricity and thus increasing their reliance on the blockchain market. Our simulation results show that the proposed dynamic game model can effectively increase the revenue of both multi-microgrids and aggregators, as well as improve the utilization of renewable energy.

However, there are still some limitations in our research. For example, we have not considered the impact of flexible load fluctuations on transaction efficiency and the lack of effective incentive measures to promote microgrid access to the blockchain. Therefore, future research should focus on improving our model by addressing these limitations and verifying its effectiveness in practical applications.

Acknowledgement: The authors would like to thank the anonymous reviewers and the editors of the journal. Your constructive comments have improved the quality of this paper.

Funding Statement: This research was funded by the NSFC under Grant No. 61803279, in part by the Qing Lan Project of Jiangsu, in part by the China Postdoctoral Science Foundation under Grant Nos. 2020M671596 and 2021M692369, in part by the Suzhou Science and Technology Development Plan Project (Key Industry Technology Innovation) under Grant No. SYG202114, in part by the Open Project Funding from Anhui Province Key Laboratory of Intelligent Building and Building Energy Saving, Anhui Jianzhu University, under Grant No. IBES2021KF08, in part by the Postgraduate Research & Practice Innovation Program of Jiangsu Province under Grant No. KYCX23_3320, in part by the Postgraduate Research & Practice Innovation Program of Jiangsu Province under Grant No. SJCX22_1585.

Author Contributions: The authors confirm contribution to the paper as follows: study conception and design: Zhikang Wang, Zhengtian Wu; data collection: Chengxuan Wang; analysis and interpretation of results: Zhikang Wang, Wendi Wu; draft manuscript preparation: Zhikang Wang. All authors reviewed the results and approved the final version of the manuscript.

Availability of Data and Materials: Due to the nature of this research, participants of this study did not agree for their data to be shared publicly, so supporting data is not available.

Conflicts of Interest: The authors declare that they have no conflicts of interest to report regarding the present study.


1. Ahmad, F., Alam, M. S., Shahidehpour, M. (2018). Profit maximization of microgrid aggregator under power market environment. IEEE Systems Journal, 13(3), 3388–3399. [Google Scholar]

2. Gomes, I. L. R., Melicio, R., Mendes, V. M. F. (2021). A novel microgrid support management system based on stochastic mixed-integer linear programming. Energy, 223(4), 120030. [Google Scholar]

3. Yang, J., Dai, J., Gooi, H. B., Nguyen, H. D., Wang, P. (2022). Hierarchical blockchain design for distributed control and energy trading within microgrids. IEEE Transactions on Smart Grid, 13(4), 3133–3144. [Google Scholar]

4. Khajeh, H., Akbari Foroud, A., Firoozi, H. (2019). Robust bidding strategies and scheduling of a price-maker microgrid aggregator participating in a pool-based electricity market. IET Generation, Transmission & Distribution, 13(4), 468–477. [Google Scholar]

5. Mollah, M. B., Zhao, J., Niyato, D., Lam, K. Y., Zhang, X. et al. (2020). Blockchain for future smart grid: A comprehensive survey. IEEE Internet of Things Journal, 8(1), 18–43. [Google Scholar]

6. van Leeuwen, G., AlSkaif, T., Gibescu, M., van Sark, W. (2020). An integrated blockchain-based energy management platform with bilateral trading for microgrid communities. Applied Energy, 263(2), 114613. [Google Scholar]

7. Tsao, Y. C., Thanh, V. V., Wu, Q. (2021). Sustainable microgrid design considering blockchain technology for real-time price-based demand response programs. International Journal of Electrical Power & Energy Systems, 125(1), 106418. [Google Scholar]

8. Hamouda, M. R., Nassar, M. E., Salama, M. M. A. (2020). A novel energy trading framework using adapted blockchain technology. IEEE Transactions on Smart Grid, 12(3), 2165–2175. [Google Scholar]

9. Zhao, Z., Guo, J., Luo, X., Xue, J., Lai, C. S. et al. (2020). Energy transaction for multi-microgrids and internal microgrid based on blockchain. IEEE Access, 8, 144362–144372. [Google Scholar]

10. Yang, J., Paudel, A., Gooi, H. B., Nguyen, H. D. (2021). A proof-of-stake public blockchain based pricing scheme for peer-to-peer energy trading. Applied Energy, 298(4), 117154. [Google Scholar]

11. Okoye, M. O., Yang, J., Cui, J., Lei, Z., Yuan, J. et al. (2020). A blockchain-enhanced transaction model for microgrid energy trading. IEEE Access, 8, 143777–143786. [Google Scholar]

12. Rezaei, N., Meyabadi, A. F., Deihimi, M. (2022). A game theory based demand-side management in a smart microgrid considering price-responsive loads via a twofold sustainable energy justice portfolio. Sustainable Energy Technologies and Assessments, 52(2), 102273. [Google Scholar]

13. Mensin, Y., Ketjoy, N., Chamsa-ard, W., Kaewpanha, M., Mensin, P. (2022). The P2P energy trading using maximized self-consumption priorities strategies for sustainable microgrid community. Energy Reports, 8(14), 14289–14303. [Google Scholar]

14. Mengelkamp, E., Gärttner, J., Rock, K., Kessler, S., Orsini, L. et al. (2018). Designing microgrid energy markets: A case study: The brooklyn microgrid. Applied Energy, 210(6), 870–880. [Google Scholar]

15. Noor, S., Yang, W., Guo, M., van Dam, K. H., Wang, X. (2018). Energy demand side management within micro-grid networks enhanced by blockchain. Applied Energy, 228, 1385–1398. [Google Scholar]

16. Tesfamicael, A. D., Liu, V., Mckague, M., Caelli, W., Foo, E. (2020). A design for a secure energy market trading system in a national wholesale electricity market. IEEE Access, 8, 132424–132445. [Google Scholar]

17. Fei, Z., Fu, B., Xi, X., Wu, Z., Chen, Z. et al. (2020). Power charging management strategy for electric vehicles based on a Stackelberg game. IET Intelligent Transport Systems, 14(5), 432–439. [Google Scholar]

18. Ghotbabadi, M. D., Dehnavi, S. D., Fotoohabadi, H., Mehrjerdi, H., Chabok, H. (2022). Optimal operation and management of multi-microgrids using blockchain technology. IET Renewable Power Generation, 16(16), 3449–3462. [Google Scholar]

19. Lin, J., Pipattanasomporn, M., Rahman, S. (2019). Comparative analysis of auction mechanisms and bidding strategies for P2P solar transactive energy markets. Applied Energy, 255(8), 113687. [Google Scholar]

20. Xu, Z., Yang, D., Li, W. (2019). Microgrid group trading model and solving algorithm based on blockchain. Energies, 12(7), 1292. [Google Scholar]

21. Liu, B., Wang, M., Men, J., Yang, D. (2020). Microgrid trading game model based on blockchain technology and optimized particle swarm algorithm. IEEE Access, 8, 225602–225612. [Google Scholar]

22. Dong, J., Song, C., Liu, S., Yin, H., Zheng, H. et al. (2022). Decentralized peer-to-peer energy trading strategy in energy blockchain environment: A game-theoretic approach. Applied Energy, 325(8), 119852. [Google Scholar]

23. Fu, B., Chen, M., Fei, Z., Wu, J., Xu, X. et al. (2021). Research on the stackelberg game method of building micro-grid with electric vehicles. Journal of Electrical Engineering & Technology, 16(3), 1637–1649. [Google Scholar]

24. Zhao, S., Zhu, S., Wu, Z., Jaing, B. (2022). Cooperative energy dispatch of smart building cluster based on smart contracts. International Journal of Electrical Power & Energy Systems, 138(6), 107896. [Google Scholar]

Cite This Article

APA Style
Wang, Z., Wang, C., Wu, W., Sun, C., Wu, Z. (2024). A blockchain-based game approach to multi-microgrid energy dispatch. Computer Modeling in Engineering & Sciences, 138(1), 845-863. https://doi.org/10.32604/cmes.2023.029442
Vancouver Style
Wang Z, Wang C, Wu W, Sun C, Wu Z. A blockchain-based game approach to multi-microgrid energy dispatch. Comput Model Eng Sci. 2024;138(1):845-863 https://doi.org/10.32604/cmes.2023.029442
IEEE Style
Z. Wang, C. Wang, W. Wu, C. Sun, and Z. Wu "A Blockchain-Based Game Approach to Multi-Microgrid Energy Dispatch," Comput. Model. Eng. Sci., vol. 138, no. 1, pp. 845-863. 2024. https://doi.org/10.32604/cmes.2023.029442

cc This work is licensed under a Creative Commons Attribution 4.0 International License , which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
  • 635


  • 472


  • 0


Share Link