Micro-grid dynamic power dispatching and trading method based on block chain
By using blockchain smart contracts to monitor the difference between power generation and consumption in real time, dynamically optimize energy storage strategies, balance supply and demand using the municipal power grid, and record power transaction data on the blockchain, the problems of power waste and transaction settlement difficulties in microgrids are solved, and an efficient and transparent power market is realized.
Patent Information
- Application Number
- CN202511107228.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-08
- Publication Date
- 2025-11-21
AI Technical Summary
In microgrids, unstable wind and solar power generation leads to energy waste or shortages. Traditional dispatching is slow to respond and power trading settlement is difficult. Energy storage devices frequently conflict with the grid, increasing the risk of fluctuations.
By using blockchain smart contracts to monitor the difference between power generation and consumption in real time, energy storage strategies are dynamically optimized, the power grid is used to balance supply and demand, and electricity transaction data is recorded on the blockchain to generate anti-counterfeiting certificates for settlement. The authenticity of transactions is verified by combining meter data and digital signatures.
It has achieved real-time supply and demand balance in microgrids, reduced transaction frictions, improved settlement efficiency, activated the flow of green energy at the community level, and built a transparent and efficient electricity market ecosystem.
Smart Images

Figure CN120999634A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of micro-grid, and particularly to a micro-grid dynamic power dispatching and transaction method based on block chain. BACKGROUND
[0002] The current micro-grid faces two major problems: first, wind and solar power generation is high at times and low at times, and electricity demand is unpredictable, often resulting in a passive situation of wasted surplus electricity or temporary high-priced electricity purchase, and traditional manual dispatching is slow and costly; second, small and micro power generation households want to sell electricity to surrounding users, but electricity settlement relies on manual reconciliation, which is prone to errors and delays, and lack of trust between each other leads to difficulty in reaching a transaction. Although there are automatic dispatching systems that attempt to optimize, electricity trading and financial settlement are still disjointed, often resulting in disputes over not receiving payment for selling electricity or being charged more for buying electricity. More troublesome is that the charging and discharging of energy storage batteries often conflict with the buying and selling of electricity from the power grid, and frequent operation not only wears out equipment but also increases the risk of power grid fluctuations. SUMMARY
[0003] To solve the technical problems in the background art, the present application provides a micro-grid dynamic power dispatching and transaction method based on block chain, which includes a plurality of power generation devices, a plurality of power consumption devices and a plurality of energy storage devices, and the method comprises:
[0004] S1, real-time collection of total power generation P g and total power consumption load P l of all power generation devices and all power consumption devices, and calculation of real-time supply-demand difference ΔP=P g -P l ;
[0005] S2, connecting the micro-grid to the city power grid through a grid connection point, and triggering dynamic transaction according to the value of ΔP: when ΔP>0, preferentially storing excess power to the energy storage device, and only when the remaining capacity of the energy storage device is lower than the preset threshold C min , performing power selling transaction through the city power grid; when ΔP<0, preferentially releasing power from the energy storage device, and only when the released power is insufficient by k% of the supply-demand gap, performing power buying transaction through the city power grid, to achieve supply-demand balance of the micro-grid;
[0006] S3, through the smart contract deployed on the block chain node, automatically recording the power transaction data generated by the power buying transaction or the power selling transaction into the block chain distributed ledger.
[0007] Further, when the real-time supply-demand difference ΔP>0 and the remaining capacity of the energy storage device is lower than C minThe time-triggered electric energy selling transaction specifically includes: uploading the excess electric energy to the city power grid through a blockchain smart contract, and selling it to the designated transaction object in the adjacent area that has signed an energy sharing agreement in advance; during the selling process, the payment of the transaction object is locked by the smart contract and an encrypted debt certificate is generated for subsequent settlement.
[0008] Further, when the real-time supply-demand difference ΔP < 0 and the energy storage device releases power that is less than k% of the supply-demand gap, the electric energy buying transaction is triggered, specifically including: buying electric energy from the city power grid through a blockchain smart contract, and recording the bought electric energy in the smart meter of the transaction object; at the same time, the smart contract destroys the corresponding encrypted debt certificate, and performs a net settlement of funds.
[0009] Further, the transaction object is an adjacent energy subject that has signed a bilateral contract with the microgrid; the electric energy transaction settlement process includes: in the electric energy selling transaction, generating an encrypted debt certificate and locking the funds; in the electric energy buying transaction, destroying the encrypted debt certificate and settling the net difference; all settlements are performed according to a predetermined rolling period to avoid redundant flow of single transaction funds.
[0010] Further, the specific process of the electric energy selling transaction includes: when ΔP > 0 and the remaining capacity of the energy storage is less than C min , the blockchain smart contract automatically uploads the excess electric energy to the city power grid, and transmits the electric energy to the designated transaction object in the adjacent area, and the payment of the transaction object is locked as an encrypted debt certificate stored in the blockchain.
[0011] Further, the specific process of the electric energy buying transaction includes: when ΔP < 0 and the energy storage releases power that is less than k% of the supply-demand gap, the blockchain smart contract buys electric energy from the city power grid, and the bought electric energy is transmitted to the microgrid through the distribution network and recorded in the smart meter of the transaction object, and at the same time, the smart contract destroys the corresponding encrypted debt certificate to trigger a net settlement of funds.
[0012] Further, it also includes: obtaining the smart meter metering data hash value H m of the transaction object, the electric energy transmission data D t of the city power grid, and the electric energy flow direction digital signature mark T flow recorded by the blockchain; performing three-party consistency verification and three-party source authenticity verification through a blockchain smart contract; after verification, synchronously triggering the electric energy ownership transfer operation and the fund settlement operation within a preset time window, wherein the three-party consistency verification needs to satisfy: ||D t -H m ||≤δ, where δ is a preset tolerance error; the three-party source authenticity verification needs to satisfy: T flow contains the digital signature of the microgrid.
[0013] The application provides a micro-grid dynamic power scheduling and transaction method based on a blockchain. The micro-grid intelligent power scheduling and transaction are realized by using the blockchain. The system monitors the power generation and power consumption load difference in real time, dynamically optimizes the energy storage charging and discharging strategy, preferentially stores power when the power is sufficient, triggers the sale of the remaining power when the energy storage is saturated, preferentially calls the energy storage when the power is insufficient, and purchases power from the power grid when the power is insufficient. The anti-forgery transaction voucher is automatically generated by the smart contract, the transaction fund is frozen, and the net settlement is implemented. The transaction is ensured to be tamper-proof through the triple cross verification of the electric meter data, the power grid transmission record and the digital signature. The mechanism enables the distributed energy (such as roof photovoltaic) to safely participate in the market transaction, the source of each kilowatt-hour of electricity can be traced back to the specific power generation equipment, and a credible carbon emission reduction account book is formed. The settlement efficiency is shortened from the traditional period to the near real-time level, the transaction friction is significantly reduced, the community-level green energy flow is activated, and an efficient and transparent distributed power market ecology is constructed. BRIEF DESCRIPTION OF DRAWINGS
[0014] Figure 1 FIG. 1 is a flowchart of a micro-grid dynamic power scheduling and transaction method based on a blockchain according to the application. DETAILED DESCRIPTION
[0015] REFERENCE Figure 1 The application provides a micro-grid dynamic power scheduling and transaction method based on a blockchain. The micro-grid includes a plurality of power generation devices, a plurality of power consumption devices and a plurality of energy storage devices. The method comprises the following steps:
[0016] S1, collecting the total power generation P of all power generation devices in real time g and the total power consumption load P of all power consumption devices l , calculating the real-time supply-demand difference ΔP=P g -P l .
[0017] The power generation device specifically includes a solar panel, a fan and the like. The micro-grid power balance monitoring system realizes real-time data grabbing through the intelligent electric meter network of the power generation end and the power consumption end: the total power generation is the sum of the output power of all solar panels, fans and other power generation devices; the total power consumption is the total consumption power of all power consumption devices. The data is transmitted to the central processor after encryption, and the real-time power difference is obtained by subtraction after time alignment; the positive difference (power generation> power consumption), then the micro-grid power generation is excessive; the negative difference (power consumption> power generation), then the micro-grid power generation is insufficient. The system automatically filters interference signals such as voltage fluctuations to ensure that the result is real and reliable. The difference is updated to the blockchain every second to drive intelligent decision-making: the power is preferentially stored in the energy storage battery when the power is sufficient, and the power is automatically sold to the surrounding area only when the battery is full; the power is preferentially supplied by the energy storage when the power is insufficient, and the power is purchased from the power grid only when the power supply is insufficient.
[0018] S2, connect the micro-grid to the city grid through the access point, and trigger dynamic transactions according to the value of ΔP: when ΔP>0, preferentially store excess power in the energy storage device, and only when the remaining capacity of the energy storage device is lower than the preset threshold C min , carry out power selling transactions through the city grid; when ΔP<0, preferentially release power from the energy storage device, and only when the released power is insufficient to fill k% of the supply-demand gap, carry out power buying transactions through the city grid to achieve supply-demand balance of the micro-grid.
[0019] This step realizes dynamic power allocation by connecting the micro-grid to the access point of the city grid: when the micro-grid generates too much power, preferentially store the excess power in the home battery, and only when the battery is almost full, automatically sell power to the surrounding area; when the power demand is too large, preferentially take power from the battery to supplement, and only when the battery power is not enough, buy power from the city grid. In this way, internal energy storage is preferentially used, improving the efficiency of the battery and reducing the interference of grid fluctuations, while reducing the cost and energy waste of frequent buying and selling of electricity by trading only when necessary, thereby ensuring stable operation of the micro-grid and saving overall expenses.
[0020] When the real-time supply-demand difference ΔP>0 and the remaining capacity of the energy storage device is lower than C min , a power selling transaction is triggered, specifically including: uploading excess power to the city grid through a blockchain smart contract, and selling it to the transaction object of the designated adjacent area that has signed an energy sharing agreement in advance; during the sale process, the payment of the transaction object is locked by the smart contract and an encrypted debt certificate is generated for subsequent settlement.
[0021] The specific process of the power selling transaction includes: when ΔP>0 and the remaining capacity of the energy storage is lower than C min , the blockchain smart contract automatically uploads the excess power to the city grid, and the power is transmitted to the transaction object of the designated adjacent area, and the payment of the transaction object is locked as an encrypted debt certificate stored in the blockchain.
[0022] When the real-time supply-demand difference ΔP<0 and the released power of the energy storage device is insufficient to fill k% of the supply-demand gap, a power buying transaction is triggered, specifically including: buying power from the city grid through a blockchain smart contract, and recording the bought power in the smart meter of the transaction object; at the same time, the smart contract destroys the corresponding encrypted debt certificate, and carries out net settlement based on the net amount.
[0023] The transaction object is an adjacent energy subject that has signed a bilateral contract with the micro-grid; the power transaction settlement process includes: in the power selling transaction, generating an encrypted debt certificate and locking the funds; in the power buying transaction, destroying the encrypted debt certificate and settling the net difference; all settlements are performed according to the predetermined rolling period to avoid redundant flow of single transaction funds.
[0024] The specific process of the electricity purchase transaction includes: when ΔP < 0 and the energy released by the energy storage is less than k% of the supply-demand gap, the smart contract of the blockchain buys electricity from the grid, the purchased electricity is transmitted to the microgrid through the distribution network, and the transaction data is recorded in the smart meter of the transaction object, and the corresponding encrypted debt certificate is destroyed to trigger the net settlement of funds.
[0025] S3, through the smart contract deployed in the blockchain node, the electricity transaction data generated by the electricity purchase transaction or the electricity sale transaction is automatically recorded in the blockchain distributed ledger.
[0026] This step automatically captures the key data of each power transaction such as power generation, power consumption information, transaction time, etc. through the blockchain smart contract, and converts it into an unalterable digital record stored in the shared ledger of all participants. Whenever the microgrid sells electricity to the surrounding area or buys electricity from the grid, the smart contract will immediately generate a unique data packet containing the transaction fingerprint, which is permanently locked on the blockchain after cross-validation by multiple nodes, so that the source and destination of each kilowatt-hour can be traced in real time. Through this automated accounting method, errors that may occur during manual recording are eliminated, and both parties can verify the authenticity of the transaction at any time; through the distributed storage feature, even if some nodes fail, data will never be lost; through encryption technology to protect commercial privacy, data query permission is only open under authorized conditions. This mechanism makes the electricity transaction transparent and reliable like mobile payment, not only speeds up the electricity settlement, but also attracts more small power stations to join the shared network, and finally forms an efficient community energy market.
[0027] S4, obtain the smart meter metering data hash value H of the transaction object from the blockchain distributed ledger m , the electricity transmission data D of the grid t , and the electricity flow direction digital signature mark T recorded by the blockchain flow ; through the blockchain smart contract, three-party consistency verification and three-party source authenticity verification are performed; after verification, the electricity ownership transfer operation and the fund settlement operation are triggered simultaneously within the preset time window, wherein the three-party consistency verification needs to satisfy: ||D t -H m ||≤δ, where δ is a preset tolerance error; the three-party source authenticity verification needs to satisfy: T flow contains the digital signature of the microgrid.
[0028] The step automatically calls the electricity metering fingerprint of the transaction object, the flow record of the city power grid conveying electric energy and the anti-counterfeiting label generated by the block chain through the block chain smart contract. First, it is compared whether the electricity consumption reading and the grid conveying amount are consistent within the allowable error range, and second, it is verified whether the anti-counterfeiting label contains the micro-grid exclusive password seal. When both verifications are passed, the system automatically completes two things within the predetermined time: the electric energy legal ownership is transferred to the buyer's account, and the funds of the buyer and the seller are settled. This three-way data cross-verification mechanism makes every transaction like three notaries on site supervision, which not only eliminates the possibility of electricity meter cheating or electricity charge default, but also compresses the traditional energy settlement period from several days to minutes; through closed-loop verification and automatic execution, small and micro power generation households dare to trade with the large power grid safely, thereby activating idle rooftop solar and other distributed resources to participate in market circulation; through the password seal to lock the transaction source, ensure that green electricity is traceable and reliable, provide tamper-proof account support for carbon emission reduction certification, and finally make the community power market as efficient and reliable as mobile phone transfers.
[0029] The above is only a preferred specific embodiment of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can make equivalent replacements or changes within the technical range disclosed by the present application according to the technical solution and the inventive concept of the present application, which should be covered within the protection scope of the present application.
Claims
1. A blockchain-based method for dynamic power dispatch and trading in microgrids, wherein the microgrid comprises multiple power generation devices, multiple power consumption devices, and multiple energy storage devices, characterized in that, The methods include: S1. Real-time acquisition of the total power generation P of all power generation equipment. g and the total electrical load power P of all electrical equipment l Calculate the real-time supply and demand difference ΔP = P g -P l ; S2. Connect the microgrid to the mains grid through the grid connection point, and trigger dynamic trading based on the value of ΔP: when ΔP > 0, prioritize storing excess energy in energy storage devices, and only proceed when the remaining capacity of the energy storage devices is lower than a preset threshold C. min When ΔP < 0, electricity is sold through the mains grid; when ΔP < 0, electricity is released from the energy storage device first, and only when the released power is less than k% of the supply-demand gap is electricity purchased through the mains grid to achieve supply-demand balance of the microgrid. S3. Through smart contracts deployed on blockchain nodes, electricity transaction data generated from electricity purchase or sale transactions are automatically recorded into the blockchain distributed ledger.
2. The method according to claim 1, characterized in that, When the real-time supply-demand difference ΔP > 0 and the remaining capacity of the energy storage device is lower than C min The process of triggering electricity sales transactions includes: uploading surplus electricity to the municipal power grid via a blockchain smart contract and selling it to designated trading partners in adjacent areas who have pre-signed energy sharing agreements; during the sale process, the payment funds of the trading partners are locked by the smart contract and a cryptographic debt certificate is generated for subsequent settlement.
3. The method according to claim 1, characterized in that, When the real-time supply-demand difference ΔP < 0 and the power released by the energy storage device is less than k% of the supply-demand gap, an electricity purchase transaction is triggered. Specifically, this includes: purchasing electricity from the grid through a blockchain smart contract and recording the purchased electricity in the smart meter of the trading partner; at the same time, the smart contract destroys the corresponding encrypted debt certificate and performs fund settlement based on the net amount.
4. The method according to claim 2 or 3, characterized in that, The trading partners are adjacent energy entities that have signed bilateral contracts with the microgrid; the electricity trading settlement process includes: in electricity selling transactions, generating encrypted debt certificates and locking funds; in electricity buying transactions, destroying encrypted debt certificates and settling the net difference; all settlements are executed according to a predetermined rolling cycle to avoid redundant flow of funds in a single transaction.
5. The method according to claim 4, characterized in that, The specific process of selling electricity includes: when ΔP > 0 and the remaining energy storage capacity is lower than C. min At that time, the blockchain smart contract automatically uploads excess electricity to the municipal power grid and directs the electricity to the trading partners in the designated adjacent area. The fees paid by the trading partners are locked as encrypted debt certificates and stored on the blockchain.
6. The method according to claim 4, characterized in that, The specific process of electricity purchase transactions includes: when ΔP < 0 and the energy storage release power is less than k% of the supply-demand gap, the blockchain smart contract purchases electricity from the grid, the purchased electricity is transmitted to the microgrid through the distribution network and recorded in the smart meter of the trading object, and at the same time the smart contract destroys the corresponding encrypted debt certificate to trigger net settlement of funds.
7. The method according to claim 1, characterized in that, Also includes: Obtain the hash value H of the smart meter metering data of the transaction object from the blockchain distributed ledger. m Power transmission data D from the municipal power grid t And the flow of electricity recorded by the blockchain to the digital signature tag T flow The blockchain smart contract executes three-party consistency verification and verification of the authenticity of the three-party sources. After successful verification, the power ownership transfer operation and fund settlement operation are triggered simultaneously within a preset time window. The three-party consistency verification must satisfy: ||D t -H m ||≤δ, where δ is the preset tolerance error; the authenticity verification of third-party sources must satisfy: T flow Includes the digital signature of this microgrid.