A P2P transaction method based on blockchain technology and oriented to distribution network security

By calculating contracts and transaction matching contracts built-in distribution network status on the blockchain trading platform, calculating network loss sensitivity coefficients and voltage sensitivity coefficients, and combining with the virtual price matching mechanism, the problem that blockchain is difficult to support complex calculations in the distribution network is solved. It realizes safe P2P transactions in the distribution network to ensure the safety and stability of transactions.

CN113254532BActive Publication Date: 2024-12-03SOUTHEAST UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110576195.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-26
Publication Date
2024-12-03
Estimated Expiration
2041-05-26

AI Technical Summary

Technical Problem

Because blockchain technology is difficult to support complex trend computing in the distribution network, it is difficult to judge whether the operating status and physical constraints of the distribution network are met in P2P transactions, which may endanger the system security.

Method used

Design a P2P trading method based on blockchain technology based on distribution network security. By calculating the contract by incorporating the distribution network state on the trading platform, calculating the network loss sensitivity coefficient (LSC) and voltage sensitivity coefficient (VSC), and in transactions A virtual price matching mechanism is introduced in the matchmaking contract to ensure the maximum cost of the distribution network's safety constraints and achieve market clearance.

Benefits of technology

It realizes P2P transactions that run smoothly on the blockchain platform, takes into account the physical constraints of distribution network security, ensures that transactions do not threaten the safe and stable operation of the distribution system, and can automatically conduct transactions without supervision.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113254532B_ABST
    Figure CN113254532B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of power trading mechanism design, and discloses a P2P trading method based on blockchain technology and directed by distribution network security. After the distribution network operator (DSO) submits the distribution network operation status information to the trading platform, the distribution network status built into the trading platform first calculates LSC and VSC according to the calculation contract, and announces the LSC and VSC of each node to all nodes participating in the P2P transaction; then, the nodes participating in the P2P transaction submit transaction applications through the trading platform; then, the transaction matching contract built into the trading platform performs market clearing and announces the transaction matching situation; finally, funds are settled for the nodes that successfully match. It can be seen that the two-way interaction between the distribution network flow information and the P2P matching information of the trading platform can be realized through the distribution network status calculation contract and the transaction matching contract, which can ensure the safety of the distribution network operation and the efficiency of the transaction when large-scale P2P transactions occur.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of power transaction mechanism design, and specifically to a P2P transaction method based on blockchain technology and oriented to power distribution network security. Background Art

[0002] The effective development of distributed power sources is an important feature of the future development of distribution systems. The development of rooftop photovoltaics, home energy storage systems, smart power terminals, and electric vehicles has turned traditional power users into producers and sellers with power generation capabilities. Therefore, actively developing the distribution energy market and solving the pressure of absorbing distributed resources within the distribution system have become important issues that need to be solved under the new situation.

[0003] Due to new advances in information and communication technology, the emergence of blockchain and other distributed ledger technologies has provided a transparent and decentralized transaction architecture for energy transactions in distribution systems. It can organize decentralized P2P transactions in distribution networks without the intervention of independent third parties, greatly reducing the pressure on upper-level dispatching agencies. Therefore, many scholars have regarded blockchain technology as the basis for realizing P2P transactions in the distribution network power market.

[0004] In actual applications, unlike ordinary commodity exchanges, the development of a decentralized P2P market in the distribution system allows users to trade energy with each other in the absence of a unified dispatching center for coordination, which will inevitably affect the operating status of the distribution network and even endanger the safe operation of the system. Therefore, the P2P transaction model in the distribution network must include the physical constraints of the distribution network.

[0005] However, due to the distributed architecture adopted by blockchain and other distributed ledger technologies, service platforms based on these technologies often find it difficult to perform complex mathematical operations. Therefore, it is also difficult for P2P trading platforms to perform a large number of repeated power flow calculations on distribution networks to determine the operating status of distribution networks and whether physical constraints are met. Summary of the invention

[0006] In order to solve the deficiencies mentioned in the above background technology, the purpose of the present invention is to provide a P2P transaction method based on blockchain technology for distribution network security orientation.

[0007] The purpose of the present invention can be achieved through the following technical solutions:

[0008] A P2P transaction method based on blockchain technology and directed to power distribution network security, the method comprising the following steps:

[0009] S101: The distribution network operator (DSO) submits distribution network operation status information to the blockchain-based trading platform, including distribution network base state flow, distribution network topology, and safety physical constraint information of distribution network operation;

[0010] S102: The transaction platform based on blockchain technology has a built-in distribution network status calculation contract. The contract calculates the network loss sensitivity coefficient (LSC) and voltage sensitivity coefficient (VSC) of each node in the distribution network according to the distribution network operation status information, and publishes the LSC and VSC of each node to all nodes participating in P2P transactions on the platform;

[0011] S103: The nodes participating in the P2P transaction decide the price and quantity of the P2P transaction based on their own preferences according to their own electricity consumption and sales needs and the LSC and VSC published by the node, and submit the transaction application through the transaction application contract built into the transaction platform based on blockchain technology;

[0012] S104: After receiving the application information of the transaction application contract and the distribution network operation status information of the distribution network status calculation contract, the transaction matching contract built into the transaction matching contract uses the virtual price matching, distribution network security guarantee and other mechanisms built into the transaction matching contract to clear the market with the goal of maximizing social welfare including the distribution network security constraint cost, and announces the transaction matching situation to all nodes participating in the P2P transaction;

[0013] S105: After the P2P transaction is matched, the transaction settlement contract built into the trading platform adopts two settlement methods to settle funds for the successfully matched nodes according to the matching situation and its own Uplift mechanism.

[0014] Furthermore, the nodes participating in the P2P transaction include power purchasing nodes and power selling nodes, and the nodes participating in the P2P transaction need to be authenticated to the trading platform in advance. The authentication information includes: maximum load capacity, maximum load power, self-provided power supply capacity, self-provided power supply power and the trading platform has no entry threshold requirements for nodes participating in P2P transactions.

[0015] Furthermore, the transaction platform based on blockchain technology and its built-in distribution network status calculation contract, transaction application contract, transaction matching contract, and transaction settlement contract are all smart contracts written in the Solidity language supported by the Ethereum platform, and have the characteristics of automatic execution and information traceability.

[0016] Furthermore, the computing contract is deployed on the system central server, and its code implementation logic is designed based on the following ideas:

[0017] The voltage sensitivity coefficient (VSC) reflects the impact of node injection power changes on the voltage of each node in the system during P2P transactions. The calculation model is as follows:

[0018] Take any section of line L in the distribution network ij For example, the power injection of node i can be decomposed into a front term only related to the node voltage amplitude and a rear term only related to the node voltage phase angle, that is:

[0019]

[0020]

[0021] Where P i , Q i represents the active and reactive power injected by node i, NB represents the number of branches; (V i , δ i )、(V j , δ j ) represents the line L provided by the distribution network operator (DSO) ij The voltage and phase angle information of the first and last nodes (i, j), (r ij , x ij ) represents the line L provided by the distribution network operator (DSO) ij Resistance and reactance information;

[0022] In order to improve the operation efficiency, the above calculation model is stored in the central processor of the trading platform in the form of a matrix. The matrix form of equations (1) and (2) can be expressed as:

[0023]

[0024] In the formula, P', Q' represent the vector of active power and reactive power of the nodes in the distribution network except the root node calculated by formulas (1) and (2), V', δ' represent the vector of voltage amplitude and voltage phase angle of the nodes in the distribution network except the root node provided by the distribution network operator (DSO), B1', B2', B E Both represent matrices composed of the distribution network topology information and branch impedance information and their deformations in formulas (1) and (2), (V1, δ1) represents the voltage amplitude and phase angle of the root node;

[0025] In formula (3), the analytical expression of B1', B2' can be obtained by deleting the first row and the first column of the extended matrix B1, B2 containing the root node information. The analytical expression of can be obtained by deleting the first element of the first column of the expanded matrix B1, B2. The elements of B1, B2 can be expressed as:

[0026]

[0027] Therefore, taking the root node as the reference node, the voltage of each node in the distribution system can be calculated by the following linearization model:

[0028]

[0029] In the formula, P′ j ,Q' j Represents the jth element in the vector P', Q', and its physical meaning is the active and reactive power of node j of the root node;

[0030] On this basis, when P2P transactions occur in the distribution system, the node injection power P caused by each transaction can be obtained. j The influence coefficient of the change on the voltage level of each node in the distribution system, namely VSC:

[0031]

[0032] The network loss sensitivity coefficient (LSC) reflects the impact of node injection power changes on system network loss in P2P transactions. The calculation model is as follows:

[0033] Flow through line L k The power flow can be expressed as:

[0034]

[0035]

[0036]

[0037] In the formula, represents the current flowing through line L provided by the distribution network operator (DSO) k The active and reactive power, Represents the branch L between node j and its parent node j-1 Active power loss and reactive power loss; represents the active load and reactive load connected to any node j provided by the distribution network operator (DSO); Formula (9) represents the topological relationship between node i and node j, φ(i) is the set of subtrees of node i, and the result of Formula (9) is determined by the distribution network topology information provided by the distribution network operator (DSO);

[0038] From formulas (8) and (9), we can know that given the system active loss, reactive loss information, and node active load, reactive load information, we can solve for the branch power flow information;

[0039] Similarly, the system active loss and reactive loss information can also be obtained through branch power flow information and node voltage information provided by the distribution network operator (DSO). The calculation is shown as follows:

[0040]

[0041] In the formula, Indicates line L k Active and reactive network losses, Indicates line L k Resistance, reactance, V k+1 Indicates line L k The downstream node voltage of

[0042] At this time, the impact of node load power on system active power loss can be calculated by the following formula:

[0043]

[0044] in, as well as It can be expressed by formulas (7), (8) and (9):

[0045]

[0046] Formulas (7)-(9) and (12) can be used to calculate formulas (10) and (11). Formulas (7)-(8) can be calculated from formula (10). Therefore, formulas (7)-(12) can be repeatedly iterated in the form of forward and backward substitution until the error between two iterations of the system active loss is less than the error limit. Then, the influence coefficient of the node load power change on the system active loss value can be obtained by convergence.

[0047] On this basis, when P2P transactions occur in the distribution system, the node injection power P caused by each transaction can be obtained. j The influence coefficient of the change on the voltage level of each node in the distribution system, namely LSC:

[0048]

[0049] Furthermore, the transaction application contract is deployed on the intelligent terminal device of the system, and has both the channel function of the user connecting to the system and the collection function of the distribution network operator (DSO) collecting system operation status information.

[0050] Furthermore, the transaction matching contract is deployed on the system central server, and its code implementation logic is designed based on the following ideas:

[0051] ① The distribution network security guarantee mechanism ensures that changes in node injection power during P2P transactions will not affect the safe operation of the system;

[0052] When the impact of the P2P transaction matching result on the distribution network is negative and exceeds the internal limit of the platform, the system sets the virtual price of the transaction to ±10*e 06 (If the transaction node is a power purchase node, the virtual power purchase price is set to -10*e 06 If the transaction node is a power selling node, the virtual power selling price is set to +10*e 06 ) to ensure that the transaction will not be cleared by the system. The specific calculation model is:

[0053]

[0054] Where P Vir P is the virtual price used for P2P transaction matching. Use is the bid price submitted by the user in the contract application in step 2, P is the bid quantity submitted by the user in the contract application in step 2, and C LSC , C VSC They are the system network loss constraint cost and the system node voltage quality physical constraint cost respectively. At the same time, it should be noted that when the impact of P2P transactions on the system is positive (helping the system to operate economically), then C LSC , C VSC Can be a negative value to ensure that the transaction has a high probability of being cleared;

[0055] ② P2P virtual price matching mechanism: During the P2P matching process, the power distribution network security constraint cost is added to the price submitted by the user to the P2P trading platform to change the priority of the user's transaction. It is only used for the matching process and not for actual fund settlement.

[0056] Taking any P2P transaction node j in the distribution network as an example, assuming that P2P transaction node j is a power selling node, the information submitted to the P2P transaction platform through the transaction application contract on the smart terminal is: transaction price Pr j , transaction volume P j , after this transaction is completed, the increase in distribution network system loss and the voltage deviation of the system over-limit node can be calculated by the following formula:

[0057] ΔP loss (j) = LSC (j)·(-P j ) (15)

[0058]

[0059]

[0060] Where LSC(j) represents the influence coefficient of the change of the injected power at node j on the change of the system loss, VSC(i,j) represents the influence coefficient of the change of the injected power at node j on the change of the voltage at node i, V rate 、V i represents the rated voltage value of the distribution network node submitted by the distribution network operator (DSO) to the P2P trading platform and the real-time voltage value collected by the smart terminal, DV(i,j), DV(j), δ rate They respectively represent the voltage deviation of node i calculated by the built-in transaction matching contract of the P2P trading platform after transaction j is cleared, the total voltage deviation of the system's over-limit nodes, and the voltage deviation threshold allowed by economic operation;

[0061] Through the calculation results of formulas (15)-(17), the transaction matching contract built into the P2P trading platform can calculate the system network loss constraint cost C LSC , system node voltage quality constraint cost C VSC , the calculation formula is as follows:

[0062]

[0063]

[0064] In the formula, C LSC (j), C VSC (j) represents the system network loss constraint cost and system node voltage quality constraint cost calculated by the transaction matching contract built into the P2P trading platform after transaction j is cleared. Indicates that the value* is normalized, λ LSC , VSC The adjustment coefficients representing the system network loss constraint cost and the system node voltage quality constraint cost are determined by the distribution network operator’s preference for power quality and economic operation;

[0065] Substitute formula (18) and formula (19) into formula (14) to calculate the virtual matching price.

[0066] ③P2P transaction matching mechanism. After the virtual price is formed, the transaction matching contract built into the P2P trading platform only needs to match according to the high and low virtual prices of the purchasing and selling electricity nodes to clear and obtain the matching results.

[0067] Furthermore, the transaction settlement contract is deployed on the system central server, and its code implementation logic is designed based on the following ideas:

[0068] ① When the matching transaction volume is less than the initial clearing volume obtained by each trading node based on the actual quotation, the transaction settlement contract built into the trading platform will perform market clearing and settlement according to the average of the marginal trading node quotations.

[0069] ② When the matched transaction volume is greater than the initial clearing volume obtained by each transaction node according to the real quotation, the P2P market is required to clear according to the real clearing point. At the same time, the transaction settlement contract built into the trading platform needs to determine whether the settlement cost of the compensation area to the right of the clearing point is less than the economic benefits of network loss and voltage optimization after executing the matching transaction in the compensation area. If the conditions are met, according to the Uplift mechanism, the smart contract charges the system maintenance cost to each power purchasing node in the entire network and executes the matching result of the compensation area. The main process is as follows:

[0070] a. Calculate the settlement cost of the compensation area:

[0071]

[0072] In the formula, Indicates the number of marginal electricity selling and purchasing nodes of P2P transaction matching results, Pr s,right , Pr b ,right The quotes of the marginal electricity selling and purchasing nodes representing the P2P transaction matching results. Indicates the reported quantity of marginal electricity selling and purchasing nodes in P2P transaction matching results.

[0073] b. Determine whether to execute the compensation zone matching results and calculate the maintenance costs that the power purchasing node needs to bear:

[0074]

[0075] In the formula, C Up N represents the maintenance cost that each power purchasing node needs to bear, calculated by the transaction matching contract built into the P2P trading platform. buy It represents the number of power purchasing nodes participating in P2P transactions. Eco represents the economic benefits obtained from optimizing the distribution network loss and node voltage after executing the matching transaction in the compensation area. If the settlement cost in the compensation area is greater than the economic benefits obtained from the optimization of the distribution network, the matching transaction in the compensation area will not be executed.

[0076] Beneficial effects of the present invention:

[0077] The present invention is different from the traditional method of realizing the mechanism and method of P2P transaction clearing. The underlying architecture for realizing P2P matching and transaction is a decentralized architecture based on blockchain technology. Considering that the economic optimal matching of each transaction party in the traditional P2P transaction method is likely to have a negative impact on the operation of the system, the present invention adds the physical constraints of distribution network security into the transaction model. At the same time, considering the limitations of the computing power of the blockchain distributed architecture, the LSC and VSC models are derived based on the power flow section of the distribution network to measure the impact of P2P transactions on the network loss and node voltage of the distribution network. Therefore, the smart contract designed based on the technology of the present invention can run smoothly on a platform based on blockchain technology. At the same time, since the physical constraints of distribution network security are considered in P2P transactions, P2P transactions can be automatically carried out without supervision and will not threaten the safe and stable operation of the distribution system. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] The present invention will be further described below in conjunction with the accompanying drawings.

[0079] Attached Figure 1 It is a schematic diagram of the flow of a P2P transaction method based on blockchain technology and directed to a security of a distribution network in an embodiment of the present invention;

[0080] Attached Figure 2 It is a schematic diagram of scenarios that may occur in the matching and settlement stages in an embodiment of the present invention;

[0081] Attached Figure 3 is a structural diagram of an IEEE-33 node power distribution system including a transaction node in an embodiment of the present invention;

[0082] Attached Figure 4 This is a schematic diagram of the interaction of smart contracts on a P2P trading platform in an embodiment of the present invention;

[0083] Attached Figure 5 This is a schematic diagram of the contract execution result of the electricity purchasing user B1 using the present invention in an embodiment of the present invention;

[0084] Attached Figure 6 Schematic diagram of the execution of a transaction application contract in an embodiment of the present invention;

[0085] Attached Figure 7 Schematic diagram of the execution of a transaction matching contract in an embodiment of the present invention;

[0086] Attached Figure 8 Schematic diagram of the execution of a transaction settlement contract in an embodiment of the present invention;

[0087] Attached Fig. 9 It is a schematic diagram of virtual prices and their components obtained by adopting a P2P transaction method based on blockchain technology and guided by distribution network security in an embodiment of the present invention. DETAILED DESCRIPTION

[0088] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0089] like Figure 1-Figure 9 As shown, a P2P transaction method based on blockchain technology and directed to power distribution network security comprises the following steps:

[0090] S101: The distribution network operator (DSO) submits the base state power flow and topology information of the distribution network to the platform.

[0091] Specifically, through the information collection module and the intelligent terminal module, the distribution network operator (DSO) is authorized to collect the operating status of the distribution network. After the distribution network operator (DSO) completes the collection of distribution network operating status information, it needs to submit the distribution network operating status information to the transaction platform based on blockchain technology, including the distribution network base state flow, distribution network topology structure and the safety physical constraint information of the distribution network operation.

[0092] The distribution system of the distribution network topology information collected by the distribution network operator (DSO) in the embodiment of the present invention includes 33 nodes, 32 branches, and 4 feeders. Nodes 1, 2, 19, 20, 21, and 22 constitute feeder 1, nodes 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, and 18 constitute feeder 2, nodes 1, 2, 3, 23, 24, and 25 constitute feeder 3, and nodes 1, 2, 3, 4, 5, 6, 26, 27, 28, 29, 30, 31, 32, and 33 constitute feeder 4.

[0093] S102: The P2P trading platform calculates and publishes the LSC and VSC coefficients of all nodes in the network based on the base state flow and topology information.

[0094] Specifically, after the P2P trading platform obtains the distribution network operation status information submitted by the distribution network operator (DSO), including the distribution network base state flow, distribution network topology and the safety physical constraint information of the distribution network operation, the P2P trading platform's built-in distribution network status calculation contract written in Solidity language supported by the Ethereum platform linearizes the flow section according to the distribution network operation status information, calculates the network loss sensitivity coefficient (LSC) and voltage sensitivity coefficient (VSC) of each node in the distribution network, and publishes the LSC and VSC of each node to all nodes participating in P2P transactions on the platform.

[0095] Furthermore, the specific process of implementing the above steps includes:

[0096] The first step is to calculate the VSC coefficient of the nodes in the distribution network system. After the distribution network operator (DSO) submits the distribution network operation status information to the trading platform based on blockchain technology, the distribution network status calculation contract built into the trading platform can obtain the base state power flow information and distribution network topology information of the distribution system, on which basis the linearization calculation of the power flow can be performed. ij For example, the power injection of node i can be decomposed into a front term only related to the node voltage amplitude and a rear term only related to the node voltage phase angle, that is:

[0097]

[0098]

[0099] In order to improve the operation efficiency, the above calculation model is stored in the central processor of the trading platform in the form of a matrix. The matrix form of equations (1) and (2) can be expressed as:

[0100]

[0101] In formula (3), the analytical expression of B1', B2' can be obtained by deleting the first row and the first column of the extended matrix B1, B2 containing the root node information. The analytical expression of can be obtained by deleting the first element of the first column of the expanded matrix B1, B2. The elements of B1, B2 can be expressed as:

[0102]

[0103] Therefore, taking the root node as the reference node, the voltage of each node in the distribution system can be calculated by the following linearization model:

[0104]

[0105] In the formula, P′ j ,Q′ j Represents the jth element in the vector P', Q', and its physical meaning is the active and reactive power of node j of the root node.

[0106] On this basis, when P2P transactions occur in the distribution system, the node injection power P caused by each transaction can be obtained. j The influence coefficient of the change on the voltage level of each node in the distribution system, namely VSC:

[0107]

[0108] The second step is to calculate the LSC coefficient of the distribution network system node. After the distribution network operator (DSO) submits the distribution network operation status information to the trading platform based on blockchain technology, the distribution network status calculation contract built into the trading platform can obtain the base state power flow information and distribution network topology information of the distribution system, on which basis the linearization calculation of the power flow can be performed. k The power flow can be expressed as:

[0109]

[0110]

[0111]

[0112] From formulas (8) and (9), we can know that given the system active loss and reactive loss information as well as the node active load and reactive load information, we can solve for the branch power flow information.

[0113] Similarly, the system active loss and reactive loss information can also be obtained through branch power flow information and node voltage information provided by the distribution network operator (DSO). The calculation model is as follows:

[0114]

[0115] At this time, the impact of node load power on system active power loss can be calculated by the following formula:

[0116]

[0117] in, as well as It can be expressed by formulas (7), (8) and (9):

[0118]

[0119] Formulas (7)-(9) and (12) can be used to calculate formulas (10) and (11). Formula (7)-(8) can be calculated from formula (10). Therefore, formulas (7)-(12) can be repeatedly iterated in the form of forward and backward substitution until the error between two iterations of the system active loss is less than the error limit. Then, the influence coefficient of the node load power change on the system active loss value can be obtained by convergence.

[0120] On this basis, when P2P transactions occur in the distribution system, the node injection power P caused by each transaction can be obtained. j The influence coefficient of the change on the voltage level of each node in the distribution system, namely VSC:

[0121]

[0122] S103: Each transaction node participating in the P2P transaction submits transaction application information through the platform.

[0123] Specifically, the nodes participating in P2P transactions decide the quotes and quantities for participating in P2P transactions based on their own preferences according to their own electricity consumption and sales needs and the LSC and VSC announced by the nodes, and submit transaction applications through the transaction application contract written in the Solidity language supported by the Ethereum platform built into the P2P trading platform. The nodes participating in P2P transactions include electricity purchasing nodes and electricity selling nodes, and the nodes participating in P2P transactions need to be authenticated to the trading platform in advance. The authentication information includes: maximum load capacity, maximum load power, self-provided power supply capacity, and self-provided power supply power. The trading platform has no entry threshold requirements for nodes participating in P2P transactions.

[0124] For example, the nodes participating in the P2P transaction include power purchasing nodes B1-B8, and power selling nodes include S1-S8. Their topological locations are shown in the attached figure. Figure 3 As shown in Table 1, the transaction application information submitted through the transaction application contract written in Solidity language supported by the Ethereum platform built into the P2P trading platform includes node ID, node location, reported quantity, and quoted price, as shown in Tables 1 and 2. Specifically, after the power purchasing node B1 submits the information through the transaction application contract written in Solidity language supported by the Ethereum platform built into the trading platform, the platform execution result is as shown in the attached figure. Figure 6 shown.

[0125] Table 1 Power purchase node submission information

[0126]

[0127] Table 2 Information submitted by the electricity sales node

[0128]

[0129]

[0130] S104: The P2P trading platform clears the P2P market and announces the matching results.

[0131] Specifically, after receiving the application information of the transaction application contract and the distribution network operation status information of the distribution network status calculation contract, the transaction matching contract written in the Solidity language supported by the Ethereum platform built into the P2P trading platform uses the virtual price matching, distribution network safety guarantee and other mechanisms built into the transaction matching contract to clear the market with the goal of maximizing social welfare including the distribution network safety constraint cost, and announces the transaction matching status to all nodes participating in the P2P transaction.

[0132] For example, the transaction matching contract written in Solidity language supported by the Ethereum platform built into the P2P trading platform determines the impact of the power purchase volume of B1-B8 and the power sale volume of S1-S8 on the network loss of the distribution system and the node voltage quality through the VSC and LSC coefficients, and superimposes the LSC adjustment cost and VSC adjustment cost on the quotations of nodes B1-B8 and S1-S8 according to the impact to form a virtual price for matching transactions, as shown in the attached figure. Fig. 9 Specifically, the execution result of the transaction matching contract written in Solidity language supported by the Ethereum platform built into the trading platform in the embodiment of the present invention is shown in the attached Figure 7 shown.

[0133] The logic of the transaction matching contract code is designed based on the following ideas:

[0134] The first step is to determine whether the transaction will threaten the safe and stable operation of the distribution network. When the distribution network operator (DSO) submits the distribution network operation status information to the P2P trading platform based on blockchain technology, the transaction matching contract built into the trading platform calculates the impact of different P2P transaction matching results on the distribution network system loss and node voltage through VSC and LSC coefficients. When the impact of the P2P transaction matching result on the distribution network is negative and exceeds the internal limit of the platform, the system sets the virtual price of the transaction to ±10*e 06 (If the transaction node is a power purchase node, the virtual power purchase price is set to -10*e 06 If the transaction node is a power selling node, the virtual power selling price is set to +10*e 06 ) to ensure that the transaction will not be cleared by the system. The specific calculation model is:

[0135]

[0136] The second step is to form a virtual price for matching transactions. When the distribution network operator (DSO) submits the distribution network operation status information to the P2P trading platform based on blockchain technology, the built-in transaction matching contract of the trading platform calculates the impact of different P2P transaction matching results on the distribution network system loss and node voltage through VSC and LSC coefficients, thereby superimposing the distribution network security constraint cost on the price submitted by the user to the P2P trading platform. Taking any P2P trading node j in the distribution network as an example, assuming that P2P trading node j is a power selling node, the information submitted to the P2P trading platform through the transaction application contract on the smart terminal is: transaction price Pr j , transaction volume P j , after this transaction is completed, the increase in distribution network system loss and the voltage deviation of the system over-limit node can be calculated by the following formula:

[0137] ΔP loss (j) = LSC (j)·(-P j ) (15)

[0138]

[0139]

[0140] Through the calculation results of formulas (15)-(17), the transaction matching contract built into the P2P trading platform can calculate the system network loss constraint cost C LSC , system node voltage quality constraint cost C VSC , the calculation model is as follows:

[0141]

[0142]

[0143] Therefore, the final virtual price used for matching transactions can be calculated by formula (14).

[0144] The third step is that after the virtual price is formed, the transaction matching contract built into the P2P trading platform only needs to match the virtual prices of the purchasing and selling electricity nodes to clear and obtain the matching results.

[0145] S105: The P2P trading platform performs fund settlement for the successfully matched transaction nodes.

[0146] Specifically, after the P2P trading platform completes the matching of trading nodes, the trading platform's built-in trading settlement contract written in the Solidity language supported by the Ethereum platform adopts two settlement methods to settle funds for the successfully matched nodes according to the matching situation and formulas (20)-(21).

[0147] Exemplarily, the transaction settlement contract written in Solidity language supported by the Ethereum platform built into the P2P trading platform calculates the winning bid power of the transaction nodes B1-B8 and S1-S8 according to the result in step S104. It can be found that although the bid of the B4 node is higher than that of the B3 node, the superimposed LSC cost and VSC cost are too high (the LSC cost and VSC cost of the power purchasing node are generally negative), and the superimposed virtual price is lower than B3, so it has not been cleared. Similarly, although the bid of the node S1 is lower than that of S3, the superimposed LSC cost and VSC cost are too high (the LSC cost and VSC cost of the power purchasing node are generally positive), and the superimposed virtual price is higher than S3, so it has not been cleared. The winning bid information of the transaction nodes is shown in Tables 3 and 4. Specifically, the execution results of the transaction settlement contract written in Solidity language supported by the Ethereum platform built into the trading platform in the embodiment of the present invention are shown in the attached figure. Figure 7 shown.

[0148] Table 3 Power purchase node winning bid information

[0149]

[0150]

[0151] Table 4 Information on winning bids for power sales nodes

[0152]

[0153] The above generation implementation logic is designed based on the following ideas:

[0154] The first step is to determine which of the built-in scenarios the P2P matching result belongs to. The built-in scenarios are as follows: Figure 2 shown.

[0155] In the second step, when the matching transaction volume is less than the initial clearing volume obtained by each trading node according to the real quotation, the clearing result is as shown in the attached Figure 2 As shown on the left, at this time, the trading settlement contract built into the trading platform performs market clearing and settlement according to the average value of the marginal trading node quotations.

[0156] Step 3: When the matched transaction volume is greater than the initial clearing volume obtained by each trading node based on the real quotation, the clearing result is as shown in the attached figure. Figure 2 As shown on the right, the P2P market is required to clear according to the real clearing point. At the same time, the transaction settlement contract built into the trading platform needs to determine whether the settlement cost of the compensation area to the right of the clearing point is less than the economic benefits of network loss and voltage optimization after executing the compensation area matching transaction. If the conditions are met, according to the Uplift mechanism, the smart contract charges the system maintenance cost to each power purchasing node in the entire network and executes the matching result of the compensation area. The main calculation model is as follows:

[0157] Attached Figure 2 Settlement cost model for the middle compensation area:

[0158]

[0159] The maintenance cost model that the power purchasing node needs to bear is:

[0160]

[0161] From the above content, it can be seen that the embodiment of the present invention provides a P2P transaction method and implementation device based on blockchain technology with distribution network security orientation. After the distribution network operator (DSO) submits the distribution network operation status information to the transaction platform based on blockchain technology, the distribution network status calculation contract built into the transaction platform first calculates the network loss sensitivity coefficient (LSC) and voltage sensitivity coefficient (VSC) of each node of the distribution network according to the distribution network operation status information, and publishes the LSC and VSC of each node to all nodes participating in the P2P transaction; then, the nodes participating in the P2P transaction calculate the LSC and VSC information of the nodes according to their own electricity consumption and electricity sales needs and the LSC and VSC information of the nodes where they are located. Submit a P2P transaction application through the transaction application contract built into the trading platform; then, the transaction matching contract built into the trading platform receives the application information of the transaction application contract and the distribution network operation status information submitted by the distribution network status calculation contract, and through the built-in virtual price matching, distribution network safety guarantee and other mechanisms of the contract, the market is cleared with the goal of maximizing social welfare with the distribution network safety constraint cost, and the transaction matching situation is announced to all the purchasing and selling nodes participating in the P2P transaction; finally, the transaction settlement contract built into the trading platform adopts different settlement methods according to the matching situation and its own Uplift mechanism to settle funds for the nodes that have successfully matched. It can be seen that the two-way interaction between the distribution network flow information and the P2P matching information of the trading platform can be realized through the distribution network status calculation contract and the transaction matching contract. Combined with the open, transparent and traceable characteristics of the blockchain, it can ensure that P2P transactions will not affect the safety of the distribution network without supervision, so that when large-scale P2P transactions occur in the future, the safety of the distribution network operation and the efficiency of the transaction can be guaranteed.

[0162] The interactive process of the distribution network state calculation contract, transaction application contract, transaction matching contract, and transaction settlement contract written in the Solidity language supported by the Ethereum platform in each step of the embodiment of the present invention is as shown in the attached figure. Figure 4 As shown, for example, taking the power purchasing node B1 as an example, the interactive results of the distribution network state calculation contract, transaction application contract, transaction matching contract, and transaction settlement contract in each step of the embodiment of the invention are shown in the attached Figure 5 shown.

[0163] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, and these changes and improvements all fall within the scope of the present invention to be protected.

Claims

1. A P2P transaction method based on blockchain technology and oriented to distribution network security, characterized in that: The method comprises the following steps: S101: The distribution network operator submits the distribution network operation status information to the transaction platform based on blockchain technology, including the distribution network base state flow, distribution network topology and the safety physical constraint information of the distribution network operation; S102: The transaction platform based on blockchain technology has a built-in distribution network status calculation contract. The contract calculates the network loss sensitivity coefficient LSC and the voltage sensitivity coefficient VSC of each node in the distribution network according to the distribution network operation status information, and publishes the LSC and VSC of each node to all nodes participating in P2P transactions on the platform; S103: The nodes participating in the P2P transaction decide the price and quantity of the P2P transaction based on their own preferences according to their own electricity consumption and sales needs and the LSC and VSC published by the node, and submit the transaction application through the transaction application contract built into the transaction platform based on blockchain technology; S104: After receiving the application information of the transaction application contract and the distribution network operation status information of the distribution network status calculation contract, the transaction matching contract built into the transaction matching contract uses the virtual price matching and distribution network safety guarantee mechanism built into the transaction matching contract to clear the market with the goal of maximizing social welfare including the distribution network safety constraint cost, and announces the transaction matching situation to all nodes participating in P2P transactions; S105: After the P2P transaction is matched, the transaction settlement contract built into the trading platform adopts two settlement methods to settle funds for the successfully matched nodes according to the matching situation and its own Uplift mechanism; The computing contract is deployed on the system central server, and its code implementation logic is designed based on the following ideas: The voltage sensitivity coefficient VSC reflects the impact of node injection power changes on the voltage of each node in the system during P2P transactions. The calculation model is as follows: Take any section of line L in the distribution network mn For example, the power injection of node m is split into a pre-term only related to the node voltage amplitude and a post-term only related to the node voltage phase angle, that is: Where P m , Q m represents the active and reactive power injected by the first node m, and NB represents the number of branches; (V m , δ m )、(V n , δ n ) represents the line L provided by the distribution network operator mn The voltage and phase angle information of the first and last nodes (m,n), (r mn , x mn ) represents the line L provided by the distribution network operator mn Resistance and reactance information; The above calculation model is stored in the trading platform central processor in the form of a matrix. The matrix form of equations (1) and (2) is as follows: In the formula, P', Q' represent the vector of active power and reactive power of the nodes in the distribution network except the root node calculated by formulas (1) and (2), V', δ' represent the vector of voltage amplitude and voltage phase angle of the nodes in the distribution network except the root node provided by the distribution network operator, B1', B2', B E Both represent matrices composed of the distribution network topology information and branch impedance information and their deformations in formulas (1) and (2), (V1, δ1) represents the voltage amplitude and phase angle of the root node; In formula (3), the analytical expression of B1', B2' is obtained by deleting the first row and the first column of the extended matrix B1, B2 containing the root node information. The analytical expression of is obtained by deleting the first element of the first column of the expanded matrix B1, B2. The elements of B1, B2 are expressed as: Therefore, taking the root node as the reference node, the voltage of each node in the distribution system is calculated by the following linearization model: Where P j ',Q' j Represents the jth element in the vector P', Q', and its physical meaning is the active and reactive power of the root node j; On this basis, when P2P transactions occur in the distribution system, the node injection power P caused by each transaction is obtained. j The influence coefficient of the change on the voltage level of each node in the distribution system, namely VSC: The network loss sensitivity coefficient LSC reflects the impact of node injection power changes on system network loss in P2P transactions. The calculation model is as follows: Flow through line L k The power flow is expressed as: In the formula, represents the flow through line L provided by the distribution network operator k The active and reactive power, Represents the branch L between node j and its parent node j-1 Active power loss and reactive power loss; represents the active load and reactive load connected to any node j provided by the distribution network operator; Formula (9) represents the topological relationship between node i and node j, is the set of subtrees of node i, and the result of formula (9) is determined by the distribution network topology information provided by the distribution network operator; From formulas (8) and (9), we know that given the system active loss and reactive loss information as well as the node active load and reactive load information, we can solve for the branch power flow information. Similarly, the system active loss and reactive loss information are obtained through the branch flow information and the node voltage information provided by the distribution network operator. The calculation formula is as follows: In the formula, Indicates line L k Active and reactive network losses, Indicates line L k Resistance, V k+1 Indicates line L k The downstream node voltage of At this time, the impact of node load power on system active power loss is calculated by the following formula: in, as well as It can be expressed by formulas (7), (8) and (9): Formulas (10) and (11) are calculated from formulas (7)-(9) and (12), and formulas (7)-(8) are calculated from formula (10). Therefore, formulas (7)-(12) are repeatedly iterated in the form of forward and backward iteration until the error between two iterations of the system active loss is less than the error limit, and the influence coefficient of the node load power change on the system active loss value is obtained by convergence; On this basis, when P2P transactions occur in the distribution system, the node injection power P caused by each transaction is obtained. j The influence coefficient of the change on the voltage level of each node in the distribution system, namely LSC: The transaction matching contract is deployed on the system central server, and its code implementation logic is designed based on the following ideas: ① The distribution network security guarantee mechanism ensures that changes in node injection power during P2P transactions will not affect the safe operation of the system; When the impact of the P2P transaction matching result on the distribution network is negative and exceeds the internal limit of the platform, the system sets the virtual price of the transaction to ±10*e 06 If the transaction node is a power purchase node, the virtual power purchase price is set to -10*e 06 If the transaction node is a power selling node, the virtual power selling price is set to +10*e 06 , to ensure that the transaction will not be cleared by the system. The specific calculation model is: In the formula, pr Vir is the virtual price used for P2P transaction matching, C LSC , C VSC The system network loss constraint cost and the system node voltage quality physical constraint cost are respectively; it should be noted that when the impact of P2P transactions on the system is positive, then C LSC , C VSC is a negative value; ② P2P virtual price matching mechanism: During the P2P matching process, the power distribution network security constraint cost is added to the price submitted by the user to the P2P trading platform to change the priority of the user's transaction. It is only used for the matching process and not for actual fund settlement. Taking any P2P transaction node j in the distribution network as an example, assuming that P2P transaction node j is a power selling node, the information submitted to the P2P transaction platform through the transaction application contract on the smart terminal is: transaction price Pr j , transaction volume P j , after the transaction is completed, the increase in distribution network system loss and the voltage deviation of the system over-limit node are calculated by the following formula: ΔP loss (j)=LSC(j)·(-P j ) (15) Where LSC(j) represents the influence coefficient of the change of the injected power at node j on the change of the system loss, VSC(i,j) represents the influence coefficient of the change of the injected power at node j on the change of the voltage at node i, and V rate 、V i represents the rated voltage value of the distribution network node submitted by the distribution network operator to the P2P trading platform and the real-time voltage value collected by the smart terminal, DV(i,j), DV(j), δ rate They respectively represent the voltage deviation of node i calculated by the built-in transaction matching contract of the P2P trading platform after transaction j is cleared, the total voltage deviation of the system's over-limit nodes, and the voltage deviation threshold allowed by economic operation; Through the calculation results of formulas (15)-(17), the transaction matching contract built into the P2P trading platform calculates the system network loss constraint cost C LSC , system node voltage quality constraint cost C VSC , the calculation formula is as follows: In the formula, C LSC (j), C VSC (j) represents the system network loss constraint cost and system node voltage quality constraint cost calculated by the transaction matching contract built into the P2P trading platform after transaction j is cleared. Indicates that the value* is normalized, λ LSC , VSC The adjustment coefficients representing the system network loss constraint cost and the system node voltage quality constraint cost are determined by the distribution network operator’s preference for power quality and economic operation; Substitute formula (18) and formula (19) into formula (14) to calculate the virtual matching price; ③P2P transaction matching mechanism: after the virtual price is formed, the transaction matching contract built into the P2P trading platform only needs to match the virtual prices of the purchase and sale nodes to clear and obtain the matching results; The transaction settlement contract is deployed on the system central server, and its code implementation logic is designed based on the following ideas: ① When the matching transaction volume is less than the initial clearing volume obtained by each trading node based on the real quotation, the transaction settlement contract built into the trading platform will perform market clearing and settlement according to the average of the marginal trading node quotations; ② When the matched transaction volume is greater than the initial clearing volume obtained by each transaction node according to the real quotation, the P2P market is required to clear according to the real clearing point. At the same time, the transaction settlement contract built into the trading platform needs to determine whether the settlement cost of the compensation area to the right of the clearing point is less than the economic benefits of network loss and voltage optimization after executing the matching transaction in the compensation area. If the conditions are met, according to the Uplift mechanism, the smart contract charges the system maintenance cost to each power purchasing node in the entire network and executes the matching result of the compensation area. The main process is as follows: a. Calculate the settlement cost of the compensation area: In the formula, Indicates the number of marginal electricity selling and purchasing nodes of P2P transaction matching results, Pr s,right , Pr b,right The quotes of the marginal electricity selling and purchasing nodes representing the P2P transaction matching results. Indicates the reported quantity of marginal electricity selling and purchasing nodes of P2P transaction matching results; b. Determine whether to execute the compensation zone matching results and calculate the maintenance costs that the power purchasing node needs to bear: In the formula, C Up N represents the maintenance cost that each power purchasing node needs to bear, calculated by the transaction matching contract built into the P2P trading platform. buy It represents the number of power purchasing nodes participating in P2P transactions. Eco represents the economic benefits obtained from optimizing the distribution network loss and node voltage after executing the matching transaction in the compensation area. If the settlement cost in the compensation area is greater than the economic benefits obtained from the optimization of the distribution network, the matching transaction in the compensation area will not be executed.

2. A distribution network security-oriented P2P transaction method based on blockchain technology according to claim 1, characterized in that: The nodes participating in the P2P transaction include power purchasing nodes and power selling nodes, and the nodes participating in the P2P transaction need to be authenticated to the trading platform in advance. The authentication information includes: maximum load capacity, maximum load power, self-provided power supply capacity, self-provided power supply power and the trading platform has no entry threshold requirements for nodes participating in the P2P transaction.

3. A distribution network security-oriented P2P transaction method based on blockchain technology according to claim 1, characterized in that: The transaction platform based on blockchain technology and its built-in distribution network status calculation contract, transaction application contract, transaction matching contract, and transaction settlement contract are all smart contracts written in the Solidity language supported by the Ethereum platform.

4. A distribution network security-oriented P2P transaction method based on blockchain technology according to claim 3, characterized in that: The transaction application contract is deployed on the intelligent terminal device of the system, and has both the channel function of the user connecting to the system and the collection function of the distribution network operator collecting system operation status information.