A method and system for distributing power supply settlement and clearing
By adopting group architecture and asymmetric encryption algorithms in the blockchain network, combined with parallel computing, the problems of high data security and operation and maintenance complexity in the centralized transaction mode are solved, and efficient and secure distributed power settlement and clearing are achieved.
Patent Information
- Application Number
- CN202111215610.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-19
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2041-10-19
AI Technical Summary
The existing centralized trading model has problems such as poor data security, high operation and maintenance complexity and low contract execution efficiency in distributed energy transactions, and the relationship between nodes is unequal, resulting in large system resource utilization and high cost.
The group architecture and asymmetric encryption algorithm of blockchain network are adopted to execute contracts through parallel computing, simplify node operation and maintenance, improve consensus speed, and parallel computing contract execution efficiency to ensure the security of information transmission.
It reduces the complexity of system operation and maintenance, improves contract execution efficiency, ensures the security and reliability of information transmission, simplifies management costs, and realizes the fairness and reliability of distributed power settlement and clearance.
Smart Images

Figure CN113935808B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method and system for distributed power supply settlement and clearing. Background Art
[0002] Distributed energy trading involves a wide variety of market participants, with high transaction frequency and relatively decentralized transactions. In traditional centralized trading models, transaction data is stored at the trading center, which is prone to data loss and lacks security. High-frequency, decentralized trading consumes significant system resources, resulting in low execution efficiency and high maintenance and operating costs for centralized systems. This centralized trading model is no longer suitable for current energy trading. Blockchain smart contract technology is currently widely used to automate the settlement of distributed transactions, providing a fair trading environment for all market participants. However, the relationships between nodes in existing trading networks are unequal, and most data still needs to be transmitted to the trading center for calculation. This complicates node operation and maintenance, and reduces the efficiency of smart contract execution. Summary of the Invention
[0003] Purpose of the invention: The purpose of the present invention is to provide a method and system for distributed power supply settlement and clearing based on blockchain, which can reduce the complexity of node operation and maintenance and improve the efficiency of contract execution.
[0004] Technical solution: The method for settlement and clearing of distributed power sources according to the present invention comprises the following steps:
[0005] (1) Performing power transaction settlement on the blockchain network automatically triggers the clearing contract stored on the blockchain to complete the clearing between the distributed power settlement and clearing objects; wherein, if the objects of the two groups of clearing transactions contain the same object, the clearing contract is executed in a serial calculation manner, otherwise, parallel calculation is used;
[0006] The blockchain network uses distributed power settlement and clearing objects as nodes, and the node consensus adopts a group architecture;
[0007] (2) The results of power transaction settlement and clearing are stored on the chain.
[0008] Before the power transaction settlement in step (1) is carried out, the power transaction center and the power grid company first determine whether there is a deviation assessment based on the actual transaction power and the agreed power. If there is a deviation assessment, the deviation fee is calculated and the power transaction settlement is carried out, triggering the deviation assessment clearing contract; otherwise, the power transaction settlement is carried out directly, triggering the non-bias assessment clearing contract; the power users and power owners complete the automatic clearing according to the clearing contract.
[0009] The blockchain network adopts a transmission mechanism based on asymmetric encryption algorithm and timestamp to ensure the secure and tamper-proof transmission of information instructions.
[0010] The present invention also provides a distributed power supply settlement and clearing system, including a blockchain network composed of distributed power supply settlement and clearing objects, and a settlement module and a clearing module for performing power supply transaction settlement and clearing; the transaction module is used to determine whether there is an assessment deviation in the transaction power and to perform power supply transaction settlement; the clearing module includes a biased assessment and clearing contract and a non-biased assessment and clearing contract; the settlement module and the clearing module are stored on the blockchain network, and are used to complete automatic settlement and clearing between distributed power supply settlement and clearing objects; the blockchain network is used for operation support and information display of the business system; and a complete human-computer interaction function is provided through the client of the blockchain node, including querying historical transactions, displaying on-chain user information and blockchain operation parameters such as the number of nodes and block height, and online modification of relevant configurations of smart contracts.
[0011] Beneficial effects: Compared with the existing technology, the present invention has the following advantages: (1) Low system operation and maintenance complexity: The blockchain network nodes adopt a group architecture to improve the node consensus speed, simplify the node operation and maintenance complexity, reduce management costs, and ensure the privacy and security of node data; (2) High contract execution efficiency: In the contract execution link, a parallel computing method based on transaction dependencies is adopted, and transaction contracts without dependencies can be executed in parallel, thereby doubling the contract execution efficiency; (3) Good information transmission security: A transmission mechanism based on asymmetric encryption algorithm and timestamp is adopted to ensure that the transmission of information instructions is secure and cannot be tampered with. (4) Complete human-computer interaction function: Various human-computer interaction functions such as historical transaction query, blockchain operation parameter display, and smart contract configuration modification are provided through the client of the blockchain node. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 This is a diagram of the blockchain network structure of the present invention;
[0013] Figure 2 This is a flow chart of the settlement and clearing of distributed power supply according to the present invention;
[0014] Figure 3 Schematic diagram of the smart contract parallel computing method of the present invention. DETAILED DESCRIPTION
[0015] The technical solution of the present invention will be further described below with reference to the accompanying drawings.
[0016] The method of the present invention comprises the following steps:
[0017] (1) Establish a distributed power supply settlement and clearing blockchain network
[0018] like Figure 1As shown in the figure, the distributed power supply settlement and clearing objects such as power supply owners, power supply users, power trading centers, power grid companies and government departments are used as nodes to build a blockchain network for distributed power supply settlement and clearing. The nodes on the chain have functions such as data storage, command transmission, and smart contract execution.
[0019] Consensus among nodes on the blockchain network utilizes a group architecture. This means that nodes involved in a particular settlement transaction are grouped together within the entire network. This significantly accelerates consensus due to the smaller number of nodes within a group. Furthermore, each group maintains its own independent ledger, which cannot be shared. This ensures the privacy and security of transaction and settlement data, avoiding the lack of node data privacy inherent in traditional blockchain systems due to full chain data sharing. This group architecture facilitates the flexible implementation of distributed energy settlement and clearing transactions, supporting both settlement and clearing operations within power trading centers and transactions between distributed power sources outside of trading centers that adhere to on-chain contracts. Nodes on the chain only need to be deployed once and, through group configuration, can participate in various multi-party settlement operations. Alternatively, a single transaction can be divided into groups based on user, time, and other factors. This significantly simplifies node operation and maintenance, reducing management costs.
[0020] In blockchain networks, to ensure secure and tamper-proof transmission of information and instructions, a transmission mechanism based on asymmetric encryption algorithms and timestamps is employed. Asymmetric encryption algorithms use asymmetric cryptography during the encryption and decryption process, using a public key for encryption and a private key for decryption. This ensures encrypted transmission and secure decryption of information. Timestamp technology distinguishes the sequence of events and applies a random hashing operation to operational data in the form of blocks, effectively adding a timestamp. This timestamp verifies that specific data existed at a specific moment, thus ensuring that information communicated within the network cannot be tampered with.
[0021] (2) Formulate a liquidation contract and store it on the chain
[0022] Based on the DG clearing rules, a clearing contract model is developed. This clearing contract is then installed and instantiated on the blockchain network nodes. After being certified by the consensus of all nodes on the network, it serves as the basis for DG clearing. There are two types of clearing contracts: unbiased assessment clearing contracts and biased assessment clearing contracts.
[0023] Elements involved in a clearing contract with unbiased assessment include: settlement entity, settlement type, power transaction cycle, clearing execution time, settlement quantity, settlement price, transmission fee, settlement electricity fee, and the initial digital signature (public key) of both parties. The clearing smart contract model is as follows, which automatically completes clearing payments between the two parties.
[0024] ChainCode(C1)=[Sign.P,Sign.C,Sign.G,(F1,[t0,t1],t,E,P,P0),P2]
[0025] Among them, Sign.P, Sign.C, and Sign.G are the digital signatures of distributed power owners, distributed power users, and power grid companies respectively, F1 indicates that the settlement type is unbiased assessment, [t0, t1] is the power transaction cycle, t is the settlement execution time, E is the actual settlement electricity volume, P is the settlement electricity price, P0 is the grid access fee, and P2 is the final settlement electricity fee.
[0026] Elements involved in a deviation assessment settlement contract include: settlement entity, settlement type, power transaction cycle, settlement execution time, settlement quantity (actual transaction quantity), settlement price, transmission fee, deviation quantity, deviation assessment price, settlement fee, and the initial digital signature (public key) of each transaction entity. The settlement and clearing smart contract model is as follows, which automatically completes settlement and payment between the two parties.
[0027] ChainCode(C2)=[Sign.P,Sign.C,Sign.G,(F2,[t0,t1],t,E,P,P0),(E1,P1),P2]
[0028] Among them, Sign.P, Sign.C, and Sign.G are the digital signatures of distributed energy power source owners, power users, and power grid companies respectively. F2 indicates that the settlement type is deviation assessment, [t0, t1] is the transaction cycle, t is the settlement execution time, E is the actual transaction volume, P is the settlement electricity price, P0 is the transmission fee, E1 is the deviation volume, that is, the difference between the actual transaction volume and the pre-agreed transaction volume, P1 is the deviation assessment price, and P2 is the final settlement electricity fee.
[0029] (3) Execute settlement and clearing of each node of distributed power generation
[0030] like Figure 2 As shown, based on Figure 1 In the distributed power generation settlement and clearing network shown, after the power trading center confirms the transaction power based on the metering data, it determines whether there is a deviation assessment. If there is a deviation assessment, the deviation fee is calculated and the power transaction pre-settlement is carried out. If there is no deviation assessment, the power transaction pre-settlement is directly entered, and the power transaction final settlement is carried out after the power grid company completes the verification and confirmation.
[0031] After the completion of the DG transaction settlement, the evidence is submitted to a third-party regulatory agency for storage, and the clearing contract is automatically triggered. If there is a deviation assessment during the settlement, the deviation assessment clearing contract is triggered; otherwise, the unbiased assessment clearing contract is triggered. According to the clearing contract, the clearing payment for each DG settlement clearing object in the market is automatically completed. Finally, the settlement results are stored on the blockchain for retrospective query of settlement history data.
[0032] Among them, around the settlement and clearing business of the power trading center, the power trading center and the power grid company nodes are responsible for the verification of settlement and the implementation of deviation assessment, calculate the final settlement fee and send the settlement information to the power users, and the power users will automatically transfer the settlement electricity charges to the power owners, completing the automatic settlement function of multiple market entities; in addition, the direct clearing transactions between power users and power owners are in accordance with the deviation assessment clearing contract or the non-bias assessment clearing contract, calculate the clearing fee and complete the automatic clearing between power users and power owners.
[0033] like Figure 3 As shown in the figure, the execution of the clearing contract adopts a parallel computing method based on transaction dependencies to improve the execution efficiency of the clearing contract. The dependency relationship is whether the transaction contains mutually exclusive objects. For example, in the transfer scenario, the transaction is a transfer operation between users. The transaction function transfer(X,Y) is used to represent the transfer interface from user X to user Y. The two transactions transfer(A,B) and transmit(A,C) contain the intersection A, which are two mutually exclusive transactions and therefore cannot be executed concurrently; while the two transactions transfer(A,B) and transmit(C,D) have no intersection elements and are non-mutually exclusive transactions, so they can be executed concurrently.
[0034] In order to realize parallel computing of clearing contracts based on transaction dependencies, the present invention formulates a concurrent transaction precompiled contract, which is applicable to all smart contracts on the blockchain. The specific concurrent transaction precompiled contract formulation is divided into three steps. First, the object contract is defined as a contract that supports parallel computing, and the Boolean function of the contract parallel attribute is set to true; secondly, the object contract parallel interface and mutual exclusion parameters are defined, and the transaction parameters are read according to the defined parallel interface. The transaction parameters are compared and analyzed in combination with the mutual exclusion parameters. If mutual exclusion occurs, the result is recorded and the subsequent parallel transactions are interrupted, and the contract is executed serially instead; if there is no mutual exclusion, the concurrent execution transaction contract can be entered; finally, when all concurrent transaction precompiled contracts of the transaction clearing blockchain system are compiled, all transaction clearing business contracts are installed on the chain, and then the blockchain node is restarted to start the online operation of the transaction clearing contract.
[0035] This parallel computing method performs dependency analysis on the original serially executed contract process, decouples and classifies serial transactions according to the principle of no dependency, and each type of no-dependency contract can be executed concurrently, thereby transforming the serial contract execution process into a no-dependency parallel execution method. This contract execution method greatly reduces the level of contract execution and can exponentially increase the efficiency of contract execution.
[0036] The system described in the present invention includes a blockchain network composed of distributed power settlement and clearing objects, as well as a settlement module and a clearing module for power transaction settlement and clearing; the transaction module is used to determine whether there is an assessment deviation in the transaction power and to perform power transaction settlement; the clearing module includes a deviation assessment clearing contract and a non-bias assessment clearing contract; the settlement module and the clearing module are stored on the blockchain network, and are used to complete automatic settlement and clearing between distributed power settlement and clearing objects; the blockchain network is used for operation support and information display of the business system.
Claims
1. A method for clearing distributed power supply, characterized in that: The steps include: (1) Performing power transaction settlement on the blockchain network automatically triggers the clearing contract stored on the blockchain to complete the clearing between the distributed power settlement and clearing objects; wherein, if the objects of the two groups of clearing transactions contain the same object, the clearing contract is executed in a serial calculation manner, otherwise, parallel calculation is used; If the objects of the two groups of clearing transactions contain the same object, the clearing contract is executed in a serial computing manner; otherwise, parallel computing is used, including: formulating a concurrent transaction precompiled contract, including the following steps: (1.1) Define the object contract as a contract that supports parallel computing, and set the Boolean function of the contract parallel attribute to true; (1.2) Define the parallel interface and mutual exclusion parameters of the object contract, read the transaction parameters according to the defined parallel interface, and compare and analyze the transaction parameters in combination with the mutual exclusion parameters. If mutual exclusion exists, record the result and interrupt the subsequent parallel transaction, and switch to serial execution of the contract; if there is no mutual exclusion, enter the concurrent execution of the transaction contract; (1.3) When all concurrent transaction pre-compiled contracts of the transaction clearing blockchain system are compiled, all transaction clearing business contracts are installed on the chain, and then the blockchain node is restarted to start the online operation of the transaction clearing contract; The blockchain network uses distributed power settlement and clearing objects as nodes, and the node consensus adopts a group architecture, which groups the nodes involved in a settlement transaction; (2) The results of power transaction settlement and clearing are stored on the chain.
2. The method for settlement and clearing of distributed power sources according to claim 1, characterized in that: In the blockchain network, the power trading center is bidirectionally connected with power owners, power users, power grid companies and government departments for central transactions, power users are bidirectionally connected with power owners and government departments for group transactions, and power grid companies are bidirectionally connected with power owners and government departments for group transactions.
3. The method for settlement and clearing of distributed power sources according to claim 1, characterized in that: Before the power transaction settlement in step (1), it is first determined whether there is a deviation assessment based on the actual transaction power and the agreed power. If there is a deviation assessment, the deviation fee is calculated and the power transaction settlement is carried out, triggering the deviation assessment clearing contract; otherwise, the power transaction settlement is carried out directly, triggering the non-deviation assessment clearing contract.
4. The method for settlement and clearing of distributed power sources according to claim 3, characterized in that: If there is a deviation assessment during the power transaction settlement, the deviation fee will be calculated and then the preliminary settlement will be carried out. If there is no deviation assessment, the preliminary settlement will be carried out directly, and the final settlement will be carried out after verification and confirmation.
5. The method for settlement and clearing of distributed power sources according to claim 1, characterized in that: The blockchain network adopts a transmission mechanism based on asymmetric encryption algorithm and timestamp.
6. The method for settlement and clearing of distributed power sources according to claim 1, characterized in that: In step (2), the results of power transaction settlement and clearing are also transmitted to the regulatory agency for evidence storage.
7. The method for settlement and clearing of distributed power sources according to claim 2, characterized in that: In step (1), the power trading center, power grid company, distributed power source owners and users conduct power transaction settlement, and upload the settlement results to the chain. The power grid company, power source owners and power users complete the clearing according to the clearing contract.
8. A distributed power supply settlement and clearing system according to any one of claims 1 to 7, characterized in that: It includes a blockchain network composed of distributed power supply settlement and clearing objects, and a settlement module and a clearing module for performing power supply transaction settlement and clearing; the settlement module and the clearing module are stored on the blockchain network; The transaction module is used to determine whether there is an assessment deviation in the transaction power and to perform power transaction settlement; The clearing module includes a clearing contract with biased assessment and a clearing contract without biased assessment; The blockchain network is used for operational support and information display of business systems, and the node consensus adopts a group architecture.
9. The distributed power source settlement and clearing system according to claim 8, characterized in that: The nodes of the blockchain network include power trading centers, power owners, power users, power grid companies and government departments; the power trading center is bidirectionally connected with power owners, power users, power grid companies and government departments respectively, the power users are bidirectionally connected with power owners and government departments respectively, and the power grid companies are bidirectionally connected with power owners and government departments respectively.
10. The distributed power source settlement and clearing system according to claim 8, characterized in that: When the objects of the two groups of clearing transactions in the biased assessment clearing contract and the unbiased assessment clearing contract in the clearing module include the same object, the clearing contract is executed in a serial calculation manner, otherwise a parallel calculation manner is adopted.
Citation Information
Patent Citations
Money transferring method and device based on block chain, and storage medium
CN108846659A
Method for clearing electric power transaction between decentralized production and consumption persons based on block chain technology
CN111476628A
Supply chain logistics cargo control platform based on block chain and use method thereof
CN113190628A