Blockchain-based framework of power demand response in China

Demand response is recognized as an effective solution for eliminating power ﬂuctuations and satisfying capacity constraints in power systems. A growing customer base equipped with energy storage and intelligent power meter on the demand side has resulted in the strong interest of China’s power companies in demand response. However, most exiting demand response programs in China are based on a centralized framework, which is eas-ier for management, but cannot support a large number of scattered small-scale users’ participation effectively. Therefore, taking the desired features of blockchain technology, such as decentralization, trustworthiness, trackability, and immutability into considera-tion, the applicability of blockchain in demand response is analyzed. On this basis, a new blockchain-based framework of China’s typical demand response programs is proposed, in which consensus mechanism, encryption algorithm, and smart contract of blockchain are applied to the process of invitation, bidding, and settlement in demand response. Fur-thermore, the development suggestions of China’s demand response based on blockchain technology are put forward from the aspects of trading products, credit management, and platform construction at the end of this work.


INTRODUCTION
With the gradual deepening of China's energy structure transition, renewable energy is developing rapidly, and the uncertainty of power supply is significantly increased. At the same time, the peak load of the user side grid increases year by year, and the problem of seasonal and periodic power supply shortage intensifies [1]. The problems on both the supply side and the demand side lead to the frequent imbalance of power systems, which directly affects the security of relevant equipment, and even leads to blackouts. It is an effective method to balance the supply and demand of the power grid with high renewable energy penetration by large-scale investment in energy storage equipment and standby units [2]. However, this traditional method leads to a series of problems, such as the increase of power grid investment, low equipment utilization rate, as well as high operation and maintenance cost. Under this background, the value of power demand response (DR), i.e. the changes in electric use by demand-side resources from their normal consumption patterns in response to the varying electricity price or incentive payments, has been highlighted [3] and has gradually become an important part of China's current electricity market reform. The gradual popularization of intelligent power meters and information communication equipment also promotes DR to become one of the effective market-oriented means to solve the problem of power supply and demand balance [4]. It is the development trend of DR to guide users to adjust their electricity consumption behaviour with market-oriented prices or incentive signals, i.e. to modify the electric load diagram (lowering it, increasing it, or shifting it horizontally) [5]. In typical international electricity markets, such as PJM in the United States and the national electricity market in Australia, corresponding to the electricity transactions with different time scales and trading objects, DR can not only participate in the electric energy market but also plays a role in the capacity market and auxiliary service market [6,7].
In recent years, Shandong, Jiangsu, and other provinces in China have carried out the pilot application of DR. State Grid Zhejiang company has proposed the development goal of a high-elastic power grid, aiming to promote the interaction of power source, grid, and load through DR, so as to realize the unity of reliability and economy of power system operation. In general, DR programs in China are implemented based on capacity, i.e. to moderate peak hours of electricity demands. Grid Company (GC) can reach a consensus on DR with large users or load aggregators through bilateral agreements or bidoffer transactions, so as to enable users to provide grid regulation resources equivalent to generators, and deeply tap the DR potential of the user side. However, the current DR program implementations in China adopt the grid company centred management mode, and GCs are both participants and managers of the DR market. Such dual identities make it difficult for GC to prove their innocence in the aspects of DR contract management, response energy measurement and settlement, and also reduces the enthusiasm of users to participate in DR to a certain extent. Besides, the centralized management mode also has some defects, such as unsafe data storage, high operational cost, complex settlement process, and user privacy disclosure. Similar problems are also common in microgrid market transactions and smart industrial applications [8,9].
In order to solve these problems, blockchain, labelled as decentralization and credible, has been applied in many fields, e.g. distributed energy trading [10,11], carbon emission certification [12], electric vehicle charging and discharging [13,14], micro-grid demand response. "Blockchain +" has become an important direction of energy industry development. In this context, a secure private P2P energy trading mechanism in the blockchain-based industrial internet of things (IoT) was proposed in [15], in which nodes were considered to satisfy their power load with local energy storage, so as to reduce the chain length and the energy transportation cost. A decentralized blockchain-based energy trading system named FeneChain, which focused on protecting the rights of energy purchasers and preventing the fraud of sellers, is established in [16]. A localized P2P trading model for plug-in hybrid electric vehicles in smart grids is proposed in [17], and consortium blockchain technology is explored to improve transaction security without reliance on a trusted third party. A credit-based blockchain framework is constructed in [18] to reduce the calculation cost and promote the energy trading efficiency in the integrated energy distribution system. In [19], an automated DR framework for decentralized scheduling among energy storage systems and a state-machine-driven smart contract for trusted transactions are designed. In [20], a blockchain-based P2P electricity market structure integrating bilateral contract, day-ahead, adjustment, and balancing markets for the big industrial user who has the authority to directly control its own load, is further proposed. Although the existing research includes the diversified application of blockchain in the energy industry, the implementation framework of "Blockchain + DR" has not been established according to the detailed rules of China's demand response transaction.
Under this background, an implementation framework of DR programs in China based on blockchain is designed in this work. Combined with the implementation process of DR in Zhejiang Province of China, the defects of centralized DR management mode in the electricity market environment are firstly sorted out. Then, the technical advantages of blockchain in alleviating the DR programs implementation dilemma are analyzed, and the application scheme of blockchain technology in DR invitation, bidding, settlement, and other processes is proposed. The development direction of DR based on blockchain is also discussed, in order to provide a reference for the marketoriented transaction and standardized management of DR in the energy Internet.
The remainder of this work is organized as follows. In Section 2, two typical DR programs in China and their challenges are introduced. The significance of the combination of blockchain and DR is presented in Section 3. The implementation framework of the DR program based on blockchain is presented in Section 4. The development prospect blockchain-based DR and conclusions are presented in Sections 5 and 6, respectively.

THE MECHANISM AND CHALLENGES OF DR IN CHINA
A series of DR policies and rules have been formulated and implemented in China, which has further deepened the demand side management and eased the operation pressure of power systems. At present, the DR of provinces in China is mainly carried out by invitation of GCs, called the invitation DR program. Through the online state grid platform, DR is implemented, which includes user application, initiation, contract confirmation, DR execution, validity judgment, result publicity, and settlement. At the beginning of each year, users who want to participate in DR need to sign a DR contract with local GC to specify its response capacity. For each specified DR project in the year, GC announces the target load reduction and sends an invitation to contract users. Users who are willing to participate in DR will reply to the invitation, and DR indicators (the desired load reduction of a specified user under the invitation DR program) are allocated by GC according to its target load reduction and the contract capacity of the users. After DR execution, DR validity judgement will be carried out according to specific rules and settlement will be conducted according to the load reduction of users. Besides, some provinces in China have also launched the bidding DR program pilot, and demand response providers (DRPs) are paid based on the demand response energy at the uniform price determined according to their quotations. The DR modes based on invitation and bidding are shown in Figure 1.
As can be seen from Figure 1, DR in China is a centralized transaction mode. The agreement management, market organization, DR indicator allocation, data collection, and settlement are dominated by GCs, and a centralized database is used for data storage. However, with the improvement of the energy Internet and electricity market trading system, the massive demand-side response resources are being awakened, and the number and types of DRPs are gradually increasing. At that time, if the centralized mode is still adopted, it is arduous for GCs to realize low-cost interaction with numerous DRPs. As listed below, the problems of DR in data credibility, transaction efficiency, and market supervision will become increasingly prominent.

Query on the credibility of the centralized database
Considering that any data passing through the centralized database may be distorted, GC needs to answer the questions of market participants about the credibility of data. On the one hand, under the invitation mode, the DR indicator of each DRP is calculated unilaterally by GC according to the feedback of the invitation response, so it is difficult to guarantee the fairness of the allocation process. On the other hand, the actual DR data of DRPs are collected by the terminal equipment of GCs and uploaded to the centralized database, and then used for DR validity judgment and settlement. DRPs may have disputes about DR measurement results, and it is difficult for GCs to prove their innocence.

Disclosure risk of privacy information
At present, the DR bidding market is organized by the GC, to which the quotation of each DRP is open and transparent. Under the bidding mode, the GC is both the demander and the manager of the DR transaction. Due to the disclosure risk of private information such as bidding data, it is easy to cause a trust crisis, affect the fairness of market transactions, thus threatening the interests of market participants.

LAG of DR settlement
DR subsidies are calculated according to the response energy of DRPs. Fund settlement is involved in the process of DR subsidy payment, which requires multi-party reconciliation among banks, DRPs, GCs, and other participants. With the expansion of the DR transaction scale, the traditional DR settlement mechanism will have the problems of low efficiency and high cost, which will cause the lag of DR subsidy approval and distribution, thus reducing the enthusiasm of DRPs.

High GC management costs
Under the current DR program implementation mechanism, the management cost of GC marketing departments in DR transactions is high, including the costs of registration management of market entities, transaction information release, market organization, etc. In addition, GCs also need to invest a lot of money to maintain the security of the centralized database and prevent the loss or damage of user data.

Problems of DR program supervision
In order to effectively supervise DR transactions, the provincial energy administration and other regulatory departments may require access to the centralized database of GCs with high authority of the internal system. However, this may lead to the disclosure of private information and unnecessary market transaction interference, which makes DRPs question the authority of the DR market.

APPLICABILITY ANALYSIS OF THE BLOCKCHAIN IN DR
As an emerging technology in the Internet era, blockchain can be regarded as a decentralized distributed ledger, which ensures that all information is uniformly stored in the database of each participating node in a chain structure through hash algorithm and consensus mechanism, thus providing desired characteristics, such as decentralization, trustworthiness, and traceability [21]. In addition, asymmetric encryption algorithm and hash function are often used to encrypt transaction data and account information, so as to protect user privacy, and ensure the nonrepudiation of transactions [22]. A smart contract, as an important technology of blockchain, takes code as the only execution standard, which can effectively ensure the accuracy and objectivity of the execution process, provide customized means for projects, and expand the application scenarios of blockchain [23]. The corresponding relationship between blockchain technology and its functional characteristics is shown in Figure 2.
The use of technologies involved in blockchains such as distributed ledger and smart contract for certifying DR services allows for the creation of a distributed system in which DRPs can communicate with the GC to provide their flexibility, in a FIGURE 2 Blockchain technology and its characteristics secure, transparent, and traceable way [24]. The details are as follows.

Trusted management and data storage
Distributed ledger and consensus mechanism provide a decentralized solution for DR contract management and data storage. Based on the integration of the blockchain and the IoT, the blockchain gateway can be embedded into intelligent power meters, and the DR-related data are provided to the GC, DRPs, and regulatory agencies through the blockchain broadcast. Therefore, DRPs and regulatory agencies can participate in DR as blockchain nodes, and jointly maintain DR data security with the GC. The application of blockchain fundamentally solves the trust problem in data collection and storage of centralized DR, which, as a result, strengthens the interaction between the GC and DRPs, and improves the latter's recognition of DR.

Privacy protection of DRPs
Blockchain technology is based on the principle of cryptography and mainly uses asymmetric encryption algorithm and hash function. Among them, the former uses pairwise keys, called the public key and the private key, to transmit and verify the information. The bidding and response energy of a DRP is known by the DRP itself and the GC, and not disclosed to other DRPs, thus avoiding privacy data disclosure caused by human factors. The latter is used to encapsulate the blockchain so that the modification of a single bit within a block involves the modification of the whole chain, which makes the data related to DR on the blockchain difficult to be tampered with. In addition, in some cases, one-way hash functions are also used for data authentication.

DR settlement simplification
Through the smart contracts deployed on the blockchain in advance and recognized by the relevant parties of the DR program, the response energy measurement and settlement can be completed automatically, which simplifies the DR implementation process. DR subsidy funds can be automatically allocated by the specified smart contract, which shortens the time for DRPs to obtain subsidies and improves their enthusiasm to provide flexibility.

DR management cost saving
The application of smart contracts makes blockchain have certain advantages in DR management cost saving. Under the traditional centralized DR mode, repetitive management work, such as market participants registration, information release, and transaction organization, are completed by GC, some of which need the participation of the Energy Bureau to provide credibility, making the process complex and the management cost high. Due to the automatic execution of the specified smart contracts and the credibility and traceability of blockchain, the cost of GCs for these repetitive DR management works is effectively reduced. However, just as a coin has two aspects, the establishment and maintenance costs of blockchain should also be considered before applying in DR programs.

Improvement of DR program supervision
Blockchain technology makes DR-related data traceable and unchangeable and ensures the authenticity of DR program supervision. As blockchain nodes, regulatory authorities can participate in the consensus process to obtain the required data without asking the GC for internal system authority, thus avoiding the suspicion of unnecessary intervention by regulators in DR programs and other electricity transactions.

Implementation framework of DR program based on blockchain
For realizing the implementation of the DR program based on blockchain and ensuring efficient and friendly interaction between the user side and the power grid side, the framework of the DR program is designed from a system perspective as shown in Figure 3.
As can be seen in Figure 3, this framework is mainly composed of the physical layer, platform layer, and business layer. The physical layer is based on the power transmission and distribution network of the power IoT and the necessary network communication equipment. The core devices of this layer are DR terminal smart meters (i.e. the DR terminals in Figure 3) and server storage devices, as shown in Figure 3. It is worth mentioning that only the providers of demand-side resources are assigned DR terminals. Through the integration of blockchain and IoT, blockchain gateways are added to the DR data collection terminal for storing data on the chain [25]. In this way, the data consistency of different subjects is guaranteed, data security and user privacy are ensured, and the security issues of data sharing are solved.
The platform layer includes the information network, data structure, and related technologies of the blockchain (e.g. distributed ledger, smart contract, and encryption algorithm). In terms of the composition of blockchain, the chain can be divided into the public chain, consortium chain, and private chain according to the different ways of node participation. Compared with the public chain which has the strongest degree of openness and decentralization, and the private chain which only uses the general ledger technology for accounting, the consortium chain assigns some pre-selected nodes to obtain the accounting right and does not rely on a single subject to endorse the transaction data. Therefore, it is characterized by fewer consensus nodes, high operating efficiency, low cost, and fast transaction speed, and usually serves the industry consortium such as banking and insurance [26]. In addition, in terms of node access, the public chain belongs to the non-license chain where nodes can join in or exit freely; the consortium chain is a permissioned blockchain, which means that only nodes with certain permission can connect the blockchain network. Thus, consortium blockchain is adopted in the blockchain platform for DR transactions when taking the participants and business needs of DR into consideration, as shown in Figure 4.
In Figure 4, the consortium blockchain is composed of GC, large users, various load aggregators (such as aggregators of industrial users, commercial buildings, and electric vehicles) nodes, and the Energy Bureau and financial institutions are also introduced. Besides, DR business management and consistency maintenance are realized by these nodes on the consortium blockchain through the consensus algorithm. It is worth mentioning that all the consensus nodes have rich computing and storage resources to maintain the distributed ledger of blockchain jointly.
As the initiator of DR business, the publisher of transaction information, and the receiver of the feedback demand-side information, the node of GC plays an important role under the framework and is the core member of DR transactions. In summary, the GC is the demander of resources and the distributor of subsidies.
The nodes of large users and load aggregators are the direct participants of DR transactions and the providers of demandside resources. In the process of DR transactions, these nodes decide whether to respond to the invitation of the GC node according to their willingness and response-ability. After reaching the response contract, the demand-side users need to adjust their power load according to the allocation results during the period of response execution.
As the third-party subject in the DR transactions, the node of the Energy Bureau supervises the whole business process and DR trading market. This node reviews the transaction start-up proposal put forward by the GC node before the response day and sends encrypted start-up decision of DR to the GC node within the specified time.
Same as the Energy Bureau node, the node of the financial institution is also a third-party node, which is responsible for exchanging tokens for each participant. It is worth mentioning that subsidy tokens and RMB are anchored in a certain proportion.
In addition, the common user nodes in the consortium blockchain can only query the block information and cannot participate in the process of consensus and block building. If a user joins or exits the consortium blockchain, all the nodes need to reach a consensus, and the user's rights are constrained The smart contract part of the platform layer contains all the smart contract functions involved in the DR program. At the initial period of the blockchain deployment, relevant regulations are formulated by the members of the consortium blockchain jointly. Then, the DR transaction regulations are contracted as several contract functions, which are compiled and deployed on the blockchain through a programming language recognized by the virtual machine, and stored in a certain block [27]. In this way, smart contract functions could be called by consortium blockchain nodes with the correct intelligent contract address, function name, parameter input, and other information during DR transaction to implement a certain function, so as to obtain feedback information, and store the calling process and result in the blockchain. The specific functions of the DR smart contract will be introduced later.

Invitation DR program based on blockchain
Under the framework introduced in Section 3.2, an invitation DR program based on blockchain is designed. The specific process can be divided into four phases, that is, invitation response, invitation confirmation, response execution, and settlement, as shown in Figure 5.
The allocation of DR indicators for power users is one of the core links of the invitation DR program. Since the total DR capability of users agreed in the contract is about 150% of the annual DR plan, GCs usually have a certain margin when FIGURE 6 DR invitation based on the consortium blockchain allocating the total DR indicator, and the DR indicator of each power user is usually lower than its own contractual DR capability. Considering that DR indicators for users are directly related to the subsidy, the fairness of DR indicator allocation by GCs under the traditional centralized mode cannot be generally recognized by power users.
Without changing the original DR invitation process, the public allocation of DR indicators can be realized by the DR transaction platform based on the consortium blockchain through asymmetric encryption and smart contracts, as shown in Figure 6. According to the supply and demand changes of the power grid, the GC determines and uploads the total DR indicator, response area, response period, and other information to the consortium blockchain. Then, GC calls the function of predeposit subsidy to deposit sufficient subsidy tokens in the contract account and broadcasts the DR invitation. In this case, the contracted users can receive the DR request and relevant information on the consortium blockchain and should feedback the decision whether to participate in the given time. After receiving the feedback information from all the contracted users or reaching the deadline of the invitation response period, the GC calls the function of indicator allocation to allocate the indicators for power users according to the DR request information, the feedback participation information of users, and the annual DR contract on the blockchain. The process can be expressed as: where Q i represents the DR indicator for user i in this case; Q i r represents the DR capability signed by user i in the annual contract. Q r sum = ∑ n j =1 k i Q r i represents the total load participating in DR, and k i represents the response of user i, which is a 0/1 variable; Q sum represents the total DR indicator. If the total planned load is greater than or equal to the total indicator of DR, power users' DR indicators are allocated proportionally according to their DR capabilities in the annual contract; otherwise, power users' indicators are determined as the DR capabilities in the contract, and the remaining supply and demand gap of the power grid will be eliminated by orderly power consumption or other means. It worth mentioning that the DR invitation contract consists of the user's DR indicator, baseline load, DR period, and subsidy, which is stored in the consortium blockchain after being multi-signed by the private key of the GC and the power user. In addition, the DR invitation smart contract deployed on the blockchain is jointly recognized and maintained by all the nodes of the consortium blockchain, so that the fairness of DR indicator allocation could be guaranteed effectively.
After the DR execution period, the smart contract obtains users' power measurement data during the execution period and historical reference daily power data uploaded by DR terminals. This transaction then enters the settlement period shown in Figure 5, and the relevant content will be introduced in detail in Section 4.4.

Bidding DR program based on blockchain
Similar to the invitation DR program above, a bidding DR program based on blockchain is designed under the framework introduced in Section 4.1. The specific process can be divided into five phases: transaction release, sealed quotation, open quotation and clearing, response execution, and settlement, as shown in Figure 7.
Bidding and clearing is the most essential link in the bidding DR program. In this program, the DR bidding method based on hash encryption and the quadratic quotation is adopted. This method encrypts the user's bidding information by hash which cannot be solved reversely and adopts the method of repeated quotation (that is, the first quotation adopts sealed quotation, the second quotation is conducted after the bidding deadline, and the user provides the real quotation without encryption during the second quotation). Based on the method, the consistency of the two quotations will be checked to prevent the occurrence of the leakage of user's bidding information and malicious bidding with the help of the tamperresistant of blockchain [28]. In fact, there are lots of encryption algorithms, such as Homomorphic Encryption and Public key encryption algorithm, which can also protect the privacy of bidding information. However, compared with the method proposed in this work, these methods are less efficient, more complex to implement, and cannot be applied to practical application. From the perspective of the specific implementation, the process of "bidding and clearing" is divided into "sealed quotation" and "open quotation and clearing" process, and corresponding functions are designed respectively as follow.

4.3.1
The function of sealed quotation Since the quotation information uploaded by demand-side users to the trading platform in the consortium blockchain are visible to all the nodes, the decentralized clearing process of the DR bidding program requires sealed quotation when the GC is the single demander of DR, that is, the demand-side users cannot know the quotation information of other market entities during the period of submitting a quotation for protecting the privacy and security of participants' quotation data. Therefore, the bidding process is divided into a sealed quotation and an open sealed quotation. During the period of sealed bidding, participants combine their real offer v with a series of self-defined random strings s, and then encrypt the combination into H = S(v, s) as the sealed quotation by taking the hash function that is irreversibly solved and easy to verify. Therefore, the sealed quotation not only contains the real quotation information that cannot be tampered with but also cannot be leaked to other bidders.

The function of open quotation and clearing
After the deadline of the sealed quotation period, the quotation will be opened and cleared. Participants on the demand side at this stage should submit their real quotation v 1 and the custom random string s to the trading platform. The smart contract of blockchain will verify whether the public quotation S(v 1 , s) is consistent with the sealed quotation H. If they are consistent, the bidder's offer is valid; otherwise, it is invalid. After the deadline of the period of the open quotation, the smart contract executes the clearing function such as the Vickery Clarke Groves (VCG) auction according to the obtained effective quotation and calculates the market marginal clearing price and the DR indicator for each participant.
Same as the invitation DR program, the smart contract obtains users' power measurement data during the execution period and historical reference daily power data uploaded by DR terminals after the DR execution period. This transaction then enters the settlement period shown in Figure 7, and the relevant content will be introduced in Section 4.4.

Blockchain-based DR validity judgment and settlement
After the end of the execution period, the system will evaluate the validity and issue the subsidy. The implementation of validity judgment and subsidy issuance is based on the trusted measurement data of DR, while the DR terminals integrated with blockchain gateway and the weakly centralized DR consortium blockchain can store the data reliably. In this way, the cost of data trust in the DR program will be reduced.
After the response, demand-side users can initiate the validity judgment and settlement request as shown in Figure 8, and the contract function of validity judgment is automatically triggered to fetch users' baseline loads, actual energy consumption during the response period, and DR subsidy data that stored in the blockchain to determine the validity of users' DR behaviours. Then, the contract function of settlement is triggered to calculate the subsidy accounting results and complete the settlement. It is worth mentioning that the real-time payment of DR subsidy can be realized through the third-party financial institution node or the financial department of the GC in the consortium blockchain, and the Energy Bureau node can backtrack DR transaction data through the consortium blockchain to improve the efficiency of market supervision.

4.4.1
The function of validity judgment The function of validity judgment is employed to calculate the baseline of historical reference day and average load during the execution period of each user by fetching the load data, historical reference day load data, and users' indicators on the chain [5]. It is noteworthy that the user's baseline load for peak shaving response is calculated from the average load curve of the five working days before the response day and can be represented as: where P i,j,P,0 represents the baseline load of user i during period j for peak shaving response. P i,j,d represents the load of user i during period j of the d th day before the response day. Different from the baseline load for peak shaving response, the baseline load for valley filling response is chosen as the load curve corresponding to the response period of similar power consumption days. Besides, the baseline of the load aggregator is obtained by the superposition of the baselines of the users under its jurisdiction. Then, it judges the validity of participating users' DR behaviour according to the following criteria. When the peak shaving response is implemented, the user's actual response energy can be expressed as: where Q i,P represents the total response energy of m period when user i participates in peak shaving response; P i,j is the actual load of user i during period j. T j represents the accumulated duration of period j. The user is deemed to make an effective response when the actual maximum load of the user is less than the baseline maximum load and the response energy exceeds 50% of its DR indicator Q i,I . Then, the effective response energy Q e i,P is calculated according to 130% of the response indicator and expressed as: Meanwhile, when the valley filling response is implemented, the user's actual and effective response energy can be expressed as: where Q i,V and Q e i,V represent the actual and effective response energy of m periods when user i participates in valley filling response, respectively. It is worth noting that the minimum load of the user is required to be greater than the minimum load of the baseline, and the total response power is calculated as 130% of the response indicator.

4.4.2
The function of DR settlement The function of DR settlement classifies the users according to the response validity, and the invalid response users are recorded in the response blacklist once. At the end of the year, the more times a user counts in the blacklist, the more annual deposits will be deducted. It is worth noting that every participating user has paid the annual deposit. For effective response users, the subsidy amount is calculated according to their response behaviours and the appointed subsidy price and is represented as: where M i represents the total amount of subsidy received for the effective user i; p P and p V represent the unit price of subsidy for peak shaving DR and valley filling DR, respectively. The unit price of peak shaving DR subsidy is 2.0 yuan/kWh, and the unit price of the valley filling DR subsidy is 1.2 yuan/kWh; the unit price of bidding DR is calculated based on the actual market clearing results. Then, the smart contract transfers the subsidy from the contract account to the user's account according to the calculation results. After the settlement, the balance of the pre-deposited token will be returned to the account of GC automatically. It is worth mentioning that the DR implementation rules are adjusted annually according to the demand side, so the relevant function parameters also need to be adjusted in response.

PROSPECT OF BLOCKCHAIN-BASED DR
In the process of promoting the implementation of blockchain technology in DR, GCs are the first to bear the brunt. Selfinnovation is needed in process management and data storage. According to the existing DR invitation, bidding, and subsidy mechanism, provincial GCs should first establish a DR management system based on consortium blockchain technology, which is a weakly centralized system with the GC as the core. Under the condition of ensuring information security of the power system, the GC can manage DR together with regulatory authorities and DRPs, so as to attract more entities to participate in DR programs. The DR management system not only needs the infrastructure of the industrial IoTs, but is also affected by the development of the electricity market mechanism. Accordingly, DR programs should be coordinated with electricity markets, and the reasonable allocation of power resources should be guided by the market price signal. After the initial establishment of the DR management system, the GCs in China should seek breakthroughs in DR in the following three aspects.

More types of DR programs
According to the existing DR implementation rules, if a DRP fails to make an effective response, it will be regarded as a breach of contract, unable to obtain subsidies and listed in the DR blacklist. DRPs on the blacklist are not allowed to participate in follow-up DR programs of the year. Then, an incentive compatible mechanism named DR quota transfer is proposed as a supplementary mechanism for the invitation/bidding DR program, which reduces the invalid response probability of DRPs through P2P DR indicator transaction between DRPs. Before DR program start-up, DRPs can make their expected response meet the validity requirements through mutual DR quota transfer, so as to obtain subsidies. This is similar to the relationship between the day-ahead market and the real-time market in electricity trading. However, with the increasing number of participants in DR, DR quota transfer will have the characteristics of small scale, multi-buyer and multi-seller, which calls for a decentralized trading mode to reduce transaction costs and improve transaction efficiency. Blockchain-based trading system is considered to provide trusted and transparent solutions for these needs, just as it is used in other decentralized transactions such as microgrid energy trading, electric vehicle (EV) charging and discharging, integrated energy system energy trading.

DRP credit management mechanism based on blockchain technology
DR programs are usually implemented to moderate peak electricity demand or balance renewable energy output. The invalid response behaviour will cause the subsidy loss of DRPs, and at the same time, have an adverse impact on the operation of the power systems. Under the idea that GCs are willing to let DRPs with good credit participate in DR, the introduction of DRP credit management (e.g. in the form of credit score) is considered to be the future development trend.
Different from DR quota transfer, the core of DRP credit management is the trusted storage and utilization of data. Considering that the credit score of a specified DRP may affect its DR subsidy and the market-clearing result, a secure, tamperresistant and traceable data storage mechanism is needed, which coincides with the functional characteristics of blockchain shown in Figure 2.
Take invitation DR as an example. If the DRP makes an invalid response, its credit score will be deducted and recorded on the blockchain. Then, the allocation of the DR indicator of each DRP is adjusted according to its own credit score. Taking the product of the DRP's contracted response-ability and its credit score as a reference, the lower the DRP's credit score is, the less DR indicator is allocated. In this way, the GC can allocate more DR indicator to the DRP with a higher credit score, so as to improve the completion rate of the target response. The process can be realized by the smart contract.
For DRPs, the DR credit score mechanism replaces the traditional DR credit management mode, so that DRPs have more opportunities to participate in DR programs. The credit score of DRPs will influence their DR subsidies, so as to encourage them to maintain good credit.

Multi-business power trading platform based on blockchain
In China's electricity market environment, it is unnecessary and questionable to realize the complete decentralization of electricity trading. A weakly centralized systems/platform based on consortium blockchain technology is more reasonable. Compared with various kinds of energy trading and ancillary services in the electricity market, the DR program has lower complexity and lower requirements for transaction efficiency. Therefore, it can be used as a pilot application of blockchain technology in energy trading. However, it can be predicted that with the development and application of blockchain, big data, cloud computing, and other Internet technologies, the blockchain-based DR management system will gradually expand into a multi-business platform integrating DR, spot market, power generation rights trading, and electricity financial market, which is worthy of the attention of GCs.

CONCLUSION
Promoting the transformation from refined development to refined utilization of energy under the background of energy Internet is an important concept for China's GCs. DR is an essential means to practice the concept. It is necessary to reasonably guide users' energy consumption behaviour and improve their awareness, recognition, and enthusiasm for participating in DR.
In this work, a blockchain-based framework for DR is proposed based on the analysis of the defects of China's DR programs and the applicability of blockchain technology. The implementation mechanisms of the invitation DR program and bidding DR program are designed, respectively. Smart contracts are used to evaluate the response validity of DR programs and grant response subsidies. Some suggestions on the development of DR integrated with blockchain are also put forward, such as enriching the market-oriented varieties of DR programs, establishing credit management mechanism of DR programs, and building blockchain-based power trading platform.
Nowadays, the research of blockchain in the energy Internet is in the ascendant, and this work is committed to providing a reference for the practical application of blockchain in China's DR and other electricity transactions. In addition, the framework proposed in this work can provide structural support for the reform of power demand response mode and the development of core business of GCs in the future high-elastic power grid construction in Zhejiang Province of China. In the process of promoting the implementation of blockchain in DR transactions, GCs can reform business management and data interaction according to the suggestions above. Relying on the existing DR trading mechanism, GCs can also build a weak centralized consortium blockchain for DR, and try to carry out DR business management with government departments, power users, and many other subjects, so as to attract more demand-side resources to participate in DR.