Distributed power distribution network transaction method and system, electronic equipment and medium
By creating smart contracts on the blockchain and updating credit scores, the centralized problems and security threats of traditional power trading systems were solved, and efficient, safe, and credible power transactions were achieved.
Patent Information
- Application Number
- CN202411651349.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-01-28
AI Technical Summary
Traditional power trading systems rely on centralized processing and storage, resulting in limited system vulnerability, transaction speed and flexibility. At the same time, they lack effective credit verification and transaction monitoring, and are prone to security threats such as data tampering and fraud.
By creating a smart contract on the blockchain, the user signature generates transaction orders, the cloud center verifies and sends a digital signature, the service party executes the transaction under the chain, the seller confirms the actual transaction volume, and the settlement transaction amount will be updated. score.
Enhance the security and transparency of power transactions, optimize the transaction process, improve the efficiency, security and credibility of the transaction, and improve the liquidity and stability of the power trading market.
Smart Images

Figure CN119379443A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of big data and blockchain application technology, and specifically to a distributed power distribution network transaction method, system, electronic equipment and medium. Background Art
[0002] In today's energy market, with the rapid development of renewable energy and distributed energy, traditional power trading systems face many challenges. Traditional power trading platforms usually rely on centralized processing and storage, which not only increases the vulnerability of the system, but also limits the speed and flexibility of transactions. In addition, due to the lack of effective credit verification and transaction monitoring mechanisms, traditional platforms are also often faced with security threats such as data tampering and fraud. These problems are particularly prominent in highly dynamic and highly heterogeneous distributed energy environments, because the participants and transaction modes of transactions are more diverse. Summary of the invention
[0003] In order to solve the problems in the related art, the embodiments of the present disclosure provide a distributed power distribution network transaction method, system, electronic device and medium.
[0004] In a first aspect, the present disclosure provides a distributed power distribution network transaction method, including: The user creates a smart contract for power trading on the blockchain at the edge node side, and generates a transaction order by signing the contract. The user includes the buyer and the seller. The cloud center verifies the transaction order and sends a digital signature to the buyer user after the verification is passed; wherein the digital signature records the transaction amount on the chain; The cloud center sends the transaction order to the off-chain service provider for execution, and the buyer user uploads the actual transaction amount and the digital signature after the off-chain service provider completes the execution; After the seller user confirms the actual transaction volume, the cloud center settles the transaction amount corresponding to the transaction order according to the smart contract and the actual transaction volume, and updates the user credit score according to the difference between the on-chain transaction volume and the actual transaction volume.
[0005] In one implementation of the present disclosure, the method further includes: The cloud center matches the buyer and seller users participating in this transaction based on the latest user credit scores.
[0006] In one implementation of the present disclosure, the user credit score is updated according to the following rules: Satisfy the conditions At the first moment T1, the user's credit score is: Satisfy the conditions When a user defaults passively, the user's credit score is: Satisfy the conditions When a user actively defaults, the user's credit score is: in, , Represented as user In cycle The initial transaction volume in the smart contract, Represented as user In cycle The actual transaction volume in the smart contract, Expressed as the coefficient of variation, Represented as user In cycle The residual volume in the smart contract, Represented as user In cycle Transaction credit score, Expressed as the penalty coefficient for passive breach of contract, Expressed as the penalty coefficient for active breach of contract.
[0007] In one implementation of the present disclosure, the smart contract includes transaction information, wherein before the user signs and generates a transaction order, the method further includes: Determine the validity of transaction information in smart contracts; If the transaction is determined to be invalid, part of the user's credit score will be deducted based on the preset rules, and the user's credit score will be updated; If the transaction is determined to be valid, the buyer and seller will sign and generate a transaction order.
[0008] In one implementation of the present disclosure, before the user signs to generate a transaction order, the method further includes: The successfully matched buyer and seller users undergo on-chain identity authentication; If the identity authentication is passed, the buyer and seller will sign and generate a transaction order.
[0009] In one implementation of the present disclosure, the on-chain identity authentication adopts an authentication scheme based on a zero-knowledge proof protocol and a DH algorithm.
[0010] In one implementation of the present disclosure, the method further includes: The edge node receives the user's historical transaction query request; The edge node verifies the user's identity. If the verification is successful, it returns the transaction access data address and the corresponding secret key to the user, and establishes a data transmission channel between the cloud center and the user; The user downloads the historical transaction data from the cloud center through the data transmission channel.
[0011] In a second aspect, the present disclosure provides a distributed power distribution network trading system, including: A creation module is configured to allow a user to create a smart contract for power trading on the blockchain on the edge node side, and generate a transaction order by signing by the user; wherein the user includes a buyer user and a seller user; A verification module is configured to verify the transaction order in the cloud center and send a digital signature to the buyer user after the verification is passed; wherein the digital signature records the transaction amount on the chain; The transaction module is configured so that the cloud center sends the transaction order to the off-chain service provider for execution, and the buyer user uploads the actual transaction amount and the digital signature after the off-chain service provider completes the execution; The settlement module is configured so that after the seller user confirms the actual transaction volume, the cloud center settles the transaction amount corresponding to the transaction order according to the smart contract and the actual transaction volume, and updates the user credit score according to the difference between the on-chain transaction volume and the actual transaction volume.
[0012] In one implementation of the present disclosure, the system further includes: The matching module is configured to match the buyer user and the seller user participating in the transaction based on the latest user credit score in the cloud center.
[0013] In one implementation of the present disclosure, the user credit score is updated according to the following rules: Satisfy the conditions At the first moment T1, the user's credit score is: Satisfy the conditions When a user defaults passively, the user's credit score is: Satisfy the conditions When a user actively defaults, the user's credit score is: in, , Represented as user In cycle The initial transaction volume in the smart contract, Represented as user In cycle The actual transaction volume in the smart contract, Expressed as the coefficient of variation, Represented as user In cycle The residual volume in the smart contract, Represented as user In cycle Transaction credit score, Expressed as the penalty coefficient for passive breach of contract, Expressed as the penalty coefficient for active breach of contract.
[0014] In one implementation of the present disclosure, the smart contract includes transaction information, and the system further includes: The determination module is configured to determine the validity of the transaction information in the smart contract. If the transaction is determined to be invalid, part of the user's credit score is deducted based on the preset rules, and the user's credit score is updated. If the transaction is determined to be valid, the buyer and seller users sign to generate a transaction order.
[0015] In one implementation of the present disclosure, the system further includes: The authentication module is configured to perform on-chain identity authentication for the successfully matched buyer user and seller user. If the identity authentication passes, a transaction order is generated by the signatures of the buyer user and the seller user.
[0016] In one implementation of the present disclosure, the on-chain identity authentication adopts an authentication scheme based on a zero-knowledge proof protocol and a DH algorithm.
[0017] In one implementation of the present disclosure, the system further includes: A query module, configured as an edge node to receive a user's historical transaction query request; The verification module is configured as an edge node to verify the user's identity. If the verification is successful, the transaction access data address and the corresponding secret key are returned to the user, and a data transmission channel is established between the cloud center and the user; The download module is configured to allow users to download historical transaction data from the cloud center through the data transmission channel.
[0018] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising a memory and a processor, wherein the memory is used to store one or more computer instructions, and wherein the one or more computer instructions are executed by the processor to implement a method as described in any one of the first aspects.
[0019] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium on which computer instructions are stored. When the computer instructions are executed by a processor, the method described in any one of the first aspects is implemented.
[0020] In a fifth aspect, an embodiment of the present disclosure provides a chip, the chip including a processor, the processor being used to call a computer program in a memory to execute the above-mentioned distributed power distribution network trading method.
[0021] The technical effects provided by the embodiments of the present disclosure may include the following beneficial effects: According to the technical solution provided by the embodiment of the present disclosure, the user creates a smart contract for power trading on the blockchain on the edge node side, and the user signs to generate a trading order; wherein the user includes a buyer user and a seller user; the cloud center verifies the trading order and sends a digital signature to the buyer user after the verification is passed; wherein the digital signature records the on-chain transaction volume; the cloud center sends the trading order to the off-chain service party for execution, and the buyer user uploads the actual transaction volume and the digital signature after the off-chain service party completes the execution; after the seller user confirms the actual transaction volume, the cloud center settles the transaction amount corresponding to the trading order according to the smart contract and the actual transaction volume, and updates the user credit score according to the difference between the on-chain transaction volume and the actual transaction volume. The above technical solution uses blockchain technology, especially its smart contract function, to enhance the security and transparency of power trading through automated contract execution and tamper-proof transaction records. Through on-chain contracts and off-chain entity transmission, the transaction process is optimized, and the efficiency, security and credibility of power trading are significantly improved. In addition, through dynamic credit evaluation and accurate fund settlement, the liquidity and stability of the power trading market are improved.
[0022] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 A flow chart of a distributed power distribution network transaction method according to an embodiment of the present disclosure is shown.
[0024] Figure 2 A structural block diagram of a distributed power distribution network trading system according to an embodiment of the present disclosure is shown.
[0025] Figure 3 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown.
[0026] Figure 4 A schematic diagram showing the structure of a computer system suitable for implementing the method according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0027] Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement them. In addition, for the sake of clarity, parts not related to the description of the exemplary embodiments are omitted in the accompanying drawings.
[0028] In the present disclosure, it should be understood that terms such as "include" or "have" are intended to indicate the presence of features, numbers, steps, behaviors, components, parts, or a combination thereof disclosed in the present specification, and are not intended to exclude the possibility that one or more other features, numbers, steps, behaviors, components, parts, or a combination thereof exist or are added.
[0029] It should also be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0030] In today's energy market, with the rapid development of renewable energy and distributed energy, traditional power trading systems face many challenges. Traditional power trading platforms usually rely on centralized processing and storage, which not only increases the vulnerability of the system, but also limits the speed and flexibility of transactions. In addition, due to the lack of effective credit verification and transaction monitoring mechanisms, traditional platforms are also often faced with security threats such as data tampering and fraud. These problems are particularly prominent in highly dynamic and highly heterogeneous distributed energy environments, because the participants and transaction modes of transactions are more diverse.
[0031] In view of the above defects, the distributed power distribution network transaction method provided by the present disclosure utilizes blockchain technology, especially its smart contract function, to enhance the security and transparency of power transactions through automated contract execution and tamper-proof transaction records. Through on-chain contracts and off-chain entity transmission, the transaction process is optimized, and the efficiency, security and credibility of power transactions are significantly improved. In addition, through dynamic credit evaluation and accurate fund settlement, the liquidity and stability of the power trading market are improved.
[0032] Figure 1 A flow chart of a distributed power distribution network transaction method according to an embodiment of the present disclosure is shown.
[0033] like Figure 1 As shown, the distributed power distribution network transaction method includes the following steps S110-S140: In step S110, the user creates a smart contract for power trading on the blockchain on the edge node side, and generates a transaction order by signing by the user; wherein the user includes a buyer user and a seller user; In step S120, the cloud center verifies the transaction order and sends a digital signature to the buyer user after the verification is passed; wherein the digital signature records the transaction amount on the chain; In step S130, the cloud center sends the transaction order to the off-chain service provider for execution, and the buyer user uploads the actual transaction amount and the digital signature after the off-chain service provider completes the execution; In step S140, after the seller user confirms the actual transaction volume, the cloud center settles the transaction amount corresponding to the transaction order according to the smart contract and the actual transaction volume, and updates the user credit score according to the difference between the on-chain transaction volume and the actual transaction volume.
[0034] In the disclosed method, users need to complete registration in the cloud center before conducting transactions. The specific registration steps are: the user first submits a registration application to the edge node. After the edge node receives the user's registration application, it verifies whether the user's attributes such as user name, phone number, etc. are valid. If valid, it will sign; then the cloud center verifies whether the signature is valid. If valid, it allows the user registration information to be uploaded to the cloud center. After the user successfully registers, the cloud center sends the public key and the corresponding private key to the user.
[0035] In the disclosed method, the smart contract created by the user includes transaction information, which includes but is not limited to key parameters such as transaction volume, price, and transaction time. The smart contract is created in the blockchain on the edge node side. The creation process of the smart contract can be regarded as a coding process, and after the coding is completed, it can be automatically executed when the conditions are met. In the disclosed method, the user's transaction margin can be automatically locked through the smart contract, and the commitment of the off-chain transaction can be recorded and the performance can be monitored. After the smart contract is created, both users use their own private keys to sign to ensure the non-repudiation and integrity of the contract. The cloud center uses the corresponding public key for verification and sends a digital signature to the buyer user after the verification is passed. The security and reliability of transactions are further enhanced through the verification and signature mechanism of the cloud center.
[0036] in, ; For users In cycle On-chain transaction volume, For users Signed with the private key.
[0037] The center sends the order to the off-chain service provider to execute the physical transmission of electricity. After the off-chain service provider completes the execution, the buyer uploads the actual transaction amount received to the cloud center, and the cloud center also retrieves the digital signature The cloud center settles funds based on the smart contract and actual transaction volume, and reasonably allocates margin and transaction funds. At this time, users can publish new transaction information and start the next round of transactions.
[0038] Through the transaction mechanism of on-chain and off-chain collaboration, seamless connection of power transactions is achieved, and transaction efficiency is improved. Through the combination of physical transmission and smart contracts, the actual execution of transactions is ensured, and the rapid start of new transactions is facilitated, achieving flexibility and efficiency of transactions.
[0039] In the disclosed method, after the user completes the transaction, the cloud center compares the difference between the on-chain transaction volume and the actual transaction volume, calculates the user's latest credit score, and updates it in real time.
[0040] In one implementation of the present disclosure, the method further includes: The cloud center matches the buyer and seller users participating in this transaction based on the latest user credit scores.
[0041] In one implementation of the present disclosure, the user credit score is updated according to the following rules: Satisfy the conditions At the first moment T1, the user's credit score is: Satisfy the conditions When a user defaults passively, the user's credit score is: Satisfy the conditions When a user actively defaults, the user's credit score is: in, , Represented as user In cycle The initial transaction volume in the smart contract, Represented as user In cycle The actual transaction volume in the smart contract, Expressed as the coefficient of variation, Represented as user In cycle The residual volume in the smart contract, Represented as user In cycle Transaction credit score, Expressed as the penalty coefficient for passive breach of contract, Expressed as the penalty coefficient for active breach of contract.
[0042] In this disclosure method, since there is no breach of contract in the initial transaction of the user, the transaction user The initial credit score is: .
[0043] In this disclosure method, different credit scores are assessed by distinguishing between passive default (such as force majeure caused by energy fluctuations) and active default (based on user purpose). The scoring results are used for subsequent transaction matching, which effectively improves the reliability of user transactions on the chain. This evaluation method that comprehensively considers the type of default not only enhances transaction security, but also provides users with a fairer and more flexible trading environment, while optimizing the overall transaction process.
[0044] In this public method, in order to further ensure the reliability of transactions, users participating in transactions need to pay a corresponding security deposit to the cloud center before the transaction. Once a violation occurs, the corresponding penalty will be imposed. The calculation formula for the security deposit is as follows:
[0045] in, Represented as user In cycle The security deposit payable, Represented as user In cycle The maximum credit score value of Represented as user In cycle The transaction credit score value, For cycle The real-time market price coefficient.
[0046] In one implementation of the present disclosure, before the user signs to generate a transaction order, the method further includes: Determine the validity of transaction information in smart contracts; If the transaction is determined to be invalid, part of the user's credit score will be deducted based on the preset rules, and the user's credit score will be updated; If the transaction is determined to be valid, the buyer and seller will sign and generate a transaction order.
[0047] In this disclosure method, during the quotation stage, the user formulates the transaction information release and quotation pricing according to his own situation, generates a random encrypted string carrying the real price, and encapsulates it into the smart contract after hash encryption. The quotation pricing at this time is confidential. After the quotation stage is over, the user discloses the actual price, and the smart contract verifies the authenticity of the quotation through hash operation. If malicious behavior is found, the platform will determine that the transaction is invalid and deduct part of the credit score. At the same time, part of the security deposit can also be deducted. After deducting the user's credit score, the user's credit score is updated, and the updated user credit score is used to match the user participating in the next transaction. If the transaction is determined to be valid, the user's signature generates a transaction order, which ensures the fairness of pricing and the credibility of the transaction, and effectively curbs malicious behavior.
[0048] In one implementation of the present disclosure, before the user signs to generate a transaction order, the method further includes: The successfully matched buyer and seller users undergo on-chain identity authentication; If the identity authentication is passed, the buyer and seller will sign and generate a transaction order.
[0049] In one implementation of the present disclosure, the on-chain identity authentication adopts an authentication scheme based on a zero-knowledge proof protocol and a DH algorithm.
[0050] Specifically, the authentication scheme based on the zero-knowledge proof protocol and the DH algorithm includes: The cloud center randomly selects a prime number , so that Satisfy its small prime number Divide by integer, then choose a generator , send parameters to the user node and ; User Node According to the private key Calculate DH algorithm interaction parameters , user node According to the private key Calculate DH algorithm interaction parameters ; User Node Select random number ,calculate , , user node Select random number ,calculate , ;in, For user nodes Schnorr zero-knowledge proof, For Node Schnorr zero-knowledge proof; User Node Will and Send to user node At the same time, the user node Will and Send to user node ; User Node Verify the equation ,node Verify the equation , if both are established, mutual identity authentication is completed.
[0051] In one implementation of the present disclosure, the method further includes: The edge node receives the user's historical transaction query request; The edge node verifies the user's identity. If the verification is successful, it returns the transaction access data address and the corresponding secret key to the user, and establishes a data transmission channel between the cloud center and the user; The user downloads the historical transaction data from the cloud center through the data transmission channel.
[0052] In the disclosed method, users can download the ciphertext information of historical transaction data through the data transmission channel, and then decrypt it with their own private key, and finally obtain the historical transaction data they want to query.
[0053] The distributed power distribution network transaction method of the disclosed embodiment utilizes blockchain technology, especially its smart contract function, to enhance the security and transparency of power transactions through automated contract execution and tamper-proof transaction records. Through on-chain contracts and off-chain entity transmission, the transaction process is optimized, and the efficiency, security and credibility of power transactions are significantly improved. In addition, through dynamic credit evaluation and accurate fund settlement, the liquidity and stability of the power transaction market are improved.
[0054] Figure 2 The structural block diagram of the distributed power distribution network trading system according to the embodiment of the present disclosure is shown. The device can be implemented as part or all of the electronic device through software, hardware or a combination of both.
[0055] like Figure 2 As shown, the distributed power distribution network trading system 200 includes: The creation module 210 is configured to allow a user to create a smart contract for power trading on the blockchain at the edge node side, and generate a transaction order by signing by the user; wherein the user includes a buyer user and a seller user; The verification module 220 is configured to verify the transaction order in the cloud center and send a digital signature to the buyer user after the verification is passed; wherein the digital signature records the transaction amount on the chain; The transaction module 230 is configured so that the cloud center sends the transaction order to the off-chain service provider for execution, and the buyer user uploads the actual transaction amount and the digital signature after the off-chain service provider completes the execution; The settlement module 240 is configured so that after the seller user confirms the actual transaction volume, the cloud center settles the transaction amount corresponding to the transaction order according to the smart contract and the actual transaction volume, and updates the user credit score according to the difference between the on-chain transaction volume and the actual transaction volume.
[0056] In the disclosed method, users need to complete registration in the cloud center before conducting transactions. The specific registration steps are: the user first submits a registration application to the edge node. After the edge node receives the user's registration application, it verifies whether the user's attributes such as user name, phone number, etc. are valid. If valid, it will sign; then the cloud center verifies whether the signature is valid. If valid, it allows the user registration information to be uploaded to the cloud center. After the user successfully registers, the cloud center sends the public key and the corresponding private key to the user.
[0057] In the disclosed method, the smart contract created by the user includes transaction information, which includes but is not limited to key parameters such as transaction volume, price, and transaction time. The smart contract is created in the blockchain on the edge node side. The creation process of the smart contract can be regarded as a coding process, and after the coding is completed, it can be automatically executed when the conditions are met. In the disclosed method, the user's transaction margin can be automatically locked through the smart contract, and the commitment of the off-chain transaction can be recorded and the performance can be monitored. After the smart contract is created, both users use their own private keys to sign to ensure the non-repudiation and integrity of the contract. The cloud center uses the corresponding public key for verification and sends a digital signature to the buyer user after the verification is passed. The security and reliability of transactions are further enhanced through the verification and signature mechanism of the cloud center.
[0058] in, ; For users In cycle On-chain transaction volume, For users Signed with the private key.
[0059] The center sends the order to the off-chain service provider to execute the physical transmission of electricity. After the off-chain service provider completes the execution, the buyer uploads the actual transaction amount received to the cloud center, and the cloud center also retrieves the digital signature The cloud center settles funds based on the smart contract and actual transaction volume, and reasonably allocates margin and transaction funds. At this time, users can publish new transaction information and start the next round of transactions.
[0060] Through the transaction mechanism of on-chain and off-chain collaboration, seamless connection of power transactions is achieved, and transaction efficiency is improved. Through the combination of physical transmission and smart contracts, the actual execution of transactions is ensured, and the rapid start of new transactions is facilitated, achieving flexibility and efficiency of transactions.
[0061] In the disclosed method, after the user completes the transaction, the cloud center compares the difference between the on-chain transaction volume and the actual transaction volume, calculates the user's latest credit score, and updates it in real time.
[0062] In one implementation of the present disclosure, the system further includes: The matching module is configured to match the buyer user and the seller user participating in the transaction based on the latest user credit score in the cloud center.
[0063] In one implementation of the present disclosure, the user credit score is updated according to the following rules: Satisfy the conditions At the first moment T1, the user's credit score is: Satisfy the conditions When a user defaults passively, the user's credit score is: Satisfy the conditions When a user actively defaults, the user's credit score is: in, , Represented as user In cycle The initial transaction volume in the smart contract, Represented as user In cycle The actual transaction volume in the smart contract, Expressed as the coefficient of variation, Represented as user In cycle The residual volume in the smart contract, Represented as user In cycle Transaction credit score, Expressed as the penalty coefficient for passive breach of contract, Expressed as the penalty coefficient for active breach of contract.
[0064] In this disclosure method, since there is no breach of contract in the initial transaction of the user, the transaction user The initial credit score is: .
[0065] In this disclosure method, different credit scores are assessed by distinguishing between passive default (such as force majeure caused by energy fluctuations) and active default (based on user purpose). The scoring results are used for subsequent transaction matching, which effectively improves the reliability of user transactions on the chain. This evaluation method that comprehensively considers the type of default not only enhances transaction security, but also provides users with a fairer and more flexible trading environment, while optimizing the overall transaction process.
[0066] In this public method, in order to further ensure the reliability of transactions, users participating in transactions need to pay a corresponding security deposit to the cloud center before the transaction. Once a violation occurs, the corresponding penalty will be imposed. The calculation formula for the security deposit is as follows:
[0067] in, Represented as user In cycle The security deposit payable, Represented as user In cycle The maximum credit score value of Represented as user In cycle The transaction credit score value, For cycle The real-time market price coefficient.
[0068] In one implementation of the present disclosure, the system further includes: The determination module is configured to determine the validity of the transaction information in the smart contract. If the transaction is determined to be invalid, part of the user's credit score is deducted based on the preset rules, and the user's credit score is updated. If the transaction is determined to be valid, the buyer and seller users sign to generate a transaction order.
[0069] In this disclosure method, during the quotation stage, the user formulates the transaction information release and quotation pricing according to his own situation, generates a random encrypted string carrying the real price, and encapsulates it into the smart contract after hash encryption. The quotation pricing at this time is confidential. After the quotation stage is over, the user discloses the actual price, and the smart contract verifies the authenticity of the quotation through hash operation. If malicious behavior is found, the platform will determine that the transaction is invalid and deduct part of the credit score. At the same time, part of the security deposit can also be deducted. After deducting the user's credit score, the user's credit score is updated, and the updated user credit score is used to match the user participating in the next transaction. If the transaction is determined to be valid, the user's signature generates a transaction order, which ensures the fairness of pricing and the credibility of the transaction, and effectively curbs malicious behavior.
[0070] In one implementation of the present disclosure, the system further includes: The authentication module is configured to perform on-chain identity authentication for the successfully matched buyer user and seller user. If the identity authentication passes, a transaction order is generated by the signatures of the buyer user and the seller user.
[0071] In one implementation of the present disclosure, the on-chain identity authentication adopts an authentication scheme based on a zero-knowledge proof protocol and a DH algorithm.
[0072] Specifically, the authentication scheme based on the zero-knowledge proof protocol and the DH algorithm includes: The cloud center randomly selects a prime number , so that Satisfy its small prime number Divide by integer, then choose a generator , send parameters to the user node and ; User Node According to the private key Calculate DH algorithm interaction parameters , user node According to the private key Calculate DH algorithm interaction parameters ; User Node Select random number ,calculate , , user node Select random number ,calculate , ;in, For user nodes Schnorr zero-knowledge proof, For Node Schnorr zero-knowledge proof; User Node Will and Send to user node At the same time, user nodes Will and Send to user node ; User Node Verify the equation ,node Verify the equation , if both are established, mutual identity authentication is completed.
[0073] In one implementation of the present disclosure, the system further includes: A query module, configured as an edge node to receive a user's historical transaction query request; The verification module is configured as an edge node to verify the user's identity. If the verification is successful, the transaction access data address and the corresponding secret key are returned to the user, and a data transmission channel is established between the cloud center and the user; The download module is configured to allow users to download historical transaction data from the cloud center through the data transmission channel.
[0074] In the disclosed method, users can download the ciphertext information of historical transaction data through the data transmission channel, and then decrypt it with their own private key, and finally obtain the historical transaction data they want to query.
[0075] The present disclosure also discloses an electronic device, Figure 3 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown.
[0076] like Figure 3 As shown, the electronic device includes a memory and a processor, wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method according to an embodiment of the present disclosure.
[0077] The distributed power distribution network transaction method comprises: The user creates a smart contract for power trading on the blockchain at the edge node side, and generates a transaction order by signing the contract. The user includes the buyer and the seller. The cloud center verifies the transaction order and sends a digital signature to the buyer user after the verification is passed; wherein the digital signature records the transaction amount on the chain; The cloud center sends the transaction order to the off-chain service provider for execution, and the buyer user uploads the actual transaction amount and the digital signature after the off-chain service provider completes the execution; After the seller user confirms the actual transaction volume, the cloud center settles the transaction amount corresponding to the transaction order according to the smart contract and the actual transaction volume, and updates the user credit score according to the difference between the on-chain transaction volume and the actual transaction volume.
[0078] The distributed power distribution network transaction method of the disclosed embodiment utilizes blockchain technology, especially its smart contract function, to enhance the security and transparency of power transactions through automated contract execution and tamper-proof transaction records. Through on-chain contracts and off-chain entity transmission, the transaction process is optimized, and the efficiency, security and credibility of power transactions are significantly improved. In addition, through dynamic credit evaluation and accurate fund settlement, the liquidity and stability of the power transaction market are improved.
[0079] In one implementation of the present disclosure, the method further includes: The cloud center matches the buyer and seller users participating in this transaction based on the latest user credit scores.
[0080] In one implementation of the present disclosure, the user credit score is updated according to the following rules: Satisfy the conditions At the first moment T1, the user's credit score is: Satisfy the conditions When a user defaults passively, the user's credit score is: Satisfy the conditions When a user actively defaults, the user's credit score is: in, , Represented as user In cycle The initial transaction volume in the smart contract, Represented as user In cycle The actual transaction volume in the smart contract, Expressed as the coefficient of variation, Represented as user In cycle The residual volume in the smart contract, Represented as user In cycle Transaction credit score, Expressed as the penalty coefficient for passive breach of contract, Expressed as the penalty coefficient for active breach of contract.
[0081] In one implementation of the present disclosure, the smart contract includes transaction information, wherein before the user signs and generates a transaction order, the method further includes: Determine the validity of transaction information in smart contracts; If the transaction is determined to be invalid, part of the user's credit score will be deducted based on the preset rules, and the user's credit score will be updated; If the transaction is determined to be valid, the buyer and seller will sign and generate a transaction order.
[0082] In one implementation of the present disclosure, before the user signs to generate a transaction order, the method further includes: The successfully matched buyer and seller users undergo on-chain identity authentication; If the identity authentication is passed, the buyer and seller will sign and generate a transaction order.
[0083] In one implementation of the present disclosure, the on-chain identity authentication adopts an authentication scheme based on a zero-knowledge proof protocol and a DH algorithm.
[0084] In one implementation of the present disclosure, the method further includes: The edge node receives the user's historical transaction query request; The edge node verifies the user's identity. If the verification is successful, it returns the transaction access data address and the corresponding secret key to the user, and establishes a data transmission channel between the cloud center and the user; The user downloads the historical transaction data from the cloud center through the data transmission channel.
[0085] Figure 4 A schematic diagram showing the structure of a computer system suitable for implementing the method according to an embodiment of the present disclosure is shown.
[0086] like Figure 4 As shown, the computer system includes a processing unit, which can execute various methods in the above-mentioned embodiments according to a program stored in a read-only memory (ROM) or a program loaded from a storage part into a random access memory (RAM). In the RAM, various programs and data required for the operation of the computer system are also stored. The processing unit, ROM and RAM are connected to each other through a bus. An input / output (I / O) interface is also connected to the bus.
[0087] The following components are connected to the I / O interface: an input part including a keyboard, a mouse, etc.; an output part including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage part including a hard disk, etc.; and a communication part including a network interface card such as a LAN card, a modem, etc. The communication part performs a communication process via a network such as the Internet. The drive is also connected to the I / O interface as needed. Removable media, such as disks, optical disks, magneto-optical disks, semiconductor memories, etc., are installed on the drive as needed so that the computer program read therefrom can be installed into the storage part as needed. Among them, the processing unit can be implemented as a processing unit such as a CPU, a GPU, a TPU, an FPGA, an NPU, etc.
[0088] In particular, according to an embodiment of the present disclosure, the method described above can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly contained on a machine-readable medium, and the computer program includes a program code for executing the above method. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium.
[0089] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0090] The units or modules involved in the embodiments described in the present disclosure may be implemented by software or programmable hardware. The units or modules described may also be set in a processor, and the names of these units or modules do not constitute limitations on the units or modules themselves in some cases.
[0091] As another aspect, the present disclosure further provides a chip, which includes at least one processor and can be used to implement the method involved in the above system embodiment.
[0092] In one possible design, the chip also includes a memory, which is used to store program instructions and data, and the memory is located inside or outside the processor.
[0093] As another aspect, the present disclosure further provides a computer-readable storage medium, which may be a computer-readable storage medium included in the electronic device or computer system in the above embodiment; or a computer-readable storage medium that exists independently and is not assembled into a device. The computer-readable storage medium stores one or more programs, and the programs are used by one or more processors to execute the method described in the present disclosure.
[0094] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present disclosure is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other.
Claims
1. A distributed power distribution network trading method, characterized in that: include: The user creates a smart contract for power trading on the blockchain at the edge node side, and generates a transaction order by signing the contract. The user includes the buyer and the seller. The cloud center verifies the transaction order and sends a digital signature to the buyer user after the verification is passed; wherein the digital signature records the transaction amount on the chain; The cloud center sends the transaction order to the off-chain service provider for execution, and the buyer user uploads the actual transaction amount and the digital signature after the off-chain service provider completes the execution; After the seller user confirms the actual transaction volume, the cloud center settles the transaction amount corresponding to the transaction order according to the smart contract and the actual transaction volume, and updates the user credit score according to the difference between the on-chain transaction volume and the actual transaction volume.
2. The distributed power distribution network transaction method according to claim 1, characterized in that: Also includes: The cloud center matches the buyer and seller users participating in this transaction based on the latest user credit scores.
3. The distributed power distribution network transaction method according to claim 2, characterized in that: The user credit score is updated according to the following rules: Satisfy the conditions At the first moment T1, the user's credit score is: Satisfy the conditions When a user defaults passively, the user's credit score is: Satisfy the conditions When a user actively defaults, the user's credit score is: in, , Represented as user In cycle The initial transaction volume in the smart contract, Represented as user In cycle The actual transaction volume in the smart contract, Expressed as the coefficient of variation, Represented as user In cycle The residual volume in the smart contract, Represented as user In cycle Transaction credit score, Expressed as the penalty coefficient for passive breach of contract, Expressed as the penalty coefficient for active breach of contract.
4. The distributed power distribution network transaction method according to claim 3, characterized in that: The smart contract includes transaction information, wherein before the user signs and generates a transaction order, the method further includes: Determine the validity of transaction information in smart contracts; If the transaction is determined to be invalid, part of the user's credit score will be deducted based on the preset rules, and the user's credit score will be updated; If the transaction is determined to be valid, the buyer and seller will sign and generate a transaction order.
5. The distributed power distribution network transaction method according to claim 2, characterized in that: Before the user signs to generate a transaction order, the method further includes: The successfully matched buyer and seller users undergo on-chain identity authentication; If the identity authentication is passed, the buyer and seller will sign and generate a transaction order.
6. The distributed power distribution network transaction method according to claim 5, characterized in that: The on-chain identity authentication adopts an authentication scheme based on zero-knowledge proof protocol and DH algorithm.
7. The distributed power distribution network transaction method according to claim 1, characterized in that: Also includes: The edge node receives the user's historical transaction query request; The edge node verifies the user's identity. If the verification is successful, it returns the transaction access data address and the corresponding secret key to the user, and establishes a data transmission channel between the cloud center and the user; The user downloads the historical transaction data from the cloud center through the data transmission channel.
8. A distributed power distribution network trading system, characterized in that: include: A creation module is configured to allow a user to create a smart contract for power trading on the blockchain on the edge node side, and generate a transaction order by signing by the user; wherein the user includes a buyer user and a seller user; A verification module is configured to verify the transaction order in the cloud center and send a digital signature to the buyer user after the verification is passed; wherein the digital signature records the transaction amount on the chain; The transaction module is configured so that the cloud center sends the transaction order to the off-chain service provider for execution, and the buyer user uploads the actual transaction amount and the digital signature after the off-chain service provider completes the execution; The settlement module is configured so that after the seller user confirms the actual transaction volume, the cloud center settles the transaction amount corresponding to the transaction order according to the smart contract and the actual transaction volume, and updates the user credit score according to the difference between the on-chain transaction volume and the actual transaction volume.
9. The distributed power distribution network trading system according to claim 8, characterized in that: Also includes: The matching module is configured to match the buyer user and the seller user participating in the transaction based on the latest user credit score in the cloud center.
10. The distributed power distribution network trading system according to claim 9, characterized in that: The user credit score is updated according to the following rules: Satisfy the conditions At the first moment T1, the user's credit score is: Satisfy the conditions When a user defaults passively, the user's credit score is: Satisfy the conditions When a user actively defaults, the user's credit score is: in, , Represented as user In cycle The initial transaction volume in the smart contract, Represented as user In cycle The actual transaction volume in the smart contract, Expressed as the coefficient of variation, Represented as user In cycle The residual volume in the smart contract, Represented as user In cycle Transaction credit score, Expressed as the penalty coefficient for passive breach of contract, Expressed as the penalty coefficient for active breach of contract.
11. The distributed power distribution network trading system according to claim 10, characterized in that: The smart contract includes transaction information and also includes: The determination module is configured to determine the validity of the transaction information in the smart contract. If the transaction is determined to be invalid, part of the user's credit score is deducted based on the preset rules, and the user's credit score is updated. If the transaction is determined to be valid, the buyer and seller users sign to generate a transaction order.
12. The distributed power distribution network trading system according to claim 9, characterized in that: Also includes: The authentication module is configured to perform on-chain identity authentication for the successfully matched buyer user and seller user. If the identity authentication passes, a transaction order is generated by the signatures of the buyer user and the seller user.
13. The distributed power distribution network trading system according to claim 12, characterized in that: The on-chain identity authentication adopts an authentication scheme based on zero-knowledge proof protocol and DH algorithm.
14. The distributed power distribution network trading system according to claim 8, characterized in that: Also includes: A query module, configured as an edge node to receive a user's historical transaction query request; The verification module is configured as an edge node to verify the user's identity. If the verification is successful, the transaction access data address and the corresponding secret key are returned to the user, and a data transmission channel is established between the cloud center and the user; The download module is configured to allow users to download historical transaction data from the cloud center through the data transmission channel.
15. An electronic device, characterized in that: The method comprises a memory and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method according to any one of claims 1 to 7.
16. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the computer instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.
17. A chip, characterized in that: include: At least one processor, configured to implement the method according to any one of claims 1 to 7.