CN111932253A - Electric energy transaction method based on credit consensus mechanism - Google Patents

Electric energy transaction method based on credit consensus mechanism Download PDF

Info

Publication number
CN111932253A
CN111932253A CN202010801709.7A CN202010801709A CN111932253A CN 111932253 A CN111932253 A CN 111932253A CN 202010801709 A CN202010801709 A CN 202010801709A CN 111932253 A CN111932253 A CN 111932253A
Authority
CN
China
Prior art keywords
node
block
credit
credit value
electric energy
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.)
Pending
Application number
CN202010801709.7A
Other languages
Chinese (zh)
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.)
North China Electric Power University
Original Assignee
North China Electric Power University
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 North China Electric Power University filed Critical North China Electric Power University
Priority to CN202010801709.7A priority Critical patent/CN111932253A/en
Publication of CN111932253A publication Critical patent/CN111932253A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/389Keeping log of transactions for guaranteeing non-repudiation of a transaction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Systems or methods specially adapted for specific business sectors, e.g. utilities or tourism
    • G06Q50/06Electricity, gas or water supply
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • 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
    • Y04S50/00Market activities related to the operation of systems integrating technologies related to power network operation or related to communication or information technologies
    • Y04S50/12Billing, invoicing, buying or selling transactions or other related activities, e.g. cost or usage evaluation

Abstract

The invention discloses an electric energy transaction method based on a credit consensus mechanism, which comprises the steps of agreeing an electric energy transaction protocol, establishing an intelligent contract, fulfilling the contract and updating a credit value. The invention provides a consensus mechanism based on credit certification, which realizes that a credit value influences a consensus process and restrains node integrity and faithfulness, and provides a microgrid node credit value evaluation mechanism, wherein the credit value is used as a basic attribute of a node and is suitable for being applied to a microgrid block chain; the method realizes anonymity of transaction users and data disclosure and transparency by using a block chain and an intelligent contract technology.

Description

Electric energy transaction method based on credit consensus mechanism
Technical Field
The invention relates to an electric energy transaction method, in particular to an electric energy transaction method based on a credit consensus mechanism, and belongs to the technical field of micro-grid power supply.
Background
With the development of distributed energy technology and the reform of electric power system by the country, the distributed energy equipment will go deep into each city and even each cell. The national relevant policy advocates local consumption of distributed electric energy, and internal trading of microgrid electric energy becomes a new trend. Under the situation, a large number of distributed electric energy producers and consumers enter the electric power system, and a large number of producers and consumers with independent decision-making capability are rushed in to put new demands on data disclosure transparency, transaction safety and fairness in the electric power system. Therefore, establishing a safe, efficient and transparent transaction mechanism will become the key of the Chinese power reform.
The problems of low admission threshold of the micro-grid power market, strong individual interest of distributed electric energy producers and consumers, strong uncertainty of the capacity of distributed electric energy equipment and the like present new challenges to the design of a trading mechanism. The problems may cause various default problems, and the default problems may cause trust of both parties of transactions inside the microgrid to be lost and cannot complete a task of local consumption of the distributed electric energy. Therefore, the credit assessment is carried out on the user while the new transaction mechanism is established, and the default behavior of the user is managed and controlled.
The block chain technology is known due to the characteristics of decentralization and distrust, has the advantages of transparent information disclosure, non-falsification of data and self-execution of intelligent contracts, is perfectly matched with the requirements of microgrid electric energy transaction, and has natural advantages in microgrid electric energy transaction and user credit management and control.
The core idea of the present consensus mechanism in the blockchain is that the node power is proportional to the probability of success in obtaining the accounting right, and the higher the node power, the more likely it becomes an accounting node. The nodes need to pack all transaction data in the period and generate a new block, the block can be written into a block chain after being generated and verified by other nodes, and the nodes can obtain corresponding accounting rewards. When a node generates a new block, a random number needs to be searched, repeated Hash operation needs to be carried out on the mining node for searching the random number, and the block generated by the earliest node which is found to meet the system difficulty random number can be written into a main chain of a block chain. This algorithm has heretofore been considered secure due to its high cost of error-making. However, with fewer active nodes in a microgrid network, a malicious node may complete a 51% computational attack by purchasing a huge computational mining machine. Because the longest chain in the block chain is considered as the main chain of the block chain, when the calculation force of a malicious node exceeds 51% of the calculation force of a full node, a longer branch chain can be manufactured to complete calculation force attack, and the block chain decentralized thought of the microgrid is violated. Meanwhile, when the nodes are used for mining calculation, a large amount of computing power, namely a large amount of electric energy, is consumed, which is not in accordance with the original intention of micro-grid establishment. Therefore, the common knowledge mechanism based on POW is not suitable for application in microgrid block chains.
Disclosure of Invention
The invention aims to provide an electric energy transaction method based on a credit consensus mechanism.
In order to solve the technical problems, the invention adopts the technical scheme that:
an electric energy transaction method based on a credit consensus mechanism comprises the following steps:
step 1: agreeing on an electric energy transaction protocol: the consumer and the prosumer are nodes in the microgrid electric energy transaction block chain, and the node attribute comprises a credit value; the consumer and the prosumer can carry out anonymous broadcast negotiation electric energy transaction protocol in a chain-down mode or by using a block chain system; the block chain adopts a linked list structure;
step 2: establishing an intelligent contract: generating an intelligent contract and storing the intelligent contract on a block chain, and simultaneously sending tokens corresponding to the total price of the electric quantity negotiated by the two parties to the intelligent contract by a consumer;
and step 3: and (3) contract fulfillment: when the electric energy transmission time agreed by both trading parties is reached, both trading parties carry out physical transmission of electric energy; after the electric energy output time is cut off, the intelligent contract calls the actual electricity consumption of both parties from the intelligent electric meters of both parties, the settlement of the transaction is completed, and corresponding tokens are paid to the buyers and the sellers;
and 4, step 4: updating the credit value: the block chain system adopts a PoCS consensus mechanism to update the credit value of the node according to the fulfillment condition of the intelligent contract.
Further, when the micro-grid can not meet the electric quantity required by the consumer, the electricity selling price is the electricity price of the power grid; when the electric energy of the micro-grid is surplus, the electricity selling price is the reserved electricity price.
Further, the step 4 comprises the following substeps:
step 4-1: generation of rights and interests representatives: intelligent electric meter generation node electric quantity right set of each consumer
Figure BDA0002627632250000021
Figure BDA0002627632250000022
Public key representing smart meter generating node i, eiRepresenting an electric quantity right interest certificate of a smart meter generation node i, wherein the electric quantity right interest refers to the total electric quantity of the node in the historical transaction of the micro-grid; n is the total number of the intelligent ammeter generation nodes, and i is more than or equal to 1 and less than or equal to n; the block chain sends a serial number to an intelligent electric meter generation node of each consumer; the number of the serial numbers received by the intelligent electric meter generating nodes of each consumer is in direct proportion to the power right of the consumers; the block chain generates random serial numbers through a pseudo-random number generator, and T random rights and interests representatives are selected;
step 4-2: generating a block head: each producer and consumer can generate a block head to participate in competition, and the format of the block head is
Figure BDA0002627632250000023
Figure BDA0002627632250000024
For the hash value of the previous block,
Figure BDA0002627632250000025
to generate the node address of the block header, KmIs a random number, and is a random number,
Figure BDA0002627632250000026
indexing the block; if the generated block head meets the requirement set by the block chain system, broadcasting the block head to the whole network;
step 4-3: consensus participants vote: the duration of step 4 is divided into more than 1 time slot; randomly selecting N consensus participants from the rights representative in each time slot, wherein N is less than or equal to T; when the consensus participant receives the block header, checking whether the block header is legal, if soWhen the block head is legal, the consensus participant signs the block head and checks the number of block head signatures; when the participant is the first 2N/3-1 signatories of the block header, the block header continues to receive the signature, and the signature information is recorded in the block for other nodes to check; other nodes check for discovery; the 2N/3 signer at the block head needs to pack all the transaction data in the time gap to generate a block body, and then writes the root Hash, the 2N/3 signatures and the time stamp of the transaction data into the block head to generate a Hash value of a new block, namely the Hash value of the next blockpre
If the signature in the block is illegal or the hash of the block head is incorrect, the block is considered to be illegal, and the signatures of all the consensus participants corresponding to the signature in the block are considered as malicious votes;
step 4-4: new block contention uplink:
the hash calculation formula is as follows:
Figure BDA0002627632250000031
in the formula: h (-) is a hash function of the hash function,
Figure BDA0002627632250000032
in order to pack the completed block,
Figure BDA0002627632250000033
for voting node addresses, TstampIs a time stamp, t is
Figure BDA0002627632250000034
Time elapsed after production, CallConsensus participant credit, N, for all votesdiffIs the system difficulty coefficient; if the calculation is successful, the new block is written into the block chain, and other new blocks are recycled;
the voting behavior of 2N/3 consensus participants corresponding to the signature in the uplink new block is determined as good voting;
and 4-5: and (3) consensus reward issuing: the block chain issues corresponding tokens to the consensus participants of the goodwill voting, and issues tokens to the prosperity and consummation generating the uplink new block;
and 4-6: and judging whether the time slot is the last time slot, if so, ending, otherwise, turning to the step 4-3.
Furthermore, in the microgrid electric energy transaction block chain, the attribute of the node comprises a credit value;
credit value of node i in nth time slot
Figure BDA0002627632250000035
Comprises the following steps:
Figure BDA0002627632250000036
in the formula:
Figure BDA0002627632250000037
representing the contract credit value of the node i in the time slot;
Figure BDA0002627632250000038
a consensus credit value for node i in this time slot;
the node i is a prosumer, and the credit value evaluation method of the contract credit value comprises the following steps:
Figure BDA0002627632250000041
in the formula:
Figure BDA0002627632250000042
and
Figure BDA0002627632250000043
the credit values of the current time and the last time of the parity I are respectively; qijAn amount of power specified for the smart contract;
Figure BDA0002627632250000044
actual power generation amount of the client i within a contract specified time;
the node j is a consumer, and the credit value evaluation method of the contract credit value comprises the following steps:
Figure BDA0002627632250000045
in the formula:
Figure BDA0002627632250000046
and
Figure BDA0002627632250000047
credit values of the current transaction and the last transaction of the consumer j are respectively;
Figure BDA0002627632250000048
actual electricity usage for consumer j within a contract specified time;
the evaluation method of the contract credit value of the node i comprises the following steps:
Figure BDA0002627632250000049
in the formula: n is the number of slots experienced in common so far; alpha is alphakVoting for the malice completed by the node i in the k time slot; beta is akVoting for the goodwill completed by the node i; λ is a penalty factor;
the initial value of the credit value of each node is 1, when the node does not have default in the preset times of transaction process, the credit value is added with 1, and the electricity-saving credit value is provided with an upper limit.
Still further, the credit value of the node needs to be corrected and then used in each time slot, and the corrected credit value of the node is:
Figure BDA00026276322500000410
in the formula:
Figure BDA00026276322500000411
for correcting the node i in the nth time slotA credit value of; gamma is a correction coefficient.
The technical effect obtained by adopting the technical scheme is as follows:
1. the invention uses the block chain and the intelligent contract technology to realize the anonymity of the transaction user and the public and transparent data;
2. the invention provides a micro-grid node credit value evaluation mechanism, which takes a credit value as a basic attribute of a node and is suitable for being applied to a micro-grid block chain;
3. the invention provides a consensus mechanism (PoCS) based on credit certification, which realizes that a credit value influences a consensus process and restricts node integrity and trust.
Drawings
The present invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
FIG. 1 is a flow chart of the present invention;
FIG. 2 is a graph of the relationship between the node right-to-gain ratio and the attack success probability in embodiment 1 of the present invention;
FIG. 3 is a graph showing the rate of increase of the total recognition credit value according to embodiment 1 of the present invention;
fig. 4 is a diagram illustrating a variation of the node consensus credit value in each scenario in embodiment 1 of the present invention;
FIG. 5 is a block successful uplink probability chart of different credit values according to embodiment 1 of the present invention.
Detailed Description
Example 1:
an electric energy transaction method based on a credit consensus mechanism comprises the following steps:
step 1: agreeing on an electric energy transaction protocol: the consumer and the prosumer are nodes in the microgrid electric energy transaction block chain, and the node attribute comprises a credit value; the consumer and the prosumer can carry out anonymous broadcast negotiation electric energy transaction protocol in a chain-down mode or by using a block chain system; the block chain adopts a linked list structure;
step 2: establishing an intelligent contract: generating an intelligent contract and storing the intelligent contract on a block chain, and simultaneously sending tokens corresponding to the total price of the electric quantity negotiated by the two parties to the intelligent contract by a consumer;
and step 3: and (3) contract fulfillment: when the electric energy transmission time agreed by both trading parties is reached, both trading parties carry out physical transmission of electric energy; after the electric energy output time is cut off, the intelligent contract calls the actual electricity consumption of both parties from the intelligent electric meters of both parties, the settlement of the transaction is completed, and corresponding tokens are paid to the buyers and the sellers;
and 4, step 4: updating the credit value: the block chain system adopts a PoCS consensus mechanism to update the credit value of the node according to the fulfillment condition of the intelligent contract.
Further, when the micro-grid can not meet the electric quantity required by the consumer, the electricity selling price is the electricity price of the power grid; when the electric energy of the micro-grid is surplus, the electricity selling price is the reserved electricity price.
Further, the step 4 comprises the following substeps:
step 4-1: generation of rights and interests representatives: intelligent electric meter generation node electric quantity right set of each consumer
Figure BDA0002627632250000051
Figure BDA0002627632250000052
Public key representing smart meter generating node i, eiRepresenting an electric quantity right interest certificate of a smart meter generation node i, wherein the electric quantity right interest refers to the total electric quantity of the node in the historical transaction of the micro-grid; n is the total number of the intelligent ammeter generation nodes, and i is more than or equal to 1 and less than or equal to n; the block chain sends a serial number to an intelligent electric meter generation node of each consumer; the number of the serial numbers received by the intelligent electric meter generating nodes of each consumer is in direct proportion to the power right of the consumers; the block chain generates random serial numbers through a pseudo-random number generator, and T random rights and interests representatives are selected;
step 4-2: generating a block head: each producer and consumer can generate a block head to participate in competition, and the format of the block head is
Figure BDA0002627632250000061
Figure BDA0002627632250000062
Hash value for previous block,
Figure BDA0002627632250000063
To generate the node address of the block header, KmIs a random number, and is a random number,
Figure BDA0002627632250000064
indexing the block; if the generated block head meets the requirement set by the block chain system, broadcasting the block head to the whole network; in this embodiment, the first 5 bits of the hash value in the generated block header are 0.
Step 4-3: consensus participants vote: the duration of step 4 is divided into more than 1 time slot; randomly selecting N consensus participants from the rights representative in each time slot, wherein N is less than or equal to T; when the consensus participant receives the block header and checks whether the block header is legal, if so, the consensus participant signs the block header and checks the signature number of the block header; when the participant is the first 2N/3-1 signatories of the block header, the block header continues to receive the signature, and the signature information is recorded in the block for other nodes to check; other nodes check for discovery; the 2N/3 signer at the block head needs to pack all the transaction data in the time gap to generate a block body, and then writes the root Hash, the 2N/3 signatures and the time stamp of the transaction data into the block head to generate a Hash value of a new block, namely the Hash value of the next blockpre
If the signature in the block is illegal or the hash of the block head is incorrect, the block is considered to be illegal, and the signatures of all the consensus participants corresponding to the signature in the block are considered as malicious votes;
step 4-4: new block contention uplink:
the hash calculation formula is as follows:
Figure BDA0002627632250000065
in the formula: h (-) is a hash function of the hash function,
Figure BDA0002627632250000066
in order to pack the completed block,
Figure BDA0002627632250000067
for voting node addresses, TstampIs a time stamp, t is
Figure BDA0002627632250000068
Time elapsed after production, CallConsensus participant credit, N, for all votesdiffIs the system difficulty coefficient; if the calculation is successful, the new block is written into the block chain, and other new blocks are recycled;
the voting behavior of 2N/3 consensus participants corresponding to the signature in the uplink new block is determined as good voting;
and 4-5: and (3) consensus reward issuing: the block chain issues corresponding tokens to the consensus participants of the goodwill voting, and issues tokens to the prosperity and consummation generating the uplink new block;
and 4-6: and judging whether the time slot is the last time slot, if so, ending, otherwise, turning to the step 4-3.
Furthermore, in the microgrid electric energy transaction block chain, the attribute of the node comprises a credit value;
credit value of node i in nth time slot
Figure BDA0002627632250000069
Comprises the following steps:
Figure BDA0002627632250000071
in the formula:
Figure BDA0002627632250000072
representing the contract credit value of the node i in the time slot;
Figure BDA0002627632250000073
a consensus credit value for node i in this time slot;
the node i is a prosumer, and the credit value evaluation method of the contract credit value comprises the following steps:
Figure BDA0002627632250000074
in the formula:
Figure BDA0002627632250000075
and
Figure BDA0002627632250000076
the credit values of the current time and the last time of the parity I are respectively; qijAn amount of power specified for the smart contract;
Figure BDA0002627632250000077
actual power generation amount of the client i within a contract specified time;
the node j is a consumer, and the credit value evaluation method of the contract credit value comprises the following steps:
Figure BDA0002627632250000078
in the formula:
Figure BDA0002627632250000079
and
Figure BDA00026276322500000710
credit values of the current transaction and the last transaction of the consumer j are respectively;
Figure BDA00026276322500000711
actual electricity usage for consumer j within a contract specified time;
the evaluation method of the contract credit value of the node i comprises the following steps:
Figure BDA00026276322500000712
in the formula: n is the number of slots experienced in common so far; alpha is alphakMalicious projection completed for node i in the k-th time slotA ticket; beta is akVoting for the goodwill completed by the node i; λ is a penalty factor;
the initial value of the credit value of each node is 1, when the node does not have default in the preset times of transaction process, the credit value is added with 1, and the electricity-saving credit value is provided with an upper limit.
Still further, the credit value of the node needs to be corrected and then used in each time slot, and the corrected credit value of the node is:
Figure BDA00026276322500000713
in the formula:
Figure BDA00026276322500000714
the credit value of the corrected node i in the nth time slot is obtained; gamma is a correction coefficient.
In this embodiment, when a node is honest and confident in the last 10 transactions, and no default occurs, the blockchain system adds 1 to the contract credit value of the node in the form of an award. The honesty and faith of both parties in the internal transaction of the microgrid are encouraged in a positive mode, and the maximum contract credit value is 100.
The consumer and the producer and the consumer can freely trade in the block chain of the microgrid, the producer and the consumer predict that the electric energy can be produced in the next time slot and broadcast to the block chain network, and after receiving the electric energy information sent by the producer and the consumer, the consumer can negotiate with the producer and the consumer in an online or offline mode according to the electric energy requirement of the consumer, and the on-chain electric energy trading is completed.
The microgrid electric energy transaction flow based on the block chain is divided into the following 3 stages.
1) The consumer and the producer and consumer can complete the agreement of the transaction details through various communication modes, and the specific contents of the agreement include contract electricity price, contract electricity quantity, power supply time and responsibility division. The two parties of the transaction can negotiate in a mode under the chain, and can also use the block chain system to carry out anonymous broadcasting, and the block chain system completes electric quantity matching. When the block chain coordination is used, two transaction parties can realize anonymous communication without worrying about privacy disclosure, and the transaction efficiency is ensured.
2) After the consumer and the producer agree the transaction details, the two parties of the transaction generate intelligent contracts of the agreed transaction contents and store the intelligent contracts on the block chain, and meanwhile, corresponding commission fees are paid to the transaction. The consumer needs to send the token corresponding to the total price of the electric quantity negotiated by the two parties to the intelligent contract for the intelligent contract to complete the settlement of the transaction.
3) And when the electric energy transmission time agreed by the two trading parties is reached after the intelligent contract is generated, the two trading parties carry out physical transmission of the electric energy. And after the electric energy output time is cut off, the intelligent contract calls the actual electricity consumption of the two parties from the intelligent electric meters of the two parties. The intelligent contract completes settlement of the transaction according to contract regulation conditions and actual electricity generation and utilization conditions and pays a network fee to the power grid enterprise. The block chain system needs to update the credit values of both parties according to the fulfillment condition of the intelligent contract by both parties of the transaction, and the specific updating rule is described below.
The block chain technology ensures that the transaction is public and transparent in the transaction process and also ensures privacy of both transaction parties, and once the transaction data is stored in the uplink, the transaction data cannot be tampered. The intelligent contract completes the settlement of decentralized transactions, and the intelligent contract is a code block, the execution of which is not influenced by external factors, and the execution of transaction details and the settlement of transactions can be completed. The grid enterprise is responsible for the transmission of physical electrical energy, and therefore, when trading inside the microgrid, the grid enterprise will charge a portion of the fee. When the inside of the microgrid cannot meet the electric quantity required by consumers, the power grid enterprise sells electricity for the consumers, and the electricity selling price is the power grid electricity price. When the production of the producer and the consumer inside the micro-grid is excessive, the power grid enterprise purchases electricity for the producer and the consumer, and the electricity purchasing price is the reserved electricity price.
In the conventional power-based PoW consensus mechanism, a large amount of power is consumed for generating one block, namely, a large amount of power is consumed, which is obviously contrary to the original intention of designing a microgrid power trading block chain. In a PoS (Point-to-Point) consensus mechanism based on equity certification, the probability of obtaining the accounting right by a node is in direct proportion to the equity occupied by the node, and the higher the equity, the more easily the node obtains the accounting reward, so that the low-equity node is not high in enthusiasm and is not beneficial to currency liquidity. However, the advantage that the node with high interest in the PoS consensus mechanism is more willing to maintain the system is consistent with the condition that the user with a large actual electric quantity transaction value in the microgrid is more willing to maintain the system, and the actual electric quantity transaction value of the power grid can be used as a node type interest certificate. In order to guarantee consensus efficiency, honesty and faith of both parties of a transaction are influenced by economic factors, a PoCS is provided, and a consensus process is influenced by credit values of nodes, so that the nodes with higher credit values can obtain account rewards more easily.
In order to correctly evaluate the effectiveness of the designed microgrid electric energy transaction block link point contract credit mechanism, the microgrid electric energy transaction is simulated by taking an ether house as an intelligent contract issuing platform. The micro-grid comprises a consumer, a producer and a consumer and a grid enterprise, and corresponding simulation is carried out according to the possible 6 transaction special conditions. The trading electricity price and the electric quantity inside the microgrid are mutually negotiated by two trading parties and written into an intelligent contract. And updating the credit values of both transaction parties by the block chain system according to the completion condition of the intelligent contract. The real-time power price of the power grid is assumed to be 0.7 yuan/(kW & h), and the power price of the producers and the consumers on the internet is assumed to be 0.5 yuan/(kW & h). The simulation results are shown in table 1.
In the simulation scene 1, both the producer and the consumer generate electricity according to the intelligent contract rules, both parties have no default condition, and contract credit values of both trading parties are unchanged. In the simulation scene 2, the contractual conditions of the consumers occur, the actual power generation amount does not reach the power generation amount specified by the intelligent contract, the residual power amount required by the consumers needs to be purchased at the power grid electricity price exceeding the contract electricity price, and the contract credit value of the consumers is reduced. In the simulation scene 3, the actual power consumption of the consumer exceeds the contract power, the excess part of the power is purchased to the power grid enterprise at the power grid price, the actual power generation amount of the producer and the consumer reaches the contract power, both trading parties have no economic loss, and the contract credit values of both parties are not influenced. In the simulation scene 4, the actual power consumption of the consumer is lower than the contract-specified power consumption, the actual power generation amount of the producer and the consumer reaches the contract-specified power consumption, the power unused by the consumer is purchased by a power grid enterprise at the power-on price, and the contract credit value of the consumer is reduced. In the simulation scenario 5, the actual electricity consumption of the consumer and the actual electricity consumption of the producer and the consumer do not reach the contract specified electricity quantity, and the contract credit values of the two parties are reduced. In the simulation scene 6, the actual electricity consumption of the consumer and the actual electricity consumption of the producer and the consumer exceed the contract specified electricity, and the contract credit values of the two parties are not influenced.
The 6 simulation scenes are the same as theoretical results, which shows that the designed evaluation mechanism of the credit values of the chain nodes of the power block of the microgrid based on the contract can effectively operate, and the designed intelligent contract can complete decentralized transactions and contract credit value updating.
In the credit-based consensus algorithm, the rising trend of the node credit value is nonlinear, and the rising trend of the credit value becomes slow and gradually tends to 0 along with the increase of the credit value, so that the upper limit of the node credit value is limited in the mechanism. The situation that the credit value of a single node is too large and the whole block chain network is threatened does not occur. When the malicious node wants to attack the blockchain system only by the power rights of the malicious node, the consensus participants above 2/3 need to be controlled to sign the generated blocks, and the 2/3 th consensus node is controlled to package the false transaction data to complete the consensus process.
A microgrid block chain network comprising 6 consensus participants is arranged on an MATLAB platform, the hash function uses an SHA-256 function, the computer configuration of consensus participant nodes inside the microgrid is assumed to be consistent, and the electric energy configuration is Intel I7-4702MQ CPU 2.20GHz and 8GB memory. The method simulates the rights and interests attack scene of the malicious node and analyzes the relationship between the rights and interests ratio of the node and the attack success probability, as shown in fig. 2.
Simulation results show that the probability of successful attack of the malicious nodes becomes larger along with the increase of the rights and interests occupied by the malicious nodes, and when the rights and interests occupied by the nodes are below 20%, the attack success probability can be almost ignored. When the node rights and interests are about 50%, the attack success probability is about 25%, and at the moment, the attack success probability enables attackers to be irrevocable. In a microgrid block chain, it is very difficult that the probability that the right of interest of a node is more than 50%. As can be seen from fig. 2, the designed microgrid block chain can effectively resist cumulative equity attacks.
In order to verify the node credit evaluation mechanism and check the influence of long-time goodwill voting on the node consensus credit value, a microgrid network comprising 15 nodes, wherein 7 consensus participants are provided, and the power rights and interests of each node are assumed to be the same. The total recognition credit values of the consensus participant nodes in the network after each consensus are counted when γ is 0.2 and 0.35, respectively, as shown in fig. 3.
The overall recognition credit value increase speed is related to the value of gamma, and the credit value increase speed is faster when the value of gamma is larger. After multiple times of consensus, the total consensus credit value increases at a speed approaching zero, and the value does not increase any more, so that the credit-based consensus mechanism can reasonably control the node credit value to increase, and the situation that a single node is too high and threatens the network security can not occur.
In order to more intuitively see the rising and falling conditions of the consensus credit value after the nodes carry out goodwill voting and malicious voting, 2 scenes are set: in a scene 1, nodes continuously vote for goodwill; in scenario 2, a well-credited consensus participant continuously maliciously votes. The change of the node consensus credit value in each scene is recorded, as shown in fig. 4. The proposed node contract credit evaluation mechanism can effectively complete the evaluation of the node contract credit, and the node contract credit can slowly increase when the node carries out goodwill voting. When the node conducts malicious voting, the contract credit value of the node is rapidly reduced.
To verify that the credit-based consensus mechanism can achieve that credit affects economic factors, simulations have tested the relationship between credit and block probability of successful uplink. Suppose that 15 blocks are generated in each consensus, wherein the credit values assigned to the blocks are 86-100 points. The probability of successful uplink of blocks with different credit values in 150 consensus processes in the microcomputer power transaction block chain was experimentally tested, as shown in fig. 5.
As shown in fig. 4, under the PoCS consensus scheme, the probability of successful uplink of a block increases with the increase of the credit, the probability of successful uplink of a block is non-linear with the credit, and the probability of successful uplink of a block decreases rapidly with the decrease of the credit. When the block credit is below 89 minutes, the block uplink probability is almost zero.
Simulation analysis shows that in a microgrid electric energy transaction block chain, a credit-based consensus mechanism can realize that the uplink probability of the block is influenced by credit values, and the node can obtain corresponding accounting rewards only if the block voted by the node is successfully uplink. The node can obey the rules for obtaining more accounting rewards, thereby realizing honesty and truthful trust of both sides of the transaction and having safe and reliable consensus process.
The simulation result proves that: firstly, the microgrid electric energy trading contract can be smoothly executed; a credit value evaluation mechanism can realize that the credit value of the benevolent node is increased smoothly, and the malicious node is punished by the credit value; the common identification mechanism can realize that the block chaining probability is influenced by the credit value, and blocks with higher credit values are easier to chain; and fourthly, the consensus mechanism can effectively resist the cumulative rights and interests attack.
TABLE 1
Figure BDA0002627632250000111

Claims (5)

1. An electric energy transaction method based on a credit consensus mechanism is characterized in that: the method comprises the following steps:
step 1: agreeing on an electric energy transaction protocol: the consumer and the prosumer are nodes in the microgrid electric energy transaction block chain, and the node attribute comprises a credit value; the consumer and the prosumer can carry out anonymous broadcast negotiation electric energy transaction protocol in a chain-down mode or by using a block chain system; the block chain adopts a linked list structure;
step 2: establishing an intelligent contract: generating an intelligent contract and storing the intelligent contract on a block chain, and simultaneously sending tokens corresponding to the total price of the electric quantity negotiated by the two parties to the intelligent contract by a consumer;
and step 3: and (3) contract fulfillment: when the electric energy transmission time agreed by both trading parties is reached, both trading parties carry out physical transmission of electric energy; after the electric energy output time is cut off, the intelligent contract calls the actual electricity consumption of both parties from the intelligent electric meters of both parties, the settlement of the transaction is completed, and corresponding tokens are paid to the buyers and the sellers;
and 4, step 4: updating the credit value: the block chain system adopts a PoCS consensus mechanism to update the credit value of the node according to the fulfillment condition of the intelligent contract.
2. The electric energy transaction method based on the credit consensus mechanism as claimed in claim 1, wherein:
when the micro-grid can not meet the electric quantity required by the consumer, the electricity selling price is the electricity price of the power grid; when the electric energy of the micro-grid is surplus, the electricity selling price is the reserved electricity price.
3. The electric energy transaction method based on the credit consensus mechanism as claimed in claim 1, wherein: the step 4 comprises the following substeps:
step 4-1: generation of rights and interests representatives: intelligent electric meter generation node electric quantity right set of each consumer
Figure FDA0002627632240000011
Figure FDA0002627632240000012
Public key representing smart meter generating node i, eiRepresenting an electric quantity interest certificate of a smart meter generation node i, wherein the electric quantity interest refers to the total electric quantity of the node in the historical transaction of the micro-grid; n is the total number of the intelligent ammeter generation nodes, and i is more than or equal to 1 and less than or equal to n; the block chain sends a serial number to an intelligent electric meter generation node of each consumer; the number of the serial numbers received by the intelligent electric meter generating nodes of each consumer is in direct proportion to the electric quantity right of the consumers; the block chain generates random serial numbers through a pseudo-random number generator, and T random rights and interests representatives are selected;
step 4-2: generating a block head: each producer and consumer can generate a block head to participate in competition, and the format of the block head is
Figure FDA0002627632240000013
Figure FDA0002627632240000014
For the hash value of the previous block,
Figure FDA0002627632240000015
to generate the node address of the block header, KmIs a random number, and is a random number,
Figure FDA0002627632240000016
indexing the block; if the generated block head meets the setting requirement of the block chain, the block head is broadcasted to the whole network;
step 4-3: consensus participants vote: the duration of step 4 is divided into more than 1 time slot; randomly selecting N consensus participants from the rights representative in each time slot, wherein N is less than or equal to T; when the consensus participant receives the block header and checks whether the block header is legal, if so, the consensus participant signs the block header and checks the signature number of the block header; when the participant is the first 2N/3-1 signers of the block header, the block header continues to receive the signature, and the signature information is recorded in the block for other nodes to check; other nodes check for discovery; the 2N/3 signer at the block head needs to pack all the transaction data in the time gap to generate a block body, and then writes the root Hash, the 2N/3 signatures and the time stamp of the transaction data into the block head to generate a Hash value of a new block, namely the Hash value of the next blockpre
If the signature in the block is illegal or the hash of the block head is incorrect, the block is considered to be illegal, and the signatures of all the commonly-identified participants corresponding to the signature in the block are considered as malicious votes;
step 4-4: new block contention uplink:
the hash calculation formula is as follows:
Figure FDA0002627632240000021
in the formula: h (-) is a hash function of the hash function,
Figure FDA0002627632240000022
in order to pack the completed block,
Figure FDA0002627632240000023
for voting node addresses, TstampIs a time stamp, t is
Figure FDA0002627632240000024
Time elapsed after production, CallConsensus participant credit, N, for all votesdiffIs the system difficulty coefficient; if the Hash calculation formula is established, the new block is written into the block chain, and other new blocks are recycled;
the voting behavior of 2N/3 consensus participants corresponding to the signature in the uplink new block is determined as good-minded voting;
and 4-5: and (3) consensus reward issuing: the block chain issues corresponding tokens to the consensus participants of the goodwill voting, and issues tokens to the prosperity and consummation generating the uplink new block;
and 4-6: and judging whether the time slot is the last time slot, if so, ending, otherwise, turning to the step 4-3.
4. The electric energy transaction method based on the credit consensus mechanism as claimed in claim 3, wherein: in a microgrid electric energy transaction block chain, the attribute of a node comprises a credit value;
credit value of node i in nth time slot
Figure FDA0002627632240000025
Comprises the following steps:
Figure FDA0002627632240000026
in the formula:
Figure FDA0002627632240000027
representing the contract credit value of the node i in the time slot;
Figure FDA0002627632240000028
a consensus credit value for node i in this time slot;
the node i is a prosumer, and the credit value evaluation method of the contract credit value comprises the following steps:
Figure FDA0002627632240000031
in the formula:
Figure FDA0002627632240000032
and
Figure FDA0002627632240000033
the credit values of the current time and the last time of the parity I are respectively; qijAn amount of power specified for the intelligent contract;
Figure FDA0002627632240000034
actual power generation amount of the client i within a contract specified time;
the node j is a consumer, and the credit value evaluation method of the contract credit value comprises the following steps:
Figure FDA0002627632240000035
in the formula:
Figure FDA0002627632240000036
and
Figure FDA0002627632240000037
credit values of the current transaction and the last transaction of the consumer j are respectively;
Figure FDA0002627632240000038
actual power usage for consumer j within the contract specified time;
the evaluation method of the contract credit value of the node i comprises the following steps:
Figure FDA0002627632240000039
in the formula: n is the number of slots experienced in common so far; alpha is alphakCarrying out malicious voting on the node i in the kth time slot; beta is akVoting for the goodwill completed by the node i; λ is a penalty factor;
the initial value of the credit value of each node is 1, when the node has no default condition in the preset times of transaction process, the credit value is added with 1, and the electricity-saving credit value is provided with an upper limit.
5. The electric energy transaction method based on the credit consensus mechanism as claimed in claim 4, wherein:
the credit value of the node is used in each time slot after being corrected, and the corrected credit value of the node is as follows:
Figure FDA00026276322400000310
in the formula:
Figure FDA00026276322400000311
the credit value of the corrected node i in the nth time slot is obtained; gamma is a correction coefficient.
CN202010801709.7A 2020-08-11 2020-08-11 Electric energy transaction method based on credit consensus mechanism Pending CN111932253A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010801709.7A CN111932253A (en) 2020-08-11 2020-08-11 Electric energy transaction method based on credit consensus mechanism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010801709.7A CN111932253A (en) 2020-08-11 2020-08-11 Electric energy transaction method based on credit consensus mechanism

Publications (1)

Publication Number Publication Date
CN111932253A true CN111932253A (en) 2020-11-13

Family

ID=73310516

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010801709.7A Pending CN111932253A (en) 2020-08-11 2020-08-11 Electric energy transaction method based on credit consensus mechanism

Country Status (1)

Country Link
CN (1) CN111932253A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112288336A (en) * 2020-12-14 2021-01-29 支付宝(杭州)信息技术有限公司 Enterprise management method and device based on block chain
CN113222690A (en) * 2021-04-27 2021-08-06 铭数科技(青岛)有限公司 Block chain consensus method applied to regional energy Internet
CN113256394A (en) * 2021-06-22 2021-08-13 北京航空航天大学 Supply chain resource management system based on intelligent contract
CN113626876A (en) * 2021-07-22 2021-11-09 三峡大学 Consensus method based on power grid block chain
CN113971611A (en) * 2021-12-23 2022-01-25 华中科技大学 Medium-and-long-term electric power transaction method and system based on intelligent contract
CN114066530A (en) * 2021-11-26 2022-02-18 华北电力大学 Block chain-based distributed transaction method capable of predicting electric energy among micro grids
CN114663091A (en) * 2022-03-25 2022-06-24 上海电力大学 Power transaction method based on multi-chain block chain architecture
CN116934344A (en) * 2023-09-18 2023-10-24 广东工业大学 Micro-grid transaction method and system based on blockchain

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111080289A (en) * 2019-10-25 2020-04-28 武汉瑞盈通网络技术有限公司 Improved block chain consensus mechanism based on PoW and PoS

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111080289A (en) * 2019-10-25 2020-04-28 武汉瑞盈通网络技术有限公司 Improved block chain consensus mechanism based on PoW and PoS

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
秦金磊 等: ""适用于微电网区块链的信用共识机制"", 《电力系统自动化》, vol. 44, no. 15, pages 10 - 18 *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112288336A (en) * 2020-12-14 2021-01-29 支付宝(杭州)信息技术有限公司 Enterprise management method and device based on block chain
CN113222690A (en) * 2021-04-27 2021-08-06 铭数科技(青岛)有限公司 Block chain consensus method applied to regional energy Internet
CN113256394A (en) * 2021-06-22 2021-08-13 北京航空航天大学 Supply chain resource management system based on intelligent contract
CN113256394B (en) * 2021-06-22 2021-09-28 北京航空航天大学 Supply chain resource management system based on intelligent contract
CN113626876A (en) * 2021-07-22 2021-11-09 三峡大学 Consensus method based on power grid block chain
CN113626876B (en) * 2021-07-22 2023-12-19 三峡大学 Consensus method based on power grid block chain
CN114066530A (en) * 2021-11-26 2022-02-18 华北电力大学 Block chain-based distributed transaction method capable of predicting electric energy among micro grids
CN113971611A (en) * 2021-12-23 2022-01-25 华中科技大学 Medium-and-long-term electric power transaction method and system based on intelligent contract
CN114663091A (en) * 2022-03-25 2022-06-24 上海电力大学 Power transaction method based on multi-chain block chain architecture
CN116934344A (en) * 2023-09-18 2023-10-24 广东工业大学 Micro-grid transaction method and system based on blockchain
CN116934344B (en) * 2023-09-18 2024-01-05 广东工业大学 Micro-grid transaction method and system based on blockchain

Similar Documents

Publication Publication Date Title
CN111932253A (en) Electric energy transaction method based on credit consensus mechanism
Kirli et al. Smart contracts in energy systems: A systematic review of fundamental approaches and implementations
Liu et al. Electric vehicle power trading mechanism based on blockchain and smart contract in V2G network
Wu et al. CReam: A smart contract enabled collusion-resistant e-auction
US20220156856A1 (en) Energy resource network
Cheng et al. Research on application model of blockchain technology in distributed electricity market
He et al. Joint operation mechanism of distributed photovoltaic power generation market and carbon market based on cross-chain trading technology
CN109409890B (en) Electric power transaction system and method based on block chain
CN109241778A (en) A kind of public transport data processing method and device based on block chain
CN110717832B (en) Clean energy trading method, system, device and storage medium based on block chain
CN110826940A (en) Distributed power transaction method under extensible multi-microgrid environment
Saxena et al. Blockchain based transactive energy systems for voltage regulation in active distribution networks
Afzal et al. Role of blockchain technology in transactive energy market: A review
CN112613861B (en) Electric power pre-selling transaction method, device and system based on alliance chain
CN110855432A (en) Asynchronous BFT & DPOS consensus mechanism for assigning verifier rewards based on verifiable random functions
He et al. A consensus and incentive program for charging piles based on consortium blockchain
Yahaya et al. Blockchain-based secure energy trading with mutual verifiable fairness in a smart community
KR20200094441A (en) Method and apparatus for trading power
CN114358969A (en) Green power confirmation method, green power confirmation equipment and computer readable storage medium
CN113626876B (en) Consensus method based on power grid block chain
Yan et al. Blockchain‐based framework of power demand response in China
Liu et al. Blockchain-enabled renewable energy certificate trading: A secure and privacy-preserving approach
Barbhaya et al. Etradechain: blockchain-based energy trading in local energy market (lem) using modified double auction protocol
Zhang et al. A privacy protection scheme for bidding users of peer-to-peer electricity call auction trading in microgrids
CN113689295A (en) Distributed energy trading method and system among multiple participating main bodies

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