| In the context of the steady development of power ratail side reform,more and more users in the distribution network will be transformed from traditional consumers to prosumers,being able to participate in the market-based energy trading.Stakeholders can be connected by setting up a trading mechanism.The technical features of blockchain,security and trustworthy,openness and transparency,collective maintenance provide a new solution for transactional execution and information security issues of distributed energy.However,the current attempts to apply blockchain to the energy field are still largely in the stage of theoretical research and proof-of-concept.There is a lack of trading models and market rules,so the relevant research is urgently needed.Firstly,the principle of blockchain technology is introduced.The engineering application and system conception of blockchain and smart contract in the energy field,and the research status at home and abroad of the combination of blockchain and distributed transaction are outlined,which lays the foundation for subsequent research.Secondly,the market-based trading mechanism of distributed generation considering risk attitude based on blockchain is studied.Trading rules and trading processes that combine the characteristics of blockchain are proposed.The calculation and adaptive adjustment of bid in each round are automatically completed according to the initial parameters of the market members by using risk-based bilateral bidding strategy.The market clearing model considering the use of system charge,and security check and congestion management based on blockchain are established.The results of the example show that the market clearing model considering the use of system charge can encourage distributed generation and users to complete proximal transactions.Then,the market-based trading mechanism of distributed generation applying best response based on blockchain is studied.Trading rules and trading processes that combine the characteristics of blockchain are proposed.Based on non-cooperative game theory,applying best response dynamics to the bilateral bidding optimization process,and correcting utility function by considering the use of system charge in order to seek the coupling point of individual optimization strategies that all market members are satisfied.The prediction error processing mechanism and settlement by utilizing blockchain are proposed.The results of the example show that the best response dynamic adjustment of bilateral bidding strategy considering the use of system charge is helpful to achieve the goal of promoting local consumption of distributed energy.Finally,the writing and debugging of smart contract are studied based on Remix.Combining risk-based trading mechanism and best response trading mechanism,the creation of variables and realization of functions in several smart contracts,such as bidding optimization,double auction,congestion management and settlement are completed.The optimal calculation of bid is completed off-chain,and the clearing and settlement of market are carried out on the blockchain.The compilation and debugging of smart contracts are carried out under the Remix development environment of Ethereum.The test results show that the functions in the smart contract can meet the expected functional requirements and realize the automated and trusted power transactions. |