| With the country’s promotion of power market reforms and the rapid development of distributed generation technology,distributed generation equipment will quickly enter various communities.A large number of power users or power companies will purchase distributed power generation equipment for self-production and sales of power,and the generation of a large number of distributed power consumers will increase the burden on the power grid.Relevant departments today purchase large-scale power grids in the form of power subsidies for the power produced by distributed power producers and consumers.In this situation,the price of electricity subsidies is low and not flexible enough,which will eliminate the enthusiasm of the distributed energy producers.Therefore,relevant departments encourage distributed power producers to complete local energy consumption,and they want to efficiently complete local power consumption within the microgrid.The urgent task is to establish an open,transparent,efficient and credible trading mechanism.Compared with the traditional electricity market,the barriers to entry for microgrids are low,transaction individuals tend to be more profitable and transactions are unstable,and distributed capacity equipment is characterized by instability and volatility.The traditional centralized transaction model relies on third-party trust institutions to maintain the trust of transaction subjects.It has the following disadvantages: high trust maintenance costs,low transaction efficiency,centralized data storage are vulnerable to attacks,and recovery is difficult.Therefore,this article introduces blockchain technology into the microgrid energy trading scenario.Blockchain technology has the characteristics of decentralization and immutability,which can effectively solve problems such as high trust costs and easy data attack.This article proposes a microgrid-based energy transaction method based on blockchain technology.First,a blockchain-based microgrid transaction process is designed to convert physical electrical energy transactions into electrical energy ownership key transactions.A smart contract is designed in detail and relies on intelligent The contract completes decentralized transactions to protect the rights and interests of both parties in the transaction.Then,an energy order matching algorithm based on the auction algorithm and a consumer bidding strategy are proposed to complete the rapid matching of energy orders and improve the micro grid transaction efficiency and local consumption capacity.After that,the micro-grid credit rating mechanism is designed,taking the credit value as the basic attribute of the node,and the credit-based consensus mechanism is designed to influence the probability of node mining success with the credit value,and economically encourage the micro-grid node to be honest and trustworthy.The microgrid power order trading platform was implemented,and functions such as order publishing and deletion,order browsing,and power trading were implemented through the Ethereum platform.Finally,the simulation results prove that the microgrid transaction process and smart contract proposed in this paper can work as expected,the power order matching algorithm can effectively improve the local power consumption of microgrid power,and the credit-based consensus mechanism can effectively complete the credit value affecting nodes Probability of mining success. |