CN115994806A - Power transaction method, device and system based on blockchain and privacy calculation - Google Patents

Power transaction method, device and system based on blockchain and privacy calculation Download PDF

Info

Publication number
CN115994806A
CN115994806A CN202310121528.3A CN202310121528A CN115994806A CN 115994806 A CN115994806 A CN 115994806A CN 202310121528 A CN202310121528 A CN 202310121528A CN 115994806 A CN115994806 A CN 115994806A
Authority
CN
China
Prior art keywords
power
power generation
ciphertext
planned
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310121528.3A
Other languages
Chinese (zh)
Other versions
CN115994806B (en
Inventor
张沈斌
韩剑锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianju Dihe Suzhou Technology Co ltd
Original Assignee
Tianju Dihe Suzhou Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianju Dihe Suzhou Technology Co ltd filed Critical Tianju Dihe Suzhou Technology Co ltd
Priority to CN202310121528.3A priority Critical patent/CN115994806B/en
Publication of CN115994806A publication Critical patent/CN115994806A/en
Application granted granted Critical
Publication of CN115994806B publication Critical patent/CN115994806B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y04INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
    • Y04SSYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
    • Y04S10/00Systems supporting electrical power generation, transmission or distribution
    • Y04S10/50Systems or methods supporting the power network operation or management, involving a certain degree of interaction with the load-side end user applications

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a power transaction method, device and system based on blockchain and privacy calculation, and relates to the technical field of blockchains. The method comprises the following steps: receiving ciphertext of planned power generation data and ciphertext of planned power consumption data, and uploading the ciphertext and the ciphertext to a block chain; determining a target transaction matching model; the trusted computing platform sends a target transaction matching model, ciphertext of planned power generation data and ciphertext of planned power consumption data; receiving ciphertext of a transaction matching result sent by a trusted computing platform, and uploading the ciphertext to a blockchain; receiving a first zero knowledge proof sent by a power generating party and a second zero knowledge proof sent by a power using party; invoking a verification intelligent contract, verifying a first zero knowledge proof and a second zero knowledge proof, and if the first zero knowledge proof passes the verification, updating a ciphertext of the electricity charge data of the power generation party; and if the second zero knowledge proof passes the verification, updating the ciphertext of the electricity charge data of the electricity consumer. The embodiment ensures privacy safety of the electricity consumer and the electricity generator.

Description

Power transaction method, device and system based on blockchain and privacy calculation
Technical Field
The invention relates to the technical field of blockchains, in particular to a method, a device and a system for electric power transaction based on blockchains and privacy calculation.
Background
In order to reduce the total cost generated by power trade, the power generator and the power consumer need to determine the amount of power trade through matching calculation.
Currently, power transaction data, such as transaction power, is stored in a centralized database in the form of plaintext. However, the centralized storage system is easy to tamper with, and the data security is low. And, the privacy security of the electricity consumer and the electricity generator cannot be ensured by data plaintext storage.
Disclosure of Invention
In view of the above, the embodiment of the invention provides a power transaction method, a device and a system based on blockchain and privacy calculation, which can improve the security of data storage and ensure the privacy security of a power consumer and a power generator.
In a first aspect, an embodiment of the present invention provides a power transaction method based on blockchain and privacy calculation, applied to a node device of a blockchain, including:
receiving ciphertext of planning power generation data sent by at least two power generating parties and ciphertext of planning power consumption data sent by at least two power consuming parties; the public key used for encrypting the planned power generation data and the planned power consumption data is calculated by a trusted computing platform in a trusted execution environment based on a homomorphic encryption algorithm;
Uploading the ciphertext of the planned power generation data and the ciphertext of the planned power consumption data to a blockchain;
determining a target transaction matching model;
sending the target transaction matching model, the ciphertext of the planned power generation data and the ciphertext of the planned power utilization data to the trusted computing platform, so that the trusted computing platform performs matching calculation in a trusted execution environment according to the target transaction matching model, the ciphertext of the planned power generation data and the ciphertext of the planned power utilization data, and provides the obtained transaction matching result to the corresponding power generator and the power consumer for power transmission;
receiving ciphertext of the transaction matching result sent by the trusted computing platform, and uploading the ciphertext of the transaction matching result to the blockchain;
receiving a first zero knowledge proof sent by the power generating party and a second zero knowledge proof sent by the power using party;
invoking a verification intelligent contract to verify the first zero knowledge proof based on the ciphertext of the transaction matching result in the blockchain, and if the verification is passed, updating the ciphertext of the electricity charge data of the electricity generator in the blockchain; and verifying the second zero knowledge proof based on the verification intelligent contract, and if the verification is passed, updating the ciphertext of the electricity charge data of the electricity consumer in the block chain.
In a second aspect, an embodiment of the present invention provides a power transaction method based on blockchain and privacy computation, applied to a trusted computing platform, including:
generating a public key and a private key in a trusted execution environment based on a homomorphic encryption algorithm, and sending the public key to at least two power generation parties and at least two power utilization parties, so that the power generation parties encrypt planned power generation data based on the public key, and the power utilization parties encrypt planned power utilization data based on the public key;
receiving a target transaction matching model, ciphertext of the planned power generation data and ciphertext of the planned power consumption data, which are sent by the power transaction platform;
decrypting ciphertext of the planned power generation data and ciphertext of the planned power consumption data based on the private key;
carrying out matching calculation in a trusted execution environment according to the target transaction matching model, the planned power generation data of the at least two power generation parties and the planned power utilization data of the at least two power utilization parties to obtain a transaction matching result;
encrypting the transaction matching result based on the public key, and sending a ciphertext of the transaction matching result to the electric power transaction platform;
and respectively sending the transaction matching results associated with the power generation party and the power utilization party to the power generation party and the power utilization party so that the power generation party and the power utilization party can perform power transmission according to the corresponding transaction matching results.
In a third aspect, an embodiment of the present invention provides a power transaction method based on blockchain and privacy calculation, applied to a power generation end, including:
receiving a public key sent by a trusted computing platform; the public key is obtained by calculation of the trusted computing platform in a trusted execution environment based on a homomorphic encryption algorithm;
encrypting planned power generation data based on the public key;
sending ciphertext of the planned power generation data to a power transaction platform;
generating a first zero knowledge proof, and sending the first zero knowledge proof to the electric power transaction platform.
In a fourth aspect, an embodiment of the present invention provides a power transaction method based on blockchain and privacy calculation, applied to a power consumer, including:
receiving a public key sent by a trusted computing platform; the public key is obtained by calculation of the trusted computing platform in a trusted execution environment based on a homomorphic encryption algorithm;
encrypting the planning electricity data based on the public key;
sending the ciphertext of the planning electricity data to an electric power transaction platform;
and generating a second zero knowledge proof, and sending the second zero knowledge proof to the electric power transaction platform.
In a fifth aspect, an embodiment of the present invention provides an electric power transaction platform, applied to a node device of a blockchain, including:
The receiving module is configured to receive ciphertext of planning power generation data sent by at least two power generation parties and ciphertext of planning power utilization data sent by at least two power utilization parties; uploading the ciphertext of the planned power generation data and the ciphertext of the planned power consumption data to a blockchain; the public key used for encrypting the planned power generation data and the planned power consumption data is calculated by a trusted computing platform in a trusted execution environment based on a homomorphic encryption algorithm;
the transaction matching module is configured to determine a target transaction matching model; sending the target transaction matching model, the ciphertext of the planned power generation data and the ciphertext of the planned power utilization data to the trusted computing platform, so that the trusted computing platform performs matching calculation in a trusted execution environment according to the target transaction matching model, the ciphertext of the planned power generation data and the ciphertext of the planned power utilization data, and provides the obtained transaction matching result to the corresponding power generator and the power consumer for power transmission; receiving ciphertext of the transaction matching result sent by the trusted computing platform, and uploading the ciphertext of the transaction matching result to the blockchain;
The verification module is configured to receive a first zero knowledge proof sent by the power generating party and a second zero knowledge proof sent by the power using party; invoking a verification intelligent contract to verify the first zero knowledge proof based on the ciphertext of the transaction matching result in the blockchain, and if the verification is passed, updating the ciphertext of the electricity charge data of the electricity generator in the blockchain; and verifying the second zero knowledge proof based on the verification intelligent contract, and if the verification is passed, updating the ciphertext of the electricity charge data of the electricity consumer in the block chain.
In a sixth aspect, embodiments of the present invention provide a trusted computing platform comprising:
the key generation module is configured to generate a public key and a private key in a trusted execution environment based on a homomorphic encryption algorithm, and send the public key to at least two power generation parties and at least two power utilization parties so that the power generation parties encrypt planned power generation data based on the public key and the power utilization parties encrypt planned power utilization data based on the public key;
the decryption module is configured to receive a target transaction matching model, ciphertext of the planned power generation data and ciphertext of the planned power utilization data, which are sent by the power transaction platform; decrypting ciphertext of the planned power generation data and ciphertext of the planned power consumption data based on the private key;
The calculation module is configured to perform matching calculation in a trusted execution environment according to the target transaction matching model, the planned power generation data of the at least two power generation parties and the planned power utilization data of the at least two power utilization parties to obtain a transaction matching result; encrypting the transaction matching result based on the public key, and sending a ciphertext of the transaction matching result to the electric power transaction platform; and respectively sending the transaction matching results associated with the power generation party and the power utilization party to the power generation party and the power utilization party so that the power generation party and the power utilization party can perform power transmission according to the corresponding transaction matching results.
In a seventh aspect, an embodiment of the present invention provides a power generating end, including:
receiving a public key sent by a trusted computing platform; the public key is obtained by calculation of the trusted computing platform in a trusted execution environment based on a homomorphic encryption algorithm;
encrypting planned power generation data based on the public key;
sending ciphertext of the planned power generation data to a power transaction platform;
generating a first zero knowledge proof, and sending the first zero knowledge proof to the electric power transaction platform.
In an eighth aspect, an embodiment of the present invention provides an electrical terminal, including:
Receiving a public key sent by a trusted computing platform; the public key is obtained by calculation of the trusted computing platform in a trusted execution environment based on a homomorphic encryption algorithm;
encrypting the planning electricity data based on the public key;
sending the ciphertext of the planning electricity data to an electric power transaction platform;
and generating a second zero knowledge proof, and sending the second zero knowledge proof to the electric power transaction platform.
In a ninth aspect, an embodiment of the present invention provides a power transaction system based on blockchain and privacy calculations, including: the power trading platform, the power generation end and the power utilization end described in the above embodiments.
In a tenth aspect, an embodiment of the present invention provides an electronic device, including:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method as described in any of the embodiments above.
In an eleventh aspect, embodiments of the present invention provide a computer readable medium having stored thereon a computer program which, when executed by a processor, implements a method as in any of the embodiments described above.
One embodiment of the above invention has the following advantages or benefits: the data related to the electric power transaction are stored in the block chain in the form of ciphertext, so that the privacy of each participant can be ensured, and the data security is improved. The matching calculation is carried out in a trusted execution environment, so that the credibility of the matching result of the transaction can be ensured. In the power transaction process, all the participants transmit data in the form of ciphertext, so that privacy leakage risk is reduced. And verifying whether the power generator generates power according to the transaction matching result through the first zero knowledge proof, and verifying whether the power consumer uses power according to the transaction matching result through the second zero knowledge proof, so that the transaction safety can be improved.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a flow chart of a blockchain and privacy calculation based power transaction method for use with a node device provided by an embodiment of the invention;
FIG. 2 is a schematic diagram of a transaction matching model assessment provided by one embodiment of the present invention;
FIG. 3 is a flow chart of a blockchain and privacy calculation based power transaction method for use with a trusted computing platform provided by an embodiment of the present invention;
FIG. 4 is a flow chart of a blockchain and privacy calculation based power transaction method for use at a power generating end provided in accordance with an embodiment of the present invention;
FIG. 5 is a flow chart of a blockchain and privacy calculation based power transaction method for use with a power consumer provided in accordance with an embodiment of the present invention;
FIG. 6 is a schematic diagram of an electric power trading platform according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a power generation end according to one embodiment of the present invention;
FIG. 8 is a schematic diagram of an electrical consumer provided by an embodiment of the present invention;
FIG. 9 is a schematic diagram of a trusted computing platform provided by one embodiment of the present invention;
FIG. 10 is a schematic diagram of a power trading system provided by an embodiment of the invention;
fig. 11 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The cost of a single node in a power system is typically calculated from a cost function.
Figure SMS_1
(1)
Taking the cost function shown in equation (1) as an example,
Figure SMS_2
cost for characterizing node i, +.>
Figure SMS_3
A power consumption for characterizing the power generation of a power generator or a power consumer, +.>
Figure SMS_4
、/>
Figure SMS_5
The parameters of the cost function are determined by the electricity generation or electricity utilization properties of the node, such as carbon emission generated by electricity generation or electricity utilization, pollution degree to the environment and the like.
The aim of the matching calculation is to calculate the generated energy or the used energy of each node when the total cost of the power system is the lowest. At the same time, this optimal solution needs to satisfy a specific constraint, e.g., constraint 1 is
Figure SMS_6
The constraint condition 1 characterizes that the target power generation amount obtained by optimization is in the range of the lower limit of the planned power generation amount and the upper limit of the planned power generation amount, and the target power consumption amount obtained by optimization is in the range of the lower limit of the planned power consumption amount and the upper limit of the planned power consumption amount; constraint 2 is: the amount of electricity transmitted by the electricity generating party m to the electricity consuming party n is equal to the amount of electricity acquired by the electricity consuming party n from the electricity generating party m.
At present, related data of power transaction is stored in a centralized manner in a plaintext form, privacy disclosure of each node is easy to cause, and data security is reduced. In addition, each participant transmits data in a plaintext form in the power transaction process, which easily causes data leakage.
In view of this, as shown in fig. 1, an embodiment of the present invention provides a power transaction method based on blockchain and privacy calculation, applied to a node device of a blockchain, including:
step 101: and receiving ciphertext of the planned power generation data sent by at least two power generating parties and ciphertext of the planned power utilization data sent by at least two power utilizing parties.
The public key used for encrypting the planned power generation data and the planned power consumption data is calculated by the trusted computing platform in a trusted execution environment based on a homomorphic encryption algorithm.
The power system generally comprises a plurality of power generating parties and a plurality of power consuming parties, the power generating parties can interact with a power trading platform and a trusted computing platform which are operated in the node equipment through power generating ends, and the power consuming parties can interact with the power trading platform and the trusted computing platform through the power consuming ends. In order to facilitate matching calculation between subsequent ciphertexts, the trusted computing platform generates a public key and a private key by adopting a homomorphic encryption algorithm, the private key is stored in the trusted computing platform, the public key is provided for a power consumer and a power generator, the power consumer uses the public key to homomorphic encrypt the planning power consumption data, and the power generator uses the public key to homomorphic encrypt the power generation data.
The planned power generation data includes: the planned power generation amount upper limit and/or the planned power generation amount lower limit, and the planned power consumption data comprise: an upper planned power generation amount limit and/or a lower planned power generation amount limit.
Step 102: uploading the ciphertext of the planned power generation data and the ciphertext of the planned power consumption data to a blockchain.
The ciphertext of the planned power generation data and the ciphertext of the planned power consumption data stored in the blockchain may be updated according to the progress of the power transaction process.
Step 103: and determining a target transaction matching model.
The target transaction matching model can be specified by a management party, and can be selected from a plurality of transaction matching models by a trusted computing platform according to the matching accuracy, the matching time length and the like of the transaction matching model. The management side can interact with the electric power transaction platform and the trusted computing platform through the management side. The trade matching model is an optimized model with constraint conditions, such as Lagrange relaxation, an alternate direction multiplier method, an augmented Lagrange and the like.
Step 104: and sending the target transaction matching model, the ciphertext of the planned power generation data and the ciphertext of the planned power consumption data to the trusted computing platform.
And the trusted computing platform performs matching calculation in a trusted execution environment according to the target transaction matching model, the ciphertext of the planned power generation data and the ciphertext of the planned power utilization data, and provides the obtained transaction matching result for the corresponding power generation party and the corresponding power utilization party for power transmission.
And the power generating party and the power consuming party perform power transmission according to the transaction matching result. The trade matching result comprises the power generation party and the corresponding power utilization party, and the power quantity planned to be transmitted between the power generation party and the power utilization party.
Step 105: and receiving the ciphertext of the transaction matching result sent by the trusted computing platform, and uploading the ciphertext of the transaction matching result to the blockchain.
And storing the ciphertext of the transaction matching result in a blockchain to prevent the data of a power generating party or a power using party from being counterfeited and ensure the safety of power transaction. The trusted computing platform homomorphic encrypts the transaction matching result based on the public key.
Step 106: and receiving the first zero knowledge proof sent by the power generating party and the second zero knowledge proof sent by the power using party.
The first zero knowledge proof is used for verifying whether the power generating party generates power according to the transaction matching result, and the second zero knowledge proof is used for verifying whether the power using party uses power according to the transaction matching result, so that the safety of power transaction is further ensured, and the generation of transaction disputes is reduced.
Step 107: invoking a verification intelligent contract to verify the first zero knowledge proof based on the ciphertext of the transaction matching result in the blockchain, and if the verification is passed, updating the ciphertext of the electricity charge data of the electricity generator in the blockchain; and verifying the second zero knowledge proof based on the verification intelligent contract, and if the verification is passed, updating the ciphertext of the electricity charge data of the electricity consumer in the block chain.
The electricity charge data may be balance of electricity charge, or data related to electricity charge such as total amount of power generation or total amount of power consumption. The power generator and the power consumer can store a certain amount of electricity charge or tokens in the contract account in advance, and the electricity charge or tokens in the contract account are updated along with the progress of the electric power transaction.
In the embodiment of the invention, the data related to the electric power transaction are stored in the block chain in the form of ciphertext, so that the privacy of each participant can be ensured, and the data security is improved. The matching calculation is carried out in a trusted execution environment, so that the credibility of the matching result of the transaction can be ensured. In the power transaction process, all the participants transmit data in the form of ciphertext, so that privacy leakage risk is reduced. And verifying whether the power generator generates power according to the transaction matching result through the first zero knowledge proof, and verifying whether the power consumer uses power according to the transaction matching result through the second zero knowledge proof, so that the transaction safety can be improved.
In view of the variety of cost functions that may be used by the power generator or consumer, to increase the success rate of the transaction, to meet the needs of the power generator or consumer, in one embodiment of the present invention, the method further comprises: receiving ciphertext of a power generation cost function sent by the power generation party and ciphertext of a power utilization cost function sent by the power utilization party; uploading the ciphertext of the power generation cost function and the ciphertext of the power consumption cost function to the blockchain; receiving an objective function type sent by a management side;
Sending the target transaction matching model, the ciphertext of the planned power generation data and the ciphertext of the planned power consumption data to a trusted computing platform, wherein the method comprises the following steps of:
and sending the target transaction matching model, the ciphertext of the power generation cost function belonging to the target function type and the ciphertext of the corresponding plan power generation data, and the ciphertext of the power utilization cost function belonging to the target function type and the ciphertext of the corresponding plan power utilization data to the trusted computing platform.
The power generation party and the power utilization party respectively provide cost functions used by the power generation party and the power utilization party for the node equipment, the management end determines the type of the objective function aimed at by the current matching calculation, and the node equipment provides ciphertext of the power generation cost function and ciphertext of the power utilization cost function belonging to the type of the objective function for the trusted computing platform so that the trusted computing platform performs the matching calculation on the power generation party and the power utilization party with the same function type.
The function types include linear functions and nonlinear functions, and of course, the linear functions may be further divided, which is not described herein. The block chain can store multiple function types, the power generator and the power consumer select the function type used by each from the multiple function types, and upload the ciphertext of the power generation cost function and the ciphertext of the power consumption cost function. The ciphertext of the power generation cost function and the ciphertext of the power consumption cost function respectively comprise the ciphertext of the corresponding function type and the ciphertext of the function parameter. If the power transaction adopts a specified objective function type, the power generating party and the power consuming party can directly provide the ciphertext of the function parameters of the corresponding power generating cost function and the power consuming cost function without providing the function type to which the ciphertext belongs.
In one embodiment of the invention, determining a target transaction matching model includes:
receiving at least two transaction matching models sent by the power generating party and/or the power consuming party;
uploading the at least two transaction matching models into the blockchain;
transmitting the at least two transaction matching models to the trusted computing platform, so that the trusted computing platform evaluates each transaction matching model in a trusted execution environment;
receiving the evaluation results of the transaction matching models sent by the trusted computing platform, and uploading the evaluation results of the transaction matching models to the blockchain;
and calling a recommended intelligent contract to select the target transaction matching model from the at least two transaction matching models based on the evaluation result of each transaction matching model.
In order to improve the trade matching effect and further reduce the cost, the embodiment of the invention evaluates the trade matching model provided by the power generating party or the power consuming party and selects the trade matching model with better evaluation effect as the target trade matching model. The transaction matching model and the evaluation result are saved in the blockchain for subsequent traceability. As shown in fig. 2, the power generator or the power consumer provides a transaction matching model, the trusted computing platform evaluates the transaction matching model and feeds back an evaluation result, and the power transaction platform uploads the transaction matching model and the evaluation result to be stored in a blockchain and provides the evaluation result to the power generator or the power consumer so as to facilitate the power generator or the power consumer to vote.
In one embodiment of the present invention, selecting the target transaction matching model from the at least two transaction matching models based on the evaluation result of each transaction matching model includes:
obtaining voting results of the power generating party and/or the power using party for each transaction matching model, selecting at least two transaction matching models to be recommended from the at least two transaction matching models according to the voting results, and selecting the target transaction matching model from the at least two transaction matching models according to evaluation results and historical use data of each transaction matching model to be recommended;
wherein the evaluation result includes: matching accuracy and matching time.
In the embodiment of the invention, the power generating party and/or the power consuming party can vote on the transaction matching model according to the evaluation result of the transaction matching model, and the power transaction platform can select the transaction matching model to be recommended according to the number of votes. Of course, rather than performing a vote, a target transaction matching model may be selected from the at least two transaction matching models directly based on the evaluation results and historical usage data. The evaluation result can also only comprise the matching accuracy or the matching duration.
The historical usage data may be a historical usage number and/or a historical usage time. In an actual application scene, the score of the trade matching model to be recommended can be calculated based on the formula (2), and the target trade matching model is selected according to the sequence from high score to low score.
Figure SMS_7
(2)
Wherein S is used for representing the score of the trade matching model to be recommended, T is used for representing the historical use times, and R 1 And C is used for representing the matching time length, and alpha and beta are weights.
The embodiment of the invention not only considers the performance of the transaction matching model, but also considers the preference of the power generating party and/or the power consuming party, and screens the transaction matching model from a plurality of different dimensions so as to improve the quality of the transaction matching result.
In one embodiment of the invention, the planned power generation data includes: a planned power generation amount lower limit and a planned power generation amount upper limit;
the planning electricity data includes: a lower planned electric power consumption limit and an upper planned electric power consumption limit;
the method further comprises the steps of:
updating ciphertext of the lower limit of the planned power generation amount and ciphertext of the upper limit of the planned power generation amount in the blockchain when the first zero knowledge proof verification passes;
and when the second zero knowledge proof verification passes, updating the ciphertext of the lower limit of the planned power consumption and the ciphertext of the upper limit of the planned power consumption in the blockchain.
When the first zero knowledge proof verification passes, the power generation party is stated to generate power according to the transaction matching result, and in order to ensure that the power generation capacity does not exceed the planned range, the ciphertext of the lower limit of the planned power generation capacity and the ciphertext of the upper limit of the planned power generation capacity are required to be updated. Similarly, the ciphertext of the lower limit of the electric power consumption and the ciphertext of the upper limit of the electric power consumption need to be updated.
For the power generation side, when the first zero knowledge proof verification passes, the actual power generation amount is within the range of the planned power generation amount lower limit and the planned power generation amount upper limit, the planned power generation amount lower limit is 0,
Figure SMS_8
wherein->
Figure SMS_9
Ciphertext for characterizing an upper limit of the planned power generation>
Figure SMS_10
Ciphertext used to characterize the actual power generation. />
Figure SMS_11
I.e. the updated planned power generation amount has a lower limit of 0 +.>
Figure SMS_12
Ciphertext for characterizing a lower limit of the planned power generation, +.>
Figure SMS_13
Ciphertext used to characterize 0.
For the electricity consuming party, when the second zero knowledge proof passes the verification, the actual electricity consumption is within the range of the lower limit of the planned electricity consumption and the upper limit of the planned electricity consumptionThe lower limit of the power consumption is 0,
Figure SMS_14
wherein->
Figure SMS_15
Ciphertext for characterizing the upper limit of the power consumption of a plan,/->
Figure SMS_16
Ciphertext used to characterize the actual power consumption. />
Figure SMS_17
I.e. the updated planned power usage has a lower limit of 0, < > >
Figure SMS_18
Ciphertext used to characterize the lower limit of the projected power usage.
In one embodiment of the invention, the method further comprises:
calculating the carbon integral of the power generation party according to the power generation mode of the power generation party;
calculating the carbon integral of the electricity utilization party according to the electricity utilization mode of the electricity utilization party;
encrypting the carbon integral of the power generation party and the carbon integral of the power utilization party respectively, and uploading ciphertext of the carbon integral of the power generation party and ciphertext of the carbon integral of the power utilization party to the blockchain;
when the first zero knowledge proof verification passes, updating the carbon integral of the power generation party in the block chain according to the ciphertext of the transaction matching result;
and when the second zero knowledge proof verification passes, updating the carbon points of the power utilization parties in the block chain according to the ciphertext of the transaction matching result.
For example, the carbon integral of solar power generation is 1, the carbon integral of wind power generation is 2, the carbon integral of hydroelectric power generation is 3, and the carbon integral of thermal power generation is 0.
According to the embodiment of the invention, through the form of the carbon points, the power generation party and the power consumption party are encouraged to generate power or use power in a more environment-friendly mode, and the trusted computing platform can screen the power consumption party and the power generation party according to the height of the carbon points in the matching process. In an actual application scenario, the carbon integration may also be converted into electricity fees.
According to the embodiment of the invention, the initial carbon points are respectively given to the power generation party and the power utilization party according to the power generation mode and the power utilization mode, and the carbon points are updated according to the trade matching result, so that the influence of power trade on the environment can be reduced.
In one embodiment of the invention, verifying the first zero-knowledge proof based on ciphertext of a transaction match result in the blockchain includes:
verifying whether the first zero-knowledge proof satisfies a first constraint condition;
wherein the first constraint comprises any one or more of: the ciphertext of the total power generation amount of the power generator is matched with the ciphertext of the transaction matching result in the blockchain, the total power generation amount is equal to the sum of the power generation amounts of all time periods counted by the electric meters of the power generator, the electric charge which the power generator can collect is calculated by the total power generation amount and the electric charge transfer function, the power generation amount of each time period of the power generator is equal to the sum of the power amounts transmitted to all power consumers in the same time period, the total power generation amount is not less than the lower limit of the planned power generation amount and not more than the upper limit of the planned power generation amount, the power generation amount of all time periods counted by the electric meters of the power generator has the signature of the electric meters of the power generator, and the power consumption amount of all time periods counted by the electric meters of the power consumer has the signature of the electric meters of the power consumer.
The generated energy of each time period counted by the ammeter of the power generator, the used energy of each time period counted by the ammeter of the power consumer, the signature of the ammeter of the power generator and the signature of the ammeter of the power consumer are private variables. Ciphertext of the electric charge to be received by the power generator, the lower limit of the planned power generation amount, the upper limit of the planned power generation amount and ciphertext of the total power generation amount are public variables. The first constraint may further include: the carbon integral of the power generation party is converted according to the total power generation amount. The electricity charge conversion function refers to electricity charge=electricity quantity x electricity price per unit quantity, electricity charge that the electricity generator should collect=actual electricity generation amount of the electricity generator x electricity price per unit quantity, electricity charge that the electricity consumer should deal with=actual electricity consumption amount of the electricity consumer x electricity price per unit quantity.
The embodiment of the invention can verify whether the generating party generates electricity according to the transaction matching result through the above items, and can improve the transaction safety.
In one embodiment of the invention, verifying the second zero-knowledge proof comprises:
verifying whether the second zero-knowledge proof satisfies a second constraint condition;
wherein the second constraint comprises any one or more of: the total electricity consumption amount of the electricity consuming party is equal to the sum of the electricity consumption amounts of all time periods counted by the electricity meter of the electricity consuming party, the electricity fee due to the electricity consuming party is calculated by the total electricity consumption amount and the electricity fee conversion function, the electricity consumption amount of the single time period of the electricity consuming party is equal to the sum of the electricity consumption amounts transmitted by the electricity consuming party in all power generation directions of the same time period, the total electricity consumption amount is not smaller than the lower limit of the planned electricity consumption amount and not larger than the upper limit of the planned electricity consumption amount, the generated energy of all time periods counted by the electricity meter of the electricity consuming party is provided with the signature of the electricity meter of the electricity consuming party, and the electricity consumption amount of all time periods counted by the electricity meter of the electricity consuming party is provided with the signature of the electricity meter of the electricity consuming party.
The generated energy of each time period counted by the ammeter of the power generator, the used energy of each time period counted by the ammeter of the power consumer, the signature of the ammeter of the power generator and the signature of the ammeter of the power consumer are private variables. Ciphertext of electricity charge due to electricity party, lower limit of electricity consumption, upper limit of electricity consumption and ciphertext of total amount of electricity consumption are public variables. The second constraint may further include: the carbon integral of the electricity utilization party is obtained by conversion according to the total electricity utilization amount.
The embodiment of the invention can verify whether the electricity consuming party uses electricity according to the transaction matching result through the above steps, thereby improving the transaction security.
As shown in fig. 3, an embodiment of the present invention provides a power transaction method based on blockchain and privacy computation, which is applied to a trusted computing platform, and includes:
step 301: and generating a public key and a private key in a trusted execution environment based on a homomorphic encryption algorithm, and sending the public key to at least two power generating parties and at least two power using parties, so that the power generating parties encrypt planned power generation data based on the public key, and the power using parties encrypt planned power using data based on the public key.
Step 302: and receiving a target transaction matching model, the ciphertext of the planned power generation data and the ciphertext of the planned power utilization data, which are sent by the power transaction platform.
Step 303: and decrypting the ciphertext of the planned power generation data and the ciphertext of the planned power consumption data based on the private key.
Step 304: and carrying out matching calculation in a trusted execution environment according to the target transaction matching model, the planned power generation data of the at least two power generation parties and the planned power utilization data of the at least two power utilization parties to obtain a transaction matching result.
Step 305: and encrypting the transaction matching result based on the public key, and sending a ciphertext of the transaction matching result to the electric power transaction platform.
Step 306: and respectively sending the transaction matching results associated with the power generation party and the power utilization party to the power generation party and the power utilization party so that the power generation party and the power utilization party can perform power transmission according to the corresponding transaction matching results.
The transaction matching result associated with the power generation party m refers to the power consumption party having a power transmission relationship with the power generation party m and the amount of power transmitted by the power generation party m and each power consumption party. That is, the power generation party m cannot obtain the power transmission information of the other power generation parties. The transaction matching result associated with the electricity consumer n refers to the electricity generating party in power transmission relation with the electricity consumer n, and the amount of electricity the electricity consumer n should acquire from each of the electricity generating parties.
The trusted computing platform provides a trusted execution environment for matching computation, ensures the security of the matching computation and prevents data leakage. Meanwhile, the trusted computing platform provides a public key used for homomorphic encryption, and the privacy of the power transaction data is guaranteed.
In one embodiment of the present invention, receiving a target transaction matching model, ciphertext of planned power generation data, and ciphertext of planned power usage data sent by a power trading platform includes:
receiving the target transaction matching model, ciphertext of a power generation cost function belonging to an objective function type, ciphertext of corresponding plan power generation data, ciphertext of a power utilization cost function belonging to the objective function type and ciphertext of corresponding plan power utilization data sent by the power transaction platform;
the method further comprises the steps of:
decrypting ciphertext of the power generation cost function and ciphertext of the planning power consumption data belonging to the objective function type based on the private key;
carrying out matching calculation in a trusted execution environment according to the target transaction matching model, the planned power generation data of the at least two power generation parties and the planned power utilization data of the at least two power utilization parties, wherein the method comprises the following steps of:
and carrying out matching calculation in a trusted execution environment according to the target transaction matching model, the power generation cost function belonging to the target function type and the corresponding planned power generation data thereof, and the power consumption cost function belonging to the target function type and the corresponding planned power consumption data thereof.
By the embodiment of the invention, the trusted computing platform can perform matching computation on the power generating party and the power consuming party with the same function type, so that the transaction matching result can more meet the actual requirements of the power generating party and the power consuming party, and the computing quantity of the matching computation is reduced.
In one embodiment of the invention, the method further comprises:
receiving at least two transaction matching models sent by the electric power transaction platform;
for any of the transaction matching models, performing: generating a test transaction matching result based on the test set and the transaction matching model, and determining an evaluation result of the transaction matching model according to the test transaction matching result and a standard transaction matching result;
and sending the evaluation result of each transaction matching model to the electric power transaction platform.
The evaluation result includes: the matching accuracy and/or the matching time length.
The test set includes a plurality of test samples, each test sample including: the planned power generation data of the power generation party and the planned power consumption data of the power consumption party, and the standard transaction matching result comprises: the power generating party and the associated power consuming party thereof, and the electric quantity transmitted between the power generating party and the associated power consuming party thereof. The test set and the standard transaction matching result are obtained in advance.
Figure SMS_19
(3)
The matching accuracy is calculated by the formula (3), wherein R 1 Used for representing matching accuracy, F 1 For characterizing the total cost of the power system corresponding to the test transaction matching result, F 2 The total cost of the power system corresponding to the standard transaction matching result is represented, gamma is a weight, and R can be set according to business requirements 2 The error rate for representing the transmission power of the power generator and the acquisition power of the power consumer can be calculated by the formula (3).
Figure SMS_20
(4)
Wherein S is m For characterising the number of generating nodes, S n For characterizing the number of electrical nodes, P mn For characterizing the quantity of electricity transmitted by the electricity generating party m to the electricity consuming party n, P nm The method is used for representing the electric quantity obtained by the electricity utilization party n from the electricity generation party m, and E is used for representing the maximum error value and preset according to actual service requirements.
In one embodiment of the invention, the planned power generation data includes: a planned power generation amount lower limit and a planned power generation amount upper limit;
the planning electricity data includes: a lower planned electric power consumption limit and an upper planned electric power consumption limit;
the method further comprises the steps of:
calculating the sum of the lower limit of the planned power generation amount of each power generation party and the sum of the upper limit of the planned power generation amount of each power utilization party;
when the sum of the lower limit of the planned power generation amount of each power consumer is larger than the sum of the upper limit of the planned power generation amount of each power consumer, selecting a target power consumer from the at least two power consumers according to the carbon integral of each power consumer in the block chain;
Carrying out matching calculation in a trusted execution environment according to the target transaction matching model, the planned power generation data of the at least two power generation parties and the planned power utilization data of the at least two power utilization parties to obtain a transaction matching result, wherein the method comprises the following steps of:
and carrying out matching calculation in a trusted execution environment according to the target transaction matching model, the planned power generation data of the at least two power generation parties and the planned power utilization data of the target power utilization party to obtain the transaction matching result.
In an actual application scenario, the planned power generation data may include only a planned power generation lower limit or a planned power generation upper limit, and the planned power consumption data may include only a planned power consumption lower limit or a planned power consumption upper limit, similarly.
The sum of the lower limit of the planned power generation amount of each power consumer is larger than the sum of the upper limit of the planned power generation amount of each power consumer, which indicates that the power consumer cannot meet the power demand of the power consumer, and at this time, one or more power consumers can be selected according to the order of the carbon integration of the power consumers from high to low. Of course, the target electricity usage party may also be selected according to the upper planned electricity usage limit or upper planned electricity usage limit of the electricity usage party.
According to the embodiment of the invention, the electricity utilization mode is more environment-friendly and can be preferentially selected through carbon integration of the electricity utilization mode, so that the influence of electricity transaction on the environment is reduced.
In one embodiment of the invention, the planned power generation data includes: a planned power generation amount lower limit and a planned power generation amount upper limit;
the planning electricity data includes: a lower planned electric power consumption limit and an upper planned electric power consumption limit;
the method further comprises the steps of:
calculating the sum of the lower limit of the planned power generation amount of each power generation party and the sum of the upper limit of the planned power generation amount of each power utilization party;
when the sum of the planned power generation amount lower limits of the power generation parties is larger than the sum of the planned power generation amount upper limits of the power utilization parties, selecting a target power generation party from the at least two power generation parties according to carbon integration of the power generation parties in the block chain;
carrying out matching calculation in a trusted execution environment according to the target transaction matching model, the planned power generation data of the at least two power generation parties and the planned power utilization data of the at least two power utilization parties to obtain a transaction matching result, wherein the method comprises the following steps of:
and carrying out matching calculation in a trusted execution environment according to the target transaction matching model, the planned power generation data of the target power generation party and the planned power utilization data of the at least two power utilization parties to obtain the transaction matching result.
The sum of the lower limit of the planned power generation amount of each power generator is larger than the sum of the upper limit of the planned power generation amount of each power consumer, which indicates that the power generation capacity of the power generator exceeds the power demand of the power consumer, and at this time, one or more power generators can be selected according to the order of the carbon integration of the power generators from high to low. Of course, the target power generation side may also be selected according to the planned power generation amount upper limit or the planned power generation amount upper limit of the power generation side.
According to the embodiment of the invention, the power generation party with more environment-friendly power generation mode can be preferentially selected through carbon integration of the power generation party, so that the influence of power transaction on the environment is reduced.
As shown in fig. 4, an embodiment of the present invention provides a power transaction method based on blockchain and privacy calculation, applied to a power generation end, including:
step 401: receiving a public key sent by a trusted computing platform; the public key is calculated by the trusted computing platform in a trusted execution environment based on a homomorphic encryption algorithm.
Step 402: and encrypting the planned power generation data based on the public key.
Step 403: and sending the ciphertext of the planned power generation data to a power transaction platform.
Step 404: generating a first zero knowledge proof, and sending the first zero knowledge proof to the electric power transaction platform.
In the embodiment of the invention, the power generation end prevents planned power generation data from being revealed through homomorphic encryption, improves the privacy safety of the data, and provides a first zero knowledge proof for the power transaction platform to verify whether a power generation party generates power according to a matching transaction result.
The power generation end can also be used for voting on each transaction matching model so as to select the transaction matching model which meets the service requirements of the power generation end.
As shown in fig. 5, an embodiment of the present invention provides a power transaction method based on blockchain and privacy calculation, which is applied to a power consumption terminal, and includes:
step 501: receiving a public key sent by a trusted computing platform; the public key is calculated by the trusted computing platform in a trusted execution environment based on a homomorphic encryption algorithm.
Step 502: planning electricity data is encrypted based on the public key.
Step 503: and sending the ciphertext of the planning electricity data to an electric power transaction platform.
Step 504: and generating a second zero knowledge proof, and sending the second zero knowledge proof to the electric power transaction platform.
In the embodiment of the invention, the electricity utilization terminal prevents the leakage of the planning electricity utilization data through homomorphic encryption, improves the privacy safety of the data, and provides the second zero knowledge proof for the electric power transaction platform so as to verify whether the electricity utilization party uses electricity according to the matching transaction result.
The electricity consumption end can also be used for voting on each transaction matching model so as to select the transaction matching model which meets the service requirements of the user.
As shown in fig. 6, an embodiment of the present invention provides an electric power transaction platform, applied to a node device of a blockchain, including:
the receiving module 601 is configured to receive ciphertext of planned power generation data sent by at least two power generating parties and ciphertext of planned power consumption data sent by at least two power consuming parties; uploading the ciphertext of the planned power generation data and the ciphertext of the planned power consumption data to a blockchain; the public key used for encrypting the planned power generation data and the planned power consumption data is calculated by a trusted computing platform in a trusted execution environment based on a homomorphic encryption algorithm;
A transaction matching module 602 configured to determine a target transaction matching model; sending the target transaction matching model, the ciphertext of the planned power generation data and the ciphertext of the planned power utilization data to the trusted computing platform, so that the trusted computing platform performs matching calculation in a trusted execution environment according to the target transaction matching model, the ciphertext of the planned power generation data and the ciphertext of the planned power utilization data, and provides the obtained transaction matching result to the corresponding power generator and the power consumer for power transmission; receiving ciphertext of the transaction matching result sent by the trusted computing platform, and uploading the ciphertext of the transaction matching result to the blockchain;
a verification module 603 configured to receive a first zero-knowledge proof sent by the power generator and a second zero-knowledge proof sent by the power consumer; invoking a verification intelligent contract to verify the first zero knowledge proof based on the ciphertext of the transaction matching result in the blockchain, and if the verification is passed, updating the ciphertext of the electricity charge data of the electricity generator in the blockchain; and verifying the second zero knowledge proof based on the verification intelligent contract, and if the verification is passed, updating the ciphertext of the electricity charge data of the electricity consumer in the block chain.
In one embodiment of the present invention, the receiving module 601 is configured to receive a ciphertext of a power generation cost function sent by the power generator and a ciphertext of a power consumption cost function sent by the power consumer; uploading the ciphertext of the power generation cost function and the ciphertext of the power consumption cost function to the blockchain;
a transaction matching module 602 configured to receive an objective function type sent by a manager; and sending the target transaction matching model, the ciphertext of the power generation cost function belonging to the target function type and the ciphertext of the corresponding plan power generation data, and the ciphertext of the power utilization cost function belonging to the target function type and the ciphertext of the corresponding plan power utilization data to the trusted computing platform.
In one embodiment of the invention, a transaction matching module 602 is configured to receive at least two transaction matching models sent by the power generating party and/or the power consuming party; uploading the at least two transaction matching models into the blockchain; transmitting the at least two transaction matching models to the trusted computing platform, so that the trusted computing platform evaluates each transaction matching model in a trusted execution environment; receiving the evaluation results of the transaction matching models sent by the trusted computing platform, and uploading the evaluation results of the transaction matching models to the blockchain; and calling a recommended intelligent contract to select the target transaction matching model from the at least two transaction matching models based on the evaluation result of each transaction matching model.
In one embodiment of the present invention, the transaction matching module 602 is configured to obtain a voting result of the power generating party and/or the power consuming party for each transaction matching model, select at least two transaction matching models to be recommended from the at least two transaction matching models according to the voting result, and select the target transaction matching model from the at least two transaction matching models according to an evaluation result and historical usage data of each transaction matching model to be recommended; wherein the evaluation result includes: matching accuracy and matching time.
In one embodiment of the invention, the planned power generation data includes: a planned power generation amount lower limit and a planned power generation amount upper limit; the planning electricity data includes: a lower planned electric power consumption limit and an upper planned electric power consumption limit;
a verification module 603 configured to update a ciphertext of a planned lower power generation amount limit and a ciphertext of a planned upper power generation amount limit of the blockchain when the first zero knowledge proof verification passes; and when the second zero knowledge proof verification passes, updating the ciphertext of the lower limit of the planned power consumption and the ciphertext of the upper limit of the planned power consumption in the blockchain.
In one embodiment of the present invention, the receiving module 601 is configured to calculate a carbon integral of the power generating party according to a power generation mode of the power generating party; calculating the carbon integral of the electricity utilization party according to the electricity utilization mode of the electricity utilization party; encrypting the carbon integral of the power generation party and the carbon integral of the power utilization party respectively, and uploading ciphertext of the carbon integral of the power generation party and ciphertext of the carbon integral of the power utilization party to the blockchain;
A verification module 603 configured to update a carbon integral of a generator in the blockchain according to a ciphertext of the transaction matching result when the first zero knowledge proof verification passes; and when the second zero knowledge proof verification passes, updating the carbon points of the power utilization parties in the block chain according to the ciphertext of the transaction matching result.
In one embodiment of the invention, a verification module 603 is configured to verify whether the first zero knowledge proof satisfies a first constraint;
wherein the first constraint comprises any one or more of: the ciphertext of the total power generation amount of the power generator is matched with the ciphertext of the transaction matching result in the blockchain, the total power generation amount is equal to the sum of the power generation amounts of all time periods counted by the electric meters of the power generator, the electric charge which the power generator can collect is calculated by the total power generation amount and the electric charge transfer function, the power generation amount of each time period of the power generator is equal to the sum of the power amounts transmitted to all power consumers in the same time period, the total power generation amount is not less than the lower limit of the planned power generation amount and not more than the upper limit of the planned power generation amount, the power generation amount of all time periods counted by the electric meters of the power generator has the signature of the electric meters of the power generator, and the power consumption amount of all time periods counted by the electric meters of the power consumer has the signature of the electric meters of the power consumer.
In one embodiment of the invention, a verification module 603 is configured to verify whether the second zero knowledge proof satisfies a second constraint;
wherein the second constraint comprises any one or more of: the total electricity consumption amount of the electricity consuming party is equal to the sum of the electricity consumption amounts of all time periods counted by the electricity meter of the electricity consuming party, the electricity fee due to the electricity consuming party is calculated by the total electricity consumption amount and the electricity fee conversion function, the electricity consumption amount of the single time period of the electricity consuming party is equal to the sum of the electricity consumption amounts transmitted by the electricity consuming party in all power generation directions of the same time period, the total electricity consumption amount is not smaller than the lower limit of the planned electricity consumption amount and not larger than the upper limit of the planned electricity consumption amount, the generated energy of all time periods counted by the electricity meter of the electricity consuming party is provided with the signature of the electricity meter of the electricity consuming party, and the electricity consumption amount of all time periods counted by the electricity meter of the electricity consuming party is provided with the signature of the electricity meter of the electricity consuming party.
As shown in fig. 7, an embodiment of the present invention provides a power generating terminal, including:
a receiving module 701 configured to receive a public key sent by a trusted computing platform; the public key is obtained by calculation of the trusted computing platform in a trusted execution environment based on a homomorphic encryption algorithm;
An encryption module 702 configured to encrypt planned generation data based on the public key;
a transmitting module 703 configured to transmit ciphertext of the planned power generation data to a power trading platform;
a generation module 704 configured to generate a first zero-knowledge proof, and send the first zero-knowledge proof to the power trading platform.
As shown in fig. 8, an embodiment of the present invention provides an electrical terminal, including:
a receiving module 801 configured to receive a public key sent by a trusted computing platform; the public key is obtained by calculation of the trusted computing platform in a trusted execution environment based on a homomorphic encryption algorithm;
an encryption module 802 configured to encrypt the planning electricity data based on the public key;
a transmitting module 803 configured to transmit the ciphertext of the planning electricity data to an electricity trading platform;
a generating module 804 is configured to generate a second zero-knowledge proof, and send the second zero-knowledge proof to the power trading platform.
As shown in fig. 9, an embodiment of the present invention provides a trusted computing platform, including:
the key generation module 901 is configured to generate a public key and a private key in a trusted execution environment based on a homomorphic encryption algorithm, and send the public key to at least two power generation parties and at least two power utilization parties, so that the power generation parties encrypt planned power generation data based on the public key, and the power utilization parties encrypt planned power utilization data based on the public key;
The decryption module 902 is configured to receive a target transaction matching model, a ciphertext of the planned power generation data and a ciphertext of the planned power consumption data, which are sent by the power transaction platform; decrypting ciphertext of the planned power generation data and ciphertext of the planned power consumption data based on the private key;
the computing module 903 is configured to perform matching computation in a trusted execution environment according to the target transaction matching model, the planned power generation data of the at least two power generation parties and the planned power utilization data of the at least two power utilization parties to obtain a transaction matching result; encrypting the transaction matching result based on the public key, and sending a ciphertext of the transaction matching result to the electric power transaction platform; and respectively sending the transaction matching results associated with the power generation party and the power utilization party to the power generation party and the power utilization party so that the power generation party and the power utilization party can perform power transmission according to the corresponding transaction matching results.
In one embodiment of the present invention, the decryption module 902 is configured to receive the target transaction matching model, the ciphertext of the power generation cost function belonging to the target function type and the ciphertext of the corresponding planned power generation data, and the ciphertext of the power consumption cost function belonging to the target function type and the ciphertext of the corresponding planned power consumption data, which are sent by the power transaction platform; decrypting ciphertext of the power generation cost function and ciphertext of the planning power consumption data belonging to the objective function type based on the private key;
The calculation module 903 is configured to perform matching calculation in a trusted execution environment according to the target transaction matching model, the power generation cost function belonging to the objective function type and the corresponding planned power generation data thereof, and the power consumption cost function belonging to the objective function type and the corresponding planned power consumption data thereof.
In one embodiment of the present invention, the computing module 903 is configured to receive at least two transaction matching models sent by the power transaction platform; for any of the transaction matching models, performing: generating a test transaction matching result based on the test set and the transaction matching model, and determining an evaluation result of the transaction matching model according to the test transaction matching result and a standard transaction matching result; and sending the evaluation result of each transaction matching model to the electric power transaction platform.
In one embodiment of the invention, the planned power generation data includes: a planned power generation amount lower limit and a planned power generation amount upper limit; the planning electricity data includes: a lower planned electric power consumption limit and an upper planned electric power consumption limit; a calculation module 903 configured to calculate a sum of a planned power generation amount lower limit of each of the power generators and a sum of a planned power generation amount upper limit of each of the power consumers; when the sum of the lower limit of the planned power generation amount of each power consumer is larger than the sum of the upper limit of the planned power generation amount of each power consumer, selecting a target power consumer from the at least two power consumers according to the carbon integral of each power consumer in the block chain; and carrying out matching calculation in a trusted execution environment according to the target transaction matching model, the planned power generation data of the at least two power generation parties and the planned power utilization data of the target power utilization party to obtain the transaction matching result.
In one embodiment of the invention, the planned power generation data includes: a planned power generation amount lower limit and a planned power generation amount upper limit; the planning electricity data includes: a lower planned electric power consumption limit and an upper planned electric power consumption limit;
a calculation module 903 configured to calculate a sum of a planned power generation amount lower limit of each of the power generators and a sum of a planned power generation amount upper limit of each of the power consumers; when the sum of the planned power generation amount lower limits of the power generation parties is larger than the sum of the planned power generation amount upper limits of the power utilization parties, selecting a target power generation party from the at least two power generation parties according to carbon integration of the power generation parties in the block chain; and carrying out matching calculation in a trusted execution environment according to the target transaction matching model, the planned power generation data of the target power generation party and the planned power utilization data of the at least two power utilization parties to obtain the transaction matching result.
As shown in fig. 10, an embodiment of the present invention provides a power transaction system based on blockchain and privacy calculation, including: the power trading platform 1001 according to any one of the embodiments, the trusted computing platform 1002 according to any one of the embodiments, the power generating terminal 1003 according to any one of the embodiments, and the power consuming terminal 1004 according to any one of the embodiments.
The power trading system may further include a management side configured to send the objective function type to the power trading platform. The management end can also be used for sending the target transaction matching model to the electric power transaction platform.
The embodiment of the invention provides a power transaction method based on blockchain and privacy calculation, which is applied to a power transaction system based on blockchain and privacy calculation and comprises the following steps:
s1: the electric power transaction platform generates a public key and a private key in a trusted execution environment based on a homomorphic encryption algorithm, and sends the public key to at least two power generating parties and at least two power consuming parties.
S2: and the power generation end encrypts the planned power generation data based on the public key and sends ciphertext of the planned power generation data to the power transaction platform.
S3: and the electricity utilization terminal encrypts the planning electricity utilization data based on the public key and sends ciphertext of the planning electricity utilization data to the electric power transaction platform.
S4: and uploading the ciphertext of the planned power generation data and the ciphertext of the planned power consumption data to a blockchain by the power transaction platform.
S5: and the electric power transaction platform determines a target transaction matching model and sends the target transaction matching model, the ciphertext of the planned power generation data and the ciphertext of the planned power utilization data to the trusted computing platform.
S6: and the trusted computing platform decrypts the ciphertext of the planned power generation data and the ciphertext of the planned power consumption data based on the private key.
S7: and the trusted computing platform performs matching calculation in a trusted execution environment according to the target transaction matching model, the planned power generation data of the at least two power generation parties and the planned power utilization data of the at least two power utilization parties to obtain a transaction matching result.
S8: and the trusted computing platform encrypts the transaction matching result based on the public key and sends a ciphertext of the transaction matching result to the electric power transaction platform.
S9: and uploading the ciphertext of the transaction matching result to the blockchain by the electric power transaction platform.
S10: and the trusted computing platform respectively sends the transaction matching result associated with the trusted computing platform to the power generating party and the power consuming party.
S11: the power generation end generates a first zero knowledge proof and sends the first zero knowledge proof to the power transaction platform.
S12: and the electricity utilization end generates a second zero knowledge proof and sends the second zero knowledge proof to the electric power transaction platform.
S13: the power transaction platform calls an intelligent contract for verification so as to verify the first zero knowledge proof based on the ciphertext of the transaction matching result in the blockchain, and if the verification is passed, the ciphertext of the power charge data of the power generator in the blockchain is updated; and verifying the second zero knowledge proof based on the verification intelligent contract, and if the verification is passed, updating the ciphertext of the electricity charge data of the electricity consumer in the block chain.
The embodiment of the invention provides electronic equipment, which comprises:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method as described in any of the embodiments above.
An embodiment of the present invention provides a computer readable medium having stored thereon a computer program which, when executed by a processor, implements a method as described in any of the embodiments above.
Referring now to FIG. 11, there is illustrated a schematic diagram of a computer system 1100 suitable for use in implementing the terminal device of an embodiment of the present invention. The terminal device shown in fig. 11 is only an example, and should not impose any limitation on the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 11, the computer system 1100 includes a CPU 1101 (central processing unit) that can execute various appropriate actions and processes according to a program stored in a ROM 1102 (read only memory) or a program loaded from a storage section 1108 into a RAM1103 (random access memory). In the RAM1103, various programs and data required for the operation of the system 1100 are also stored. The CPU 1101, ROM 1102, and RAM1103 are connected to each other by a bus 1104. An I/O interface 1105 (input/output) is also connected to the bus 1104.
The following components are connected to the I/O interface 1105: an input section 1106 including a keyboard, a mouse, and the like; an output portion 1107 including a CRT (cathode ray tube), an LCD (liquid crystal display), and the like, and a speaker, and the like; a storage section 1108 including a hard disk or the like; and a communication section 1109 including a network interface card such as a LAN card, a modem, and the like. The communication section 1109 performs communication processing via a network such as the internet. The drive 1110 is also connected to the I/O interface 1105 as needed. Removable media 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, is installed as needed in drive 1110, so that a computer program read therefrom is installed as needed in storage section 1108.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication portion 1109, and/or installed from the removable media 1111. The above-described functions defined in the system of the present invention are performed when the computer program is executed by the CPU 1101.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, RAM, ROM, EPROM (erasable programmable read-only memory) or flash memory, an optical fiber, a CD-ROM (portable compact disc read-only memory), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules involved in the embodiments of the present invention may be implemented in software or in hardware. The described modules may also be provided in a processor, for example, as: a processor includes a sending module, an obtaining module, a determining module, and a first processing module. The names of these modules do not in some cases limit the module itself, and for example, the transmitting module may also be described as "a module that transmits a picture acquisition request to a connected server".
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (21)

1. A blockchain and privacy computation based power transaction method, characterized by a node device applied to a blockchain, comprising:
receiving ciphertext of planning power generation data sent by at least two power generating parties and ciphertext of planning power consumption data sent by at least two power consuming parties; the public key used for encrypting the planned power generation data and the planned power consumption data is calculated by a trusted computing platform in a trusted execution environment based on a homomorphic encryption algorithm;
uploading the ciphertext of the planned power generation data and the ciphertext of the planned power consumption data to a blockchain;
determining a target transaction matching model;
sending the target transaction matching model, the ciphertext of the planned power generation data and the ciphertext of the planned power utilization data to the trusted computing platform, so that the trusted computing platform performs matching calculation in a trusted execution environment according to the target transaction matching model, the ciphertext of the planned power generation data and the ciphertext of the planned power utilization data, and provides the obtained transaction matching result to the corresponding power generator and the power consumer for power transmission;
Receiving ciphertext of the transaction matching result sent by the trusted computing platform, and uploading the ciphertext of the transaction matching result to the blockchain;
receiving a first zero knowledge proof sent by the power generating party and a second zero knowledge proof sent by the power using party;
invoking a verification intelligent contract to verify the first zero knowledge proof based on the ciphertext of the transaction matching result in the blockchain, and if the verification is passed, updating the ciphertext of the electricity charge data of the electricity generator in the blockchain; and verifying the second zero knowledge proof based on the verification intelligent contract, and if the verification is passed, updating the ciphertext of the electricity charge data of the electricity consumer in the block chain.
2. The method as recited in claim 1, further comprising:
receiving ciphertext of a power generation cost function sent by the power generation party and ciphertext of a power utilization cost function sent by the power utilization party;
uploading the ciphertext of the power generation cost function and the ciphertext of the power consumption cost function to the blockchain;
receiving an objective function type sent by a management side;
sending the target transaction matching model, the ciphertext of the planned power generation data and the ciphertext of the planned power consumption data to a trusted computing platform, wherein the method comprises the following steps of:
And sending the target transaction matching model, the ciphertext of the power generation cost function belonging to the target function type and the ciphertext of the corresponding plan power generation data, and the ciphertext of the power utilization cost function belonging to the target function type and the ciphertext of the corresponding plan power utilization data to the trusted computing platform.
3. The method of claim 1, wherein,
determining a target transaction matching model, comprising:
receiving at least two transaction matching models sent by the power generating party and/or the power consuming party;
uploading the at least two transaction matching models into the blockchain;
transmitting the at least two transaction matching models to the trusted computing platform, so that the trusted computing platform evaluates each transaction matching model in a trusted execution environment;
receiving the evaluation results of the transaction matching models sent by the trusted computing platform, and uploading the evaluation results of the transaction matching models to the blockchain;
and calling a recommended intelligent contract to select the target transaction matching model from the at least two transaction matching models based on the evaluation result of each transaction matching model.
4. The method of claim 3, wherein,
selecting the target transaction matching model from the at least two transaction matching models based on the evaluation result of each transaction matching model, including:
obtaining voting results of the power generating party and/or the power using party for each transaction matching model, selecting at least two transaction matching models to be recommended from the at least two transaction matching models according to the voting results, and selecting the target transaction matching model from the at least two transaction matching models according to evaluation results and historical use data of each transaction matching model to be recommended;
wherein the evaluation result includes: matching accuracy and matching time.
5. The method of claim 1, wherein,
the planned power generation data includes: a planned power generation amount lower limit and a planned power generation amount upper limit;
the planning electricity data includes: a lower planned electric power consumption limit and an upper planned electric power consumption limit;
the method further comprises the steps of:
updating ciphertext of the lower limit of the planned power generation amount and ciphertext of the upper limit of the planned power generation amount in the blockchain when the first zero knowledge proof verification passes;
And when the second zero knowledge proof verification passes, updating the ciphertext of the lower limit of the planned power consumption and the ciphertext of the upper limit of the planned power consumption in the blockchain.
6. The method as recited in claim 5, further comprising:
calculating the carbon integral of the power generation party according to the power generation mode of the power generation party;
calculating the carbon integral of the electricity utilization party according to the electricity utilization mode of the electricity utilization party;
encrypting the carbon integral of the power generation party and the carbon integral of the power utilization party respectively, and uploading ciphertext of the carbon integral of the power generation party and ciphertext of the carbon integral of the power utilization party to the blockchain;
when the first zero knowledge proof verification passes, updating the carbon integral of the power generation party in the block chain according to the ciphertext of the transaction matching result;
and when the second zero knowledge proof verification passes, updating the carbon points of the power utilization parties in the block chain according to the ciphertext of the transaction matching result.
7. The method of claim 1, wherein,
verifying the first zero knowledge proof based on ciphertext of a transaction matching result in the blockchain includes:
verifying whether the first zero-knowledge proof satisfies a first constraint condition;
Wherein the first constraint comprises any one or more of: the ciphertext of the total power generation amount of the power generator is matched with the ciphertext of the transaction matching result in the blockchain, the total power generation amount is equal to the sum of the power generation amounts of all time periods counted by the electric meters of the power generator, the electric charge which the power generator can collect is calculated by the total power generation amount and the electric charge transfer function, the power generation amount of each time period of the power generator is equal to the sum of the power amounts transmitted to all power consumers in the same time period, the total power generation amount is not less than the lower limit of the planned power generation amount and not more than the upper limit of the planned power generation amount, the power generation amount of all time periods counted by the electric meters of the power generator has the signature of the electric meters of the power generator, and the power consumption amount of all time periods counted by the electric meters of the power consumer has the signature of the electric meters of the power consumer.
8. The method of claim 1, wherein,
validating the second zero-knowledge proof, comprising:
verifying whether the second zero-knowledge proof satisfies a second constraint condition;
wherein the second constraint comprises any one or more of: the total electricity consumption amount of the electricity consuming party is equal to the sum of the electricity consumption amounts of all time periods counted by the electricity meter of the electricity consuming party, the electricity fee due to the electricity consuming party is calculated by the total electricity consumption amount and the electricity fee conversion function, the electricity consumption amount of the single time period of the electricity consuming party is equal to the sum of the electricity consumption amounts transmitted by the electricity consuming party in all power generation directions of the same time period, the total electricity consumption amount is not smaller than the lower limit of the planned electricity consumption amount and not larger than the upper limit of the planned electricity consumption amount, the generated energy of all time periods counted by the electricity meter of the electricity consuming party is provided with the signature of the electricity meter of the electricity consuming party, and the electricity consumption amount of all time periods counted by the electricity meter of the electricity consuming party is provided with the signature of the electricity meter of the electricity consuming party.
9. A blockchain and privacy computation based power transaction method, characterized by being applied to a trusted computing platform, comprising:
generating a public key and a private key in a trusted execution environment based on a homomorphic encryption algorithm, and sending the public key to at least two power generation parties and at least two power utilization parties, so that the power generation parties encrypt planned power generation data based on the public key, and the power utilization parties encrypt planned power utilization data based on the public key;
receiving a target transaction matching model, ciphertext of the planned power generation data and ciphertext of the planned power consumption data, which are sent by the power transaction platform;
decrypting ciphertext of the planned power generation data and ciphertext of the planned power consumption data based on the private key;
carrying out matching calculation in a trusted execution environment according to the target transaction matching model, the planned power generation data of the at least two power generation parties and the planned power utilization data of the at least two power utilization parties to obtain a transaction matching result;
encrypting the transaction matching result based on the public key, and sending a ciphertext of the transaction matching result to the electric power transaction platform;
and respectively sending the transaction matching results associated with the power generation party and the power utilization party to the power generation party and the power utilization party so that the power generation party and the power utilization party can perform power transmission according to the corresponding transaction matching results.
10. The method of claim 9, wherein,
receiving a target transaction matching model, ciphertext of planned power generation data and ciphertext of planned power consumption data sent by a power transaction platform, wherein the target transaction matching model, ciphertext of planned power generation data and ciphertext of planned power consumption data comprise:
receiving the target transaction matching model, ciphertext of a power generation cost function belonging to an objective function type, ciphertext of corresponding plan power generation data, ciphertext of a power utilization cost function belonging to the objective function type and ciphertext of corresponding plan power utilization data sent by the power transaction platform;
the method further comprises the steps of:
decrypting ciphertext of the power generation cost function and ciphertext of the planning power consumption data belonging to the objective function type based on the private key;
carrying out matching calculation in a trusted execution environment according to the target transaction matching model, the planned power generation data of the at least two power generation parties and the planned power utilization data of the at least two power utilization parties, wherein the method comprises the following steps of:
and carrying out matching calculation in a trusted execution environment according to the target transaction matching model, the power generation cost function belonging to the target function type and the corresponding planned power generation data thereof, and the power consumption cost function belonging to the target function type and the corresponding planned power consumption data thereof.
11. The method as recited in claim 9, further comprising:
receiving at least two transaction matching models sent by the electric power transaction platform;
for any of the transaction matching models, performing: generating a test transaction matching result based on the test set and the transaction matching model, and determining an evaluation result of the transaction matching model according to the test transaction matching result and a standard transaction matching result;
and sending the evaluation result of each transaction matching model to the electric power transaction platform.
12. The method of claim 11, wherein,
the planned power generation data includes: a planned power generation amount lower limit and a planned power generation amount upper limit;
the planning electricity data includes: a lower planned electric power consumption limit and an upper planned electric power consumption limit;
the method further comprises the steps of:
calculating the sum of the lower limit of the planned power generation amount of each power generation party and the sum of the upper limit of the planned power generation amount of each power utilization party;
when the sum of the lower limit of the planned power generation amount of each power consumer is larger than the sum of the upper limit of the planned power generation amount of each power consumer, selecting a target power consumer from the at least two power consumers according to the carbon integral of each power consumer in the block chain;
Carrying out matching calculation in a trusted execution environment according to the target transaction matching model, the planned power generation data of the at least two power generation parties and the planned power utilization data of the at least two power utilization parties to obtain a transaction matching result, wherein the method comprises the following steps of:
carrying out matching calculation in a trusted execution environment according to the target transaction matching model, the planned power generation data of the at least two power generation parties and the planned power utilization data of the target power utilization party to obtain a transaction matching result;
or alternatively, the first and second heat exchangers may be,
the planned power generation data includes: a planned power generation amount lower limit and a planned power generation amount upper limit;
the planning electricity data includes: a lower planned electric power consumption limit and an upper planned electric power consumption limit;
the method further comprises the steps of:
calculating the sum of the lower limit of the planned power generation amount of each power generation party and the sum of the upper limit of the planned power generation amount of each power utilization party;
when the sum of the planned power generation amount lower limits of the power generation parties is larger than the sum of the planned power generation amount upper limits of the power utilization parties, selecting a target power generation party from the at least two power generation parties according to carbon integration of the power generation parties in the block chain;
carrying out matching calculation in a trusted execution environment according to the target transaction matching model, the planned power generation data of the at least two power generation parties and the planned power utilization data of the at least two power utilization parties to obtain a transaction matching result, wherein the method comprises the following steps of:
And carrying out matching calculation in a trusted execution environment according to the target transaction matching model, the planned power generation data of the target power generation party and the planned power utilization data of the at least two power utilization parties to obtain the transaction matching result.
13. The utility model provides a power transaction method based on blockchain and privacy calculation, which is characterized in that the method is applied to a power generation end and comprises the following steps:
receiving a public key sent by a trusted computing platform; the public key is obtained by calculation of the trusted computing platform in a trusted execution environment based on a homomorphic encryption algorithm;
encrypting planned power generation data based on the public key;
sending ciphertext of the planned power generation data to a power transaction platform;
generating a first zero knowledge proof, and sending the first zero knowledge proof to the electric power transaction platform.
14. The utility model provides a power transaction method based on blockchain and privacy calculation, which is characterized in that the method is applied to a power utilization end and comprises the following steps:
receiving a public key sent by a trusted computing platform; the public key is obtained by calculation of the trusted computing platform in a trusted execution environment based on a homomorphic encryption algorithm;
encrypting the planning electricity data based on the public key;
sending the ciphertext of the planning electricity data to an electric power transaction platform;
And generating a second zero knowledge proof, and sending the second zero knowledge proof to the electric power transaction platform.
15. An electric power trading platform, characterized by a node device applied to a blockchain, comprising:
the receiving module is configured to receive ciphertext of planning power generation data sent by at least two power generation parties and ciphertext of planning power utilization data sent by at least two power utilization parties; uploading the ciphertext of the planned power generation data and the ciphertext of the planned power consumption data to a blockchain; the public key used for encrypting the planned power generation data and the planned power consumption data is calculated by a trusted computing platform in a trusted execution environment based on a homomorphic encryption algorithm;
the transaction matching module is configured to determine a target transaction matching model; sending the target transaction matching model, the ciphertext of the planned power generation data and the ciphertext of the planned power utilization data to the trusted computing platform, so that the trusted computing platform performs matching calculation in a trusted execution environment according to the target transaction matching model, the ciphertext of the planned power generation data and the ciphertext of the planned power utilization data, and provides the obtained transaction matching result to the corresponding power generator and the power consumer for power transmission; receiving ciphertext of the transaction matching result sent by the trusted computing platform, and uploading the ciphertext of the transaction matching result to the blockchain;
The verification module is configured to receive a first zero knowledge proof sent by the power generating party and a second zero knowledge proof sent by the power using party; invoking a verification intelligent contract to verify the first zero knowledge proof based on the ciphertext of the transaction matching result in the blockchain, and if the verification is passed, updating the ciphertext of the electricity charge data of the electricity generator in the blockchain; and verifying the second zero knowledge proof based on the verification intelligent contract, and if the verification is passed, updating the ciphertext of the electricity charge data of the electricity consumer in the block chain.
16. A trusted computing platform, comprising:
the key generation module is configured to generate a public key and a private key in a trusted execution environment based on a homomorphic encryption algorithm, and send the public key to at least two power generation parties and at least two power utilization parties so that the power generation parties encrypt planned power generation data based on the public key and the power utilization parties encrypt planned power utilization data based on the public key;
the decryption module is configured to receive a target transaction matching model, ciphertext of the planned power generation data and ciphertext of the planned power utilization data, which are sent by the power transaction platform; decrypting ciphertext of the planned power generation data and ciphertext of the planned power consumption data based on the private key;
The calculation module is configured to perform matching calculation in a trusted execution environment according to the target transaction matching model, the planned power generation data of the at least two power generation parties and the planned power utilization data of the at least two power utilization parties to obtain a transaction matching result; encrypting the transaction matching result based on the public key, and sending a ciphertext of the transaction matching result to the electric power transaction platform; and respectively sending the transaction matching results associated with the power generation party and the power utilization party to the power generation party and the power utilization party so that the power generation party and the power utilization party can perform power transmission according to the corresponding transaction matching results.
17. A power generation terminal, comprising:
the receiving module is configured to receive the public key sent by the trusted computing platform; the public key is obtained by calculation of the trusted computing platform in a trusted execution environment based on a homomorphic encryption algorithm;
an encryption module configured to encrypt planned generation data based on the public key;
the sending module is configured to send ciphertext of the planned power generation data to the power transaction platform;
the generation module is configured to generate a first zero knowledge proof and send the first zero knowledge proof to the power transaction platform.
18. An electrical consumer, comprising:
the receiving module is configured to receive the public key sent by the trusted computing platform; the public key is obtained by calculation of the trusted computing platform in a trusted execution environment based on a homomorphic encryption algorithm;
an encryption module configured to encrypt the planning electricity data based on the public key;
the sending module is configured to send the ciphertext of the planning electricity data to the electric power transaction platform;
and the generation module is configured to generate a second zero knowledge proof and send the second zero knowledge proof to the electric power transaction platform.
19. A blockchain and privacy calculation based power trading system, comprising: the power trading platform of claim 15, the trusted computing platform of claim 16, the power generation end of claim 17, and the power utilization end of claim 18.
20. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-14.
21. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-14.
CN202310121528.3A 2023-02-16 2023-02-16 Power transaction method, device and system based on blockchain and privacy calculation Active CN115994806B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310121528.3A CN115994806B (en) 2023-02-16 2023-02-16 Power transaction method, device and system based on blockchain and privacy calculation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310121528.3A CN115994806B (en) 2023-02-16 2023-02-16 Power transaction method, device and system based on blockchain and privacy calculation

Publications (2)

Publication Number Publication Date
CN115994806A true CN115994806A (en) 2023-04-21
CN115994806B CN115994806B (en) 2023-07-25

Family

ID=85991929

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310121528.3A Active CN115994806B (en) 2023-02-16 2023-02-16 Power transaction method, device and system based on blockchain and privacy calculation

Country Status (1)

Country Link
CN (1) CN115994806B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109377411A (en) * 2018-10-29 2019-02-22 南方电网科学研究院有限责任公司 Electricity market based on block chain concentrates trade matching method and device
CN110135819A (en) * 2019-05-21 2019-08-16 福建航誉大数据服务有限公司 A kind of third party's trust data transaction system and method based on block chain
CN112257102A (en) * 2020-09-28 2021-01-22 铭数科技(青岛)有限公司 Energy transaction privacy protection method based on block chain
CN115203749A (en) * 2022-09-16 2022-10-18 天聚地合(苏州)科技股份有限公司 Data transaction method and system based on block chain

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109377411A (en) * 2018-10-29 2019-02-22 南方电网科学研究院有限责任公司 Electricity market based on block chain concentrates trade matching method and device
CN110135819A (en) * 2019-05-21 2019-08-16 福建航誉大数据服务有限公司 A kind of third party's trust data transaction system and method based on block chain
CN112257102A (en) * 2020-09-28 2021-01-22 铭数科技(青岛)有限公司 Energy transaction privacy protection method based on block chain
CN115203749A (en) * 2022-09-16 2022-10-18 天聚地合(苏州)科技股份有限公司 Data transaction method and system based on block chain

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
赵丙镇: ""基于区块链架构的电力业务交易数据隐私保护"", 《电力系统自动化》 *

Also Published As

Publication number Publication date
CN115994806B (en) 2023-07-25

Similar Documents

Publication Publication Date Title
CN111259070B (en) Method and related device for storing and acquiring service data
US8667292B2 (en) Privacy-preserving metering with low overhead
Li et al. PPMA: Privacy-preserving multisubset data aggregation in smart grid
CN107909358B (en) Energy settlement method, device and system
Rial et al. Privacy-preserving smart metering
TWI452533B (en) Privacy-preserving metering
US8731199B2 (en) Zero knowledge proofs for arbitrary predicates over data
US9703963B2 (en) Trusted and privacy-preserving mechanism for electricity usage data disclosure using verifiable noise
CN112347495A (en) Trusted privacy intelligent service computing system and method based on block chain
Chu et al. Privacy-preserving smart metering with regional statistics and personal enquiry services
CN108960552B (en) Charging method based on real-time electricity price and related equipment
Inayat et al. Load balancing in decentralized smart grid trade system using blockchain
CN112702341B (en) Privacy protection-based user electricity consumption data sharing method and system
Zhang et al. Blockchain-based secure equipment diagnosis mechanism of smart grid
Mashima et al. Privacy preserving disclosure of authenticated energy usage data
CN110476313A (en) The method for operating power transmission network
CN113609224A (en) Crowdsourcing operation method and system for realizing privacy protection based on block chain
Wang et al. A privacy protection scheme for electricity transactions in the microgrid day-ahead market based on consortium blockchain
CN114493709A (en) Power demand response transaction subsidy calculation method, system and device
Erdayandi et al. A privacy-preserving and accountable billing protocol for peer-to-peer energy trading markets
CN115994806B (en) Power transaction method, device and system based on blockchain and privacy calculation
Ma et al. A Novel Cryptography-based Architecture to Achieve Secure Energy Trading in Microgrid
CN114726529A (en) Smart power grid data aggregation method based on credit consensus mechanism
EP3859652A1 (en) Technique for trustless cryptographic verification of energy allocations
CN115801474B (en) Power transaction method and system based on privacy calculation, power utilization end and power generation end

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant