Block chain-based distributed energy transaction method and system
By adopting a blockchain-based transaction method in distributed energy transactions, the problems of high maintenance costs, transaction data security and low consensus efficiency are solved, and safe, convenient and efficient energy transactions are achieved.
Patent Information
- Application Number
- CN202510211112.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-25
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2045-02-25
AI Technical Summary
There are problems in distributed energy transactions with high maintenance and operation costs, easy tampering of transaction data, and low consensus efficiency.
A distributed energy transaction method based on blockchain is adopted to achieve safe and convenient energy transactions through steps such as user registration, transaction application, transaction proposal verification and accounting node accounting, and the consensus algorithm is improved through the BLS signature algorithm and RSA signature algorithm to improve consensus efficiency.
It reduces the maintenance and operation costs of traditional trading centers, prevents transaction data tampering, and improves transaction efficiency and scalability of blockchain networks.
Smart Images

Figure CN120147006A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a distributed energy trading method and system, and in particular to a distributed energy trading method and system based on blockchain, belonging to the technical field of blockchain. Background Art
[0002] Distributed energy is generally located near users, has a small installed capacity, and consumes locally generated energy. Distributed energy systems can use a variety of energy forms such as photovoltaics, thermal energy, and wind energy to provide users with clean energy services, which can effectively reduce energy losses caused by power transmission, reduce environmental pollution caused by traditional energy, and improve the utilization rate of clean energy. However, distributed energy still faces many problems, such as the high maintenance and operating costs of trading centers. Important transaction data can be easily tampered with, which will cause great economic losses and trust crises to all parties involved in the transaction.
[0003] Blockchain technology is a new technology that integrates a variety of computer technologies, such as decentralization, peer-to-peer transmission, consensus mechanism and various cryptographic encryption algorithms. Since blockchain does not require mutual trust between the two parties, it can be applied to many centralized or distributed systems. The decentralized characteristics of blockchain and smart contract technology are just adapted to the characteristics of distributed energy, which can greatly improve the transaction efficiency of energy and reduce the maintenance cost of the system. Therefore, combining blockchain technology to solve the transaction problem of distributed energy is a feasible solution.
[0004] Power Ledger is a project that applies blockchain in the field of distributed energy. This project joins users to the distributed energy network. Users collect energy through solar panels and energy storage devices on their roofs, and automatically trade their excess energy through the blockchain network. On the one hand, this project increases the output of clean energy and reduces environmental pollution; on the other hand, it reduces the maintenance cost of traditional energy networks. From these existing applications, it can be seen that blockchain technology has broad and bright application prospects in the field of distributed energy, but the current systems are mostly limited to the trading of photovoltaic power, with a single energy type and low energy collection efficiency. In addition, problems such as low consensus efficiency and low transaction throughput of blockchain also need to be urgently solved. Summary of the invention
[0005] Purpose of the invention: The purpose of the present invention is to provide a distributed energy trading method and system based on blockchain that can improve transaction efficiency.
[0006] Technical solution: The distributed energy transaction method based on blockchain described in the present invention comprises:
[0007] S1: The user uploads device information and personal information to the blockchain network for registration, which is recorded on the block in the form of a blockchain transaction;
[0008] S2: The user calls the client interface to initiate a transaction application to the blockchain network. After receiving the transaction application, the endorsing nodes conduct consensus. If it is found during the execution process that the transaction submitted by the user fails to reach a consensus, a message will be returned to inform the user that the transaction cannot be completed. If the transaction can reach a consensus, the simulation execution result and the signed message will be combined to generate a transaction proposal and returned to the user;
[0009] S3: After receiving the transaction proposal, the user sends the transaction proposal to the ordering nodes. The ordering nodes verify the transaction proposal, sort the transactions after passing the verification to obtain a transaction block, and sequentially send the transaction block to the accounting nodes for accounting;
[0010] S4: The accounting nodes receive the transaction block and record it in the local blockchain, and then broadcast the transaction block to other nodes. After the nodes reach a consensus, the transactions corresponding to the transaction block are recorded in the blockchain network to complete the transaction.
[0011] Further, the step S1 includes:
[0012] The user sends the device information and personal information to the certificate authority CA node in the blockchain for a registration request; the device information includes a device identifier SID, and the device identifier SID contains an identity that can uniquely represent this device, including the hardware factory internal label, TF card, and MAC address of the device;
[0013] The CA node queries the blockchain network based on the device identifier SID in the device information to check whether there is already a transaction block related to the device identifier SID. If not, the request is passed;
[0014] After the request is passed, the CA node returns a registration password to the user for the user to log in.
[0015] Further, the step S2 includes:
[0016] The user calls the client interface to initiate a transaction application to the blockchain network. After receiving the transaction application, the endorsing nodes conduct consensus;
[0017] If it is found during the execution process that the transaction submitted by the user fails to reach a consensus, a message will be returned to inform the user that the transaction cannot be completed;
[0018] If the transaction can reach a consensus, the endorsing nodes generate a message in the form of <TRAN||RES||EA> and return it to the user, where TRAN represents the current transaction information, RES represents the current simulation result, and EA represents the signature of the endorsing nodes.
[0019] Further, the step S3 includes:
[0020] After receiving the transaction proposal, the user signs the transaction proposal to generate a transaction proposal in the form of <TRAN||RES||EA||UA>, and sends it to the sorting node, where UA represents the user signature;
[0021] The sorting node verifies the transaction proposal. After passing the verification, it signs and sorts the transaction, and then generates a transaction block in the form of <TRAN||RES||EA||UA||RA||T1>, and sends it to the accounting node for accounting in sequence, where RA represents the sorting node signature, and T1 represents the serial number of the current block.
[0022] Further, the step S4 includes:
[0023] After receiving the transaction block, the accounting node signs the transaction block to generate a transaction block in the form of <TRAN||RES||EA||UA||RA||SA||T2>, and then broadcasts the transaction block to all other accounting nodes for consensus. After the consensus is passed, the transaction is completed, where SA represents the accounting node signature, and T2 represents the serial number of the current block.
[0024] Further, the CA node uses two keys, which are respectively used for the issuance of digital certificates and the verification of the legality of digital signatures.
[0025] Further, the endorser signature EA, the user signature UA, and the sorter signature RA are all implemented through the RSA signature algorithm; the steps of implementing the RSA signature include:
[0026] Generate keys: Select two prime numbers p and q greater than a preset threshold, calculate their product to obtain n = p×q; calculate the Euler's totient function of n Select an integer e that is relatively prime to and calculate the modular inverse d of e with respect to ; the public key is (e,n), and the private key is (d,n);
[0027] Generate a signature: The sender calculates the hash value H(M) of the message M, and then encrypts the hash value using the private key d to generate a signature S = d mod n;
[0028] Verify the signature: The receiver verifies the signature using the sender's public key e and n; calculate H(M)e mod n. If the result is equal to S, the verification passes, indicating that the message has not been tampered with and was indeed sent by the sender.
[0029] Further, the accounting node signature SA is implemented through the BLS signature algorithm, specifically including:
[0030] Initialization: Let \(G_0\), \(G_1\), \(G_A\) be cyclic groups, and define a function \(e: G_0\times G_1\rightarrow G_A\) in the cyclic groups \(G_0\), \(G_1\), \(G_A\).
[0031] Key generation: Use a randomly generated number \(r\) as the key, and the public key is \(pk = r\times G\).
[0032] Signature: According to the properties of the bilinear mapping function, map the unsigned message \(m\) to the corresponding point \(E(m)\) on the elliptic curve, and generate the signature \(s = r\times E(m)\) through calculation.
[0033] Verification: Determine whether the signature satisfies the verification equation \(e(P, H)=e(G, s)\). If it is satisfied, the verification is successful.
[0034] Based on the same inventive concept, the present invention also provides a blockchain-based distributed energy trading system, including:
[0035] A user registration module, which is used for users to upload device information and personal information to the blockchain network for registration and record them on the block in the form of blockchain transactions.
[0036] A simulation trading module, which is used for users to call the client interface to initiate a trading application to the blockchain network. After the endorsement node receives the trading application, it conducts consensus. If it is found during the execution process that the transaction submitted by the user fails to reach consensus, it returns a message to inform the user that the transaction cannot be completed. If the transaction can reach consensus, it combines the simulation execution result and the signed message to generate a transaction proposal and returns it to the user.
[0037] A transaction submission module, which is used for users to send the transaction proposal to the sorting node after obtaining the transaction proposal. The sorting node verifies the transaction proposal, sorts the transactions after passing the verification to obtain a transaction block, and sequentially sends the transaction block to the accounting node for accounting.
[0038] A transaction confirmation module, which is used for the accounting node to receive the transaction block and record it in the local blockchain, and then broadcasts the transaction block to other nodes. After the nodes reach consensus, the transaction corresponding to the transaction block is recorded in the blockchain network to complete the transaction.
[0039] Based on the same inventive concept, the present invention also provides a computing device, including: one or more processors, one or more memories, and one or more programs. The programs are stored in the memory and are configured to be executed by the processor. When the programs are loaded into the processor, the steps of the blockchain-based distributed energy trading method according to any one of the above are implemented.
[0040] Beneficial effects: Compared with the prior art, the present invention has the following remarkable advantages: 1. Compared with the traditional energy trading method, the present invention constructs a new distributed energy trading method based on blockchain technology, saving the relatively high maintenance and operation costs of the traditional trading center, preventing important trading data from being tampered with, and realizing a more secure and convenient energy trading; 2. The present invention improves the PBFT consensus algorithm applied to the blockchain based on the BLS signature algorithm and the RSA signature algorithm, reduces the communication volume consumed during the consensus process while ensuring a relatively fast signature speed, improves the consensus efficiency, and improves the scalability of the blockchain network. Description of the Drawings
[0041] Figure 1 It is the flowchart of the method of the embodiment of the present invention;
[0042] Figure 2 It is the registration transaction flowchart of the embodiment of the present invention;
[0043] Figure 3 It is the simulation execution flowchart of the embodiment of the present invention;
[0044] Figure 4 It is the submission transaction flowchart of the embodiment of the present invention;
[0045] Figure 5 It is the transaction confirmation flowchart of the embodiment of the present invention;
[0046] Figure 6 It is the system architecture diagram of the embodiment of the present invention. Detailed Embodiments
[0047] In order to enable those skilled in the art of the present technology to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application.
[0048] As shown in the Figure 1 accompanying drawings, the distributed energy trading method based on blockchain in this embodiment includes:
[0049] S1: The user uploads the device information and personal information to the blockchain network for registration, and records them on the block in the form of a blockchain transaction;
[0050] S2: The user calls the client interface to initiate a transaction application to the blockchain network. After receiving the transaction application, the endorsing node conducts consensus. If it is found during the execution process that the transaction submitted by the user fails to reach consensus, a message will be returned to inform the user that the transaction cannot be completed. If the transaction can reach consensus, the simulation execution result and the signed message will be combined to generate a transaction proposal and returned to the user;
[0051] S3: After the user obtains the transaction proposal, the user sends the transaction proposal to the sorting node. The sorting node verifies the transaction proposal. After the verification passes, the sorting node sorts the transactions to obtain a transaction block, and sequentially sends the transaction block to the accounting nodes for accounting;
[0052] S4: The accounting node receives the transaction block and records it in the local blockchain, and then broadcasts the transaction block to other nodes. After the nodes reach a consensus, the transactions corresponding to the transaction block are recorded in the blockchain network to complete the transaction.
[0053] As Figure 2 shown, step S1 is specifically a registration transaction, including:
[0054] Registration transaction: The user sends device information and personal information to the CA node in the blockchain for a registration request; the device information includes a device identifier SID, and the device identifier SID includes an identity that can uniquely represent this device, including the hardware factory internal label, TF card, and MAC address of the device;
[0055] The CA node queries the blockchain network according to the device identifier SID in the device information to check whether there is a transaction block related to the device identifier SID. If not, the request is passed;
[0056] After the request is passed, the CA node returns a registration password to the user for the user to log in.
[0057] As Figure 3 shown, step S2 is specifically simulation execution, including:
[0058] The user calls the client interface to initiate a transaction application to the blockchain network. After receiving the transaction application, the endorsing node performs simulation execution (for consensus);
[0059] If it is found during the execution process that the transaction submitted by the user has not reached a consensus, a message will be returned to inform the user that the transaction cannot be completed;
[0060] If the transaction can reach a consensus, the endorsing node generates a message in the form of <TRAN||RES||EA> and returns it to the user, where TRAN represents the current transaction information, RES represents the result of this simulation, and EA represents the endorsing node signature.
[0061] As Figure 4 shown, step S3 is specifically submitting a transaction, including:
[0062] After the user obtains the transaction proposal, the user signs the transaction proposal to generate a transaction proposal in the form of <TRAN||RES||EA||UA> and sends it to the sorting node, where UA represents the user signature;
[0063] The sorting node verifies the transaction proposal. After passing the verification, it signs and sorts the transaction, and then generates a transaction block in the form of <TRAN||RES||EA||UA||RA||T1>, and sends it to the accounting nodes for accounting in sequence. The RA represents the signature of the sorting node.
[0064] As Figure 5 shown, step S4 is specifically transaction confirmation, including:
[0065] After receiving the transaction block, the accounting node generates a transaction block in the form of <TRAN||RES||EA||UA||RA||SA||T2> by signing it, and then broadcasts the block to all other accounting nodes for consensus. After the consensus is passed, it means that this transaction is completed. The SA represents the signature of the accounting node.
[0066] Further, the CA node uses two keys, which are respectively used for the issuance of digital certificates and the verification of the legality of digital signatures.
[0067] Further, the endorsement node signature EA, the user signature UA, and the sorting node signature RA are all implemented through the RSA signature algorithm; the steps of implementing the RSA signature include:
[0068] Generate keys: Select two prime numbers p and q greater than a preset threshold, and calculate their product to obtain n = p × q; calculate the Euler function of n Select an integer e that is relatively prime to and calculate the modular inverse element d of e with respect to ; the public key is (e, n), and the private key is (d, n);
[0069] Generate a signature: The sender calculates the hash value H(M) of the message M, and then encrypts the hash value using the private key d to generate a signature S = d mod n;
[0070] Verify the signature: The receiver uses the sender's public key e and n to verify the signature; calculate H(M)e mod n. If the result is equal to S, the verification passes, indicating that the message has not been tampered with and was indeed sent by the sender.
[0071] Further, the accounting node signature SA is implemented through the BLS signature algorithm, specifically including:
[0072] Initialization: Let G0, G1, GA be cyclic groups, and define a function e: G0 × G1 → GA in the G0, G1, GA cyclic groups;
[0073] Generate keys: Use a randomly generated number r as the key, and the public key is pk = r × G;
[0074] Signature: According to the properties of the bilinear mapping function, the unsigned message m is mapped to the corresponding point E(m) on the elliptic curve, and the signature s = r × E(m) is generated through calculation;
[0075] Verification: Determine whether the signature satisfies the verification equation e(P, H) = e(G, s). If it is satisfied, the verification is successful.
[0076] Example 2, as Figure 6 shown, based on the same inventive concept, this example provides a blockchain-based distributed energy trading system, including the following modules:
[0077] User registration module, used for users to upload device information and personal information to the blockchain network for registration, and record it on the block in the form of blockchain transactions;
[0078] Simulation trading module, used for users to initiate a trading application to the blockchain network by calling the client interface. After the endorsing node receives the trading application, it conducts consensus. If it is found during the execution process that the transaction submitted by the user fails to reach a consensus, a message will be returned to inform the user that the transaction cannot be completed. If the transaction can reach a consensus, the simulation execution result and the signed message will be combined to generate a transaction proposal and returned to the user;
[0079] Transaction submission module, used for users to send the transaction proposal to the sorting node after obtaining the transaction proposal. The sorting node verifies the transaction proposal, sorts the transaction after passing the verification to obtain a transaction block, and sequentially sends the transaction block to the accounting node for accounting;
[0080] Transaction confirmation module, used for the accounting node to receive the transaction block and record it in the local blockchain, and then broadcast the transaction block to other nodes. After the nodes reach a consensus, record the transaction corresponding to the transaction block in the blockchain network to complete the transaction.
[0081] Example 3, based on the same inventive concept, this example provides a computing device, including: one or more processors, one or more memories, and one or more programs. The programs are stored in the memory and are configured to be executed by the processor. When the programs are loaded into the processor, the steps of the blockchain-based distributed energy trading method according to any one of the above are implemented.
[0082] Example 4, apply the blockchain-based distributed energy trading method of the present invention to the scenario where users own autonomous power generation equipment. For example, users can install equipment such as a small photovoltaic power generation system or a wind power generation system, and the specific steps are as follows:
[0083] Build a blockchain network through multiple servers or hosts and serve as blockchain nodes.
[0084] User's intelligent power storage device A and power company's intelligent power storage device B both upload their device identifiers SID to the blockchain network and request registration.
[0085] After the registration is passed, device A calls the client interface to initiate a transaction application to the blockchain network. After receiving the transaction application, the endorsing nodes conduct consensus. If it is found during the execution process that the transaction submitted by device A fails to reach a consensus, a message will be returned to inform device A that the transaction cannot be completed. If the transaction can reach a consensus, the simulation execution result and the signed message will be combined to generate a transaction proposal and returned to device A.
[0086] After device A obtains the transaction proposal, it sends the transaction proposal to the ordering nodes. The ordering nodes verify the transaction proposal, sort the transactions after passing the verification, and then send them to the accounting nodes for accounting in sequence;
[0087] After receiving the transaction, the accounting nodes will record it in the local blockchain, and then broadcast the block to other nodes. After the nodes reach a consensus, this transaction will be recorded in the blockchain network. Subsequently, device A transmits energy to device B, thus completing the transaction.
[0088] In this embodiment, during the entire process of the transaction between the user's intelligent power storage device A and the power company's intelligent power storage device B, no third-party intervention is required, and a series of operations such as energy transactions can be completed independently, realizing the automation and intelligence of energy transactions, which is safer and more efficient.
Claims
1. A distributed energy trading method based on blockchain, characterized in that: include: S1: The user uploads the device information and personal information to the blockchain network for registration, which is recorded on the block in the form of blockchain transactions; S2: The user calls the client interface to initiate a transaction application to the blockchain network. After receiving the transaction application, the endorsing node reaches a consensus. If it is found during the execution that the transaction submitted by the user has not reached a consensus, a message is returned to inform the user that the transaction cannot be completed. If the transaction can reach a consensus, the simulated execution result and the signed message are combined to generate a transaction proposal and returned to the user; S3: After receiving the transaction proposal, the user sends it to the sorting node. The sorting node verifies the transaction proposal, sorts the transactions after verification, obtains the transaction block, and sends the transaction block to the accounting node for accounting in sequence; S4: The accounting node receives the transaction block and records it in the local blockchain, then broadcasts the transaction block to other nodes. After the nodes reach a consensus, the transaction corresponding to the transaction block is recorded in the blockchain network to complete the transaction.
2. The distributed energy transaction method based on blockchain according to claim 1 is characterized in that: The step S1 comprises: The user sends the device information and personal information to the CA node of the certificate authority in the blockchain to make a registration request; the device information includes a device identifier SID, and the device identifier SID contains an identity that can uniquely represent this device, including the hardware factory internal standard, TF card and MAC address of the device; The CA node queries the blockchain network based on the device identifier SID in the device information to see if there is a transaction block related to the device identifier SID. If not, the request is approved. After the request is approved, the CA node returns the registration password to the user for user login.
3. The distributed energy transaction method based on blockchain according to claim 1 is characterized in that: The step S2 comprises: The user calls the client interface to initiate a transaction request to the blockchain network, and the endorsing node reaches consensus after receiving the transaction request; If it is found during the execution process that the transaction submitted by the user has not reached consensus, a message will be returned to inform the user that the transaction cannot be completed; If the transaction can reach consensus, the endorsing node generates a<TRAN||RES||EA> The message is in the form of a transaction message and returned to the user, where TRAN represents the current transaction information, RES represents the simulation result, and EA represents the endorsement node signature.
4. The distributed energy transaction method based on blockchain according to claim 3 is characterized in that: The step S3 comprises: After the user receives the transaction proposal, he signs the transaction proposal to generate a<TRAN||RES||EA||UA> The transaction proposal is in the form of , and is sent to the sorting node, where UA represents the user signature; The sorting node verifies the transaction proposal, signs and sorts the transaction after verification, and then generates a<TRAN||RES||EA||UA||RA||T1> The transaction blocks in the form of , are sent to the accounting nodes in sequence for accounting, where RA represents the sorting node signature and T1 represents the sequence number of the current block.
5. The distributed energy transaction method based on blockchain according to claim 4 is characterized in that: The step S4 comprises: After receiving the transaction block, the accounting node will sign the transaction block and generate a<TRAN||RES||EA||UA||RA||SA||T2> The transaction block exists in the form of a transaction, and then the transaction block is broadcast to all other accounting nodes for consensus. After the consensus is passed, the transaction is completed. Among them, SA represents the signature of the accounting node, and T2 represents the serial number of the current block.
6. The distributed energy transaction method based on blockchain according to claim 2 is characterized in that: The CA node uses two keys, one for issuing a digital certificate and the other for verifying the legitimacy of a digital signature.
7. The distributed energy transaction method based on blockchain according to claim 5 is characterized in that: The endorsement node signature EA, user signature UA, and sorting node signature RA are all implemented through the RSA signature algorithm; The steps of implementing the RSA signature include: Generate a key: Select two prime numbers p and q that are greater than a preset threshold, calculate their product to get n = p × q; calculate the Euler function of n Choose one with For integers e that are relatively prime, calculate e with respect to The modular inverse d of ; the public key is (e,n), and the private key is (d,n); Generate signature: The sender calculates the hash value H(M) of the message M, and then encrypts the hash value using the private key d to generate a signature S = d mod n; Verify the signature: The receiver verifies the signature using the sender's public keys e and n; calculate H(M)e mod n. If the result is equal to S, the verification succeeds, indicating that the message has not been tampered with and is indeed sent by the sender.
8. The distributed energy transaction method based on blockchain according to claim 5 is characterized in that: The accounting node signature SA is implemented through the BLS signature algorithm, which specifically includes: Initialization: Let G0, G1, GA be cyclic groups, and define a function e in the cyclic groups G0, G1, GA: G0×G1→GA; Generate key: Use a randomly generated number r as the key, and the public key is pk = r × G; Signature: According to the properties of the bilinear mapping function, the unsigned message m is mapped to the corresponding point E(m) on the elliptic curve, and the signature s=r×E(m) is generated after calculation; Verification: Determine whether the signature satisfies the verification equation e(P,H)=e(G,s). If so, the verification is successful.
9. A distributed energy trading system based on blockchain, characterized in that: include: The user registration module is used for users to upload device information and personal information to the blockchain network for registration, which is recorded on the block in the form of blockchain transactions; The simulated transaction module is used by users to call the client interface to initiate a transaction application to the blockchain network. After receiving the transaction application, the endorsing node will reach a consensus. If it is found during the execution process that the transaction submitted by the user has not reached a consensus, a message will be returned to inform the user that the transaction cannot be completed. If the transaction can reach a consensus, the simulated execution result and the signed message will be combined to generate a transaction proposal and returned to the user; The transaction submission module is used for users to send transaction proposals to the sorting node after receiving them. The sorting node verifies the transaction proposals, sorts the transactions after verification, obtains transaction blocks, and sends the transaction blocks to the accounting nodes for accounting in sequence; The transaction confirmation module is used for the accounting node to receive the transaction block and record it in the local blockchain, and then broadcast the transaction block to other nodes. After the nodes reach a consensus, the transaction corresponding to the transaction block is recorded in the blockchain network to complete the transaction.
10. A computing device, characterized in that include: One or more processors, one or more memories, and one or more programs, wherein the programs are stored in the memories and configured to be executed by the processors, and when the programs are loaded into the processors, the steps of the distributed energy trading method based on blockchain according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Transaction processing method of block chain network and block chain network
CN111047319A
Transaction method of block chain energy transaction system
CN115720146A
System and method to validate blockchain transactions in a distributed ledger network
US20190156336A1
Blockchain-based transaction processing method and apparatus, and electronic device
US20190370806A1
Method for signing a new block in a decentralized blockchain consensus network
US20200228318A1
Cited By
Distributed multi-energy transaction method and system based on block chain and ORC system
CN122048513A