CN111932293A - Resource safety transaction method based on block chain - Google Patents
Resource safety transaction method based on block chain Download PDFInfo
- Publication number
- CN111932293A CN111932293A CN202010678496.3A CN202010678496A CN111932293A CN 111932293 A CN111932293 A CN 111932293A CN 202010678496 A CN202010678496 A CN 202010678496A CN 111932293 A CN111932293 A CN 111932293A
- Authority
- CN
- China
- Prior art keywords
- block
- node
- seller
- buyer
- bandwidth
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 45
- 230000008569 process Effects 0.000 claims abstract description 17
- 230000008901 benefit Effects 0.000 claims abstract description 11
- 238000012856 packing Methods 0.000 claims abstract description 7
- 230000009471 action Effects 0.000 claims description 24
- 230000006870 function Effects 0.000 claims description 15
- 230000005611 electricity Effects 0.000 claims description 10
- 238000012795 verification Methods 0.000 claims description 8
- 230000005540 biological transmission Effects 0.000 claims description 5
- 230000002787 reinforcement Effects 0.000 claims description 4
- 230000006399 behavior Effects 0.000 claims description 3
- 238000004519 manufacturing process Methods 0.000 claims description 3
- 238000004806 packaging method and process Methods 0.000 claims description 3
- 238000012163 sequencing technique Methods 0.000 claims description 3
- 239000000126 substance Substances 0.000 claims description 3
- 230000007246 mechanism Effects 0.000 abstract description 9
- 238000001228 spectrum Methods 0.000 description 6
- 238000004364 calculation method Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 3
- 238000009826 distribution Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000003860 storage Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000002146 bilateral effect Effects 0.000 description 1
- 239000003795 chemical substances by application Substances 0.000 description 1
- 230000008094 contradictory effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000010248 power generation Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000010187 selection method Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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
- G06Q30/00—Commerce
- G06Q30/02—Marketing; Price estimation or determination; Fundraising
- G06Q30/0201—Market modelling; Market analysis; Collecting market data
- G06Q30/0206—Price or cost determination based on market factors
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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
- G06Q30/00—Commerce
- G06Q30/06—Buying, selling or leasing transactions
- G06Q30/0601—Electronic shopping [e-shopping]
- G06Q30/0611—Request for offers or quotes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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
- G06Q30/00—Commerce
- G06Q30/06—Buying, selling or leasing transactions
- G06Q30/08—Auctions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
- G06Q50/06—Energy or water supply
Landscapes
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Engineering & Computer Science (AREA)
- Strategic Management (AREA)
- Development Economics (AREA)
- Economics (AREA)
- Marketing (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Entrepreneurship & Innovation (AREA)
- Health & Medical Sciences (AREA)
- Data Mining & Analysis (AREA)
- Technology Law (AREA)
- Game Theory and Decision Science (AREA)
- Public Health (AREA)
- Water Supply & Treatment (AREA)
- General Health & Medical Sciences (AREA)
- Human Resources & Organizations (AREA)
- Primary Health Care (AREA)
- Tourism & Hospitality (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention provides a resource safety transaction method based on a block chain, which comprises the following steps: s1: the buyer node submits a bid to the auctioneer server according to the demand quantity of the buyer node, and the seller node submits the bid to the auctioneer server according to the supply quantity of the seller node; s2: the auctioneer server calculates the transaction amount according to the bids of the buyer and the seller; s3: the auctioneer server carries out iterative matching according to the bids of the buyer and the seller to obtain a trading scheme with maximized benefits of the buyer and the seller and complete the trading according to the trading scheme; s4: and packing the transaction records into a new block and connecting the new block to a block chain. The invention provides a resource safe transaction method based on a block chain, which reasonably protects the privacy of both buyers and sellers by using an iterative double-clap selling mechanism and maximizes the benefit of both parties; meanwhile, the block chain is used as a trading environment to store trading information, and the problem that the centralized information leakage risk exists in the energy trading process of the existing microgrid bearing information flow is solved.
Description
Technical Field
The invention relates to the technical field of power resource and communication spectrum resource transaction, in particular to a resource security transaction method based on a block chain.
Background
In the past decades, large power grids have rapidly developed by virtue of their unique advantages, becoming the main power supply channel. With the increasing expansion of the power grid scale, the drawbacks of the centralized single power supply system mainly characterized by large units, large power grid and high voltage are gradually revealed, including high cost and great operation difficulty, which are difficult to meet the higher and higher safety and reliability requirements of users and diversified power supply requirements.
At the end of the 20 th century, scholars proposed the concept of a microgrid. The micro-grid has the advantages of low investment cost, flexible power generation mode, low grid loss, low pollution and the like, and can well solve the power supply problem of remote areas and autonomous areas. With the development of the micro-grid technology, the micro-grid will be widely applied, and the demand of users on the micro-grid cannot be met only by trading power resources. Residential users not only need power resources from the microgrid, but also need communication spectrum resources to complete the transmission of power consumption information in the microgrid. Thus, the local aggregator provides communication spectrum resources-bandwidth in addition to power resources. But at present, a microgrid carrying information flow has a centralized information leakage risk in the process of carrying out energy transaction.
In the prior art, most auction schemes have a risk of centralized information leakage in the transaction process, for example, an optimal relay selection method based on a two-way auction model, with a notice number of CN103220757B, selects an optimal energy efficiency matching combination by using the two-way auction model and a maximum weight matching algorithm, but the transaction process has a risk of centralized information leakage.
Disclosure of Invention
The invention provides a resource safety transaction method based on a block chain, aiming at overcoming the technical defect that the centralized information leakage risk exists in the energy transaction process of the existing micro-grid carrying information flow.
In order to solve the technical problems, the technical scheme of the invention is as follows:
a resource secure transaction method based on a block chain comprises the following steps:
s1: the buyer node submits a bid to the auctioneer server according to the demand quantity of the buyer node, and the seller node submits the bid to the auctioneer server according to the supply quantity of the seller node;
s2: the auctioneer server calculates the transaction amount according to the bids of the buyer and the seller;
s3: the auctioneer server carries out iterative matching according to the bids of the buyer and the seller to obtain a trading scheme with maximized benefits of the buyer and the seller and complete the trading according to the trading scheme;
s4: and packing the transaction records into a new block and connecting the new block to a block chain.
Preferably, the buyer node is a residential user, the seller node is a local aggregator, and the auctioneer server is a transaction server in the local aggregator.
Preferably, the demand amount of the buyer node includes the power demand b of the buyer nodeijSum bandwidth requirement dijThe supply amount of the seller node includes the power supply s supplied by the seller nodejiSum bandwidth tji。
Preferably, in step S1, the method specifically includes:
s1.1: the buyer node according to the own power demand bijSum bandwidth requirement dijAccording to the electricity payment function of the buyer nodeSum bandwidth payment functionTo solve the optimal bidding problem EB:
thereby obtaining a bid for buyer BRiAnd submitting to the auctioneer server;
wherein I belongs to X, X ∈ {1, 2., I }, J belongs to Z, Z ∈ {1, 2., J }, m ∈ X, X ∈ {1, 2., J }, m ∈ijPrice bid for buyer nodes on electricity, Mi∈{mijI j belongs to Z and is a bidding price vector of the buyer node to the electric power; y isijPrice bid for seller nodes on bandwidth, Yi∈{yij| j ∈ Z } is a bid price vector of the seller node for the bandwidth;a satisfaction function of purchasing power for the buyer node,in the form of a power demand vector for the buyer node, wiIs a constant, eta is the power transmission efficiency,purchasing a minimum value of power for the buyer node;as a function of the satisfaction of the buyer node with respect to purchasing bandwidth,is in the form of a bandwidth demand vector, θ, for the buyer nodeiIs a constant number of times, and is,purchasing a minimum value of bandwidth for the buyer node;
s1.2: seller node according to seller's electric power profit functionSum bandwidth revenue functionTo solve the optimal bidding problem ES:
thereby obtaining a seller bid SRjAnd submitting to the auctioneer server;
wherein l1And l2Is a cost factor of electric power, and1>0,njiprice of the seller node's bid for the electricity transaction, Nj∈{njiI belongs to X and is a bidding price vector of the seller node for the electric power transaction; l3And l4Is a cost factor of bandwidth, and3>0,zjibid price for seller nodes for bandwidth transactions, Zj∈{zjiI belongs to X and is a bid price vector of the seller node for the bandwidth transaction; sjiSupply of electric power to seller nodes, Sj∈{sjiI e X is the vector that the seller node supplies power,a power cost function for the seller node; t is tjiBandwidth, T, supplied to seller nodesj∈{tjiI e X is a vector of the seller node supply bandwidth,is a bandwidth cost function of the seller node.
Preferably, in step S2, specifically, the method includes: the auctioneer server solves the optimal allocation problem A according to the bids of the buyer and the seller:
S.t.
thereby calculating the transaction amount; the transaction amount comprises transaction electric quantity and transaction bandwidth;
wherein the content of the first and second substances,the maximum amount of power to be purchased for the buyer node,the maximum amount of bandwidth purchased by the buyer node,the maximum vector of power supplied to the seller node,the maximum vector of bandwidth is supplied to the seller node.
Preferably, in step S3, the condition for ending the iterative matching includes:
wherein, it is a very small constant used for determining the convergence of the algorithm.
Preferably, in step S4, the method specifically includes the following steps:
s4.1: each node estimates the voting action and the non-voting action according to the successful record of the block production of the block producer candidate and the computing power;
s4.2: substituting the estimation value into an updating formula of Q-learning in the deep reinforcement learning:
Q'(s,a)=Q(s,a)+α(r+γmaxQ'(s,a)-Q(s,a))
obtaining a new value of Q' (s, a);
where a is the action selected in the update process, i.e. voting or not. S is the current state, alpha is the learning efficiency, r is the obtained reward, gamma is the discount factor, maxQ' (S, a) is the maximum value selected in the action to be performed; r + gamma maxQ' (s, a) is the reward obtained by multiplying the maximum value by the discount factor and adding the discount factor, namely the real Q value; q (s, a) is a Q' (s, a) value estimated from historical block success rate and computational power; updating once by updating a new Q' (s, a) value and then executing the action of voting or not voting as entering the next state after the completion;
s4.3: each node judges whether to execute voting or not according to the Q' (s, a) value;
s4.4: counting the action of voting and non-voting of each node to obtain the vote rate of each block of producer candidates;
if the ticket obtaining rate of the block producer candidate exceeds 50%, the block producer candidate enters a candidate pool;
if the vote rate of the block producer candidate does not exceed 50%, the block producer candidate waits for a next round of re-voting;
s4.5: according to the number of tickets, 21 producers are selected out from the candidate pool from big to small in sequence;
if the number of the block producers reaches 21, randomly sequencing the selected 21 block producers;
if the number of the block producers does not reach 21, returning to the step S4.1 to continue voting until 21 block producers are elected;
s4.6: packing the transaction records into a new block by one block producer and then sending the new block to other block producers for verification;
if the verification of at least 15 block producers is passed, connecting the new block to a block chain, wherein the block producer successfully obtains the corresponding reward when taking out the block, and taking turns to the next block producer to be responsible for packaging the new transaction record into the new block;
if the block producer confirms less than 15, the block producer fails to produce the block, and the block producer is rejected and re-enters the candidate pool, and the step S4.1 is executed again.
Preferably, in step S4.1, any seller node holding a token is a block producer candidate, and each buyer node and seller node has voting rights.
Preferably, in step S4.6, when a block producer exhibits malicious activity, the block producer will be reported by other nodes and receive a penalty, and then a block producer is selected from the candidate pool to replace the block producer.
Preferably, in step S4.6, when the number of times the block producers take turns exceeds a preset threshold, the process returns to step S4.1 and votes for the block producers again.
Compared with the prior art, the technical scheme of the invention has the beneficial effects that:
the invention provides a resource safe transaction method based on a block chain, which reasonably protects the privacy of buyers and sellers by utilizing an iterative double-auction mechanism, and the buyers and sellers can deduce the requirements of users by only giving out their own bids, thereby effectively avoiding the leakage of the user demand and other privacy; the auction maximizes the benefits of both parties by using an iterative method, meets the benefits of both parties, improves the auction efficiency and promotes the both parties to participate in the auction; meanwhile, the traditional third-party credit company is removed as an auctioneer, the blockchain is used as a transaction environment to store transaction information, the auction cost is reduced, decentralization is realized, the transaction records cannot be tampered, and the auction is safer.
Drawings
FIG. 1 is a flow chart of the steps for implementing the technical solution of the present invention;
fig. 2 is a flowchart illustrating an implementation step of step S4 according to the present invention.
Detailed Description
The drawings are for illustrative purposes only and are not to be construed as limiting the patent;
for the purpose of better illustrating the embodiments, certain features of the drawings may be omitted, enlarged or reduced, and do not represent the size of an actual product;
it will be understood by those skilled in the art that certain well-known structures in the drawings and descriptions thereof may be omitted.
The technical solution of the present invention is further described below with reference to the accompanying drawings and examples.
Example 1
As shown in fig. 1, a resource secure transaction method based on a block chain includes the following steps:
s1: the buyer node submits a bid to the auctioneer server according to the demand quantity of the buyer node, and the seller node submits the bid to the auctioneer server according to the supply quantity of the seller node;
s2: the auctioneer server calculates the transaction amount according to the bids of the buyer and the seller;
s3: the auctioneer server carries out iterative matching according to the bids of the buyer and the seller to obtain a trading scheme with maximized benefits of the buyer and the seller and complete the trading according to the trading scheme;
s4: and packing the transaction records into a new block and connecting the new block to a block chain.
In the implementation process, the traditional auction needs buyers and sellers to provide specific demands, and such direct transaction can reveal electricity utilization information and personal privacy of residential users; by utilizing an iterative double auction mechanism, buyers and sellers can complete the transaction only by providing own bids according to pricing rules without giving own demand and supply, thereby effectively protecting the privacy of the buyers and sellers and smoothly completing the auction and trading the resources of the buyers and sellers. The block chain technology is applied to a P2P power resource and spectrum resource transaction system in a microgrid, transaction data are stored in a block and recorded on a chain, decentralized processing and non-falsification of transaction records can be realized, the safe execution of transactions is guaranteed, and transaction cost is reduced.
More specifically, the buyer node is a residential user, the seller node is a local aggregator, and the auctioneer server is a transaction server in the local aggregator.
In the implementation process, the local aggregator is an agent selling power and spectrum resources locally, is used for controlling the transmission of power and managing the use of bandwidth, and has extremely strong computing power and a large amount of storage space. Residential users purchase their own required power and spectrum resources through local aggregators, but their computing power and storage space are limited. Thus, the buyer is a residential user, the seller is a local aggregator, and the auctioneer is a transaction server in the local aggregator.
More specifically, the demand amount of the buyer node includes the power demand b of the buyer nodeijSum bandwidth requirement dijThe supply amount of the seller node includes the power supply s supplied by the seller nodejiSum bandwidth tji。
More specifically, in step S1, the method specifically includes:
s1.1: the buyer node according to the own power demand bijSum bandwidth requirement dijAccording to the electricity payment function of the buyer nodeSum bandwidth payment functionTo solve the optimal bidding problem EB:
thereby obtaining a bid for buyer BRiAnd submitting to the auctioneer server;
wherein I belongs to X, X ∈ {1, 2., I }, J belongs to Z, Z ∈ {1, 2., J }, m ∈ X, X ∈ {1, 2., J }, m ∈ijPrice bid for buyer nodes on electricity, Mi∈{mijI j belongs to Z and is a bidding price vector of the buyer node to the electric power; y isijPrice bid for seller nodes on bandwidth, Yi∈{yij| j ∈ Z } is a bid price vector of the seller node for the bandwidth;a satisfaction function of purchasing power for the buyer node,in the form of a power demand vector for the buyer node, wiIs a constant, eta is the power transmission efficiency,purchasing a minimum value of power for the buyer node;as a function of the satisfaction of the buyer node with respect to purchasing bandwidth,is in the form of a bandwidth demand vector, θ, for the buyer nodeiIs a constant number of times, and is,purchasing a minimum value of bandwidth for the buyer node;
s1.2: seller node according to seller's electric power profit functionSum bandwidth revenue functionTo solve the optimal bidding problem ES:
thereby obtaining a seller bid SRjAnd submitted to the auctioneer's uniformA server;
wherein l1And l2Is a cost factor of electric power, and1>0,njiprice of the seller node's bid for the electricity transaction, Nj∈{njiI belongs to X and is a bidding price vector of the seller node for the electric power transaction; l3And l4Is a cost factor of bandwidth, and3>0,zjibid price for seller nodes for bandwidth transactions, Zj∈{zjiI belongs to X and is a bid price vector of the seller node for the bandwidth transaction; sjiSupply of electric power to seller nodes, Sj∈{sjiI e X is the vector that the seller node supplies power,a power cost function for the seller node; t is tjiBandwidth, T, supplied to seller nodesj∈{tjiI e X is a vector of the seller node supply bandwidth,is a bandwidth cost function of the seller node.
In practice, the residential and local aggregators are in a non-cooperative relationship, and their goals are often contradictory, since the residential needs more power and bandwidth to improve satisfaction, while the local aggregators try to reduce their cost, so the base station as a trading broker not only needs to meet the residential needs, but also maximize power and bandwidth distribution efficiency.
More specifically, in step S2, specifically: the auctioneer server solves the optimal allocation problem A according to the bids of the buyer and the seller:
S.t.
thereby calculating the transaction amount; the transaction amount comprises transaction electric quantity and transaction bandwidth;
wherein the content of the first and second substances,the maximum amount of power to be purchased for the buyer node,the maximum amount of bandwidth purchased by the buyer node,the maximum vector of power supplied to the seller node,the maximum vector of bandwidth is supplied to the seller node.
In the implementation process, in order to protect the privacy of residential users, a bilateral auction mechanism is applied to the power bandwidth trading market of the micro-grid residential and local aggregators, the residential users and the local aggregators respectively bid on electric energy and bandwidth, and an auctioneer solves the optimal distribution problem according to the bids to maximize the benefits of two trading parties, namely maximize social benefits, so that the trading volume and the trading price of the electric energy and the bandwidth are determined, the situation that a buyer and a seller directly disclose privacy information is avoided, and the auction is smoothly completed.
More specifically, in step S3, the condition for the end of the iterative matching includes:
wherein, it is a very small constant used for determining the convergence of the algorithm.
More specifically, as shown in fig. 2, in step S4, the method specifically includes the following steps:
s4.1: each node estimates the voting action and the non-voting action according to the successful record of the block production of the block producer candidate and the computing power;
s4.2: substituting the estimation value into an updating formula of Q-learning in the deep reinforcement learning:
Q'(s,a)=Q(s,a)+α(r+γmaxQ'(s,a)-Q(s,a))
obtaining a new value of Q' (s, a);
where a is the action selected in the update process, i.e. voting or not. S is the current state, alpha is the learning efficiency, r is the obtained reward, gamma is the discount factor, maxQ' (S, a) is the maximum value selected in the action to be performed; r + gamma maxQ' (s, a) is the reward obtained by multiplying the maximum value by the discount factor and adding the discount factor, namely the real Q value; q (s, a) is a Q' (s, a) value estimated from historical block success rate and computational power; updating once by updating a new Q' (s, a) value and then executing the action of voting or not voting as entering the next state after the completion;
s4.3: each node judges whether to execute voting or not according to the Q' (s, a) value;
s4.4: counting the action of voting and non-voting of each node to obtain the vote rate of each block of producer candidates;
if the ticket obtaining rate of the block producer candidate exceeds 50%, the block producer candidate enters a candidate pool;
if the vote rate of the block producer candidate does not exceed 50%, the block producer candidate waits for a next round of re-voting;
s4.5: according to the number of tickets, 21 producers are selected out from the candidate pool from big to small in sequence;
if the number of the block producers reaches 21, randomly sequencing the selected 21 block producers;
if the number of the block producers does not reach 21, returning to the step S4.1 to continue voting until 21 block producers are elected;
s4.6: packing the transaction records into a new block by one block producer and then sending the new block to other block producers for verification;
if the verification of at least 15 block producers is passed, connecting the new block to a block chain, wherein the block producer successfully obtains the corresponding reward when taking out the block, and taking turns to the next block producer to be responsible for packaging the new transaction record into the new block;
if the block producer confirms less than 15, the block producer fails to produce the block, and the block producer is rejected and re-enters the candidate pool, and the step S4.1 is executed again.
In the implementation process, a node voting mechanism with Token is designed based on the Q-Learning decision of deep reinforcement Learning, the node voting mechanism combines the past block output record, the initial calculation capacity and the estimation of the future situation of each node to elect the node entering a candidate pool, the node with strong calculation capacity and high block output success rate is easy to select, the node with insufficient calculation capacity and high block output failure rate is reduced in the selection probability, and therefore the success rate and the efficiency of the whole consensus process are improved. And selecting the first 21 block producers of the comprehensive ticket share result to generate blocks in turn, wherein the rest block producers can be used as verification nodes and are responsible for verifying the newly generated blocks. Compared with other consensus mechanisms, the mechanism considers that the computing resources of the local aggregators are sufficient and the computing speed is high, and the local aggregators are responsible for generation and verification of new blocks, so that the number of accounting nodes is reduced, the transaction speed is high, the transaction is safer, and the final consistency is ensured.
In implementation, state s is determined by the initial computing power of the block producer candidate and the historical block conditions, according to Table 1. Every time the Q value is updated, the state s is also updated according to the updating condition of the Q value. The values of the non-voting action a1 and voting action a2 are first estimated based on the initial computing power of the block producer candidate and the historical situation of the block. Assuming that the node has high computing power and a high historical block-out success rate, it is estimated that a1 does not vote for the action at +5, and a2 votes for the action at + 6. At this time, the decision is made by Q-learning, because the value of a2 is greater than the value of a1, so that action a2 is selected, i.e. the candidate voted to the block producer is voted for, but the action is not actually executed, but the state of s2 is reached after the action is imagined, when all voters complete the voting, statistics is carried out, and if the node vote rate exceeds 50%, the block producer candidate is allowed to enter the candidate pool; if the node vote rate is less than 50%, the block producer candidate waits for a next round of re-voting.
Table 1 is a table of motion estimates for block producer candidates.
TABLE 1
a1 | a2 | |
s1 | +5 | +6 |
s2 | +5 | +6 |
More specifically, in step S4.1, any seller node holding a token is a block producer candidate, and each buyer node and seller node has voting rights.
In practice, any node holding Token can become a block producer and have voting rights, and each residential user and local aggregator have voting rights.
More specifically, in step S4.6, when a block producer exhibits malicious activity, the block producer will be reported by other nodes and receive a penalty, and then a block producer is selected from the candidate pool to replace the block producer.
In the implementation process, a punishment mechanism is added, if the block producer does not produce the block or has malicious behavior, the block producer is reported by other aggregator nodes and receives punishment, and the negative behavior of the block producer in the consensus process is effectively reduced.
More specifically, in step S4.6, when the number of times the block producers take turns exceeds the preset threshold, the process returns to step S4.1 and votes for the block producers again.
In practice, if the number of times the block generators take turns exceeds 10 or the time of the turns exceeds one day, voting is performed again.
It should be understood that the above-described embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. Other variations and modifications will be apparent to persons skilled in the art in light of the above description. And are neither required nor exhaustive of all embodiments. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the claims of the present invention.
Claims (10)
1. A resource secure transaction method based on a block chain is characterized by comprising the following steps:
s1: the buyer node submits a bid to the auctioneer server according to the demand quantity of the buyer node, and the seller node submits the bid to the auctioneer server according to the supply quantity of the seller node;
s2: the auctioneer server calculates the transaction amount according to the bids of the buyer and the seller;
s3: the auctioneer server carries out iterative matching according to the bids of the buyer and the seller to obtain a trading scheme with maximized benefits of the buyer and the seller and complete the trading according to the trading scheme;
s4: and packing the transaction records into a new block and connecting the new block to a block chain.
2. The blockchain-based resource secure transaction method of claim 1, wherein in step S1, the buyer node is a residential user, the seller node is a local aggregator, and the auctioneer server is a transaction server in the local aggregator.
3. The method of claim 2, wherein the demand of the buyer node comprises the power demand b of the buyer nodeijSum bandwidth requirement dijThe supply amount of the seller node includes the power supply s supplied by the seller nodejiSum bandwidth tji。
4. The secure resource transaction method according to claim 3, wherein in step S1, the method specifically includes:
s1.1: the buyer node according to the own power demand bijSum bandwidth requirement dijAccording to the electricity payment function of the buyer nodeSum bandwidth payment functionTo solve the optimal bidding problem EB:
thereby obtaining a bid for buyer BRiAnd submitted to the auctioneerA server;
wherein I belongs to X, X ∈ {1, 2., I }, J belongs to Z, Z ∈ {1, 2., J }, m ∈ X, X ∈ {1, 2., J }, m ∈ijPrice bid for buyer nodes on electricity, Mi∈{mijI j belongs to Z and is a bidding price vector of the buyer node to the electric power; y isijPrice bid for seller nodes on bandwidth, Yi∈{yij| j ∈ Z } is a bid price vector of the seller node for the bandwidth;a satisfaction function of purchasing power for the buyer node,in the form of a power demand vector for the buyer node, wiIs a constant, eta is the power transmission efficiency,purchasing a minimum value of power for the buyer node;as a function of the satisfaction of the buyer node with respect to purchasing bandwidth,is in the form of a bandwidth demand vector, θ, for the buyer nodeiIs a constant number of times, and is,purchasing a minimum value of bandwidth for the buyer node;
s1.2: seller node according to seller's electric power profit functionSum bandwidth revenue functionTo solve the optimal bidding problem ES:
thereby obtaining a seller bid SRjAnd submitting to the auctioneer server;
wherein l1And l2Is a cost factor of electric power, and1>0,njiprice of the seller node's bid for the electricity transaction, Nj∈{njiI belongs to X and is a bidding price vector of the seller node for the electric power transaction; l3And l4Is a cost factor of bandwidth, and3>0,zjibid price for seller nodes for bandwidth transactions, Zj∈{zjiI belongs to X and is a bid price vector of the seller node for the bandwidth transaction; sjiSupply of electric power to seller nodes, Sj∈{sjiI e X is the vector that the seller node supplies power,a power cost function for the seller node; t is tjiBandwidth, T, supplied to seller nodesj∈{tjiI e X is a vector of the seller node supply bandwidth,is a bandwidth cost function of the seller node.
5. The secure transaction method for resources based on block chain as claimed in claim 4, wherein in step S2, specifically: the auctioneer server solves the optimal allocation problem A according to the bids of the buyer and the seller:
S.t.
thereby calculating the transaction amount; the transaction amount comprises transaction electric quantity and transaction bandwidth;
7. The secure transaction method for resources based on block chain as claimed in claim 6, wherein in step S4, the method specifically includes the following steps:
s4.1: each node estimates the voting action and the non-voting action according to the successful record of the block production of the block producer candidate and the computing power;
s4.2: substituting the estimation value into an updating formula of Q-learning in the deep reinforcement learning:
Q'(s,a)=Q(s,a)+α(r+γmaxQ'(s,a)-Q(s,a))
obtaining a new value of Q' (s, a);
where a is the action selected in the update process, i.e. voting or not. S is the current state, alpha is the learning efficiency, r is the obtained reward, gamma is the discount factor, maxQ' (S, a) is the maximum value selected in the action to be performed; r + gamma maxQ' (s, a) is the reward obtained by multiplying the maximum value by the discount factor and adding the discount factor, namely the real Q value; q (s, a) is a Q' (s, a) value estimated from historical block success rate and computational power;
s4.3: each node judges whether to execute voting or not according to the Q' (s, a) value;
s4.4: counting the action of voting and non-voting of each node to obtain the vote rate of each block of producer candidates;
if the ticket obtaining rate of the block producer candidate exceeds 50%, the block producer candidate enters a candidate pool;
if the vote rate of the block producer candidate does not exceed 50%, the block producer candidate waits for a next round of re-voting;
s4.5: according to the number of tickets, 21 producers are selected out from the candidate pool from big to small in sequence;
if the number of the block producers reaches 21, randomly sequencing the selected 21 block producers;
if the number of the block producers does not reach 21, returning to the step S4.1 to continue voting until 21 block producers are elected;
s4.6: packing the transaction records into a new block by one block producer and then sending the new block to other block producers for verification;
if the verification of at least 15 block producers is passed, connecting the new block to a block chain, wherein the block producer successfully obtains the corresponding reward when taking out the block, and taking turns to the next block producer to be responsible for packaging the new transaction record into the new block;
if the block producer confirms less than 15, the block producer fails to produce the block, and the block producer is rejected and re-enters the candidate pool, and the step S4.1 is executed again.
8. The method of claim 7, wherein in step S4.1, any seller node holding token is a candidate for block producer, and each buyer node and seller node has voting right.
9. A block chain based secure transaction method for resources as claimed in claim 8, wherein in step S4.6, when malicious behavior occurs in the block producer, the block producer will be reported by other nodes and receive punishment, and then a block producer is selected from the candidate pool to replace the block producer.
10. A method for resource secure transaction based on block chain as claimed in claim 7 or 9, wherein in step S4.6, when the number of times of block generator turns exceeds the preset threshold, the method returns to step S4.1 and votes for the block producer again.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010678496.3A CN111932293A (en) | 2020-07-15 | 2020-07-15 | Resource safety transaction method based on block chain |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010678496.3A CN111932293A (en) | 2020-07-15 | 2020-07-15 | Resource safety transaction method based on block chain |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111932293A true CN111932293A (en) | 2020-11-13 |
Family
ID=73312418
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010678496.3A Pending CN111932293A (en) | 2020-07-15 | 2020-07-15 | Resource safety transaction method based on block chain |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111932293A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112819594A (en) * | 2021-01-07 | 2021-05-18 | 南京航空航天大学 | Privacy protection dynamic spectrum auction method based on alliance chain |
CN112954628A (en) * | 2021-01-25 | 2021-06-11 | 南京邮电大学 | P2P task unloading system and combined resource transaction method thereof |
CN114549092A (en) * | 2022-04-24 | 2022-05-27 | 南方电网数字电网研究院有限公司 | Energy demand data processing method and device, computer equipment and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108520402A (en) * | 2018-04-09 | 2018-09-11 | 济南浪潮高新科技投资发展有限公司 | A kind of method of commerce and transaction system based on block chain |
CN109658075A (en) * | 2018-12-13 | 2019-04-19 | 广东工业大学 | Method for secret protection and product for block chain family micro-capacitance sensor electricity transaction |
CN110276671A (en) * | 2019-06-25 | 2019-09-24 | 南京工程学院 | A kind of electricity transaction method based on block chain technology |
KR20190109914A (en) * | 2018-03-19 | 2019-09-27 | 상명대학교 천안산학협력단 | System and method for trading power based on blockchain smart contract |
CN110415093A (en) * | 2019-07-11 | 2019-11-05 | 上海电器科学研究所(集团)有限公司 | A kind of intelligent energy gateway of user oriented side micro-capacitance sensor electricity transaction |
CN111402043A (en) * | 2020-03-03 | 2020-07-10 | 中山大学 | Internet of vehicles data transaction method based on block chain |
-
2020
- 2020-07-15 CN CN202010678496.3A patent/CN111932293A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20190109914A (en) * | 2018-03-19 | 2019-09-27 | 상명대학교 천안산학협력단 | System and method for trading power based on blockchain smart contract |
CN108520402A (en) * | 2018-04-09 | 2018-09-11 | 济南浪潮高新科技投资发展有限公司 | A kind of method of commerce and transaction system based on block chain |
CN109658075A (en) * | 2018-12-13 | 2019-04-19 | 广东工业大学 | Method for secret protection and product for block chain family micro-capacitance sensor electricity transaction |
CN110276671A (en) * | 2019-06-25 | 2019-09-24 | 南京工程学院 | A kind of electricity transaction method based on block chain technology |
CN110415093A (en) * | 2019-07-11 | 2019-11-05 | 上海电器科学研究所(集团)有限公司 | A kind of intelligent energy gateway of user oriented side micro-capacitance sensor electricity transaction |
CN111402043A (en) * | 2020-03-03 | 2020-07-10 | 中山大学 | Internet of vehicles data transaction method based on block chain |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112819594A (en) * | 2021-01-07 | 2021-05-18 | 南京航空航天大学 | Privacy protection dynamic spectrum auction method based on alliance chain |
CN112954628A (en) * | 2021-01-25 | 2021-06-11 | 南京邮电大学 | P2P task unloading system and combined resource transaction method thereof |
CN114549092A (en) * | 2022-04-24 | 2022-05-27 | 南方电网数字电网研究院有限公司 | Energy demand data processing method and device, computer equipment and storage medium |
CN114549092B (en) * | 2022-04-24 | 2022-07-29 | 南方电网数字电网研究院有限公司 | Energy demand data processing method and device, computer equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Doan et al. | Peer-to-peer energy trading in smart grid through blockchain: A double auction-based game theoretic approach | |
Borenstein et al. | Diagnosing market power in California's restructured wholesale electricity market | |
Zhang et al. | Credit rating based real-time energy trading in microgrids | |
CN111932293A (en) | Resource safety transaction method based on block chain | |
CN110826940A (en) | Distributed power transaction method under extensible multi-microgrid environment | |
Chen et al. | Asymmetric Nash bargaining model for peer-to-peer energy transactions combined with shared energy storage | |
CN112580850A (en) | Clearing method and system for electric power peak regulation market | |
CN114358756B (en) | Power point-to-point transaction method and system based on double-layer block chain | |
Sun et al. | Bi-level model for integrated energy service providers in joint electricity and carbon P2P market | |
Dotoli et al. | A Nash equilibrium simulation model for the competitiveness evaluation of the auction based day ahead electricity market | |
Peng et al. | Review on bidding strategies for renewable energy power producers participating in electricity spot markets | |
Karandikar et al. | RenewLedger: Renewable energy management powered by Hyperledger Fabric | |
Doan et al. | Optimal peer-to-peer energy trading under load uncertainty incorporating carbon emission and transaction cost for grid-connected prosumers | |
Fan et al. | A Wasserstein‐distance‐based distributionally robust chance constrained bidding model for virtual power plant considering electricity‐carbon trading | |
CN113837897A (en) | Day-ahead real-time distributed electric energy transaction method considering source load uncertainty | |
CN112767146A (en) | Community distributed energy transaction mechanism based on block chain technology and double auction | |
Li et al. | Prosumer energy-storage trading feasibility evaluation and price bundling | |
Wang et al. | Renewable energy certificate trading via permissioned blockchain | |
Anastopoulou et al. | Efficient peer-to-peer energy trading mechanisms with unreliable prosumers | |
CN114154670A (en) | Hybrid energy transaction scheduling method combined with block chain technology and application | |
Bai et al. | Intelligent optimal demand response implemented by blockchain and cooperative game in microgrids | |
Saini et al. | Multi-Objective Optimal Bidding Approach for both Small & Large Customers in Competitive power Market | |
Zhou et al. | Peer-to-peer electricity trading model for urban virtual power plants considering prosumer preferences and power demand heterogeneity | |
Huang et al. | Carbon Neutrality-Oriented Energy Sharing for Prosumers Based on VCG Auction Mechanism | |
Akter et al. | Design of coordination mechanisms for price anticipatory transactive microgrids |
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 |