Blockchain-based power transaction method and electronic device

By using a blockchain-based electricity trading method, which utilizes a dual-chain structure and reputation values ​​to screen power supply user nodes and provide electricity to power purchasing user nodes, the problems of transaction security and renewable energy consumption in smart grids are solved, and the efficiency, fairness and security of electricity trading are achieved.

CN116342279BActive Publication Date: 2026-06-19STATE GRID HEBEI ELECTRIC POWER RES INST +2

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
STATE GRID HEBEI ELECTRIC POWER RES INST
Filing Date
2023-03-27
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

The existing smart grid, which uses wireless networks, cannot guarantee the security of electricity market transactions and the high consumption of renewable energy.

Method used

A blockchain-based electricity trading method is adopted, which uses a dual-chain structure consisting of a local energy trading blockchain and a renewable energy trading blockchain. By combining reputation value and location marginal price, qualified power supply user nodes are selected to provide electricity to power purchase user nodes, ensuring the security and efficiency of the transaction.

Benefits of technology

It has improved the efficiency of electricity trading and renewable energy consumption, ensured the fairness and rationality of electricity trading, reduced the cost of purchasing electricity, and guaranteed the fairness and rationality of trading partners through credit scores, thus achieving stable and reliable energy trading.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116342279B_ABST
    Figure CN116342279B_ABST
Patent Text Reader

Abstract

This invention provides a blockchain-based electricity trading method and electronic device. The method includes: receiving first electricity information submitted by a first power supply user node and second electricity information submitted by a power purchase user node on a local energy trading blockchain; calculating the location marginal price of the distribution network, and determining intermediate first power supply user nodes whose storage bidding and first reputation values ​​meet a first preset requirement based on the location marginal price and a reputation threshold; providing power demand to the power purchase user node based on the stored electricity of the intermediate first power supply user nodes; when the sum of the first electricity stored by all intermediate first power supply user nodes is less than the power demand, providing the power shortage electricity to the power purchase user node based on the second power supply user node on the renewable energy trading blockchain; wherein, the power shortage electricity is the difference between the power demand and the sum of the first electricity stored. This invention can effectively ensure the transaction security of the electricity market under stable and reliable energy trading conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electricity market technology, and in particular to a blockchain-based electricity trading method and electronic device. Background Technology

[0002] The rapid growth of renewable energy has increased the demands of smart grids on communication and processing capabilities. Wireless networks, as an effective solution for collecting and managing information, can improve the efficiency of renewable energy management. However, due to the risks associated with wireless data transmission and centralized electricity trading, smart grids employing wireless networks cannot guarantee the security of electricity market transactions and the high consumption of renewable energy.

[0003] Therefore, proposing an electricity trading mechanism to ensure the security of electricity market transactions under the premise of stable and reliable energy trading is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0004] This invention provides a blockchain-based electricity trading method and electronic device to address the problems in the prior art where smart grids using wireless networks cannot guarantee the security of electricity market transactions and the high consumption of renewable energy.

[0005] In a first aspect, embodiments of the present invention provide a blockchain-based electricity trading method, comprising:

[0006] The system receives first power information submitted by the first power supply user node and second power information submitted by the power purchase user node on the local energy trading blockchain; wherein, the first power information includes stored power, storage bidding and a first reputation value, and the second power information includes power demand and reputation threshold;

[0007] Calculate the location marginal price of the distribution network, and determine the intermediate first power supply user node whose storage bidding and first reputation value meet the first preset requirements based on the location marginal price and the reputation threshold, and provide the power demand to the power purchasing user node based on the stored power of the intermediate first power supply user node;

[0008] When the total amount of stored electricity of all intermediate first power supply user nodes is less than the electricity demand, the second power supply user node on the renewable energy trading blockchain provides the electricity purchase user node with the shortage electricity; wherein, the shortage electricity is the difference between the electricity demand and the total amount of stored electricity.

[0009] In a second aspect, embodiments of the present invention provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method as described in the first aspect or any possible implementation thereof.

[0010] This invention provides a blockchain-based electricity trading method and electronic device. It provides the stored electricity at a first power supply user node on a local energy trading blockchain to power purchase user nodes. When the stored electricity at the first power supply user node, meeting a first preset requirement, is insufficient to support the power demand of the power purchase user nodes, the remaining electricity is further provided to the power purchase user nodes via a second power supply user node on a renewable energy trading blockchain. This dual-chain structure, composed of a local energy trading blockchain and a renewable energy trading blockchain, effectively improves the efficiency of electricity trading and renewable energy consumption. Furthermore, the accurate and fair location-based marginal price calculated in this invention effectively constrains the unit price of electricity, thereby ensuring fair and reasonable electricity trading and effectively reducing the power purchase cost for users. In addition, by assigning a reputation value to each registered entity, the fairness and reasonableness of the selected trading partners are ensured. Based on this, this invention can effectively guarantee the security of the electricity market while ensuring stable and reliable energy trading. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 This is a flowchart illustrating the implementation of the blockchain-based power trading method provided in this embodiment of the invention.

[0013] Figure 2 This is a schematic diagram of the load demand and battery power curves provided in an embodiment of the present invention;

[0014] Figure 3 This is a schematic diagram of the power curves for power shortages and photovoltaic power generation provided in an embodiment of the present invention;

[0015] Figure 4 This is a comparative curve diagram of the total daily electricity demand provided by an embodiment of the present invention;

[0016] Figure 5 This is a schematic diagram of a comparison curve of electricity prices for one day provided by an embodiment of the present invention;

[0017] Figure 6 This is a schematic diagram of the structure of a blockchain-based power trading device provided in an embodiment of the present invention;

[0018] Figure 7 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0019] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.

[0020] To make the objectives, technical solutions, and advantages of the present invention clearer, specific embodiments will be described below in conjunction with the accompanying drawings.

[0021] Figure 1 This is a flowchart illustrating the implementation of a blockchain-based power trading method provided in an embodiment of the present invention. Figure 1 As shown, this embodiment of the invention provides a blockchain-based power trading method, including:

[0022] Step 101: Receive the first power information submitted by the first power supply user node and the second power information submitted by the power purchase user node on the local energy trading blockchain; wherein, the first power information includes the stored power, storage bidding and the first reputation value, and the second power information includes the power demand and the reputation threshold.

[0023] In a distributed electricity market, there are typically four types of electricity participants: consumers, local producers, renewable energy producers, and the grid. Optionally, consumers, i.e., the electricity demanders in the electricity market and the aforementioned electricity-purchasing user nodes, can purchase electricity from local producers, renewable energy producers, and the grid. For example, consumers may include controllable loads, uncontrollable loads, and energy storage systems, etc., which are not limited in this application.

[0024] Local producers can be geographically similar entities to consumers, i.e., the aforementioned first-level power user nodes, which can generate electricity through rooftop photovoltaics and sell the electricity stored in energy storage systems. Renewable energy producers can generate electricity through distributed photovoltaic power plants to provide power to the electricity market. The power grid can consist of other large power plants and regulating power plants, which can provide power support to consumers when local producers and / or renewable energy producers cannot meet their electricity needs.

[0025] Based on this, a local energy trading blockchain can be established using blockchain technology, connecting consumers and local producers in similar geographical locations. By introducing blockchain to record electricity data collected by a smart grid using a wireless network, corresponding smart contracts can make reasonable transaction decisions for both parties. Under the guidance of these smart contracts, electricity providers can safely and efficiently supply electricity to electricity demanders, thereby ensuring the security and efficiency of electricity transactions for both parties.

[0026] Therefore, in step 101, the system receives first electricity information submitted by local producers and second electricity information submitted by consumers on the local energy trading blockchain. The first electricity information may include the storage capacity currently available from the local producer, the storage bid price, and the local producer's first reputation value. The second electricity information may include the consumer's current electricity demand and a reputation threshold for constraining the reputation of the trading partner. This facilitates the subsequent selection of qualified local producers to meet the consumer's electricity needs, thereby realizing electricity trading based on blockchain technology.

[0027] Step 102: Calculate the location marginal price of the distribution network, and determine the intermediate first power supply user node that meets the first preset requirement for storage bidding and first reputation value based on the location marginal price and reputation threshold, and provide the power demand to the power purchasing user node based on the stored power of the intermediate first power supply user node.

[0028] In step 102, consumers typically seek the lowest possible electricity purchase cost and the best possible power quality. Therefore, when two parties engage in electricity trading, it is essential to minimize the consumer's electricity purchase cost and maximize the quality of the traded power. Thus, in this embodiment, a location marginal price can be set for each node in the blockchain's distribution network. This location marginal price serves as a pricing constraint for electricity transactions between consumers and producers. When the electricity producer's price exceeds this location marginal price, the electricity transaction will not proceed, thereby ensuring the fairness and reasonableness of the transaction between the two parties.

[0029] Optionally, local producers whose storage bids are no higher than the location's marginal price can be selected based on that price. Simultaneously, local producers with a first reputation value no lower than a reputation threshold can be selected based on that threshold. In this way, the selected local producers with storage bids no higher than the location's marginal price and first reputation values ​​no lower than the reputation threshold are designated as the first intermediate power supply user nodes. Thus, the electricity demand is met by providing the electricity to consumers based on the storage capacity of these first intermediate power supply user nodes, thereby realizing this electricity transaction.

[0030] Optionally, the initial reputation value can serve as the basis for the order of producer transactions in each electricity transaction, influencing the order of producer transactions and thus affecting the economic interests of producers. By selecting entities with high reputation values ​​(not less than the reputation threshold) as authorized nodes to maintain the local energy trading blockchain, it is ensured that consumers receive high-quality electricity and services in each electricity transaction, and local producers receive timely electricity payments and consumer feedback. This creates a well-organized power supply and purchase process, which is conducive to ensuring the security and sustainable development of the local energy trading blockchain's electricity transactions.

[0031] For example, the initial reputation value can change accordingly with each completed electricity transaction. For instance, if a consumer reports excellent power quality or service after a transaction, the local producer's initial reputation value can increase, and the next transaction can be based on this updated value. In other words, producers can increase their initial reputation value through successful electricity transactions, thereby improving their competitiveness. However, poor power generation or service will decrease their initial reputation value, thus reducing their competitiveness. Therefore, constraints based on the initial reputation value can effectively filter out local producers with high-quality power and excellent service, thereby meeting consumer demand and completing each electricity transaction efficiently and effectively.

[0032] In one possible implementation, calculating the location marginal price of the distribution network includes:

[0033] Establish an optimal power flow model with the objective function of minimizing electricity purchase cost.

[0034] Under the constraints of power generation, load power, distribution network loss power, and energy balance, the optimal power flow model is solved, and the location marginal price is calculated.

[0035] In this embodiment, the location marginal price can be determined based on minimizing the electricity purchase cost of each node in the blockchain. An optimal power flow model is established with the minimum electricity purchase cost as the objective function. This model is then solved under constraints such as generation power constraints, load power constraints, distribution network loss power constraints, and energy balance constraints to further calculate the location marginal price. By satisfying different constraints, an accurate and reasonable location marginal price can be calculated, which helps to select local producers that meet the location marginal price constraints, thereby ensuring the safe and stable operation of electricity transactions.

[0036] Optionally, taking the minimization of active power purchase cost as an example, the objective function of the above optimal power flow model can be:

[0037]

[0038] Where F represents the objective function, min represents the minimum function, and P loss C represents heat loss. MCP P represents the settlement price in the active power market. DG,i C represents the active power of node i. stor P represents storage cost. stor,i This represents the energy storage capacity of the energy storage system at node i.

[0039] Optionally, the conventional goal of minimizing electricity purchase cost refers to minimizing both active and reactive power purchase costs. Therefore, in addition to the example of minimizing active power purchase cost mentioned above, the objective function of the above optimal power flow model can also include minimizing reactive power purchase cost, thereby achieving the goal of minimizing electricity purchase cost.

[0040] Based on this, in this embodiment, when the electricity purchase cost is minimized, the optimal solutions for heat loss, active power and reactive power at node i, and energy storage capacity of the energy storage system can be further determined. This facilitates the further calculation of the location marginal price of the distribution network.

[0041] In one possible implementation, the power generation constraint includes a first power constraint on fossil fuel generators and a second power constraint on solar panels.

[0042] The first power constraint includes:

[0043] Among them, P Gi,t Q represents the first active power of the fossil fuel generator unit at node i at time t. Gi,t P represents the first reactive power of the fossil fuel generator unit at node i at time t. Gi,mim P represents the lower limit of the first active power. Gi,max Q represents the upper limit of the first active power. Gi,mim Q represents the lower limit of the first reactive power. Gi,max This indicates the upper limit of the first reactive power.

[0044] In this embodiment, the fossil fuel generator set can also be referred to as a regulating power station, which mainly consists of a set of control nodes G, including small thermal power generator sets, gas turbines, and fuel cells. To ensure power quality and power supply security requirements, node i should satisfy the aforementioned first power constraint condition.

[0045] The second power constraint may include: P DGi,min ≤P DGi,t ≤P DGi,max .

[0046] Among them, P DGi,t P represents the second active power of the solar panel at node i at time t.DGi,mim P represents the lower limit of the second active power. DGi,max This indicates the upper limit of the second active power.

[0047] In this embodiment, solar panel power generation (also known as photovoltaic power generation) represents renewable energy power generation. To ensure power quality and power supply security, node i should satisfy the aforementioned second power constraint condition.

[0048] In one possible implementation, the load power constraints include: a third power constraint for controllable loads, a fourth power constraint for uncontrollable loads, and a fifth power constraint for the energy storage system.

[0049] The third power constraint includes:

[0050] Among them, S i,t P represents the power of the controllable load at node i at time t. i,t Q represents the third active power of the controllable load at node i at time t. i,t E represents the second reactive power of the controllable load at node i at time t, where j represents the imaginary unit. i,demond Let T represent the fixed energy demand of the controllable load at node i, T represent the time length, and Δt represent the first time interval.

[0051] In this embodiment, the controllable load in the power system can be an electric vehicle. Therefore, the third power constraint can be formed based on the daily power demand of an electric vehicle with flexible power distribution but fixed energy demand.

[0052] The fourth power constraint may include:

[0053] Among them, P static Q represents the static active power of an uncontrollable load. static P represents the static reactive power of an uncontrollable load. N Q represents the fourth active power of an uncontrollable load under rated voltage. N The third reactive power of the uncontrollable load under rated voltage, a p b represents the power consumed by the constant impedance corresponding to the fourth active power. p c represents the power of the constant current load corresponding to the fourth active power. p V represents the constant power component of the fourth active power. n represents the rated voltage of the uncontrollable load, v represents the transient voltage of the uncontrollable load, and a represents the rated voltage of the uncontrollable load. q b represents the power consumed by the constant impedance corresponding to the third reactive power. q c represents the power of the constant current load corresponding to the third reactive power. qThis represents the constant power component of the third reactive power.

[0054] In this embodiment, in the power system, uncontrollable loads may include non-outage or power-limited loads such as streetlights and medical institutions. Typically, the power of uncontrollable loads is static, thus forming the aforementioned fourth power constraint. Wherein, a p b p c p a q b q and c q These six coefficients should satisfy:

[0055]

[0056] Optionally, the above coefficients can be obtained by fitting the actual voltage static characteristics using the least squares method. The above equation shows that the active and reactive power of an uncontrollable load consists of three parts. p a represents the power consumed by the constant impedance corresponding to the fourth active power. q This represents the power consumed by the constant impedance corresponding to the third reactive power, and both are proportional to the square of the voltage. p b represents the power of the constant current load corresponding to the fourth active power. q This represents the power of the constant current load corresponding to the third reactive power; both are proportional to the voltage. q c represents the constant power component of the third reactive power. p This represents the constant power component of the fourth active power.

[0057] The fifth power constraint includes:

[0058] Among them, E i,t E represents the energy storage capacity of the energy storage system at node i at time t. i,t-1 The second time interval represents the historical energy storage capacity of the energy storage system at node i at time t-1. η represents the charging power of the energy storage system at node i at time t. cha Indicates the first energy conversion factor. η represents the discharge power of the energy storage system at node i at time t. dis P represents the second energy conversion factor. i,t E represents the difference between the charging power and the discharging power of the energy storage system at node i at time t. i,c SoC min E represents the lower limit of energy storage capacity. i,c SoC max E represents the upper limit of energy storage capacity. i,c Indicates the rated capacity of the energy storage system. This represents the maximum charging power of the energy storage system at node i. This represents the maximum discharge power of the energy storage system at node i.

[0059] In this embodiment, an energy storage system is a device capable of storing and releasing energy, and it plays a crucial role in the reliability and power quality of the power system. In the fifth power constraint mentioned above, the SoC... min and SoC max Both belong to (0,1], which are the minimum and maximum charging states to prevent overcharging and over-discharging of batteries in the energy storage system.

[0060] In one possible implementation, the power loss constraints of the distribution network include:

[0061] Among them, P t loss δ represents the power loss of the distribution network. i δ represents the first voltage phase angle at node i. j U represents the second voltage phase angle at node j. i,t U represents the first voltage value of node i at time t. j,t G represents the second voltage value of node j at time t. ij This represents the electrical conductance on the branch ij between node i and node j.

[0062] In this embodiment, the active power of branch ij can be expressed as:

[0063]

[0064] Among them, P ij,t U represents the active power of branch ij. i,t U represents the first voltage value at node i. j,t G represents the second voltage value at node j. ij B represents the conductance on branch ij. ij δ represents the susceptance on branch ij. ij Let J represent the voltage phase angle of branch ij, and J represent the set of nodes i and j.

[0065] Based on this, the active power loss of branch ij It can be represented as:

[0066]

[0067] Due to δ ij They are usually very small, so they can make Substituting this formula into the active power loss of branch ij From the calculation formula, we can obtain:

[0068]

[0069] Furthermore, the voltage amplitude is insensitive to changes in injected active power, and therefore can be considered a constant value. Thus, the variation in distribution network power loss is only related to the active power injected at the nodes; that is, the distribution network power loss constraint can be expressed as:

[0070] Energy balance constraints include:

[0071] in, P represents the injected power of the load. t cha P represents the charging power of the energy storage system. t dis This indicates the discharge power of the energy storage system. P represents the active power of a solar panel. t SL This represents the injected active power of the relaxation bus in the distribution network, and n represents the number of nodes.

[0072] In this embodiment, a healthy balance should be achieved between power generation by producers, power consumption by consumers, and network losses in the distribution network within the power system. Therefore, this healthy balance can be achieved by constructing energy balance constraints.

[0073] Optionally, the equations involved in the above constraints can constitute a nonlinear programming problem. However, due to the nonconvexity of the power flow equations, it is difficult to obtain a globally optimal solution for the objective function of the optimal power flow model. Therefore, this nonlinear programming problem can be transformed into a convex optimization problem using the second-order cone relaxation technique, and then further transformed into a second-order cone programming problem. Using commonly used commercial solvers such as CPLEX and MOSEK, the globally optimal solution can be found quickly. That is, the equations involved in the above constraints are transformed into the following set of constraint equations using the second-order cone relaxation technique:

[0074]

[0075] Under the constraints of this set of constraint equations, the objective function of the optimal power flow model is solved to obtain the optimal solutions for heat loss, active power and reactive power at node i, and energy storage capacity of the energy storage system when the power purchase cost is minimized. Based on the optimal solutions for active power and reactive power at generation node i, the quadratic cost functions for active power and reactive power are constructed as follows:

[0076]

[0077] Among them, C pi,t (P Gi,tC represents the quadratic cost function of active power. qi,t (Q Gi,t ) represents the quadratic cost function of reactive power, a i,t β represents the coefficient of the quadratic term. i,t γ represents the coefficient of the single-term term (also called the coefficient of the linear term). i,t This indicates the offset.

[0078] After determining the quadratic cost functions for active and reactive power, based on the theoretical foundation of real-time electricity pricing, a Lagrangian function consisting of an objective function and a set of constraints is derived. The Lagrangian constraint factor for node-injected power balance represents the corresponding location marginal price of the node's injected power. Therefore, the blockchain can invoke a smart contract to calculate the location marginal price according to the following equation:

[0079]

[0080] Where, ρ pi ρ represents the active power injected into the node. qi λ represents the reactive power injected into the node. pi λ represents the Lagrange multiplier for injecting active power constraints at nodes. qi η represents the Lagrange multiplier for reactive power injected into a node. min η max Let ξ represent the minimum and maximum values ​​of the Lagrange multipliers for the active power constraint of the generator set, respectively. min ξ max These represent the maximum and minimum values ​​of the Lagrange multipliers for the reactive power constraint of the generator set, respectively.

[0081] In this way, an accurate and reasonable marginal price can be calculated, which is beneficial for selecting high-quality power producers and providing consumers with high-quality electricity, thereby achieving reliable transactions between the two parties.

[0082] In one possible implementation, the power demand of the purchasing user node is provided based on the stored power of the intermediate first power supply user node, including:

[0083] The first power supply user node is selected in order of increasing storage bidding price to provide the power demand for the purchasing user node.

[0084] When the sum of the second energy stored in each of the selected intermediate first power supply user nodes is greater than or equal to the power demand, the power demand is provided to the power purchasing user node based on the sum of the second energy.

[0085] Alternatively, when the second total electricity consumption equals the first total electricity consumption and the first total electricity consumption is less than the electricity demand, the electricity demand is provided to the electricity-purchasing user node based on the first total electricity consumption.

[0086] In this embodiment, after screening through storage bidding and first reputation value, the resulting intermediate first power supply user node is a local producer on the local energy trading blockchain that generates high-quality electricity with high credibility. At this point, the intermediate first power supply user node is selected in ascending order of storage bidding price to provide the electricity demand for the purchasing user node.

[0087] When the sum of the second energy stored in all selected intermediate first power supply user nodes is greater than or equal to the power demand of the power purchasing user node, it is considered that the current sum of the second energy can meet the power demand of the power purchasing user node. At this time, the power demand of the power purchasing user node is provided based on the sum of the second energy.

[0088] Alternatively, when the sum of the first-level stored power of all intermediate first-level power supply user nodes equals the sum of the second-level stored power, and this sum of the first-level stored power is less than the power demand, i.e., the sum of the first-level stored power of all intermediate first-level power supply user nodes is insufficient to support the power demand of the power purchasing user node, a portion of the power demand is provided to the power purchasing user node based on the sum of the first-level stored power. In this case, the smart contract corresponding to the local energy trading blockchain will generate a transaction result based on the actual power demand of the power purchasing user node and publish the transaction result on the local energy trading blockchain.

[0089] Simultaneously, the smart contract will transmit the transaction results to the power transmission and distribution system operator, enabling the operator to transmit and distribute the actual electricity demand of the purchasing user node based on these results. In this transmission and distribution process, if the local producer does not cancel the transaction, the smart meter will accurately provide the electricity transaction information. Furthermore, after completing this transmission and distribution, the purchasing user node will send a signal of successful transaction to the local energy trading blockchain and pay the electricity fee.

[0090] Step 103: When the total amount of stored electricity of all intermediate first power supply user nodes is less than the electricity demand, the second power supply user node on the renewable energy trading blockchain provides the electricity shortage to the electricity purchasing user node; wherein, the electricity shortage is the difference between the electricity demand and the total amount of stored electricity.

[0091] In step 103, when the total stored power of all intermediate first power supply user nodes on the local energy trading blockchain cannot meet the power demand of the power purchasing user node, the power shortage can be provided to the power purchasing user based on the second power supply user node (i.e., renewable energy producer) on the renewable energy trading blockchain. Optionally, this power shortage is the difference between the power demand and the total stored power.

[0092] In this embodiment, by introducing blockchain technology to record the electricity data collected by the wireless network, problems such as data transmission and single points of failure in the electricity market are solved, thereby improving the security of the wireless network. Based on this, the smart contracts corresponding to the local energy trading blockchain and the renewable energy trading blockchain can make reasonable transaction decisions to ensure fair and secure transactions between electricity buyers and suppliers. Furthermore, the dual-chain structure composed of the local energy trading blockchain and the renewable energy trading blockchain effectively improves the efficiency of electricity trading and renewable energy consumption.

[0093] In one possible implementation, a second power user node on a renewable energy trading blockchain provides the shortfall in electricity to the power purchasing user node, including:

[0094] It receives third power information submitted by the second power supply user node on the renewable energy trading blockchain, as well as power demand period and shortage power submitted by the power purchase user node; among which, the third power information includes the expected stable power generation period, power generation capacity, expected electricity price, and second reputation value.

[0095] The expected electricity price and the second credit value of the intermediate second power supply user node are determined based on the location marginal price and credit threshold.

[0096] For each time period under the electricity demand period, the second power supply user node in the middle of the expected stable power generation period is selected to provide the power shortage to the power purchasing user node in order of expected electricity price from low to high.

[0097] When the sum of the third power generation capacity of each selected intermediate second power supply user node in a given period is greater than or equal to the corresponding shortage power in that period, the shortage power in that period is provided to the power purchasing user node based on the sum of the third power generation capacity.

[0098] Alternatively, when the sum of the fourth power generation capacity of all intermediate second power supply user nodes in a given period is less than the corresponding shortage power for that period, the shortage power for that period is provided to the power purchasing user node based on the sum of the fourth power generation capacity.

[0099] In this embodiment, if the electricity demand of the purchasing user node is not met by the stored electricity of the intermediate first supplying user node after the local electricity transaction is completed, the renewable energy transaction phase begins. At this time, the system receives third electricity information submitted by the second supplying user node and the electricity demand period and shortage quantity submitted by the purchasing user node on the renewable energy transaction blockchain. The third electricity information includes the second supplying user node's expected stable power generation period, power generation capacity, expected electricity price, and second reputation value. To improve the accuracy of electricity transactions, it is necessary to continuously update the information contained in each supplying user node and purchasing user node after each electricity transaction is completed.

[0100] In this embodiment, a second power supply user node is determined based on the location marginal price, with the expected electricity price not exceeding that location marginal price. Simultaneously, a second power supply user node is determined based on a reputation threshold, with a reputation value not less than that threshold. After filtering to obtain second power supply user nodes that simultaneously satisfy both the location marginal price constraint and the reputation threshold constraint, these are recorded as intermediate second power supply user nodes.

[0101] Then, for each time period under the electricity demand period, the second power supply user node in the middle of the expected stable power generation period is selected to provide the power shortage to the power purchasing user node in order of expected electricity price from low to high.

[0102] When the sum of the third-order power generation capacity of the selected intermediate second power supply user nodes during a given time period is greater than or equal to the corresponding power shortage for that time period, the power shortage for that time period is provided to the power purchasing user node based on the sum of the third-order power generation capacity. In this way, the power shortage needs of the power purchasing user node are met in each time period.

[0103] For example, the electricity demand of a user node during the first time period is m kWh. In this scenario:

[0104] Optionally, if the total power generation capacity of the selected intermediate second power supply user nodes during this period is m+a or m kWh (where m and a are both positive integers), it indicates that the power shortage can be provided to the power purchasing user nodes based on these intermediate second power supply user nodes.

[0105] Optionally, if the total power generation capacity of all selected intermediate second power supply user nodes during this period is m+a or m kWh, it indicates that the power shortage can be provided to the power purchasing user nodes based on all intermediate second power supply user nodes.

[0106] Optionally, if the total generation capacity of some of the selected intermediate second power supply user nodes during the period cannot meet the power shortage of the power purchasing user node during the period, the total generation capacity can be increased by adding more selected intermediate second power supply user nodes, thereby providing power to the power purchasing user node, until all intermediate second power supply user nodes are selected to use their total generation capacity during the period to provide the power shortage of the power purchasing user node.

[0107] However, even after all intermediate second-level power supply user nodes are selected, the total generation capacity of all intermediate second-level power supply user nodes during this period may still be insufficient to meet the power shortage demand of the purchasing user nodes. In this scenario, the specific power supply plan is detailed below:

[0108] When the sum of the fourth power generation capacity of all intermediate second power supply user nodes in a given period is less than the corresponding shortage power for that period, the shortage power for that period is provided to the power purchasing user node based on the sum of the fourth power generation capacity.

[0109] In other words, even if the total power generation capacity of all intermediate second-level power supply user nodes during a given period is insufficient to meet the power shortage for that period, the power shortage will still be provided to the purchasing user nodes based on the total power generation capacity of this fourth sum. Simultaneously, the purchasing user nodes can purchase the difference between the total power generation capacity of the fourth sum and the power shortage from the distribution network to meet the power shortage demand for that period. In this way, by conducting electricity trading on the local energy trading blockchain and the renewable energy blockchain, the security and stability of electricity trading can be guaranteed, thus ensuring the security of the electricity market; on the other hand, it can also effectively alleviate the generation pressure on the distribution network.

[0110] Accordingly, the smart contract corresponding to the renewable energy trading blockchain will generate a transaction result based on the actual shortage of electricity traded by the electricity purchasing user node, and publish this result on the renewable energy trading blockchain. Simultaneously, the smart contract will also transmit the transaction result to the transmission and distribution system operator, enabling the operator to complete the transmission and distribution of the actual shortage of electricity traded by the electricity purchasing user node. During this transmission and distribution, if the renewable energy producer does not cancel the transaction, the smart meter will accurately provide the electricity transaction information. Furthermore, after completing this transmission and distribution, the electricity purchasing user node will send a signal of successful transaction to the renewable energy trading blockchain and pay the electricity fee.

[0111] In one possible implementation, after providing the electricity purchaser node with the shortfall electricity for that period based on the third total electricity consumption, or after providing the electricity purchaser node with the shortfall electricity for that period based on the fourth total electricity consumption, the following is also included:

[0112] An incentive price is obtained by applying an incentive price to the expected electricity price of the intermediate second power supply user node that provides the electricity shortage to the power purchase user node.

[0113] The expected electricity price for the intermediate second power supply user node that provides the shortage electricity to the power purchase user node is updated based on the incentive electricity price, so that the intermediate second power supply user node that provides the shortage electricity to the power purchase user node can provide electricity to other power purchase user nodes based on the updated expected electricity price.

[0114] In this embodiment, after the transmission and distribution of electricity during the renewable energy trading phase is completed, the electricity purchasing user node sends a signal of successful transaction to the renewable energy trading blockchain. At this time, the smart contract corresponding to the renewable energy trading blockchain can incentivize renewable energy producers based on this feedback signal to obtain an incentive price. Then, based on this incentive price, the expected price in the third power information of the intermediate second power supply user nodes that provide electricity to the electricity purchasing user node in case of shortage is updated, so that these intermediate second power supply user nodes can provide electricity to other electricity purchasing user nodes based on the updated expected price. Optionally, the second reputation value of these intermediate second power supply user nodes can also be updated based on this feedback signal to better achieve high-quality electricity transactions each time.

[0115] In one possible implementation, an incentive price is applied to the expected electricity price of the intermediate second power supply user node that provides the shortfall electricity to the power purchasing user node, resulting in an incentive price, including:

[0116] Based on C d =C REG ·[1+log k [x+1], the expected electricity price of the intermediate second power supply user node that provides the electricity shortage to the power purchase user node is used to incentivize the electricity price, and the incentive price is obtained.

[0117] Among them, C d Indicating an incentive electricity price, C REG Let represent the expected electricity price, k represent the difficulty adjustment coefficient, and x represent the comprehensive parameter equation of the intermediate second power supply user node that provides the shortage electricity to the power purchasing user node.

[0118] In this embodiment, the comprehensive parameter equation x = P·t is used in the calculation formula of the incentive electricity price. d +s. P represents the power generation scale, s represents the power generation stability of the node during the expected stable power generation period, and t d t represents the cumulative power supply time of the second power supply user node. d ≥0. The incentive function for renewable energy producers aims to encourage the construction and investment of renewable energy producers. At the same time, stable power generation performance and long-term cumulative power generation time can bring better economic benefits to renewable energy producers.

[0119] However, the electricity generated by local producers and renewable energy producers may still be insufficient to meet consumer demand. In such cases, electricity can be obtained from nearby regional power grids to satisfy consumer needs, thus completing the power transmission and distribution to consumers. In this embodiment, to enhance the stability of renewable energy producers and expand their scale, a blockchain-based renewable energy incentive mechanism is proposed, thereby further improving overall transaction security while ensuring the stability of energy transactions.

[0120] In summary, this invention proposes a blockchain-based power trading method for smart grids employing wireless networks. By introducing blockchain technology, it solves problems such as data transmission and single points of failure in the power market, thereby improving the security of the wireless network. This method enables trusted distributed transactions between consumers and producers without the need for a trusted central authority. The dual-chain structure composed of transmission lines fully utilizes local energy storage and renewable energy in distributed power trading, meeting user demand under optimal power flow constraints, thereby reducing electricity costs and alleviating the burden on the grid. The smart contract-based electricity price incentive mechanism can effectively encourage power producers to improve their power quality and expand production capacity.

[0121] This invention provides a blockchain-based electricity trading method. It provides the stored electricity at a first power supply user node on a local energy trading blockchain to power purchase user nodes. When the stored electricity at the first power supply user node, meeting a first preset requirement, is insufficient to support the power demand of the power purchase user node, the remaining electricity is further provided by a second power supply user node on a renewable energy trading blockchain. This dual-chain structure, composed of a local energy trading blockchain and a renewable energy trading blockchain, effectively improves the efficiency of electricity trading and renewable energy consumption. Furthermore, the accurate and fair location-based marginal price calculated in this invention effectively constrains the unit price of electricity, thereby ensuring fair and reasonable electricity trading and effectively reducing the power purchase cost for users. In addition, by assigning a reputation value to each registered entity, the fairness and reasonableness of the selected trading partners are ensured. Based on this, this invention can effectively guarantee the security of the electricity market while maintaining stable and reliable energy trading.

[0122] To verify the effectiveness of the blockchain-based power trading method proposed in this embodiment of the invention, power grid loads under different scenarios were tested. Figure 2 This diagram illustrates the load demand and battery power curves provided for embodiments of the present invention, depicting the changes in load and local energy storage over 24 hours. Two peaks in load power consumption occur at 8:00 AM and 8:00 PM. From 8:00 PM to 5:00 AM the following morning, local energy storage provides additional power. Figure 2 It can be seen that after 5 a.m. the next day, locally produced batteries provided electricity to the consumer distributed electricity market. However, due to limitations in current battery hardware, the total power provided by local energy storage remains insufficient.

[0123] Figure 3The schematic diagram of power shortages and photovoltaic (PV) power generation provided for embodiments of the present invention illustrates the annual changes in consumer power shortages and PV power generation by renewable energy producers. At different times after the local electricity trading period ends, it can be seen that renewable energy power generation gradually increases after 8:00 AM, peaking from 10:00 AM to 4:00 PM. During this period, renewable energy producers can provide a significant amount of electricity. Therefore, when PV power generation is operating normally, this method can effectively alleviate power shortages from 10:00 AM to 4:00 PM.

[0124] at last, Figure 4 The diagram illustrates a comparison of total daily electricity demand for an embodiment of the present invention, showing the difference in total load before and after the implementation of the method. Figure 4 The area below the middle line represents all electricity demand from consumers onto the grid. Clearly, after using this method, consumer electricity demand on the grid is lower at any given time compared to when this method was not used.

[0125] To demonstrate the impact of this method on the cost of electricity for consumers, price changes over time before and after the application of this method were tested and compared. Figure 5 This is a schematic diagram illustrating a comparison of electricity prices for one day, provided as an embodiment of the present invention. It depicts a price comparison before and after the implementation of this method. Figure 5 As shown, after using this method, consumers pay less electricity at any time than the original price. Furthermore, the effect of this method is more pronounced during the peak electricity price period at 8 PM. Consumers' electricity costs are reduced because they can purchase electricity from local and renewable energy producers at below-average bid prices, which effectively lowers their electricity costs.

[0126] In summary, this method can effectively reduce electricity prices for users and smooth the power curve to reduce grid load. By introducing blockchain technology, effective distributed electricity trading is achieved without a trusted third party, and the overhead for consumers and producers using blockchain is limited.

[0127] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0128] The following are device embodiments of the present invention. For details not described in detail, please refer to the corresponding method embodiments described above.

[0129] Figure 6The schematic diagram of the blockchain-based power trading device provided in the embodiment of the present invention is shown below. For ease of explanation, only the parts related to the embodiment of the present invention are shown, and are described in detail below:

[0130] like Figure 6 As shown, the blockchain-based power trading device 2 includes:

[0131] The power information receiving module 201 is used to receive the first power information submitted by the first power supply user node and the second power information submitted by the power purchase user node on the local energy trading blockchain; wherein, the first power information includes the stored power, the storage bid and the first reputation value, and the second power information includes the power demand and the reputation threshold.

[0132] The first power supply module 202 is used to calculate the location marginal price of the distribution network, and determine the intermediate first power supply user node whose storage bidding and first credit value meet the first preset requirements based on the location marginal price and credit threshold, and provide the power demand to the power purchasing user node based on the stored power of the intermediate first power supply user node.

[0133] The second power supply module 203 is used to provide the power shortage to the power purchasing user node based on the second power supply user node on the renewable energy trading blockchain when the total first power storage of all intermediate first power supply user nodes is less than the power demand; wherein, the power shortage is the difference between the power demand and the total first power storage.

[0134] In one possible implementation, the first power supply module 202 is specifically used for:

[0135] Establish an optimal power flow model with the objective function of minimizing electricity purchase cost.

[0136] Under the constraints of power generation, load power, distribution network loss power, and energy balance, the optimal power flow model is solved, and the location marginal price is calculated.

[0137] In one possible implementation, the power generation constraints in the first power supply module 202 may include a first power constraint of the fossil fuel generator set and a second power constraint of the solar panel.

[0138] The first power constraint may include:

[0139] Among them, P Gi,t Q represents the first active power of the fossil fuel generator unit at node i at time t. Gi,t P represents the first reactive power of the fossil fuel generator unit at node i at time t. Gi,mim P represents the lower limit of the first active power. Gi,maxQ represents the upper limit of the first active power. Gi,mim Q represents the lower limit of the first reactive power. Gi,max This indicates the upper limit of the first reactive power.

[0140] The second power constraint may include: P DGi,min ≤P DGi,t ≤P DGi,max .

[0141] Among them, P DGi,t P represents the second active power of the solar panel at node i at time t. DGi,mim P represents the lower limit of the second active power. DGi,max This indicates the upper limit of the second active power.

[0142] In one possible implementation, the load power constraints in the first power supply module 202 may include: a third power constraint for controllable loads, a fourth power constraint for uncontrollable loads, and a fifth power constraint for the energy storage system.

[0143] The third power constraint may include:

[0144] Among them, S i,t P represents the power of the controllable load at node i at time t. i,t Q represents the third active power of the controllable load at node i at time t. i,t E represents the second reactive power of the controllable load at node i at time t, where j represents the imaginary unit. i,demond Let T represent the fixed energy demand of the controllable load at node i, T represent the time length, and Δt represent the first time interval.

[0145] The fourth power constraint may include:

[0146] Among them, P static Q represents the static active power of an uncontrollable load. static P represents the static reactive power of an uncontrollable load. N Q represents the fourth active power of an uncontrollable load under rated voltage. N The third reactive power of the uncontrollable load under rated voltage, a p b represents the power consumed by the constant impedance corresponding to the fourth active power. p c represents the power of the constant current load corresponding to the fourth active power. p V represents the constant power component of the fourth active power. n represents the rated voltage of the uncontrollable load, v represents the transient voltage of the uncontrollable load, and a represents the rated voltage of the uncontrollable load. q b represents the power consumed by the constant impedance corresponding to the third reactive power. qc represents the power of the constant current load corresponding to the third reactive power. q This represents the constant power component of the third reactive power.

[0147] The fifth power constraint may include:

[0148] Among them, E i,t E represents the energy storage capacity of the energy storage system at node i at time t. i,t-1 The second time interval represents the historical energy storage capacity of the energy storage system at node i at time t-1. η represents the charging power of the energy storage system at node i at time t. cha Indicates the first energy conversion factor. η represents the discharge power of the energy storage system at node i at time t. dis P represents the second energy conversion factor. i,t E represents the difference between the charging power and the discharging power of the energy storage system at node i at time t. i,c SoC min E represents the lower limit of energy storage capacity. i,c SoC max E represents the upper limit of energy storage capacity. i,c Indicates the rated capacity of the energy storage system. This represents the maximum charging power of the energy storage system at node i. This represents the maximum discharge power of the energy storage system at node i.

[0149] In one possible implementation, the power loss constraint of the distribution network in the first power supply module 202 may include:

[0150] Among them, P t loss δ represents the power loss of the distribution network. i δ represents the first voltage phase angle at node i. j U represents the second voltage phase angle at node j. i,t U represents the first voltage value of node i at time t. j,t G represents the second voltage value of node j at time t. ij This represents the electrical conductance on the branch ij between node i and node j.

[0151] Energy balance constraints include:

[0152] in, P represents the injected power of the load. t cha P represents the charging power of the energy storage system. t disThis indicates the discharge power of the energy storage system. P represents the active power of a solar panel. t SL This represents the injected active power of the relaxation bus in the distribution network, and n represents the number of nodes.

[0153] In one possible implementation, the first power supply module 202 is further specifically used for:

[0154] Based on the stored power of the intermediate first power supply user node, the power demand of the power purchasing user node is provided, including:

[0155] The first power supply user node is selected in order of increasing storage bidding price to provide the power demand for the purchasing user node.

[0156] When the sum of the second energy stored in each of the selected intermediate first power supply user nodes is greater than or equal to the power demand, the power demand is provided to the power purchasing user node based on the sum of the second energy.

[0157] Alternatively, when the second total electricity consumption equals the first total electricity consumption and the first total electricity consumption is less than the electricity demand, the electricity demand is provided to the electricity-purchasing user node based on the first total electricity consumption.

[0158] In one possible implementation, the second power supply module 203 is specifically used for:

[0159] It receives third power information submitted by the second power supply user node on the renewable energy trading blockchain, as well as power demand period and shortage power submitted by the power purchase user node; among which, the third power information includes the expected stable power generation period, power generation capacity, expected electricity price, and second reputation value.

[0160] The expected electricity price and the second credit value of the intermediate second power supply user node are determined based on the location marginal price and credit threshold.

[0161] For each time period under the electricity demand period, the second power supply user node in the middle of the expected stable power generation period in that time period is selected to provide the power shortage to the power purchasing user node in order of expected electricity price from low to high.

[0162] When the sum of the third power generation capacity of each selected intermediate second power supply user node in the time period is greater than or equal to the corresponding shortage power in the time period, the shortage power in the time period is provided to the power purchasing user node based on the sum of the third power.

[0163] Alternatively, when the sum of the fourth power generation capacity of all intermediate second power supply user nodes in a given period is less than the corresponding shortage power for that period, the shortage power for that period is provided to the power purchasing user node based on the sum of the fourth power generation capacity.

[0164] In one possible implementation, the second power supply module 203 is further specifically used for:

[0165] An incentive price is obtained by applying an incentive price to the expected electricity price of the intermediate second power supply user node that provides the electricity shortage to the power purchase user node.

[0166] The expected electricity price for the intermediate second power supply user node that provides the shortage electricity to the power purchase user node is updated based on the incentive electricity price, so that the intermediate second power supply user node that provides the shortage electricity to the power purchase user node can provide electricity to other power purchase user nodes based on the updated expected electricity price.

[0167] In one possible implementation, the second power supply module 203 is further specifically used for:

[0168] Based on C d =C REG ·[1+log k [x+1], the expected electricity price of the intermediate second power supply user node that provides the electricity shortage to the power purchase user node is used to incentivize the electricity price, and the incentive price is obtained.

[0169] Among them, C d Indicating an incentive electricity price, C REG Let represent the expected electricity price, k represent the difficulty adjustment coefficient, and x represent the comprehensive parameter equation of the intermediate second power supply user node that provides the shortage electricity to the power purchasing user node.

[0170] This invention provides a blockchain-based power trading device, comprising: a power information receiving module 201, a first power supply module 202, and a second power supply module 203. By providing the stored electricity at a first power supply user node on the local energy trading blockchain to power purchasing user nodes, and when the stored electricity at the first power supply user node, meeting a first preset requirement, is insufficient to support the power demand of the power purchasing user nodes, the remaining shortage electricity is further provided to the power purchasing user nodes based on a second power supply user node on the renewable energy trading blockchain. In this way, the power trading method based on a dual-chain structure composed of the local energy trading blockchain and the renewable energy trading blockchain effectively improves the efficiency of power trading and renewable energy consumption. Furthermore, the accurate and fair location marginal price calculated by this invention can effectively constrain the unit price of electricity, thereby ensuring the fairness and reasonableness of power trading and effectively reducing the power purchasing costs for power purchasing users; in addition, by assigning a reputation value to each registered entity, the fairness and reasonableness of the selected trading partners are ensured. Based on this, this invention can effectively guarantee the security of the power market under stable and reliable energy trading conditions.

[0171] Figure 7This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Figure 7 As shown, the electronic device 3 in this embodiment includes: a processor 30, a memory 31, and a computer program 32 stored in the memory 31 and executable on the processor 30. When the processor 30 executes the computer program 32, it implements the steps in the various blockchain-based power trading method embodiments described above, for example... Figure 1 Steps 101 to 103 are shown. Alternatively, when the processor 30 executes the computer program 32, it implements the functions of each module in the above-described device embodiments, for example... Figure 6 The functions of modules 201 to 203 are shown.

[0172] For example, the computer program 32 can be divided into one or more modules / units, which are stored in the memory 31 and executed by the processor 30 to complete the present invention. The one or more modules / units can be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program 32 in the electronic device 3. For example, the computer program 32 can be divided into... Figure 6 Modules 201 to 203 are shown.

[0173] The electronic device 3 can be a desktop computer, laptop, handheld computer, or cloud server, etc. The electronic device 3 may include, but is not limited to, a processor 30 and a memory 31. Those skilled in the art will understand that... Figure 7 This is merely an example of electronic device 3 and does not constitute a limitation on electronic device 3. It may include more or fewer components than shown, or combine certain components, or different components. For example, the electronic device may also include input / output devices, network access devices, buses, etc.

[0174] The processor 30 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0175] The memory 31 can be an internal storage unit of the electronic device 3, such as a hard disk or memory. The memory 31 can also be an external storage device of the electronic device 3, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on the electronic device 3. Furthermore, the memory 31 can include both internal and external storage units of the electronic device 3. The memory 31 is used to store the computer program and other programs and data required by the electronic device. The memory 31 can also be used to temporarily store data that has been output or will be output.

[0176] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0177] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0178] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0179] In the embodiments provided by this invention, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0180] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0181] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0182] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various blockchain-based power trading method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately added to or subtracted from the content as required by the legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium may not include electrical carrier signals and telecommunication signals.

[0183] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A blockchain-based electricity trading method, characterized in that, include: The system receives first power information submitted by the first power supply user node and second power information submitted by the power purchase user node on the local energy trading blockchain; wherein, the first power information includes stored power, storage bidding and a first reputation value, and the second power information includes power demand and reputation threshold; Calculate the location marginal price of the distribution network, and determine the intermediate first power supply user node whose storage bidding and first reputation value meet the first preset requirements based on the location marginal price and the reputation threshold, and provide the power demand to the power purchasing user node based on the stored power of the intermediate first power supply user node; When the total amount of stored electricity of all intermediate first power supply user nodes is less than the electricity demand, the second power supply user node on the renewable energy trading blockchain provides the electricity purchase user node with the shortage electricity; wherein, the shortage electricity is the difference between the electricity demand and the total amount of stored electricity. The intermediate first power supply user node is selected in order of increasing storage bidding to provide the power demand of the power purchasing user node. For each time period under the electricity demand period, the second power supply user node in the middle of the expected stable power generation period in that time period is selected in order of expected electricity price from low to high to provide the shortfall electricity to the power purchasing user node; An incentive price is obtained by applying an incentive price to the expected electricity price of the intermediate second power supply user node that provides the shortfall electricity to the power purchase user node; The calculation of the location marginal price of the distribution network includes: Establish an optimal power flow model with the objective function of minimizing electricity purchase cost; Under the constraints of power generation, load power, distribution network loss power, and energy balance, the optimal power flow model is solved to obtain the marginal price of the location. Electricity trading is conducted based on a dual-chain structure consisting of a local energy trading blockchain and a renewable energy trading blockchain.

2. The blockchain-based power trading method according to claim 1, characterized in that, The provision of the power demand to the purchasing user node based on the stored power capacity of the intermediate first power supply user node includes: When the sum of the second energy of the stored energy of each of the selected intermediate first power supply user nodes is greater than or equal to the power demand, the power demand is provided to the power purchasing user node based on the sum of the second energy. Alternatively, when the second total electricity consumption equals the first total electricity consumption and the first total electricity consumption is less than the electricity demand, the electricity demand is provided to the electricity purchasing user node based on the first total electricity consumption.

3. The blockchain-based power trading method according to claim 1 or 2, characterized in that, The second power supply user node on the renewable energy trading blockchain provides the power shortage to the power purchasing user node, including: The system receives third power information submitted by the second power supply user node on the renewable energy trading blockchain, as well as the power demand period and shortage power submitted by the power purchase user node; wherein, the third power information includes the expected stable power generation period, power generation capacity, expected electricity price, and second reputation value; Based on the location marginal price and the credit threshold, determine the intermediate second power supply user node whose expected electricity price and second credit value meet the second preset requirements; When the sum of the third power generation capacity of each selected intermediate second power supply user node in the time period is greater than or equal to the corresponding shortage power in the time period, the shortage power in the time period is provided to the power purchasing user node based on the sum of the third power. Alternatively, when the sum of the fourth power generation capacity of all intermediate second power supply user nodes in a given time period is less than the corresponding shortage power for that time period, the shortage power for that time period is provided to the power purchasing user node based on the sum of the fourth power generation capacity.

4. The blockchain-based power trading method according to claim 3, characterized in that, After providing the electricity shortage power for the period to the electricity purchasing user node based on the third total electricity consumption, or after providing the electricity shortage power for the period to the electricity purchasing user node based on the fourth total electricity consumption, the method further includes: The expected electricity price for the intermediate second power supply user node that provides the shortage electricity to the power purchase user node is updated based on the incentive electricity price, so that the intermediate second power supply user node that provides the shortage electricity to the power purchase user node can provide electricity to other power purchase user nodes based on the updated expected electricity price.

5. The blockchain-based power trading method according to claim 4, characterized in that, The proposed electricity price incentive for the intermediate second power supply user node that provides the shortfall electricity to the power purchase user node, resulting in an incentive electricity price, includes: based on An incentive price is obtained by applying an incentive price to the expected electricity price of the intermediate second power supply user node that provides the electricity shortage to the power purchase user node; in, This refers to the incentive electricity price. This indicates the expected electricity price. This indicates the difficulty adjustment factor. This represents the comprehensive parametric equations for the intermediate second power supply node that provides the power shortage to the power purchasing node.

6. The blockchain-based power trading method according to claim 1, characterized in that, The power generation constraints include a first power constraint on fossil fuel generator sets and a second power constraint on solar panels. The first power constraint includes: ; in, express Fossil fuel generator units at the node The first active power, express Fossil fuel generator units at the node The first reactive power, This indicates the lower limit of the first active power. This indicates the upper limit of the first active power. This indicates the lower limit of the first reactive power. This indicates the upper limit of the first reactive power; The second power constraint includes: ; in, express Solar panels at nodes The second active power, This indicates the lower limit of the second active power. This indicates the upper limit of the second active power.

7. The blockchain-based power trading method according to claim 1, characterized in that, The load power constraints include: a third power constraint for controllable loads, a fourth power constraint for uncontrollable loads, and a fifth power constraint for energy storage systems. The third power constraint includes: ; in, express Controllable load at nodes power, express Controllable load at nodes The third active power, express Controllable load at nodes The second reactive power, Represents the imaginary unit. Indicates controllable load at the node Fixed energy demand, Indicates the length of time. Indicates the first time interval; The fourth power constraint includes: ; in, This represents the static active power of an uncontrollable load. Represents the static reactive power of uncontrollable loads. This represents the fourth active power of the uncontrollable load under rated voltage. This represents the third reactive power of an uncontrollable load under rated voltage. This represents the power consumed by the constant impedance corresponding to the fourth active power. This represents the power of the constant current load corresponding to the fourth active power. This represents the constant power component of the fourth active power. Indicates the rated voltage of an uncontrollable load. Indicates the transient voltage of an uncontrollable load. This represents the power consumed by the constant impedance corresponding to the third reactive power. This represents the power of the constant current load corresponding to the third reactive power. The constant power component representing the third reactive power; The fifth power constraint includes: ; in, express Real-time energy storage system at nodes energy storage capacity, express Real-time energy storage system at nodes Historical energy storage capacity, Indicates the second time interval. express Real-time energy storage system at nodes The charging power, Indicates the first energy conversion factor. express Real-time energy storage system at nodes The discharge power, Indicates the second energy conversion factor. express Real-time energy storage system at nodes The difference between the charging power and the discharging power, This indicates the lower limit of the energy storage capacity. This indicates the upper limit of the energy storage capacity. Indicates the rated capacity of the energy storage system. Indicates that the energy storage system is at the node Maximum charging power, Indicates that the energy storage system is at the node The maximum discharge power.

8. The blockchain-based power trading method according to claim 1, characterized in that, The power loss constraint of the distribution network includes: ; in, Indicates the power loss of the distribution network. Represents a node The first voltage phase angle, Represents a node The second voltage phase angle, express Time Node The first voltage value, express Time Node The second voltage value, Represents a node With nodes Branch road Electrical conductivity; The energy balance constraints include: ; in, This indicates the injected power of the load. Indicates the charging power of the energy storage system. This indicates the discharge power of the energy storage system. This indicates the active power of the solar panel. This represents the injected active power at the relaxation bus in the distribution network. Indicates the number of nodes.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 8 above.