CN114745135A - Block chain system for energy transaction based on V-raft consensus algorithm - Google Patents
Block chain system for energy transaction based on V-raft consensus algorithm Download PDFInfo
- Publication number
- CN114745135A CN114745135A CN202210410485.6A CN202210410485A CN114745135A CN 114745135 A CN114745135 A CN 114745135A CN 202210410485 A CN202210410485 A CN 202210410485A CN 114745135 A CN114745135 A CN 114745135A
- Authority
- CN
- China
- Prior art keywords
- node
- transaction
- energy
- nodes
- consensus algorithm
- 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 claims abstract description 36
- 230000008569 process Effects 0.000 claims abstract description 32
- 230000010076 replication Effects 0.000 claims abstract description 17
- 238000012163 sequencing technique Methods 0.000 claims description 11
- 238000012790 confirmation Methods 0.000 claims description 7
- 230000008859 change Effects 0.000 claims description 3
- 238000004088 simulation Methods 0.000 claims description 3
- 238000009826 distribution Methods 0.000 claims description 2
- 230000000694 effects Effects 0.000 claims description 2
- 238000004806 packaging method and process Methods 0.000 claims 1
- 238000012545 processing Methods 0.000 abstract description 5
- 238000012550 audit Methods 0.000 abstract description 2
- 238000004364 calculation method Methods 0.000 abstract 1
- 230000005611 electricity Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 238000010248 power generation Methods 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- 241000219112 Cucumis Species 0.000 description 1
- 235000015510 Cucumis melo subsp melo Nutrition 0.000 description 1
- FJJCIZWZNKZHII-UHFFFAOYSA-N [4,6-bis(cyanoamino)-1,3,5-triazin-2-yl]cyanamide Chemical compound N#CNC1=NC(NC#N)=NC(NC#N)=N1 FJJCIZWZNKZHII-UHFFFAOYSA-N 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000005111 flow chemistry technique Methods 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000012797 qualification Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/3247—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
-
- 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
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/382—Payment protocols; Details thereof insuring higher security of transaction
- G06Q20/3825—Use of electronic signatures
-
- 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2209/00—Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
- H04L2209/56—Financial cryptography, e.g. electronic payment or e-cash
-
- Y—GENERAL 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
- Y04—INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
- Y04S—SYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
- Y04S10/00—Systems supporting electrical power generation, transmission or distribution
- Y04S10/50—Systems or methods supporting the power network operation or management, involving a certain degree of interaction with the load-side end user applications
Landscapes
- Business, Economics & Management (AREA)
- Engineering & Computer Science (AREA)
- Accounting & Taxation (AREA)
- Theoretical Computer Science (AREA)
- Strategic Management (AREA)
- Economics (AREA)
- Finance (AREA)
- Computer Security & Cryptography (AREA)
- General Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Marketing (AREA)
- General Health & Medical Sciences (AREA)
- Tourism & Hospitality (AREA)
- Primary Health Care (AREA)
- Human Resources & Organizations (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Water Supply & Treatment (AREA)
- Public Health (AREA)
- Development Economics (AREA)
- Technology Law (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention provides a block chain system for energy transaction based on a V-raft consensus algorithm, and belongs to the field of computer software assembler and data security. The system consensus layer uses a V-Raft consensus algorithm, and the improved consensus algorithm is based on the original Raft consensus algorithm, adds a node state table to optimize collapse fault tolerance and respectively acts on leader node election and log replication stages; the method reduces the phenomenon that the state of the following node automatically changes into a candidate to disturb the node log copying process due to unstable network, and shortens the time for the leader node to wait for the following node to reply the copy result before the day. Compared with the existing energy block chain network, the invention omits the calculation power consumption consensus algorithm such as POW and the like and the consensus algorithm of PBFT and the like which can not dynamically add or delete nodes, and uses the improved V-raft consensus algorithm to accelerate the consensus efficiency and the transaction concurrent processing speed of energy transaction on the basis of the network access audit of the alliance block chain.
Description
Technical Field
The invention belongs to the field of computer software assembly programs and data safety, and particularly relates to a block chain system for energy transaction based on a V-raft consensus algorithm.
Background
With Bitcoin published by Zhongben Congress in 2008: the online bit currency system breaks through the traditional centralized transaction mode in 2009, the bit currency allows the same business function as the traditional centralized environment to be realized in a completely decentralized distributed environment by means of a block chain technology, and the key for completing the function is a consensus algorithm which is a reliable technical support for keeping consistency of a distributed database.
In a blockchain network, the consensus algorithm is divided into strong and weak consistency. Strong consistency means that data in all nodes at any time are the same, and weak consistency means that data on any node at any time are not guaranteed to be the same, but are finally consistent. In the energy internet, the traditional energy trading mode is that an energy generator sells own electric energy to a large power grid, and then the electric energy is dispatched from provincial dispatching to city dispatching through the uniform dispatching of the large power grid layer by layer, which inevitably leads to the waste of human resources and the electric loss of power transmission lines. Therefore, the block chain is used in the energy internet, local power generators are allowed to sell electric power nearby, a suitable consensus algorithm is provided for a special scene of electric power transaction, the node state table is used for monitoring relevant important indexes of the nodes, and a safer and more efficient energy transaction platform is created.
Disclosure of Invention
The invention aims to provide an energy block chain system based on a high-efficiency safe consensus algorithm V-raft for energy trading. The consensus efficiency of the energy transaction is accelerated, and the concurrent processing speed of the transaction is accelerated.
In order to achieve the purpose, the invention provides an energy block chain system based on a high-efficiency safety consensus algorithm V-Raft, wherein the V-Raft consensus algorithm is an improvement of the existing Raft consensus algorithm and is a collapse fault-tolerant algorithm based on a node state table, and the energy block chain system based on the V-Raft consensus algorithm is a mode of connecting all energy generators, power consumers and a large power grid in an area by using an intelligent electric meter, purchasing power and using on-chain purchase and under-chain transaction. The system comprises a physical layer, a data layer, a network layer, a service layer and an application layer;
in a physical layer, the intelligent electric meter is used as an internet of things device to upload recorded information in user power generation and utilization equipment to a transaction platform in real time, the data is processed in a data organization mode through a data layer and stored in a structured database, a two-season layered structure is adopted in a network layer to meet user transaction requirements of different power consumption demands, a service layer completes related work of node identity registration and authentication, transaction flow processing and the like, and an application layer is used for realizing related data; the realization of the functions requires the linkage processing of various technologies of a block chain, wherein a consensus algorithm is the most important, the consensus algorithm works in a network layer, when a trading user initiates an intelligent contract to trade, the consensus algorithm is verified, and the consensus process comprises three stages of execution, sequencing and verification: in the execution stage, after the intelligent electric meter reads the power generation information, a request containing information such as a signature and a chain code name is sent to a node deployed by a monitoring authority to carry out simulated transaction and endorsement operation, and the obtained endorsement information and the result of the simulated transaction are returned to the client;
further, after receiving enough endorsement information, the client sends the endorsement information and the obtained simulation result to the power grid nodes participating in the sorting to sort and generate blocks, and sends the packed blocks to the producer and consumer user nodes in the network;
furthermore, after receiving the block information, the prosumers and the consumers respectively perform authentication operations such as endorsement authentication and transaction validity, namely a consensus process; in the V-raft consensus process, the key steps are divided into three parts: leader election, log replication and block generation. Firstly, a leader election stage; the V-raft consensus algorithm is a strong-consistency consensus algorithm, and a Leader node (Leader) is copied and directly interacted with a Client (Client), and is responsible for confirming consistency guarantee of other followers and a transaction log in the current network; at the beginning of network starting, a consensus node determines a Leader node, then the Leader node is responsible for interacting with a client and receiving a related transaction request to be processed by the client, after an endorsement node simulates and executes a transaction proposal and signs an endorsement, a Leader node sorts transactions and sends the sorted result to a Follower (Follower) node;
further, the sequencing result sent by the Leader node to the Follower node is log replication, in order to reduce the time for the Leader node to wait for confirmation of Follower node replication in the log replication process, the node state table is used for judging whether the node is a node which needs to wait or not, when a node with a total value of more than 7 points in the node state table is a node which needs to wait in the log replication process of the Leader node, in order to avoid unstable network of the Follower node or the phenomenon of packet loss in the sending process to cause that the log replication confirmation information is not replied to the Leader node in time, the Leader node continuously sends a log replication request and waits for confirmation; therefore, in the system, the Leader node only needs to ensure that the logs are copied consistently every time by the nodes with the total value of the node state table exceeding 7 points in the network, and after the network is recovered by the nodes with the rest nodes not exceeding 7 points, the Leader node actively initiates log copying requests to peripheral nodes, so that the original log copying process is changed from a passive process to an active process;
furthermore, when a Leader node is down and elections need to be carried out again, because more nodes are added into the energy transaction network, the situation that a plurality of nodes change the states of the nodes into Candidate easily occurs, and election requests are simultaneously initiated to other Follower nodes, and as a result of simultaneously carrying out vote sorting on the plurality of nodes, no node takes more than 50% votes, and the Leader elections of the nodes are carried out again; at the moment, the node state table can effectively reduce the participation of the nodes with lower node state values in the melon sorting ticket, the Leader election process is finished more quickly, and the throughput of the system is increased;
further, after the node consensus sequencing is completed in the energy transaction, the energy transaction is packaged into blocks and issued to all nodes in the channel; each node appends the block to a chain of channels, and for each valid transaction, the write set is submitted to the database of the current state;
furthermore, the peer node executes the related transaction according to the broadcasted related transaction information and the intelligent contract signed between the peer node and the corresponding node, and updates the broadcasted related information in time to change the current world state, thereby completing the transaction.
According to the method, the improved consensus algorithm has the advantages that the V-Raft consensus algorithm is used, and the improved consensus algorithm is based on the original Raft consensus algorithm, the node state table is added to optimize the crash fault tolerance, and the optimization is respectively acted on stages of leader node election and log replication; the method has the advantages that the phenomenon that the following node automatically turns into a candidate to disturb the node log copying process due to unstable network is reduced, and the time that the leader node waits for the following node to reply the copy result before the day is shortened; compared with the existing energy source block chain network, the network abandons the algorithm of common recognition of power consumption such as POW and the like and the algorithm of common recognition of nodes which can not be dynamically added and deleted such as PBFT and the like, and uses the improved V-raft common recognition algorithm to accelerate the common recognition efficiency and the transaction concurrent processing speed of energy transaction on the basis of the network access audit of the alliance block chain.
Drawings
FIG. 1 is a detailed process of a V-raft consensus algorithm in an embodiment of the present invention;
FIG. 2 is a block chain system flow diagram for energy trading based on the V-raft consensus algorithm.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the following embodiments, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, rather than all embodiments, and all other embodiments obtained by those skilled in the art without any inventive work based on the embodiments of the present invention belong to the protection scope of the present invention.
As shown in fig. 1, a blockchain system for energy trading based on a V-raft consensus algorithm.
The block chain system for carrying out energy transaction based on the V-raft consensus algorithm comprises a physical layer, a network layer, a consensus layer, a data layer, an intelligent contract layer and an application layer. The energy nodes which carry out the transaction collect energy information at a physical layer, wherein the energy information comprises the existing electricity generation and utilization information and the required electricity generation capacity. The method comprises the steps of signing an intelligent contract for transaction contents with a peer node in a network layer, broadcasting the transaction contents in a consensus layer, updating related data after transaction in a data layer, updating the current world state in an intelligent contract layer, and completing login, verification and query functions in an application layer.
The consensus completion of the energy transaction related data has great significance in distributed transaction, the accepted transaction really has a practical basis and is very important for subsequent inspection and data storage, and the specific process of the transaction consensus comprises the following steps:
s1: the client collects relevant information of the transaction, including address, time, amount and energy type of the transaction node, and packages the transaction and sends a proposal to the endorsement node;
s2: the endorsement node executes proposal simulation and signs the result, the endorsement process needs to verify the legality of the transaction, and whether the energy transaction is blocked or not can be checked at the moment, the unsatisfied transaction is directly returned and fails, and the transaction meeting the conditions is returned and sent to the client;
s3: and after collecting enough endorsements, the client side can send the endorsements to the sequencing node for consensus process. Generally, in an energy transaction system, nodes for endorsement should be a power distribution network, a main energy generator and a large energy user, and endorsement strategies may be different for different channels, for example, a transaction occurring in a channel one may only need a signature of an endorsement node in the channel one, and if the transaction occurs between different channels, the transaction may be allowed only if the signature number of the endorsement nodes in different channels exceeds a certain value;
s4: the sequencing nodes carry out consensus sequencing, and the specific process of constructing the block is as follows:
s41: firstly, Leader nodes of sequencing nodes are selected, the selection of the head Leader nodes is random, the probability that the common identification nodes are over concentrated is avoided, particularly, account book consistency and safety of distributed nodes are completed by log replication, random election is completed by a clock module arranged in the nodes, the interval of random time is generally selected to be between [200 and 250] ms, when election starts, built-in clocks of all the nodes start to count down, the node completing the counting down first sends a voting request to other nodes, and as the node is the first node sending the request in the whole network, more than half of votes can be received and elected;
s42: after the Leader node elects, the Leader node needs to send a heartbeat signal uninterruptedly to announce the leadership of the Leader to a Follower, and sends a transaction request to all Follower nodes in a log mode after receiving a transaction sequencing request sent by a client, and the Follower nodes add the request to the logs of the Follower nodes and send a confirmation message;
s43: after the Leader node receives the confirmation messages of all nodes with the state values exceeding 7 points, the Leader node submits the log to a state machine of the Leader node so as to generate output, and once the Leader node submits the log, the Follower node also submits the log to an RSM of the Leader node so as to update the world state and the account book;
s5: it should be further noted that, in the specific implementation process, the consensus speed determines the processing speed of the transaction, and only when the Leader node does not go down in the current due period or the process of replacing the Leader node does not go through multiple elections, and in the process of performing log replication on the Follower node, most of the nodes are not unstable in network or the nodes go down, so that the faults which easily occur in different processes are avoided by using the node state table, and the specific implementation process is as follows:
s51: the node state table is a description of performance expression and behavior of all nodes in the current network, the state table exists in the key information of each node in the form of an array, each key index in all the state tables can also comprehensively represent the state condition of one node after being superposed, but the original consensus algorithm Raft has different key information needing to be determined at different stages, so that the expression mode of the array is selected and used, and the node state table describes the behavior of the node from three dimensions:
s511: the transaction condition of the energy node represents the total transaction times of the current node since the node is added into the network and the total energy transaction amount in the network, and when the total transaction amount in the current quarter is larger, the controllable parameters are adjusted to enlarge the gap as much as possible. When the transaction times of the energy nodes are increased, the requirements on the system throughput and the log replication speed are higher, and when a plurality of nodes are elected simultaneously, if the node transaction conditions of current candidates are not greatly different, the performance state and the credit state of the nodes are used as the elected final reference values of the nodes;
s512: the performance status index of the energy node is 3 minutes in full score in initial setting, when a node is disconnected once, the node is reduced by one minute, the node is deleted after being disconnected for many times, and the full value can not be recovered until the next online is reactivated, so that the condition that the node has the qualification of being sent and waiting in the log copying process is avoided, but the Leader node continuously resends the log copying and waits for replying due to the disconnection, and the time is wasted;
s513: the performance state index of the energy node is to make up that the raw consensus algorithm of the Raft cannot avoid malicious nodes, and only has a certain precaution effect on fault nodes, under the special background of energy transaction, the PBFT is used at the cost that the nodes cannot be dynamically increased or deleted, and the experience feeling of a user is not good, so that the default condition of the nodes only needs to be supervised for a certain time in a federation chain which needs CA authentication to be admitted, and in the setting of the system, the energy node is only allowed to default for 4 times in the period of any Leader node, and the default reason is that only renewable energy output fluctuates. This will make the energy node more cautious in submitting the transaction total;
s52: the data structure of each energy node includes a node status table that is updated in a smart contract. Triggering the node state table to update the chain code after the node completes one transaction each time;
s6: after the consensus is finished, the transaction condition is executed by the intelligent electric meter, the intelligent electric meter is also required to participate in the settlement stage, the intelligent contract compares the current electric quantity flowing through the intelligent electric meter with the electric quantity reserved in the previous contract, if the flowing-in electric quantity is larger than the contracted electric quantity, the amount of the previous electric price is required to be deducted from the account of the purchasing user, the redundant part is required to be deducted, the redundant part is purchased at the lowest price of the market, the default content is not counted in the part, if the flowing-in electric quantity is smaller than the contracted electric quantity, the selling party is not finished with the contract, and besides the amount required to be deducted previously, part of the guarantee fund is required to be deducted again to the large power grid to serve as service charge;
s7: after the transaction settlement part is finished, the client needs to return the amount of money and the electric quantity state of the current energy node to update the world state in time, so that the consensus process needs to be carried out again, and two consensus can be carried out in one transaction.
In summary, the block chain system for energy transaction based on the V-raft consensus algorithm is only a preferred embodiment, and should not be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the invention are intended to be included in the scope of the invention.
Claims (5)
1. A blockchain system for energy transaction based on a V-raft consensus algorithm is characterized by comprising the following steps:
1) the client collects relevant information of the transaction, including address, time, amount and energy type of the transaction node. And sends the transaction packaging sending proposal to the endorsement node;
2) the endorsement node executes the proposal simulation of the step 1) and signs the result, the endorsement process needs to verify the legality of the transaction, whether the energy transaction is blocked or not can be checked at the moment, the unsatisfied transaction is directly returned to be unavailable, and the transaction meeting the conditions is returned and sent to the client;
3) the client side can send the endorsements to the sequencing node after collecting enough endorsements from the step 2), and the consensus is carried out: generally, in an energy transaction system, nodes for endorsement should be a power distribution network, a main energy generator and a large energy user, and endorsement strategies may be different for different channels, for example, a transaction occurring in a channel one may only need a signature of an endorsement node in the channel one, and if the transaction occurs in different channels, the transaction may be passed only if the signature number of the endorsement nodes in different channels exceeds a certain value;
4) the sequencing node sequences the transaction proposal received in the step 3) and broadcasts the transaction proposal to all nodes in the network to change the current account book, namely, the consensus process is carried out by using an improved V-raft consensus algorithm;
5) step 4) after the consensus is finished, the transaction condition is executed by the intelligent electric meter, the intelligent electric meter is also needed to participate in the settlement stage, the intelligent contract compares the current electric quantity flowing through the intelligent electric meter with the electric quantity reserved in the previous contract, if the flowing-in electric quantity is larger than the contracted electric quantity, the previous electric price amount is deducted from the account of the purchasing user, and the redundant part is deducted and purchased at the lowest price of the market, and the default content is not deducted from the redundant part; if the incoming electric quantity is less than the appointed electric quantity, the seller does not finish the appointment, and besides the amount of money needing to be deducted before, part of the deposit is deducted to the large power grid to be used as service charge;
6) after the transaction clearing part is finished, the client needs to return the amount of money and the electric quantity state of the current energy node to update the world state in time.
2. The blockchain system for energy trading based on the V-raft consensus algorithm as claimed in claim 1, wherein the detailed steps of the consensus process head Leader node election in step 4) are:
in the step 4), Leader nodes of the sequencing nodes need to be selected first, and the first Leader node is selected randomly, so that over-concentration of the authority of the consensus nodes is avoided, and particularly, the account book consistency and the safety of the distributed nodes are finished by log replication; the random election is completed by a built-in clock module of the node, the interval of random time is generally selected to be between [ 200-.
3. The blockchain system for energy trading based on the V-raft consensus algorithm as claimed in claim 1, wherein the detailed steps of the consensus process log replication of step 4) are:
in step 4), after the Leader node elects, the Leader node needs to send a heartbeat signal uninterruptedly to announce its leadership to the Follower, and after receiving a transaction ordering request sent by the client, sends the transaction request to all the Follower nodes in a log manner, the Follower nodes add the request to their logs and send a confirmation message, and after the Leader node receives the confirmation messages of all the nodes whose state values exceed 7 points, the Leader node submits its logs to its state machine, thereby generating some outputs; once the Leader node submits the log, the Follower node will also submit the log to their RSM, thereby updating the world state and ledger.
4. The blockchain system for energy trading based on the V-raft consensus algorithm as claimed in claim 1, wherein the details of the consensus process node state table of step 4) are:
the node state table is divided into three dimensions, the transaction condition of the energy node represents the total transaction times of the current node since the node is added into the network and the total energy transaction amount in the network, and when the total transaction amount in the current quarter is larger, the controllable parameters are adjusted to enlarge the difference as much as possible; when the transaction times of the energy node are increased, the requirements on the system throughput and the log replication speed are higher. When a plurality of nodes are elected simultaneously, if the node transaction conditions of the current candidate are not greatly different, the performance state and the credit state of the node are taken as the elected final reference value of the node;
the performance status index of the energy node is full 3 minutes in the initial setting, when the node is disconnected once, the node is reduced by one minute, and the node is deleted after being disconnected for many times, and the full value can not be recovered until the next online is reactivated; this is to avoid that during the log replication process, there is a node that qualifies to be sent and waiting, but because of the dropped connection, the Leader node continuously resends the log replication and waits for a reply, which results in wasted time;
the performance state index of the energy node is to make up that the raw consensus algorithm of the Raft cannot avoid malicious nodes and only has a certain precaution effect on fault nodes, and under the special background of energy transaction, the cost of using the PBFT is that the nodes cannot be dynamically increased or deleted, so that the experience of users is not good; therefore, in the alliance chain which can be admitted only by CA authentication, only certain supervision is needed to be carried out on default conditions of the nodes; in the setting of the system, the energy nodes are only allowed to default for 4 times in the dead time of any Leader node, and the default causes are that the output of the renewable energy fluctuates. This will make the energy node more cautious in submitting the transaction total.
5. The blockchain system for energy trading based on the V-raft consensus algorithm as claimed in claim 1, wherein the update process of the consensus process node state table in step 4) is:
the data structure of each energy node comprises a node state table, and the updating mode of the node state table is an intelligent contract mode; and triggering the node state table to update the chain code after the node completes one transaction each time.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210410485.6A CN114745135A (en) | 2022-04-19 | 2022-04-19 | Block chain system for energy transaction based on V-raft consensus algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210410485.6A CN114745135A (en) | 2022-04-19 | 2022-04-19 | Block chain system for energy transaction based on V-raft consensus algorithm |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114745135A true CN114745135A (en) | 2022-07-12 |
Family
ID=82281269
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210410485.6A Pending CN114745135A (en) | 2022-04-19 | 2022-04-19 | Block chain system for energy transaction based on V-raft consensus algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114745135A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115250277A (en) * | 2022-08-09 | 2022-10-28 | 西安邮电大学 | Consensus mechanism applicable to edge cache system based on alliance chain |
CN118332617A (en) * | 2024-06-12 | 2024-07-12 | 中国民航大学 | Traceability method and system for trusted storage of aircraft engine maintenance data |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108810046A (en) * | 2017-04-28 | 2018-11-13 | 华为技术有限公司 | A kind of method, apparatus and equipment of election leadership person Leader |
CN108833081A (en) * | 2018-06-22 | 2018-11-16 | 中国人民解放军国防科技大学 | Block chain-based equipment networking authentication method |
CN109493056A (en) * | 2018-12-04 | 2019-03-19 | 深圳市链联科技有限公司 | A kind of block chain common recognition mechanism based on supply chain Ecological Information scene |
US20200145189A1 (en) * | 2018-11-01 | 2020-05-07 | International Business Machines Corporation | Database encryption layer |
CN112132682A (en) * | 2020-08-10 | 2020-12-25 | 国网浙江省电力有限公司嘉兴供电公司 | Electric power transaction method, device and system based on block chain technology |
WO2021018088A1 (en) * | 2019-07-30 | 2021-02-04 | 华为技术有限公司 | Trusted authentication method, network device, system and storage medium |
CN112788137A (en) * | 2021-01-06 | 2021-05-11 | 平衡机器科技(深圳)有限公司 | Alliance chain consensus method based on RAFT algorithm |
CN112804207A (en) * | 2020-12-30 | 2021-05-14 | 北京工业大学 | Alliance link node safety access method applied to electronic government scene |
US20210176041A1 (en) * | 2019-12-06 | 2021-06-10 | Sasken Technologies Ltd | Method and system for consensus in a permissioned blockchain |
CN113114473A (en) * | 2021-04-02 | 2021-07-13 | 西南石油大学 | Credit evaluation system based on agricultural block chain Internet of things perception layer node |
CN113158227A (en) * | 2021-03-08 | 2021-07-23 | 重庆邮电大学 | Database access log chaining method and system based on Fabric |
CN113837758A (en) * | 2021-09-27 | 2021-12-24 | 深圳前海微众银行股份有限公司 | Consensus method and device for block chain system |
CN113923222A (en) * | 2021-12-13 | 2022-01-11 | 云和恩墨(北京)信息技术有限公司 | Data processing method and device |
-
2022
- 2022-04-19 CN CN202210410485.6A patent/CN114745135A/en active Pending
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108810046A (en) * | 2017-04-28 | 2018-11-13 | 华为技术有限公司 | A kind of method, apparatus and equipment of election leadership person Leader |
CN108833081A (en) * | 2018-06-22 | 2018-11-16 | 中国人民解放军国防科技大学 | Block chain-based equipment networking authentication method |
US20200145189A1 (en) * | 2018-11-01 | 2020-05-07 | International Business Machines Corporation | Database encryption layer |
CN109493056A (en) * | 2018-12-04 | 2019-03-19 | 深圳市链联科技有限公司 | A kind of block chain common recognition mechanism based on supply chain Ecological Information scene |
WO2021018088A1 (en) * | 2019-07-30 | 2021-02-04 | 华为技术有限公司 | Trusted authentication method, network device, system and storage medium |
US20210176041A1 (en) * | 2019-12-06 | 2021-06-10 | Sasken Technologies Ltd | Method and system for consensus in a permissioned blockchain |
CN112132682A (en) * | 2020-08-10 | 2020-12-25 | 国网浙江省电力有限公司嘉兴供电公司 | Electric power transaction method, device and system based on block chain technology |
CN112804207A (en) * | 2020-12-30 | 2021-05-14 | 北京工业大学 | Alliance link node safety access method applied to electronic government scene |
CN112788137A (en) * | 2021-01-06 | 2021-05-11 | 平衡机器科技(深圳)有限公司 | Alliance chain consensus method based on RAFT algorithm |
CN113158227A (en) * | 2021-03-08 | 2021-07-23 | 重庆邮电大学 | Database access log chaining method and system based on Fabric |
CN113114473A (en) * | 2021-04-02 | 2021-07-13 | 西南石油大学 | Credit evaluation system based on agricultural block chain Internet of things perception layer node |
CN113837758A (en) * | 2021-09-27 | 2021-12-24 | 深圳前海微众银行股份有限公司 | Consensus method and device for block chain system |
CN113923222A (en) * | 2021-12-13 | 2022-01-11 | 云和恩墨(北京)信息技术有限公司 | Data processing method and device |
Non-Patent Citations (4)
Title |
---|
DEZHI TAN ECT.: "VBBFT-Raft: An Understandable Blockchain Consensus Protocol with High Performance", 《2019 IEEE 7TH INTERNATIONAL CONFERENCE ON COMPUTER SCIENCE AND NETWORK TECHNOLOGY (ICCSNT)》 * |
ZHONG YU ECT.: "DNSTSM: DNS Cache Resources Trusted Sharing Model Based on Consortium Blockchain", 《IEEE ACCESS ( VOLUME: 8)》 * |
朱西平;付迁;文红;钟宇等: "区块链视角下多能源主体储能优化配置模型", 《电力自动化设备》 * |
赵会群;张隆龙;: "一种面向Fabric区块链应用软件的体系结构演化算法", 软件, no. 07 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115250277A (en) * | 2022-08-09 | 2022-10-28 | 西安邮电大学 | Consensus mechanism applicable to edge cache system based on alliance chain |
CN115250277B (en) * | 2022-08-09 | 2023-09-05 | 西安邮电大学 | Method for adapting consensus mechanism to edge buffer system based on alliance chain |
CN118332617A (en) * | 2024-06-12 | 2024-07-12 | 中国民航大学 | Traceability method and system for trusted storage of aircraft engine maintenance data |
CN118332617B (en) * | 2024-06-12 | 2024-08-23 | 中国民航大学 | Traceability method and system for trusted storage of aircraft engine maintenance data |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112395640B (en) | Industry internet of things data light-weight credible sharing technology based on block chain | |
Zhou et al. | Solutions to scalability of blockchain: A survey | |
CN111382456B (en) | Proposal message processing method, device, equipment and storage medium | |
CN114745135A (en) | Block chain system for energy transaction based on V-raft consensus algorithm | |
CN111754307B (en) | Multi-factor electric quantity transaction matching method and device based on block chain | |
CN110717832B (en) | Clean energy trading method, system, device and storage medium based on block chain | |
CN108805627B (en) | Media resource allocation method, device, system, medium and equipment | |
CN111311414A (en) | Block chain multi-party consensus method based on consistent hash algorithm | |
CN111563786A (en) | Virtual power plant regulation and control platform based on block chain and operation method | |
CN107464106A (en) | The method and system merchandised between block chain main chain and side chain | |
CN109040014A (en) | Block chain processing method and processing device, block chain node and storage medium | |
CN111106942A (en) | Block chain credit mechanism based on AP-PBFT algorithm | |
CN113179168B (en) | Cross-chain interaction method of block chain | |
CN110298754A (en) | A kind of common recognition method applied to block chain | |
CN114663091B (en) | Power transaction method based on multi-chain block chain architecture | |
CN113240380A (en) | System and method for distributed power management | |
CN113448694A (en) | Block chain consensus method for improving transaction processing capability | |
CN115841382A (en) | Virtual power plant transaction block chain, credit evaluation method thereof and consensus mechanism thereof | |
Wang et al. | A multiblockchain-oriented decentralized market framework for frequency regulation service | |
Ge et al. | Blockchain and green certificates based market structure and transaction mechanism of direct power-purchase for industrial users | |
Elliott et al. | Peer-to-peer energy trading and grid impact studies in smart communities | |
CN113626876A (en) | Consensus method based on power grid block chain | |
CN116452334B (en) | Multi-carbon transaction method and system for industrial park based on blockchain | |
CN111475777A (en) | Block chain intelligent contract upgrading method | |
CN114363084B (en) | Cross-border trade data trusted storage method based on block chain |
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 | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20220712 |
|
WD01 | Invention patent application deemed withdrawn after publication |