A blockchain-based distributed energy storage energy transaction management method
By using blockchain technology and smart contracts, the performance capabilities and green attributes of energy storage nodes are quantified, and energy traceability tokens are generated. This solves the problems of trust deficiency and inefficient matching in the electricity market transactions of distributed energy storage systems, and realizes an efficient and transparent transaction process and green energy management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-31
- Publication Date
- 2026-06-26
AI Technical Summary
Distributed energy storage systems face challenges in electricity market transactions, including high transaction risks, high trust costs, and low resource allocation efficiency. Furthermore, traditional centralized trading platforms fail to comprehensively consider the multidimensional factors of nodes, resulting in suboptimal matching outcomes.
By using blockchain technology and a trust value calculation model, the performance capability and green attributes of energy storage nodes are quantified. Combined with smart contracts, energy traceability tokens are generated to realize the on-chain storage and traceability of transaction parameters and trust characteristics. The matching is carried out by comprehensively considering factors such as trust value, price, and power. The transaction process is optimized by using performance guarantee and deviation penalty mechanism.
It reduces transaction risks, improves resource allocation efficiency, achieves global optimal matching, supports green electricity certification and carbon emission accounting, enhances transaction transparency and system reliability, and incentivizes nodes to improve their compliance rate.
Smart Images

Figure CN122288254A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of blockchain and new energy storage technology, and in particular to a distributed energy storage energy trading management method based on blockchain. Background Technology
[0002] With the large-scale grid connection of renewable energy, distributed energy storage systems (such as electric vehicles, residential energy storage, and industrial and commercial energy storage) play a crucial role as a flexible regulatory resource in smoothing renewable energy fluctuations and improving grid stability. However, distributed energy storage currently faces the following technical challenges in participating in electricity market transactions: First, massive distributed energy storage nodes have different operating characteristics and reliability. When selecting discharge services, buyers lack objective and quantifiable indicators to assess the credibility of potential sellers, resulting in high transaction risks and high trust costs.
[0003] Secondly, traditional centralized trading platforms need to collect supply and demand information from all nodes and then match them using simple rules (such as price priority). This fails to take into account the multi-dimensional factors of other nodes, resulting in suboptimal matching results and inefficient resource allocation. Summary of the Invention
[0004] To address the aforementioned technical problems, this application proposes a blockchain-based distributed energy storage energy trading management method, comprising: S1: Each energy storage node collects its own historical transaction records within a preset historical period, extracts the actual discharge amount and agreed discharge amount of each transaction from the historical transaction records, and calculates the historical discharge fulfillment rate. Extract the electricity source data for each charge from the historical transaction records and calculate the historical green electricity consumption ratio. It also collects the time interval from receiving the scheduling instruction to starting to discharge for each energy storage node in each transaction, and calculates the historical average response time. .
[0005] Historical discharge fulfillment rate The calculation method is as follows: In the historical transaction records of each energy storage node, for each transaction, using... As the single-time fulfillment rate, the arithmetic mean of all single-time fulfillment rates is taken as... ; The historical green energy consumption ratio This refers to the average proportion of renewable energy in the electricity used by an energy storage node during each historical charging process. The calculation method is as follows: extract the power source data for each charge from historical transaction records, obtain the proportion of renewable energy power used in that charge from the grid dispatch system or renewable energy certification agency through an oracle, and then take the arithmetic mean of the renewable energy power proportions of all charging events as the calculation method.
[0006] This step quantifies the node's performance capability and green attributes using objective historical data, improving the comprehensiveness of the trust assessment and laying the foundation for subsequent trust value calculation.
[0007] S2: Each energy storage node determines its historical discharge compliance rate. Historical average response time and the historical green energy consumption ratio Calculate your own trust value using a trust value calculation model. .
[0008] The trust value calculation model is as follows: ; in, The maximum allowed response time is preset. , , The weighting coefficients and 1. Can be dynamically adjusted according to market preferences or system objectives; Trust value The value ranges from 0 to 1, with higher values indicating more trustworthy nodes.
[0009] Furthermore, , , The system is dynamically adjusted periodically based on the historical transaction performance of all energy storage nodes in the network. The adjustment period is a preset time interval or number of transactions.
[0010] Better Set to 30 minutes.
[0011] This step integrates multi-dimensional historical performance into a comprehensive trust value, which can be directly used in subsequent matching. The higher the trust value, the more reliable and environmentally friendly the node is.
[0012] S3: Each energy storage node will calculate the trust value. It packages its own identity identifier and stores it on the blockchain through smart contracts, forming a trust value database that can be verified across the entire network.
[0013] On-chain storage of trust values ensures data transparency and immutability, avoiding the risk of centralized platforms tampering with trust data; the network-wide shared trust value database provides buyers with a unified basis for decision-making, reducing trust costs.
[0014] S4: All energy storage nodes S that are ready to sell electricity send transaction declaration information to the smart contract in the blockchain network through their clients.
[0015] The application information includes each energy storage node in S. Current discharge volume to be sold and discharge price , where i is the index number of all energy storage nodes S that are ready to sell electricity.
[0016] S5: After receiving the declaration information, the smart contract calls the trust value database to obtain the energy storage nodes in S. Current trust value The smart contract generates a unique energy traceability token and a corresponding identifier for the energy traceability token.
[0017] The metadata of the energy traceability token includes , , And generate timestamps.
[0018] The Energy Traceability Token integrates transaction parameters and trust feature values, providing a core carrier for subsequent traceability. The identifier corresponding to the Energy Traceability Token ensures the distinguishability of each transaction, and the metadata contains key information such as device health, enhancing the depth of traceability.
[0019] S6: The smart contract broadcasts the generated energy traceability token to the blockchain network and stores the metadata of the energy traceability token in a distributed storage system.
[0020] Furthermore, the hash value of the energy traceability token's metadata will also be recorded on the blockchain.
[0021] S7: As the first energy storage node of the buyer, it sends a power purchase request to the smart contract through its client.
[0022] The electricity purchase request includes the required electricity amount. and acceptable price range ,in The lowest price that the buyer can accept. This is the highest price the buyer can accept.
[0023] S8: The smart contract responds to the electricity purchase request by obtaining all current energy traceability tokens from the blockchain and the trust value of the energy storage node corresponding to each energy traceability token from the trust value database, and determines the maximum value among all energy storage nodes as the highest trust value in the entire network. .
[0024] S9: The smart contract iterates through all energy traceability tokens, and for each energy traceability token, according to... And calculate the matching degree between it and the electricity purchase request based on the preset transaction matching model. .
[0025] The transaction matching model is as follows: ; in, , , To match the weight coefficients and satisfy + + =1, The midpoint of the price range and = .
[0026] Furthermore, in step S8, the smart contract also obtains the geographical coordinates of the energy storage node corresponding to each energy traceability token, and calculates the relationship between the first energy storage node and each energy storage node in S before step S9. Geographical distance ; when Less than the preset distance threshold At that time, for the corresponding energy storage node By introducing a geographical proximity factor into the transaction matching model, the transaction matching model is expanded to: ; in, This is the location weight coefficient, used to adjust the influence of geographical location on the matching degree, satisfying 0 < <1.
[0027] Determining the highest trust feature value across the entire network provides a benchmark for matching degree calculation, ensuring the effectiveness of trust value weights; geographical distance calculation provides data support for introducing proximity factors, which can reduce losses caused by long-distance power transmission and improve energy utilization efficiency.
[0028] S10: The smart contract compares the matching degree of all energy traceability tokens. Matching degree The energy storage node corresponding to the highest energy traceability token is designated as the second energy storage node. The second energy storage node is determined as the counterparty in the transaction, i.e., the seller, and the metadata of the energy traceability token of the second energy storage node is output as the matching result.
[0029] Furthermore, if multiple energy traceability tokens have the same matching degree, the second energy storage node will be selected according to the time priority principle (the energy traceability token generated first takes priority).
[0030] Selecting counterparties based on quantitative matching ensures the objectivity and scientific nature of the decision-making process, allows buyers to clearly understand the matching logic, and improves transaction transparency.
[0031] S11: The smart contract responds to the matching result and automatically generates a delivery order.
[0032] The delivery order must include at least the identifiers of the two parties to the transaction and the agreed discharge amount. Agreed electricity price and the preset delivery time window .
[0033] in, ,and , These are the discharge volume and discharge price that the second energy storage node currently intends to sell, both of which belong to the metadata of the energy traceability token of the second energy storage node.
[0034] Furthermore, if Then the first energy storage node can target the remaining power. - The power purchase request was initiated again.
[0035] Furthermore, after generating a delivery order, the generated delivery order is also recorded on the blockchain; the smart contract also uses the trust value of the second energy storage node in the metadata of the energy traceability token. The performance bond G is calculated using the following formula: ;in The preset risk coefficient; Preferably, the preset risk coefficient The value ranges from 0.5 to 1.0.
[0036] The smart contract deducts the margin from the account of the second energy storage node and holds it in escrow to guarantee that the second energy storage node will be delivered on time according to the agreed discharge amount.
[0037] The automatic generation of delivery orders avoids the tediousness and errors of manual drafting; the core parameters of the order are clear, providing a clear basis for subsequent performance and settlement; on-chain storage ensures that the order content cannot be tampered with, protecting the legitimate rights and interests of both parties to the transaction.
[0038] S12: The smart contract locks the corresponding discharge capacity of the second energy storage node according to the delivery order, ensuring that it has at least [capacity] within the delivery time window. The amount of dischargeable quantity.
[0039] The discharge capacity lock-in mechanism technically guarantees the seller's ability to fulfill its obligations and improves the success rate of transactions.
[0040] S13: During the delivery time window Within the system, the local controller of the second energy storage node controls the energy storage unit to discharge according to the instructions of the smart contract, while the local controller of the first energy storage node controls the energy storage unit to charge, thereby realizing the actual physical transfer of energy.
[0041] The energy transfer based on smart contract instruction execution automates the transaction process and reduces human intervention; funds are first transferred to a custodian account to reserve space for subsequent settlement adjustments and ensure fund security.
[0042] Furthermore, it also includes: S14: During the actual energy transfer process, the second energy storage node collects the actual discharge amount in real time at a preset frequency, and calculates the actual total discharge amount after the delivery is completed. and deviation rate And the smart contract is based on the agreed electricity price. and agreed discharge amount Calculate the amount due, and then transfer the amount due from the account of the first energy storage node to the account of the second energy storage node; At the same time, the actual discharge amount and deviation rate will be digitally signed and stored on the blockchain, and the data hash obtained from the digital signature will be recorded on the blockchain. S15: The smart contract, based on the deviation rate Update the historical discharge fulfillment rate of the second energy storage node, and include the fulfillment rate of this transaction. Add to historical transaction records.
[0043] Furthermore, S14 also includes the following settlement price adjustment steps: The actual total discharge amount was calculated after the delivery was completed. and deviation rate Then, the smart contract determines the deviation rate. For agreed electricity price Adjustments were made, and the final settlement price was calculated. ,in This is the preset penalty coefficient; Finally, based on the final settlement price... Triggering fund transfer, to Replace the agreed electricity price Perform transaction settlement and calculate the actual amount payable. = .
[0044] Preferably, the preset penalty coefficient The value ranges from 1.5 to 2.5.
[0045] The settlement price is dynamically adjusted in conjunction with the deviation rate, which not only punishes default behavior and enhances the flexibility and rationality of the pricing mechanism, but also incentivizes energy storage nodes to improve their performance.
[0046] Furthermore, after step S14, the following margin G processing steps are also included: like If the deposit G is not refunded, the deposit will be fully refunded to the account of the second energy storage node. like Then, according to the deduction ratio After deducting the margin G, a portion of G× will be deducted. Automatic compensation is given to the account of the first energy storage node, with the remaining portion being G×(1- The refund will be returned to the account of the second energy storage node; in, The preset deviation threshold, The preset maximum permissible deviation rate, when The entire security deposit G will be deducted.
[0047] The margin rules enable precise risk management, and the dynamic refund mechanism of the margin incentivizes sellers to comply with the contract.
[0048] The beneficial effects of the distributed energy storage energy trading management method based on blockchain of the present invention are as follows: (1) The reliability and green attributes of nodes are quantified by multi-dimensional trust value calculated based on historical objective data, which provides a scientific basis for the selection of trading objects and reduces the trading risk; (2) The matching degree is calculated by comprehensively considering multiple factors such as trust value, price, and electricity, so as to achieve global optimal matching and improve resource allocation efficiency; (3) The energy traceability token is combined with the delivery data stored on the chain to construct a full life cycle traceability chain from production to consumption, which supports green electricity certification and carbon emission accounting; (4) Through the performance bond and deviation penalty mechanism, the behavior of node delivery is economically constrained, which incentivizes nodes to improve the performance rate and improves the overall reliability of the system; (5) The intelligent measurement equipment signs the data in the trusted execution environment and puts the hash on the chain to ensure the credibility and immutability of the data source; (6) Users can intuitively understand the detailed transaction information of the purchased electricity through the traceability interface, which enhances market trust and promotes green electricity consumption; at the same time, it provides an efficient penetrating audit interface for regulatory agencies, which helps to prevent market manipulation and maintain a fair trading environment. Attached Figure Description
[0049] Figure 1 This is a schematic diagram illustrating the transaction matching relationship of a blockchain-based distributed energy storage energy trading management method according to the present invention. Detailed Implementation
[0050] To provide a further understanding of the purpose, structure, features, and functions of the present invention, detailed descriptions are provided below with reference to specific embodiments.
[0051] Example: This example illustrates a blockchain network containing multiple distributed energy storage nodes, where one energy storage node acts as the buyer and two other energy storage nodes act as sellers. This invention provides a blockchain-based distributed energy storage energy trading management method, comprising: S1: Each energy storage node collects its own historical transaction records within a preset historical period, extracts the actual discharge amount and agreed discharge amount of each transaction from the historical transaction records, and calculates the historical discharge fulfillment rate. Extract the electricity source data for each charge from the historical transaction records and calculate the historical green electricity consumption ratio. It also collects the time interval from receiving the scheduling instruction to starting to discharge for each energy storage node in each transaction, and calculates the historical average response time. ; In this embodiment, each energy storage node collects historical transaction records within a preset historical period (the most recent 30 days) through its smart metering device. The energy storage node records the actual discharge amount of each transaction. With the agreed discharge amount Calculate the single-time fulfillment rate The historical discharge compliance rate of the energy storage node is obtained by taking the arithmetic mean of all single compliance rates. .
[0052] The energy storage node extracts the power source data for each charge from historical transaction records. It then obtains the proportion of renewable energy used for that charge from the grid dispatch system or renewable energy certification bodies via an oracle. The arithmetic mean of the renewable energy proportions for all charging events is then calculated to obtain the historical green electricity consumption ratio. Historical green energy consumption ratio It refers to the average proportion of renewable energy in the electricity used by an energy storage node during each charging process in the past.
[0053] Simultaneously, the time interval from receiving the scheduling instruction from the smart contract to the smart measurement device detecting the start of discharge is collected for each transaction. Calculate the arithmetic mean of all time intervals as the historical average response time. .
[0054] S2: Each energy storage node determines its historical discharge compliance rate. Historical average response time and the historical green energy consumption ratio Calculate your own trust value using a trust value calculation model. ; The trust value calculation model is as follows: ; in, The maximum allowed response time is preset. , , The weighting coefficients and 1. Can be dynamically adjusted according to market preferences or system objectives; Trust value The value ranges from 0 to 1, with higher values indicating more trustworthy nodes.
[0055] Furthermore, , , The system is dynamically adjusted periodically based on the historical transaction performance of all energy storage nodes in the network. The adjustment period is a preset time interval or number of transactions.
[0056] S3: Each energy storage node will calculate the trust value. It packages its own identity identifier and stores it on the blockchain through smart contracts, forming a trust value database that can be verified across the entire network.
[0057] Each energy storage node sends its trust value and identity identifier to a smart contract, which is then recorded after blockchain consensus. All nodes can publicly query this information, ensuring the transparency and immutability of the data.
[0058] S4: All energy storage nodes S that are ready to sell electricity send transaction declaration information to the smart contract in the blockchain network through their clients.
[0059] Energy storage nodes, denoted as set S, that are ready to sell electricity send transaction declaration information through a client. The declaration information includes the amount of discharge that each node intends to sell. and discharge price , where i is the index number of the energy storage node in set S. The application information is sent to the smart contract after being digitally signed by the client.
[0060] S5: After receiving the declaration information, the smart contract calls the trust value database to obtain the energy storage nodes in S. Current trust value The smart contract generates a unique energy traceability token and a corresponding identifier for the energy traceability token.
[0061] After the smart contract verifies the validity of the signature, it retrieves the trust value of each reporting node from the trust value database and generates a unique energy traceability token for each reporting node.
[0062] The metadata of the energy traceability token includes , , And generate timestamps.
[0063] S6: The smart contract broadcasts the generated energy traceability token to the blockchain network and stores the metadata of the energy traceability token in a distributed storage system.
[0064] The metadata of the energy traceability token is stored in the IPFS distributed storage system, which returns the corresponding content identifier. At the same time, the smart contract records the content identifier as a metadata hash value on the blockchain and associates it with the token identifier to ensure data integrity and verifiability.
[0065] S7: As the first energy storage node of the buyer, it sends a power purchase request to the smart contract through its client.
[0066] The first energy storage node sends a power purchase request, which includes the required amount of electricity. and acceptable price range ,in The lowest price that the buyer can accept. This is the highest price the buyer can accept.
[0067] S8: The smart contract responds to the electricity purchase request by obtaining all current energy traceability tokens from the blockchain and the trust value of the energy storage node corresponding to each energy traceability token from the trust value database, and determines the maximum value among all energy storage nodes as the highest trust value in the entire network. .
[0068] The smart contract iterates through all energy traceability tokens on the current blockchain, retrieves the trust value of the corresponding energy storage node from the trust value database, and finds the maximum value as the highest trust value in the entire network, providing a normalized benchmark for subsequent matching degree calculations.
[0069] S9: The smart contract iterates through all energy traceability tokens, and for each energy traceability token, according to... And calculate the matching degree between it and the electricity purchase request based on the preset transaction matching model. .
[0070] The transaction matching model is as follows: ; in, , , To match the weight coefficients and satisfy + + =1, The midpoint of the price range and = It takes into account trust level, price deviation and battery capacity matching.
[0071] Furthermore, considering geographical location factors, in step S8, the smart contract also obtains the geographical location coordinates of the energy storage node corresponding to each energy traceability token and the first energy storage node, and calculates the relationship between the first energy storage node and each energy storage node in S using the geographical location coordinates before step S9. Geographical distance .
[0072] when Less than the preset distance threshold When a geographical proximity factor is introduced into the transaction matching model, the transaction matching model is expanded to: ; in, The position weight coefficient satisfies 0 < <1.
[0073] S10: The smart contract compares the matching degree of all energy traceability tokens. Matching degree The energy storage node corresponding to the highest energy traceability token is designated as the second energy storage node. The second energy storage node is determined as the counterparty in the transaction, i.e., the seller, and the metadata of the energy traceability token of the second energy storage node is output as the matching result.
[0074] If multiple energy traceability tokens have the same matching degree, the second energy storage node will be selected according to the time priority principle (the energy traceability token generated first takes priority).
[0075] S11: The smart contract responds to the matching result and automatically generates a delivery order.
[0076] The delivery order must include at least the identifiers of the two parties to the transaction and the agreed discharge amount. Agreed electricity price and the preset delivery time window .
[0077] in, ,and , These are the discharge volume and discharge price that the second energy storage node currently intends to sell, both of which belong to the metadata of the energy traceability token of the second energy storage node.
[0078] Furthermore, if Then the first energy storage node can target the remaining power. - The power purchase request was initiated again.
[0079] Furthermore, after generating a delivery order, the generated delivery order is also recorded on the blockchain; the smart contract also uses the trust value of the second energy storage node in the metadata of the energy traceability token. The performance bond G is calculated using the following formula: ;in The preset risk coefficient; Preferably, the preset risk coefficient The value ranges from 0.5 to 1.0.
[0080] The smart contract deducts the margin from the account of the second energy storage node and holds it in escrow to guarantee that the second energy storage node will be delivered on time according to the agreed discharge amount.
[0081] S12: The smart contract locks the corresponding discharge capacity of the second energy storage node according to the delivery order, ensuring that it has at least [capacity] within the delivery time window. The amount of dischargeable quantity.
[0082] The smart contract deducts from the available capacity of the second energy storage node. This is to prevent the capacity from being sold repeatedly.
[0083] S13: During the delivery time window Within the system, the local controller of the second energy storage node controls the energy storage unit to discharge according to the instructions of the smart contract, while the local controller of the first energy storage node controls the energy storage unit to charge, thereby realizing the actual physical transfer of energy.
[0084] Furthermore, it also includes: S14: During the actual energy transfer process, the second energy storage node collects the actual discharge amount in real time at a preset frequency, and calculates the actual total discharge amount after the delivery is completed. and deviation rate And the smart contract is based on the agreed electricity price. and agreed discharge amount Calculate the amount due, and then transfer the amount due from the account of the first energy storage node to the account of the second energy storage node; Meanwhile, the intelligent measurement equipment measures the actual total discharge in a trusted execution environment. Sum of deviations Digital signatures are performed, the signed complete data is stored in a distributed storage system, and the data hash is recorded on the blockchain to ensure that the data source is trustworthy and tamper-proof.
[0085] Furthermore, this step also includes the following settlement price adjustment steps: The actual total discharge amount was calculated after the delivery was completed. and deviation rate Then, the smart contract calculates the deviation rate. For agreed electricity price Adjustments were made, and the final settlement price was calculated. : ; in This is a preset penalty coefficient. Then, based on the final settlement price... Replace the agreed electricity price Perform transaction settlement and calculate the actual amount payable. = The actual amount payable will be transferred from the account of the first energy storage node. To the account of the second energy storage node, to achieve Alternative Complete transaction settlement.
[0086] S15: The smart contract, based on the deviation rate Update the historical discharge fulfillment rate of the second energy storage node, and include the fulfillment rate of this transaction. Add to historical transaction records.
[0087] The smart contract will determine the fulfillment rate of this transaction. The historical fulfillment rate sequence of the second energy storage node is added for subsequent transactions.
[0088] Furthermore, after step S14, the following margin G processing steps are also included: like If the deposit G is not refunded, the deposit will be fully refunded to the account of the second energy storage node. like Then, according to the deduction ratio After deducting the margin G, a portion of G× will be deducted. Automatic compensation is given to the account of the first energy storage node, with the remaining portion being G×(1- The refund will be returned to the account of the second energy storage node; in, The preset deviation threshold, The preset maximum permissible deviation rate, when The entire security deposit G will be deducted.
[0089] Through the above steps, this invention achieves reliable matching, dynamic adjustment, and closed-loop optimization of distributed energy storage transactions, effectively solving the problems mentioned in the background technology, such as lack of trust, inefficient matching, unclear energy sources, and weak performance guarantee.
[0090] The present invention has been described by the above-described embodiments; however, these embodiments are merely examples for implementing the present invention. It must be noted that the disclosed embodiments do not limit the scope of the present invention. Conversely, any modifications and refinements made without departing from the spirit and scope of the present invention are within the scope of patent protection of the present invention.
Claims
1. A blockchain-based distributed energy storage energy trading management method, characterized in that, Includes the following steps: S1: Each energy storage node collects its own historical transaction records within a preset historical period, extracts the actual discharge amount and agreed discharge amount of each transaction from the historical transaction records, and calculates the historical discharge fulfillment rate. ; Extract the power source data for each charge from the historical transaction records to calculate the historical green electricity consumption ratio. ; It also collects the time interval from receiving the scheduling instruction to starting to discharge for each energy storage node in each transaction, and calculates the historical average response time. ; S2: Each energy storage node determines its historical discharge compliance rate. Historical average response time and the historical green energy consumption ratio Calculate your own trust value using a trust value calculation model. ; The trust value calculation model is as follows: ; in, To preset the maximum allowable response time, , , The weighting coefficients and 1; S3: Each energy storage node will calculate the trust value. The identity identifiers are packaged and stored on the blockchain through smart contracts, forming a trust value database that can be verified across the entire network; S4: All energy storage nodes S that are ready to sell electricity send transaction declaration information to the smart contract in the blockchain network through their clients; The application information includes each energy storage node in S. Current discharge volume to be sold and discharge price , where i is the index number of all energy storage nodes S that are ready to sell electricity; S5: After receiving the declaration information, the smart contract calls the trust value database to obtain the energy storage nodes in S. Current trust value The smart contract generates a unique energy traceability token and a corresponding identifier for the energy traceability token. The metadata of the energy traceability token includes , , And generate timestamps; S6: The smart contract broadcasts the generated energy traceability token to the blockchain network and stores the metadata of the energy traceability token in a distributed storage system; At the same time, the hash value of the energy traceability token's metadata will also be recorded on the blockchain; S7: As the first energy storage node of the buyer, it sends a power purchase request through its client to the smart contract; The electricity purchase request includes the required electricity amount. and acceptable price range ,in The lowest price that the buyer can accept. The highest price the buyer can accept; S8: The smart contract responds to the electricity purchase request by obtaining all current energy traceability tokens from the blockchain and the trust value of the energy storage node corresponding to each energy traceability token from the trust value database, and determines the maximum value among all energy storage nodes as the highest trust value in the entire network. ; S9: The smart contract iterates through all energy traceability tokens, and for each energy traceability token, according to... And calculate the matching degree between it and the electricity purchase request based on the preset transaction matching model. ; The transaction matching model is as follows: ; in, , , To match the weight coefficients and satisfy + + =1, The midpoint of the price range and = ; S10: The smart contract compares the matching degree of all energy traceability tokens. Matching degree The energy storage node corresponding to the highest energy traceability token is designated as the second energy storage node. The second energy storage node is determined as the counterparty in the transaction, i.e., the seller, and the metadata of the energy traceability token of the second energy storage node is output as the matching result. S11: The smart contract responds to the matching result and automatically generates a delivery order; The delivery order must include at least the identifiers of the two parties to the transaction and the agreed discharge amount. Agreed electricity price and the preset delivery time window ; , These are the discharge volume and discharge price that the second energy storage node currently intends to sell, both of which belong to the metadata of the energy traceability token of the second energy storage node; The generated delivery orders will also be recorded on the blockchain; S12: The smart contract locks the corresponding discharge capacity of the second energy storage node according to the delivery order, ensuring that it has at least [capacity] within the delivery time window. Dischargeable quantity; S13: During the delivery time window Within the system, the local controller of the second energy storage node controls the energy storage unit to discharge according to the instructions of the smart contract, while the local controller of the first energy storage node controls the energy storage unit to charge, thus realizing the actual physical transfer of energy; finally, the smart contract calculates the energy based on the agreed electricity price. and agreed discharge amount Calculate the amount payable R= Then, the payable amount R is transferred from the account of the first energy storage node to the account of the second energy storage node.
2. The method according to claim 1, characterized in that, In S1, the historical discharge fulfillment rate The calculation method is as follows: In the historical transaction records of each energy storage node, for each transaction, using... As the single-time fulfillment rate, the arithmetic mean of all single-time fulfillment rates is taken as... The historical green electricity consumption ratio The calculation method is as follows: extract the power source data for each charge from historical transaction records, obtain the proportion of renewable energy power used in that charge from the grid dispatch system or renewable energy certification agency through an oracle, and then take the arithmetic mean of the renewable energy power proportions of all charging events as the calculation method. .
3. The method according to claim 1, characterized in that, In step S8, the smart contract also obtains the geographical coordinates of the energy storage node corresponding to each energy traceability token, and calculates the relationship between the buyer node and each energy storage node in S before step S9. Geographical distance ;when Less than the preset distance threshold At that time, for the corresponding energy storage node By introducing a geographical proximity factor into the transaction matching model, the transaction matching model is expanded to... ; in, This is the location weight coefficient, used to adjust the influence of geographical location on the matching degree, satisfying 0 < <1.
4. The method according to claim 1, characterized in that, Also includes: S14: During the actual energy transfer process, the second energy storage node collects the actual discharge amount in real time at a preset frequency, and calculates the actual total discharge amount after the energy transfer is completed. and deviation rate And the smart contract is based on the agreed electricity price. and agreed discharge amount Calculate the amount due, and then transfer the amount due from the account of the first energy storage node to the account of the second energy storage node; The actual discharge amount and deviation rate are digitally signed and stored on the blockchain for evidence, and the data hash obtained from the digital signature is recorded on the blockchain. S15: The smart contract, based on the deviation rate Update the historical discharge fulfillment rate of the second energy storage node, and include the fulfillment rate of this transaction. Add to historical transaction records.
5. The method according to claim 4, characterized in that, After generating the delivery order in step S11, the smart contract also uses the trust value of the second energy storage node from the metadata of the energy traceability token. The performance bond G is calculated using the following formula: ;in The preset risk coefficient; The smart contract deducts the margin from the account of the second energy storage node and holds it in escrow to guarantee that the second energy storage node will be delivered on time according to the agreed discharge amount.
6. The method according to claim 5, characterized in that, Step S14 is followed by the following margin G processing steps: like If the deposit G is not refunded, the deposit will be fully refunded to the account of the second energy storage node. like Then, according to the deduction ratio After deducting the margin G, a portion of G× will be deducted. Automatic compensation is given to the account of the first energy storage node, with the remaining portion being G×(1- The refund will be returned to the account of the second energy storage node; in, The preset deviation threshold, The preset maximum permissible deviation rate, when The entire security deposit G will be deducted.
7. The method according to claim 4, characterized in that, Step S14 also includes the following settlement price adjustment step: The actual total discharge amount was calculated after the delivery was completed. and deviation rate Then, the smart contract determines the deviation rate. For agreed electricity price Adjustments were made, and the final settlement price was calculated. ,in This is the preset penalty coefficient; Finally, based on the final settlement price... Triggering fund transfer, to Replace the agreed electricity price Perform transaction settlement and calculate the actual amount payable. = .
8. The method according to claim 1, characterized in that, The weighting coefficients in the trust value calculation model , , The system is dynamically adjusted periodically based on the historical transaction performance of all energy storage nodes in the network. The adjustment period is a preset time interval or number of transactions.
9. The method according to claim 1, characterized in that, It also includes S16: Constructing an energy traceability query interface, wherein the energy traceability query interface allows users to input the identifier of the energy traceability token; Upon receiving the input, the system retrieves the metadata hash value of the energy traceability token and the data hash values of the actual discharge amount and deviation rate from the blockchain; it also retrieves the metadata of the corresponding energy traceability token from the distributed storage system, and retrieves the delivery order associated with the energy traceability token, as well as the actual discharge amount and deviation rate, from the blockchain. By integrating the information obtained above, a full lifecycle traceability map of the energy traceability token is generated and displayed.