A method, apparatus, device and storage medium for electric energy point-to-point transaction
Patent Information
- Application Number
- CN202210551825.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-18
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2042-05-18
AI Technical Summary
[0003]在实际应用中,不同于普通商品交换,在配电系统中展开分散的电能市场,缺乏统一调度中心协调情况下必然会对配电网的运行状态产生影响甚至会危及系统安全运行,因此,链上市场电能点对点交易必须要包含链上交易管理功能,同时不能需要考虑到用户参与链上市场的隐私保护需求
[0062]本发明提供了一种电能点对点交易的方法、装置、设备及存储介质,。
Smart Images

Figure CN115311084B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method, apparatus, equipment, and storage medium for peer-to-peer electricity trading, belonging to the technical field of electricity trading mechanism design. Background Technology
[0002] Due to new advancements in information and communication technologies, the emergence of blockchain and other distributed ledger technologies has provided a transparent and decentralized trading architecture for energy trading in power distribution systems. This architecture enables decentralized peer-to-peer trading within the power distribution network without the intervention of independent third parties, significantly reducing the pressure on upper-level dispatching agencies. Therefore, many scholars have regarded blockchain-based on-chain trading markets as an effective way to realize peer-to-peer electricity trading in the power distribution network market.
[0003] In practical applications, unlike ordinary commodity exchanges, the decentralized electricity market in the power distribution system, without the coordination of a unified dispatch center, will inevitably affect the operation of the power distribution network and may even endanger the safe operation of the system. Therefore, the peer-to-peer electricity trading in the on-chain market must include on-chain transaction management functions, and at the same time, it must take into account the privacy protection needs of users participating in the on-chain market. Summary of the Invention
[0004] (a) Technical problems to be solved
[0005] To address the shortcomings of existing technologies, this invention provides a method, apparatus, device, and storage medium for peer-to-peer electricity trading. Compared to other benchmark energy management methods, it can achieve the highest model performance and convergence close to the optimal strategy.
[0006] (II) Technical Solution
[0007] To achieve the above objectives, the present invention provides the following technical solution:
[0008] On the one hand, a method for peer-to-peer trading of electricity is provided, including the following steps:
[0009] S101: The distribution network operator submits distribution network physical parameter information to the blockchain trading platform. The distribution network physical parameter information includes the distribution network topology, distribution network branch parameter information, and distribution network operation safety physical constraint information.
[0010] S102: The blockchain trading platform aims to reduce the consumption of computing resources on the blockchain platform. Based on the physical parameter information of the distribution network, the power flow calculation network is redesigned. By constructing virtual node active power injection (Pxn), virtual node reactive power injection (Qxn), virtual branch active power flow (PLxn), and virtual branch reactive power flow (QLxn), the linear design of the power flow calculation network is achieved under the condition of meeting the accuracy of power flow calculation in the distribution network.
[0011] S103: The blockchain trading platform combines a linearized power flow calculation network and linearizes the voltage calculation process of each node according to the iterative algorithm, fully realizing the power flow on-chain calculation model (BC-PF Model) for the distribution network on-chain computing, so that power flow calculation no longer depends on the offline computing platform.
[0012] S104: The blockchain trading platform constructs a fully on-chain market for peer-to-peer electricity trading based on the BC-PF Model. With the aim of on-chain electricity trading, on-chain management, and on-chain transaction privacy protection, it designs a trading mechanism for each trading entity to participate in the fully on-chain market through the dual decomposition method, realizing the on-chain decomposition of the peer-to-peer trading model and the local solution of on-chain decomposition subproblems.
[0013] S105: The blockchain trading platform designs smart contracts based on the trading mechanism to achieve the normal and stable operation of the fully on-chain market.
[0014] Furthermore, the nodes participating in the peer-to-peer transaction include electricity purchasing nodes and electricity selling nodes, and the nodes participating in the peer-to-peer transaction need to be certified by the trading platform in advance. The certification information includes: maximum load capacity, maximum load power, self-provided power capacity, and self-provided power power. The trading platform has no entry threshold requirements for nodes participating in P2P transactions.
[0015] Furthermore, the blockchain trading platform and the smart contracts built into the blockchain trading platform that support on-chain peer-to-peer transactions are both written in Solidity, a language supported by the Ethereum platform.
[0016] Furthermore, step S102 specifically includes:
[0017] ① The power flow calculation network is designed using standard, precise power flow calculation:
[0018] in, Describe the active and reactive current flows of branch lk; Sub(k+1,j) represents the active and reactive power output of the downstream node of branch lk and the active and reactive power loss of the downstream branch; Sub(k+1,j) represents a Boolean variable to determine whether node j is a downstream node of node k+1; NB represents the number of system nodes. It can be found that the nonlinearity of the accurate power flow calculation model is mainly reflected in the active and reactive power loss of the downstream branch.
[0019] Among them, P ij Describe the branch power flow of branch ij with node i as the head node and node j as the tail node; P ji The branch flow of branch ji with node j as the head node and node i as the tail node; R represents the network loss of branch ij in the power flow calculation network, which is the main cause of the nonlinearity of the power flow calculation network under model (1); ij X ij δ ij This represents the resistance, reactance, and phase angle difference of branch ij.
[0020] ② By constructing virtual variables, including virtual node active power injection (Pxn), virtual node reactive power injection (Qxn), virtual branch active power flow (PLxn), and virtual branch reactive power flow (QLxn), the power flow calculation network of model (2) is linearized, thereby reducing the computational resource consumption of its calculation process: By constructing This makes the network loss of branch ij "disappear," achieving linearization of the power flow calculation network, where V i V j P represents the voltage at nodes i and j; ij P ji The newly constructed variables are: branch ij and the virtual branch active power flow (PLxn) of branch ji;
[0021] The linearization of the computational power flow network is achieved under the logic of setting the network variables. PLxn and Pxn are constructed as follows: in, This represents the virtual branch active power flow of branch lk. This represents the virtual node active power injection (Pxn) of node j; the corresponding QLxn and Qxn are constructed in a similar manner.
[0022] Finally, integrating the above variables and expressing them in matrix form yields the linearized power flow calculation network proposed in this patent: Among them, P Br Q Br P represents a column vector composed of the system's branch variables PLxn and QLxn; Out Q Out S represents a column vector composed of the system's node variables Pxn and Qxn; S represents a matrix constructed using the Boolean variable Sub(k+1,j).
[0023] ③ By linearizing the node voltages through an iterative algorithm and combining the linearized power flow calculation network model (5), a complete power flow chain calculation model (BC-PF Model) for the distribution network is obtained, so that power flow calculation no longer depends on the offline calculation platform:
[0024] Models (3)-(4) show that the accuracy of the newly constructed dummy variable calculation depends on the node voltage. Therefore, it is necessary to model the accurate calculation of the node voltage and integrate the calculation process into the power flow chain calculation model (BC-PFModel). Among them, V i V j Represents the voltage at nodes i and j; R ij X ij This represents the virtual resistance and virtual reactance of branch ij, with node i as the head node and node j as the tail node.
[0025] The voltage values of nodes in model (7) are constructed using model (6), with node 1 as the reference node in model (7). Where V1, V2, and V3 represent the voltages at nodes 1, 2, and 3, respectively; R 12 X 12 P 12 Q 12 This represents the virtual resistance, virtual reactance, virtual active power flow, and virtual reactive power flow of branch 12, with node 1 as the first node and node 2 as the last node; R 23 X 23 P 23 Q 23 This represents the virtual resistance, virtual reactance, virtual active power flow, and virtual reactive power flow of branch 12, which has node 2 as the first node and node 3 as the last node; ij∈Path(1:j) represents a Boolean variable for determining whether branch ij is a component of road Path(1:j).
[0026] Finally, integrating the above variables and expressing them in matrix form yields the voltage linearization calculation model proposed in this patent: Where V represents the vector composed of the node voltages of each node in the system; T represents the matrix composed of Boolean variables {ij∈Path(1:j)}; R Br X Br This represents the resistance and reactance of any branch of the system; Indicated by formula The diagonal matrix formed; B P B Q Represented by matrix The calculated new matrix;
[0027] By combining the interactive iterative calculations between models (7) and (8) until convergence, accurate power flow calculation results are obtained.
[0028] Furthermore, step S104 specifically includes:
[0029] ① Model the transaction users and network access fees participating in on-chain peer-to-peer electricity trading:
[0030] Electricity purchaser model:
[0031] Where, α j β j Represents the quadratic and linear coefficients of electricity user j; p j U represents the energy consumption value of electricity user j; j (p j () represents the energy benefits derived from the energy use of electricity user j;
[0032] Electricity sales user model:
[0033] Among them, a i b i c i p represents the quadratic coefficient, linear coefficient, and constant term of electricity user i. i C represents the power generation of electricity user i. i (p i () represents the power generation cost of electricity user i;
[0034] Network access fee model:
[0035] Wherein, N(p) ij () represents the electricity transaction volume p between electricity seller i and electricity buyer j. ij The resulting internet access fee, p ij π represents the electricity transaction volume between electricity seller i and electricity buyer j; π represents the grid access fee per unit of electricity; d ij The virtual electrical distance between electricity seller i and electricity buyer j represents the usage of grid assets by electricity seller i and electricity buyer j in their transactions; S ij,l This represents the Boolean variable in matrix S corresponding to line l when electricity seller i and electricity buyer j conduct a transaction.
[0036] ② The objective and constraints of constructing an on-chain peer-to-peer electricity trading matching model:
[0037] Among them, P J ,P I ,P IJ V represents the virtual electricity purchase vector of electricity purchaser j, the virtual electricity sales vector of electricity seller i, the virtual electricity transaction matrix between electricity seller i and electricity purchaser j, and the node voltage vector, respectively; C and P represent the sets of electricity purchasers and electricity sellers; λi δ represents the dual variable of the equilibrium constraint condition for electricity user i; j Let represent the dual variable of the equilibrium constraint condition for electricity purchaser j; Represents the lower and upper limits of the system node voltages and their corresponding dual variables; Represents the lower and upper limits of the power flow in the system's line branches and their corresponding dual variables; pi, Let i represent the upper and lower limits of the electricity sales volume of electricity user i and its corresponding dual variables; p j , Let represent the upper and lower limits of the electricity purchase volume for electricity user j and their corresponding dual variables;
[0038] ③ The model (12) is decomposed according to the dual variable method to realize the on-chain decomposition of the peer-to-peer transaction model and the local solution of the on-chain decomposition subproblems in order to protect user privacy and realize on-chain transaction management:
[0039] Model (12) is rearranged using the distribution network power flow chain calculation model (BC-PF Model) to obtain:
[0040] in, Represented by matrix B C A new matrix composed of columns corresponding to electricity purchasers and electricity retailers; S C S P This represents a new matrix composed of the columns corresponding to electricity purchasers and electricity sellers in matrix S; This represents the upper and lower voltage margins of node n due to peer-to-peer electricity trading. This represents the voltage change at node n due to peer-to-peer electricity trading. This represents the upper and lower bounds of the power flow on line k due to point-to-point electricity trading.
[0041] Constructing the Lagrangian function for model (13), we obtain:
[0042]
[0043] Model (14) is decomposed using the dual decomposition method, resulting in:
[0044]
[0045]
[0046]
[0047] Among them, model (15a) is an equivalent decomposition of model (14). Based on model (15a), on-chain management of transactions can be achieved without knowing the user's privacy information (cost information such as first-order coefficients, second-order coefficients, and constant terms). Models (15b) and (15c) are the solution models for the subproblems in model (15a). They can be solved locally by the user and then the solution results can be uploaded to the chain to protect the user's privacy information.
[0048] The gradient ascent method is used to update the dual variable:
[0049] in, This represents the gradient of the Lagrange function L with respect to the dual variable λ; This represents the gradient of the Lagrange function L with respect to the dual variable κ; This represents the gradient of the Lagrange function L with respect to the dual variable μ; This represents the gradient of the Lagrangian function L with respect to the dual variable γ; α t This represents the iteration step size for the t-th iteration; Represents the value of the dual variable in the t-th iteration;
[0050] The node voltages of each node are updated according to model (8):
[0051]
[0052] Based on models (15b), (15c), (16), and (17), iterative calculations are performed until the conditions are met. The results of on-chain peer-to-peer electricity transactions are obtained.
[0053] In another aspect, an apparatus is provided, the apparatus comprising:
[0054] The module for acquiring parameters of the resource under test is used to acquire the status parameters and parameters of the target resource under test.
[0055] The target management strategy output module is used to input the measured state parameters and measured resource parameters into the pre-trained target management model to obtain the output target management strategy and the target benefit corresponding to the target management strategy. The target management model is trained based on the flexible action-evaluation algorithm.
[0056] In another aspect, an apparatus is provided, the apparatus comprising:
[0057] At least one processor;
[0058] Memory, used to store at least one program;
[0059] When the at least one program is executed by the at least one processor, the at least one processor implements a method for peer-to-peer trading of electrical energy as described in claims 1-5.
[0060] On another aspect, a storage medium for computer-executable instructions is provided, which, when executed by a computer processor, are used to perform a method for peer-to-peer trading of electrical energy as described in claims 1-5.
[0061] (III) Beneficial Effects
[0062] This invention provides a method, apparatus, equipment, and storage medium for peer-to-peer trading of electrical energy. Attached Figure Description
[0063] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0064] Figure 1 This is a flowchart of the peer-to-peer electricity trading method in an embodiment of the present invention;
[0065] Figure 2 This is a comparison chart of the voltage calculation results of the BC-PF Model in the embodiments of the present invention;
[0066] Figure 3 This is a comparison chart of the power flow calculation performance of the BC-PF Model in the embodiments of the present invention;
[0067] Figure 4 This is a convergence graph of the transaction results of the fully on-chain market transaction mechanism in this embodiment of the invention;
[0068] Figure 5 This is a schematic diagram of the device in an embodiment of the present invention. Detailed Implementation
[0069] The technical solutions in the embodiments of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0070] Example:
[0071] like Figure 1 As shown, Figure 1This is a flowchart illustrating the design method for a fully on-chain market peer-to-peer electricity trading system in an embodiment of the present invention. The method may include:
[0072] S101: Distribution network operators submit distribution network physical parameter information to the blockchain trading platform, including distribution network topology, distribution network branch parameter information, and distribution network operation safety physical constraint information.
[0073] S102: The blockchain trading platform achieves linearization of the power flow computing network by constructing virtual variables.
[0074] Specifically, the blockchain trading platform aims to reduce the consumption of computing resources on the blockchain platform. Based on the physical parameter information of the distribution network, it redesigns the power flow calculation network. By constructing virtual node active power injection (Pxn), virtual node reactive power injection (Qxn), virtual branch active power flow (PLxn), and virtual branch reactive power flow (QLxn), it achieves a linear design of the power flow calculation network that meets the accuracy requirements of distribution network power flow calculation.
[0075] Furthermore, the specific process for implementing the above steps includes:
[0076] The first step is to design the power flow calculation network using standard precise power flow calculation. The specific model is as follows:
[0077]
[0078]
[0079] The second step involves constructing virtual variables, including virtual node active power injection (Pxn), virtual node reactive power injection (Qxn), virtual branch active power flow (PLxn), and virtual branch reactive power flow (QLxn). The power flow calculation network of model (2) is linearized to reduce the computational resource consumption of its calculation process. The specific model is as follows:
[0080]
[0081] It can be found from model (3) that by constructing This can make the network loss of branch ij "disappear", realizing the linearization of the power flow calculation network.
[0082] Without loss of generality, PLxn and Pxn are constructed as follows:
[0083]
[0084] The third step is to integrate the above variables and express them in matrix form, which is the linearized power flow calculation network proposed in this patent:
[0085]
[0086] S103: The blockchain trading platform linearizes the voltage of system nodes and combines it with the linearization of power flow calculation to realize the on-chain calculation model of power flow in the distribution network (BC-PF Model) for on-chain calculation of the blockchain.
[0087] Furthermore, the specific process for implementing the above steps includes:
[0088] The first step is to linearize the node voltages using an iterative algorithm, as shown in the following model:
[0089]
[0090] Since node 1 is often directly connected to the upper-level power grid, its per-unit voltage value can be maintained at 1. Therefore, model (7) uses node 1 as the reference node and constructs the voltage values of other nodes through model (6).
[0091]
[0092] The second step is to integrate the above variables and express them in matrix form, which is the voltage linearization calculation model proposed in this patent. The specific model is as follows:
[0093]
[0094] The third step is to combine the interactive iterative calculation between models (7) and (8) until convergence, so as to obtain accurate power flow calculation results. The above process is the complete power flow chain calculation model (BC-PFModel) of the distribution network.
[0095] like Figure 2-3 As shown, the voltage and power flow calculation results of BC-PFModel are compared with the calculation results of other power flow calculation models that require off-chain platform support (AC power flow calculation model, DC power flow calculation model, and power flow calculation model based on Taylor expansion).
[0096] S104: Based on the BC-PF Model, design a fully on-chain market trading mechanism for peer-to-peer electricity trading to achieve on-chain management of electricity trading and on-chain transaction privacy protection.
[0097] Specifically, the blockchain trading platform constructs a fully on-chain market for peer-to-peer electricity trading based on the BC-PF Model. With the aim of on-chain management of on-chain electricity trading and protection of on-chain transaction privacy, it designs a trading mechanism for various trading entities to participate in the fully on-chain market through the dual decomposition method, realizing the on-chain decomposition of the peer-to-peer trading model and the local solution of on-chain decomposition subproblems.
[0098] Furthermore, the specific process for implementing the above steps includes:
[0099] The first step is to model the users participating in on-chain peer-to-peer electricity trading and the network access fees:
[0100] Electricity purchaser model:
[0101]
[0102] Electricity sales user model:
[0103]
[0104] Network access fee model:
[0105]
[0106] The second step is to construct the objective and constraints of the on-chain peer-to-peer electricity trading matching model:
[0107]
[0108] The third step is to decompose model (12) according to the dual variable method, realize the on-chain decomposition of the peer-to-peer transaction model and the local solution of the on-chain decomposition subproblems in order to protect user privacy and realize on-chain transaction management. The specific model is as follows:
[0109]
[0110] Constructing the Lagrangian function for model (13), we obtain:
[0111]
[0112] Model (14) is decomposed using the dual decomposition method, resulting in:
[0113]
[0114]
[0115]
[0116] In the above formula, model (15a) is an equivalent decomposition of model (14). Based on model (15a), on-chain management of transactions can be achieved without knowing the user's privacy information (cost information such as first-order coefficients, second-order coefficients, and constant terms). Models (15b) and (15c) are the solution models for the subproblems in model (15a). They can be solved locally by the user and then the solution results can be uploaded to the chain to protect the user's privacy information.
[0117] The gradient ascent method is used to update the dual variable:
[0118]
[0119] The fourth step is to update the node voltage of each node according to model (8):
[0120]
[0121] The fifth step involves iterative calculations based on models (15b), (15c), (16), and (17) until the following convergence condition (model (18)) is met, at which point the results of on-chain peer-to-peer electricity transactions can be obtained.
[0122]
[0123] For example, the transaction results of a fully on-chain market transaction mechanism are shown in the attached figure. Figure 4 As shown in the transaction results, it can be seen that the results obtained by the transaction mechanism in this paper all converge.
[0124] Appendix Figure 5 This is a schematic diagram of the structure of a device provided in an embodiment of the present invention. This embodiment provides services for the fully on-chain market peer-to-peer energy trading design method of the above embodiments of the present invention, which considers on-chain transaction management and user privacy protection. It is configurable as an implementation device for the fully on-chain market peer-to-peer energy trading method in the above embodiments. (Appendix) Figure 5 A block diagram is shown of an exemplary device 12 suitable for implementing embodiments of the present invention. (See attached diagram.) Figure 5 The device 12 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0125] As attached Figure 5 As shown, device 12 is represented as a general-purpose computing device. Components of device 12 may include, but are not limited to: one or more processors or processing units 16, system memory 28, and a bus 18 connecting different system components (including system memory 28 and processing unit 16).
[0126] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0127] Device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by device 12, including volatile and non-volatile media, removable and non-removable media.
[0128] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (with attachments). Figure 5 Not shown; usually referred to as a "hard drive"). Despite the attached... Figure 5 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0129] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of the present invention.
[0130] Device 12 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable a user to interact with device 12, and / or with any device that enables device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 22. Furthermore, device 12 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 20. Figure 5 As shown, network adapter 20 communicates with other modules of device 12 via bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0131] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the P2P transaction method provided in the embodiments of the present invention.
[0132] The aforementioned equipment solves the physical constraints of adding power distribution network security to P2P transactions, enabling P2P transactions to proceed automatically without supervision and without threatening the safe and stable operation of the power distribution system.
[0133] This invention also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to execute a power distribution network status calculation contract, a transaction application contract, a transaction matching contract, and a transaction settlement contract written in Solidity language supported by the Ethereum platform, which are involved in a P2P transaction method.
[0134] The computer storage medium of this invention can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0135] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0136] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0137] Of course, the computer-executable instructions provided in the embodiments of the present invention are not limited to the above-described method operations, but can also perform related operations in any embodiment of the present invention.
[0138] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
[0139] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. A method for peer-to-peer trading of electricity, characterized in that, Includes the following steps: S101: The distribution network operator submits distribution network physical parameter information to the blockchain trading platform. The distribution network physical parameter information includes the distribution network topology, distribution network branch parameter information, and distribution network operation safety physical constraint information. S102: The blockchain trading platform aims to reduce the consumption of computing resources on the blockchain platform. Based on the physical parameter information of the distribution network, the power flow calculation network is redesigned. By constructing virtual node active power injection Pxn, virtual node reactive power injection Qxn, virtual branch active power flow PLxn, and virtual branch reactive power flow QLxn, the linear design of the power flow calculation network is achieved under the condition of meeting the accuracy of power flow calculation in the distribution network. S103: The blockchain trading platform combines a linearized power flow calculation network to linearize the calculation process of the node voltage of the power distribution system according to the iterative algorithm, and fully realizes the BC-PF Model of power flow calculation on the blockchain, so that power flow calculation no longer depends on the offline calculation platform. S104: The blockchain trading platform constructs a fully on-chain market for peer-to-peer electricity trading based on the BC-PF Model. With the aim of on-chain electricity trading, on-chain management, and on-chain transaction privacy protection, it designs a trading mechanism for each trading entity to participate in the fully on-chain market through the dual decomposition method, realizing the on-chain decomposition of the peer-to-peer trading model and the local solution of on-chain decomposition subproblems. S105: The blockchain trading platform designs smart contracts based on the trading mechanism to achieve the normal and stable operation of the fully on-chain market.
2. The method for peer-to-peer electricity trading according to claim 1, characterized in that, The users participating in the peer-to-peer transaction include electricity purchasers and electricity sellers. Nodes participating in the peer-to-peer transaction need to be certified by the trading platform in advance. The certification information includes: maximum load capacity, maximum load power, self-provided power capacity, and self-provided power power. The trading platform has no entry threshold requirements for nodes participating in P2P transactions.
3. The method for peer-to-peer electricity trading according to claim 1, characterized in that, The blockchain trading platform and the smart contracts built into it that support on-chain peer-to-peer transactions are both written in Solidity, a language supported by the Ethereum platform.
4. The method for peer-to-peer electricity trading according to claim 1, characterized in that, Step S102 specifically includes: ① The power flow calculation network is designed using standard, precise power flow calculation: (1), in, , Describe the active and reactive current flows of branch lk; , , , This represents the active and reactive power output of the downstream node of branch lk and the active and reactive power loss of the downstream branch; This represents a Boolean variable used to determine whether node j is a downstream node of node k+1; NB represents the number of system nodes, which can reveal that the nonlinearity of the accurate power flow calculation model is mainly reflected in the active and reactive power losses of downstream branches. (2) , in, Describe the branch power flow of branch ij with node i as the head node and node j as the tail node; The branch flow of branch ji with node j as the head node and node i as the tail node; The network loss of branch ij in the power flow calculation network is the main reason for the nonlinearity of the power flow calculation network under model (1). , , This represents the resistance, reactance, and phase angle difference of branch ij; ② By constructing virtual variables, including virtual node active power injection Pxn and virtual node reactive power injection The power flow calculation network of model (2) is linearized by designing Qxn, virtual branch active power flow PLxn, and virtual branch reactive power flow QLxn, thereby reducing the computational resource consumption of its calculation process: (3), By constructing , This makes the network loss of branch ij "disappear," achieving linearization of the power flow calculation network. , Let i represent the voltage at nodes i and j; , The newly constructed variables are: branch ij and the virtual branch active power flow PLxn of branch ji; The linearization of the computational power flow network is achieved under the logic of setting the network variables. PLxn and Pxn are constructed as follows: (4), in, This represents the virtual branch active power flow of branch lk. The virtual node active power injection of node j is represented by Pxn; the corresponding QLxn and Qxn are constructed in a similar manner. Finally, integrating the above variables and expressing them in matrix form yields the linearized power flow calculation network proposed in this patent: (5), in, , This represents a column vector composed of the system's branch variables PLxn and QLxn; , This represents a column vector composed of the system's node variables Pxn and Qxn; Represented by Boolean variables The constructed matrix; ③ Linearize the node voltages using an iterative algorithm, and combine this with a linearized power flow calculation network model. (5) This yields the complete BC-PF model for power flow calculation in the distribution network, making power flow calculation more efficient. Relying on offline computing platforms again: Models (3)-(4) show that the accuracy of the newly constructed dummy variable calculation depends on the node voltage. Therefore, it is necessary to model the accurate calculation of the node voltage and integrate the calculation process into the BC-PF model for power flow in the distribution network. (6), of which, , Let i represent the voltage at nodes i and j; , This represents the virtual resistance and virtual reactance of branch ij, with node i as the head node and node j as the tail node. The voltage values of nodes in model (7) are constructed using model (6), with node 1 as the reference node in model (7). (7), where, , , This represents the voltage at nodes 1, 2, and 3; , , , This represents the virtual resistance, virtual reactance, virtual active power flow, and virtual reactive power flow of branch 12, with node 1 as the first node and node 2 as the last node. , , , This represents the virtual resistance, virtual reactance, virtual active power flow, and virtual reactive power flow of branch 12, with node 2 as the first node and node 3 as the last node. This indicates whether branch ij is a road. Boolean variables of the components; Finally, integrating the above variables and expressing them in matrix form yields the voltage linearization calculation model proposed in this patent: (8), where, A vector representing the node voltages of all nodes in the system; Indicates a Boolean variable The matrix formed; , This represents the resistance and reactance of any branch of the system; , Indicated by formula , The diagonal matrix formed; , Represented by matrix , The calculated new matrix; By combining the interactive iterative calculations between models (7) and (8) until convergence, accurate power flow calculation results are obtained.
5. The method for peer-to-peer electricity trading according to claim 1, characterized in that, Step 104 specifically includes: ① Model the transaction users and network access fees participating in on-chain peer-to-peer electricity trading: Electricity purchaser model: (9) , in, , Represents the quadratic and linear coefficients of electricity purchaser j; This represents the energy consumption value of electricity user j; This represents the benefits derived from the energy use of electricity purchaser j; Electricity sales user model: (10) , in, , , This represents the quadratic coefficient, linear coefficient, and constant term of electricity user i. This represents the amount of electricity generated by electricity user i. This represents the power generation cost for electricity user i; Network access fee model: (11), in, This represents the volume of electricity traded between electricity seller i and electricity buyer j. The resulting internet access fee, This represents the amount of electricity traded between electricity seller i and electricity buyer j; This represents the grid connection fee per unit of electrical energy. This represents the virtual electrical distance between electricity seller i and electricity buyer j, and can express the usage of power grid assets by electricity seller i and electricity buyer j in their transactions. This represents the Boolean variable in matrix S corresponding to line l when electricity seller i and electricity buyer j conduct a transaction. ② The objective and constraints of constructing an on-chain peer-to-peer electricity trading matching model: (12), in, Let them represent the virtual electricity purchase vector of electricity purchaser j, the virtual electricity sales vector of electricity seller i, the virtual electricity transaction matrix between electricity seller i and electricity purchaser j, and the node voltage vector, respectively. This represents the set of electricity buyers and the set of electricity sellers; Let i represent the dual variable of the balance constraint condition for electricity user i. Let represent the dual variable of the equilibrium constraint condition for electricity purchaser j; , , , Represents the lower and upper limits of the system node voltages and their corresponding dual variables; , , , Represents the lower and upper limits of the power flow in the system's line branches and their corresponding dual variables; , , , Let i represent the upper and lower limits of the electricity sales volume of electricity user i and its corresponding dual variables; , , , Let represent the upper and lower limits of the electricity purchase volume for electricity user j and their corresponding dual variables; ③ The model (12) is decomposed according to the dual variable method to realize the on-chain decomposition of the peer-to-peer transaction model and the local solution of the on-chain decomposition subproblems in order to protect user privacy and realize on-chain transaction management: Model (12) is modified using the BC-PF Model, a computational model for power flow in a distribution network, to obtain: (13), in, , Represented by matrix A new matrix composed of columns corresponding to electricity purchasers and electricity retailers; , This represents a new matrix composed of the columns corresponding to electricity purchasers and electricity sellers in matrix S; , This represents the upper and lower voltage margins of node n due to peer-to-peer electricity trading. This represents the voltage change at node n due to peer-to-peer electricity trading. , This represents the upper and lower margins of the power flow on line k due to point-to-point power trading. Constructing the Lagrangian function for model (13), we obtain: (14) ; Model (14) is decomposed using the dual decomposition method, resulting in: (15a); (15b); (15c); Among them, model (15a) is an equivalent split of model (14). Based on model (15a), on-chain management of transactions can be achieved without knowing the user's privacy information, cost information such as first-order coefficients, second-order coefficients, and constant terms. Models (15b) and (15c) are the solution models for the subproblems in model (15a). They can be solved locally by the user and then the solution results can be uploaded to the chain to protect the user's privacy information. The gradient ascent method is used to update the dual variable: (16), in, Represents the Lagrangian function L with respect to dual variables. Find the gradient; Represents the Lagrangian function L with respect to dual variables. Find the gradient; Represents the Lagrangian function L with respect to dual variables. Find the gradient; Represents the Lagrangian function L with respect to dual variables. Find the gradient; This represents the iteration step size for the t-th iteration; , , , Represents the value of the dual variable in the t-th iteration; The node voltages of each node are updated according to model (8): (17); Based on models (15b), (15c), (16), and (17), iterative calculations are performed until the conditions are met. (18) The results of on-chain peer-to-peer electricity transactions are obtained.
6. A device for peer-to-peer trading of electrical energy, characterized in that, The apparatus is used to implement the method according to any one of claims 1 to 5, the apparatus comprising: The information acquisition module is configured to acquire physical parameter information of the power distribution network; The smart terminal module is configured with smart contract code written in Solidity, a language supported by Ethereum, for transaction requests, local solutions, etc., and provides a communication interface for transaction nodes to connect to the platform's central processing module. The platform's central processing module is configured to use smart contracts written in Solidity, a language supported by Ethereum, for on-chain power flow calculations, peer-to-peer transaction node publication, and other functions.
7. A device for peer-to-peer trading of electrical energy, characterized in that, include: At least two processors; The processor is connected to at least one memory and at least one bus; The processor and memory communicate with each other via the bus. The processor is configured to invoke program instructions in the memory to perform the method as described in any one of claims 1 to 5.
8. A storage medium containing computer-executable instructions, characterized in that, The storage medium includes a stored program, wherein the program, when running, controls the device on which the storage medium is located to perform the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Power distribution network security-oriented P2P transaction method based on blockchain technology
CN113254532A