WO2019210714A1 - 一种区块链共识方法、记账节点及节点 - Google Patents

一种区块链共识方法、记账节点及节点 Download PDF

Info

Publication number
WO2019210714A1
WO2019210714A1 PCT/CN2019/073232 CN2019073232W WO2019210714A1 WO 2019210714 A1 WO2019210714 A1 WO 2019210714A1 CN 2019073232 W CN2019073232 W CN 2019073232W WO 2019210714 A1 WO2019210714 A1 WO 2019210714A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
billing
nodes
campaign
information
Prior art date
Application number
PCT/CN2019/073232
Other languages
English (en)
French (fr)
Inventor
韦张勇
王立
陆堃彪
Original Assignee
中国银联股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中国银联股份有限公司 filed Critical 中国银联股份有限公司
Priority to JP2020561790A priority Critical patent/JP7138726B2/ja
Priority to US17/044,000 priority patent/US11830001B2/en
Priority to KR1020207034671A priority patent/KR102469267B1/ko
Publication of WO2019210714A1 publication Critical patent/WO2019210714A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0815Network architectures or network communication protocols for network security for authentication of entities providing single-sign-on or federations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/389Keeping log of transactions for guaranteeing non-repudiation of a transaction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/018Certifying business or products
    • G06Q30/0185Product, service or business identity fraud
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2379Updates performed during online database operations; commit processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/02Payment architectures, schemes or protocols involving a neutral party, e.g. certification authority, notary or trusted third party [TTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • G06Q20/0655Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash e-cash managed centrally
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/22Payment schemes or models
    • G06Q20/223Payment schemes or models based on the use of peer-to-peer networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/12Accounting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q2220/00Business processing using cryptography
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q2230/00Voting or election arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2463/00Additional details relating to network architectures or network communication protocols for network security covered by H04L63/00
    • H04L2463/102Additional details relating to network architectures or network communication protocols for network security covered by H04L63/00 applying security measure for e-commerce

Definitions

  • Embodiments of the present invention relate to the field of blockchain technology, and in particular, to a blockchain consensus method, a billing node, and a node.
  • the blockchain uses a Proof of Work (PoW) consensus mechanism, and the mining process is the core of the consensus mechanism.
  • Mining is the process of obtaining the right of billing.
  • the node that obtains the billing right packs all the legal transactions received by itself into the block, and connects the block to the main chain to obtain the bitcoin reward.
  • Nodes in the Bitcoin network can compete for accounting, and in the end, accounting can only be done by a node that first solves the problem of proof of workload. Since PoW requires nodes to perform a series of calculations to obtain billing rights, this process requires a large amount of computing resources and power, and requires a long calculation time, which cannot meet many project requirements that require high efficiency.
  • the embodiment of the invention provides a blockchain consensus method, a billing node and a node, which are used to improve the consensus efficiency of the blockchain.
  • an embodiment of the present invention provides a blockchain consensus method, the method comprising: a billing node generating a block, and broadcasting the verification of the billing node to other billing nodes of the N billing nodes Information, the N billing nodes are determined according to the age information carried in the campaign request broadcasted by the M campaign nodes, M is greater than or equal to 1, N is greater than or equal to 1, and M is greater than or equal to N; Determining information broadcast by other billing nodes, and verifying the confirmation information broadcast by the other billing nodes, wherein the confirmation information broadcast by the other billing node is the second billing received by the first billing node Generating and broadcasting when the preparation information of the node satisfies the first setting condition; the preparation information of the second accounting node is generated and broadcast by the second accounting node when the verification information of the accounting node is verified
  • the first billing node and the second billing node are any one of the other billing nodes; the confirmation information broadcast by the billing node at the other billing node received satisfies
  • the accounting node Since the plurality of billing nodes are selected from the campaign nodes according to the age of the campaign node, instead of determining the billing node by solving the problem of proof of work, the efficiency of determining the billing node is improved, and the resource consumption is reduced. .
  • the accounting node generates a block, wherein the accounting node that generates the block determines the accounting node with the largest currency age as the accounting node of the generated block according to the currency age of the accounting node, and may also be based on the currency The age randomly selects the accounting node as the accounting node that generates the block.
  • the information of the accounting node and the information of the block are broadcasted.
  • the accounting node can add the block to the local blockchain, thereby ensuring the consistency of the blockchain network. Sex and safety.
  • the accounting node can immediately implement consensus after generating the block, and the consensus process does not need to solve the problem of proof of workload, thereby improving the consensus efficiency.
  • the billing node receives the preparation information broadcasted by the other billing node and performs verification; the preparation information of the other billing node received by the billing node satisfies the first When the condition is set, the confirmation information of the billing node is generated and broadcast.
  • the second billing node receives the confirmation information broadcast by the first billing node and the confirmation information broadcast by the billing node; the second billing node satisfies the received confirmation information.
  • the block is added to the blockchain when the second setting condition is met.
  • the node receives an election request broadcast by the M campaign nodes, and according to the currency age information carried in the campaign request broadcast by the M campaign nodes, from the M campaign nodes. Determining N campaign nodes; the node generates campaign result information and broadcasts, the campaign result information includes the N campaign nodes; and the node when the selected campaign result information sent by other nodes meets the third set condition And determining, by the N campaign nodes in the campaign result information, a billing node. After the campaign node broadcasts the campaign request, the other nodes in the blockchain network sort the campaign nodes according to the age of the received campaign request, and then broadcast the sorted result.
  • any one of the nodes determines that the campaign node in the sorting result is a billing node, and the whole process does not need to solve the problem of proof of workload, thereby improving the efficiency of determining the billing node. On the other hand, reduce resource consumption.
  • the accounting node determines, when the verification of the received confirmation information fails, the accounting node that broadcasts the confirmation information as a faulty node and broadcasts a first faulty node removal request;
  • the billing node receives a second faulty node removal request and verifies the second failed node removal request, the second failed node removal request is determined by the other billing node to determine the first
  • the faulty node removal request is generated and broadcasted after passing the verification; the billing node broadcasts the billing node reselection request when the received second faulty node removal request satisfies the fourth set condition, so that the non-remembering
  • the account node broadcasts the campaign request to participate in the billing node competition.
  • the billing node Since the billing node broadcasts the faulty node removal request when the faulty node is found, and the faulty node removal request is recognized by the other billing node, the billing node reselects the request, thereby avoiding the faulty node bringing the blockchain network.
  • the interference improves the stability of the blockchain network.
  • the billing node is a primary billing node, and the other billing nodes are backup billing nodes, and the main billing node is carried in the N billing nodes during the campaign request
  • the billing node having the largest currency age information
  • the backup billing node being a billing node other than the main billing node among the N billing nodes. Since the more nodes with more equity, the more powerful the system security is, the main accounting node initiates the consensus process after determining the main accounting node and the backup accounting node from the N accounting nodes according to the currency age information, which can be further improved. System security.
  • an embodiment of the present invention provides a billing node, including: a first broadcast module, configured to generate a block, and broadcast the verification of the billing node to other billing nodes of the N billing nodes.
  • the information, the N billing nodes are determined according to the age information carried in the campaign request broadcasted by the M campaign nodes, where M is greater than or equal to 1, N is greater than or equal to 1, and M is greater than or equal to N; and the verification module is configured to receive the Determining information broadcast by other billing nodes, and verifying the confirmation information broadcast by the other billing nodes, wherein the confirmation information broadcast by the other billing node is the second billing received by the first billing node Generating and broadcasting when the preparation information of the node satisfies the first setting condition; the preparation information of the second accounting node is generated and broadcast by the second accounting node when the verification information of the accounting node is verified
  • the first billing node and the second billing node are any one of the other billing nodes; the first processing module is configured to satisfy the confirmation information
  • the verification module is further configured to receive preparation information broadcasted by the other billing node, and perform verification;
  • the first processing module is further configured to prepare for receiving the other billing node When the information satisfies the first setting condition, the confirmation information of the billing node is generated and broadcasted.
  • the method further includes: a first receiving module, configured to receive the acknowledgement information broadcast by the first billing node and the acknowledgement information broadcast by the billing node; and the processing module is further configured to receive When the confirmation information satisfies the second setting condition, the block is added to the blockchain.
  • the first processing module is further configured to determine, when the verification of the received confirmation information fails, the accounting node that broadcasts the confirmation information as a faulty node and broadcast the first faulty node shift
  • the verification module is further configured to receive a second faulty node removal request, and verify the second faulty node removal request, the second faulty node removal request is determined by the other billing node
  • the received first fault node removal request is generated and broadcasted after the verification is passed;
  • the first broadcast module is further configured to: when the received second fault node removal request satisfies the fourth setting condition, broadcast
  • the account node reselects the request to cause the non-billing node to broadcast the campaign request to participate in the billing node competition after receiving the billing node reselection request.
  • the billing node is a primary billing node, and the other billing nodes are backup billing nodes, and the main billing node is carried in the N billing nodes during the campaign request
  • the billing node having the largest currency age information, the backup billing node being a billing node other than the main billing node among the N billing nodes.
  • an embodiment of the present invention provides a node, including:
  • a second receiving module configured to receive an election request broadcast by the M campaign nodes, and determine N campaign nodes from the M campaign nodes according to the currency age information carried in the campaign request broadcast by the M campaign nodes;
  • a second broadcast module configured to generate the campaign result information and broadcast, the campaign result information includes the N campaign nodes, and the second processing module is configured to: when the received campaign result information sent by other nodes meets the third set condition And determining, by the N campaign nodes in the campaign result information, a billing node.
  • an embodiment of the present invention provides a terminal device, including at least one processing unit, and at least one storage unit, where the storage unit stores a computer program, when the program is executed by the processing unit, Having the processing unit perform the steps of the method of any of the above.
  • an embodiment of the present invention provides an electronic device, including: a processor, a memory, a transceiver, and a bus interface, wherein a processor, a memory, a transceiver, and a bus interface are connected by a bus;
  • the processor is configured to read a program in the memory, and perform the following method: generating a block, and broadcasting, by using a transceiver, verification information of the billing node to other billing nodes of the N billing nodes,
  • the N billing nodes are determined according to the currency age information carried in the campaign request broadcast by the M campaign nodes, where M is greater than or equal to 1, N is greater than or equal to 1, and M is greater than or equal to N; and the other billing is received by the transceiver.
  • Confirmation information broadcast by the node, and verifying the confirmation information broadcast by the other billing node wherein the confirmation information broadcast by the other billing node is the preparation information of the second billing node received by the first billing node Generating and broadcasting when the first setting condition is satisfied; the preparation information of the second billing node is generated and broadcasted by the second billing node when the verification information of the billing node is verified;
  • the first billing node and the second billing node are any one of the other billing nodes; when the confirmation information broadcast by the other billing node received through the transceiver satisfies the second setting condition, Said block chain is added to the block.
  • the memory is configured to store one or more executable programs, and may store data used by the processor when performing operations.
  • an embodiment of the present invention provides an electronic device, including: a processor, a memory, a transceiver, and a bus interface, wherein a processor, a memory, a transceiver, and a bus interface are connected by a bus;
  • the processor is configured to read a program in the memory, and perform the following method: when the campaign result information sent by other nodes received by the transceiver meets the third setting condition, the N in the campaign result information
  • the campaign node is determined as a billing node;
  • the transceiver is configured to receive, after the control of the processor, the campaign request broadcasted by the M campaign nodes, and according to the age information carried in the campaign request broadcast by the M campaign nodes Determining N campaign nodes among the M campaign nodes; generating campaign result information and broadcasting, the campaign result information including the N campaign nodes;
  • the memory is configured to store one or more executable programs, and may store data used by the processor when performing operations.
  • an embodiment of the present application provides a non-transitory computer readable storage medium, where a computer storage medium stores instructions that, when run on a computer, cause the computer to perform any of the first aspect or the first aspect. The method in the implementation.
  • an embodiment of the present application provides a computer program product comprising instructions, when executed on a computer, causing a computer to perform the method of the first aspect or any possible implementation of the first aspect.
  • the determination of the billing node is improved on the one hand.
  • Efficiency reduces resource consumption.
  • the block is generated by the accounting node, and the information of the accounting node and the information of the block are broadcasted. After the broadcasted information is verified by other accounting nodes, the accounting node can add the block to the local block. Chain, thus ensuring the consistency and security of the blockchain network.
  • the accounting node can immediately implement consensus after generating the block, and the consensus process does not need to solve the problem of proof of workload, thereby improving the consensus efficiency.
  • FIG. 1 is a schematic flowchart of a blockchain consensus method according to an embodiment of the present invention
  • FIG. 2a is a schematic flowchart of a method for determining a billing node according to an embodiment of the present invention
  • 2b is a schematic flowchart of a method for determining a billing node according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart diagram of a method for detecting a faulty node according to an embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of a billing node according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a node according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic structural diagram of a terminal device according to an embodiment of the present disclosure.
  • FIG. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
  • Blockchain In a narrow sense, a blockchain is a chained data structure that combines data blocks in sequential order in a chronological order, and is cryptographically guaranteed to be non-tamperable and unforgeable. Account book. Broadly speaking, blockchain technology uses blockchain data structures to validate and store data, use distributed node consensus algorithms to generate and update data, and use cryptography to ensure data transmission and access security, using automated scripts. The code consists of a smart contract to program and manipulate data in a completely new distributed infrastructure and computing approach.
  • the embodiment of the invention provides a flow of a blockchain consensus method, and the process of the method can be performed by a billing node, as shown in FIG. 1 , including the following steps:
  • step S101 the billing node generates a block and broadcasts the verification information of the billing node to the other billing nodes of the N billing nodes.
  • the billing node is a node in the blockchain network that packages legitimate transactions into blocks and connects the blocks to the blockchain.
  • the verification information is used to indicate the information of the accounting node and the information of the block of the accounting node.
  • the format of the verification information is as follows:
  • p is the block number
  • the block number is determined by the accounting node when generating the block
  • Block is the block content
  • sig(M) is the message signature of the accounting node.
  • the N billing nodes are determined according to the currency age information carried in the campaign request broadcast by the M campaign nodes. M is greater than or equal to 1, N is greater than or equal to 1, and M is greater than or equal to N.
  • step S102 the accounting node receives the confirmation information sent by the other accounting nodes, and verifies the confirmation information broadcast by the other accounting nodes.
  • the confirmation information broadcast by the other accounting node is generated and broadcast by the first accounting node when the preparation information of the received second accounting node satisfies the first setting condition; the preparation information of the second accounting node is the second
  • the billing node generates and broadcasts when the verification information verification of the billing node passes; the first billing node and the second billing node are any of the other billing nodes.
  • the second accounting node performs verification after receiving the verification information broadcast by the accounting node. Specifically, it is preferred to verify whether the message signature of the accounting node is legal, and then verify the next block to be generated in the own blockchain. Whether the block number is consistent with the block number in the verification information, and then verify whether the verification information that the block number is the same but the message signature of the accounting node is different is received. When all the above three verification conditions are satisfied, that is, the message signature of the accounting node is legal, and the block number of the next block to be generated in the own blockchain is consistent with the block number in the verification information, and the block is not received. The message number is the same but the message of the accounting node is different from the verification information, and the second accounting node generates the preparation information.
  • the format of the preparation information is as follows:
  • Block is the block content
  • sig(M) is the message signature of the second accounting node.
  • the second billing node broadcasts the preparation information to other billing nodes. When one of the above three verification conditions does not satisfy the verification condition, indicating that the second billing node is a faulty node, the second billing node is removed and the billing node is re-elected instead of the second billing node.
  • the first accounting node After receiving the preparation information, the first accounting node verifies the preparation information, specifically, whether the signature of the message in the preferred verification preparation information is legal, and then verifies whether the block number of the next block to be generated in the own blockchain is In accordance with the block number in the preparation information, if both of the above verification conditions are satisfied, the received preparation information is written into the log, and the confirmation information of the block is generated and broadcasted when it is determined that the received preparation information satisfies the first setting condition.
  • the first setting condition may be that the quantity of the preparation information for the verification pass is greater than the first threshold, the first threshold may be 2f, and f is the number of the faulty nodes.
  • the format of the confirmation information is as follows:
  • Block is the block content
  • sig(M) is the message signature of the first accounting node.
  • the first billing node is removed and the billing node is re-elected instead of the first billing node.
  • the accounting node receives the preparation information broadcasted by the other accounting node and performs verification, and when the received preparation information of the other accounting node satisfies the first setting condition, generates the confirmation information of the accounting node and broadcasts the confirmation information.
  • the process of verifying the received preparation information by the accounting node and generating the confirmation information is the same as the process of verifying the preparation information by the first accounting node and generating the confirmation information, and details are not described herein again.
  • step S103 the accounting node adds the block to the blockchain when the received confirmation information broadcast by the other accounting node satisfies the second setting condition.
  • the accounting node After receiving the confirmation information broadcast by other accounting nodes, the accounting node verifies the confirmation information, specifically, whether the signature of the message in the preferred verification confirmation information is legal, and then verifies the next block to be generated in the own blockchain. Whether the block number is consistent with the block number in the confirmation information, and when both of the above verification conditions are satisfied, the received confirmation information is written into the log. The block is added to the blockchain when it is determined that the received acknowledgment information satisfies the second set condition.
  • the second setting condition is that the verification information passed by the verification is greater than the second threshold, and the second threshold may be 2f+1, where f is the number of faulty nodes.
  • the second billing node receives the confirmation information broadcast by the first billing node and the confirmation information broadcast by the billing node, and adds the block to the blockchain when the received confirmation information satisfies the second setting condition.
  • the process in which the second accounting node adds the block to the blockchain according to the received confirmation information is the same as the process in which the accounting node adds the block to the blockchain according to the received confirmation information, and details are not described herein again. .
  • the efficiency of determining the billing node is improved, and the resource consumption is reduced. .
  • the block is generated by the accounting node, and the information of the accounting node and the information of the block are broadcasted. After the broadcasted information is verified by other accounting nodes, the accounting node can add the block to the local block. Chain, thus ensuring the consistency and security of the blockchain network.
  • the accounting node can immediately implement consensus after generating the block, and the consensus process does not need to solve the problem of proof of workload, thereby improving the consensus efficiency.
  • the node receives the campaign request broadcasted by the M campaign nodes, and determines N campaign nodes from the M campaign nodes according to the currency age information carried in the campaign request broadcasted by the M campaign nodes.
  • Step S202 The node generates the campaign result information and broadcasts, and the campaign result information includes N campaign nodes.
  • the node may be an election node participating in the accounting node election, or may be an ordinary node not participating in the accounting node election.
  • the campaign node broadcasts the campaign request when participating in the billing node campaign.
  • the format of the campaign request is as follows:
  • addr is the account address of the campaign node
  • txs is the newly initiated transaction of the campaign node.
  • the transaction is signed with the private key of the campaign node, and the transaction content is output in the Unspent Transaction Output (UTXO).
  • UXO Unspent Transaction Output
  • the currency is paid to itself, the transaction time is updated, the currency is emptied, and sig(M) is the message signature of the campaign node.
  • the coin age is the product of the number of coins and the number of days.
  • the age of the voting node may be determined according to the transaction content and the updated transaction time.
  • the campaign node A uses 10 coins to participate in the accounting node competition, and the competition node A The time for obtaining these 10 coins is March 1, 2018, the transaction is to pay 10 coins in UTXO to yourself, and the trading time is updated to the current time, that is, March 31, 2018, through the transaction content and trading time.
  • Competing Node A has a currency age of 300.
  • other nodes After receiving the election request, other nodes first check the legality of the transaction in txs, specifically check whether the currency of the transaction initiator meets the transaction requirement, and whether the account address of the transaction recipient is legal. If the transaction in txs is invalid, the election request of the campaign node is ignored and the campaign node is blacklisted. If the transaction in txs is legal, the campaign request of the campaign node is saved. After the set time arrives, the campaign requests received during the time period are counted, and the campaign nodes are sorted according to the age of the coins in the campaign request.
  • the format of the campaign result information is as follows:
  • list is a list of accounting node account addresses
  • sig(M) is the message signature of the node that broadcasts the campaign result information.
  • Step S203 When the selected campaign result information sent by the other nodes meets the third set condition, the node determines the N campaign nodes in the campaign result information as the billing node.
  • any node After receiving the campaign result information, any node first verifies the message signature in the campaign result information, and then compares the list in the received campaign result information. When the number of election result information in which the node receives the same list is greater than the third threshold, the campaign node in the list is determined as the accounting node.
  • the node can determine whether it is elected as a billing node based on the list. When it is elected as a billing node, the billing node confirms the information, and when it is not elected as the billing node, it does not broadcast the billing node confirmation information.
  • the format of the accounting node confirmation message is as follows:
  • list is a list of accounting node account addresses
  • sig(M) is the message signature of the node that broadcasts the accounting node confirmation information.
  • any accounting node in the list receives the confirmation information broadcast by other accounting nodes in the list and the received confirmation information is consistent, it is determined that the node in the list is the accounting node for the election success, and each accounting node can be based on the list.
  • the order determines its own number and empties the currency age. Since the plurality of billing nodes are selected from the campaign nodes according to the age of the currency, instead of determining the billing node by solving the problem of proof of work, the efficiency of determining the billing node is improved, and the resource consumption is reduced on the other hand. Since the accounting node is determined according to the size of the currency, and the currency of the accounting node is cleared after the accounting node confirms, the person holding the currency is not allowed to control the blockchain network, thereby improving the security of the blockchain network. Sex.
  • step S01 the accounting node election is started.
  • step S02 it is determined whether any node in the blockchain network participates in the election. If yes, step S03 is performed; otherwise, step S04 is performed.
  • step S03 the node broadcasts the campaign request to become the campaign node.
  • step S04 the node receives the campaign request and checks the legality of the campaign request.
  • step S05 the node determines whether an election request is received within the set time period. If yes, step S04 is performed, otherwise step S06 is performed.
  • step S06 the node sorts the campaign nodes according to the received campaign request from large to small, and selects the campaign node ranked in the top m as the billing node, and puts the account address of the billing node into the list.
  • step S07 the campaign result information including the list is broadcast to the billing node.
  • step S08 the accounting node determines whether 2n/3 list matching campaign result information is received, where n is the total number of nodes, and if yes, step S09 is performed, otherwise step S13 is performed.
  • step S09 the accounting node broadcasts the accounting node confirmation information.
  • step S10 the billing node determines whether the billing node confirmation information of all the billing nodes is received and the billing node confirmation information is consistent. If yes, step S11 is performed, otherwise step S13 is performed.
  • step S11 the accounting node broadcasts the transaction information in the campaign request.
  • step S12 the accounting node election ends.
  • step S13 the billing node broadcasts the billing node removal request to remove the billing node whose billing node confirms that the information is inconsistent.
  • step S14 the billing node broadcasts the billing node reselection request after receiving 2m/3 legal billing node removal requests.
  • step S15 after receiving the 2m/3 legal billing node reselection request, the non-billing node performs step S02.
  • the processing includes the following steps, as shown in Figure 3:
  • Step S301 When the accounting node determines that the received confirmation information fails to pass, the accounting node determines the accounting node that broadcasts the confirmation information as the faulty node and broadcasts the first faulty node removal request.
  • the accounting node is not limited to detecting the faulty node by verifying the confirmation information, and may also verify the verification information and the preparation letter to detect the faulty node, or may be in the voting node election phase, according to the receiving.
  • the accounting node confirms whether the information is consistent and whether or not the accounting node confirmation information broadcast by all other accounting nodes in the list is received to detect the faulty node.
  • the following is an example of detecting a faulty node by verifying the confirmation information. After receiving the confirmation information broadcast by other accounting nodes, the accounting node verifies the confirmation information broadcasted by other accounting nodes, and when the confirmation information is verified, When passing, the accounting node that broadcasts the confirmation information is determined as the faulty node and the first faulty node removal request is broadcasted.
  • the format of the first faulty node removal request is as follows:
  • addr is the account address of the faulty node
  • c is the acknowledgement information broadcast by the faulty node
  • sig(M) is the message signature of the billing node that broadcasts the request to the first billing node.
  • step S302 the billing node receives the second faulty node removal request and verifies the second faulty node removal request.
  • the second faulty node removal request is generated and broadcast by the other billing node to determine that the received first faulty node removal request is verified.
  • the format of the second faulty node removal request is the same as the format of the first faulty node removal request. .
  • the other billing node verifies the confirmation information in the first billing node removal request, and if the verification fails, the first billing will be received.
  • the message signature in the node removal request is modified to generate a second accounting node removal request and broadcast after signing its own message.
  • Step S303 the billing node broadcasts the billing node reselection request when the received second faulty node removal request satisfies the fourth set condition, so that the non-accounting node broadcasts the campaign after receiving the billing node reselection request. Request to participate in the accounting node competition.
  • the billing node reselection request is generated and broadcasted, and the format of the billing node reselection request is as follows Show:
  • n is the number of the failed node
  • sig(M) is the message signature of the accounting node of the broadcast accounting node reselection request.
  • the broadcast campaign request participates in the billing node competition when it is determined that the number of billing node reselection requests passed by the received verification is greater than a fifth threshold.
  • the number of billing nodes that are elected at this time is the number of faulty nodes, and the number of the billing nodes that are elected corresponds to the number of the faulty node in the list. Since the billing node broadcasts the faulty node removal request when the faulty node is found, and the faulty node removal request is recognized by the other billing node, the billing node reselects the request, thereby avoiding the faulty node bringing the blockchain network. The interference improves the stability of the blockchain network.
  • the N accounting nodes are divided into a primary accounting node and a backup accounting node.
  • the primary accounting node is a accounting node with the largest currency age information carried in the N accounting nodes during the election request.
  • the account node is a billing node other than the main billing node among the N billing nodes.
  • the primary accounting node generates a block and broadcasts the verification information of the primary accounting node to the backup accounting node in the N accounting nodes.
  • the primary accounting node receives the confirmation information broadcast by the backup accounting node and verifies the confirmation information broadcast by the backup accounting node, wherein the confirmation information broadcast by the backup accounting node is the second accounting received by the first accounting node.
  • the preparation information of the second billing node is generated and broadcast by the second billing node when the verification information of the main billing node is verified, and the first billing node and the second billing node are any of the backup billing nodes.
  • the accounting node with the largest currency among the N accounting nodes is determined as the primary accounting node, and then the main accounting node initiates the consensus process, which can further Improve the security of the system.
  • the billing node 400 includes:
  • a first broadcast module 401 configured to generate a block, and broadcast verification information of the billing node to other billing nodes of the N billing nodes, the N billing nodes being broadcast according to the M campaign nodes Determined by the age information carried in the election request, M is greater than or equal to 1, N is greater than or equal to 1, and M is greater than or equal to N;
  • the verification module 402 is configured to receive the confirmation information broadcast by the other billing node, and verify the confirmation information broadcast by the other billing node, wherein the confirmation information broadcast by the other billing node is the first billing And generating, by the node, when the preparation information of the received second billing node satisfies the first set condition; the preparation information of the second billing node is that the second billing node is at the billing node Generating and broadcasting when the verification information verification is passed; the first billing node and the second billing node are any one of the other billing nodes;
  • the first processing module 403 is configured to add the block to the blockchain when the received confirmation information broadcast by the other billing node satisfies the second setting condition.
  • the verification module 402 is further configured to receive preparation information broadcast by the other billing node, and perform verification;
  • the first processing module 403 is further configured to: when the received preparation information of the other billing node meets the first setting condition, generate confirmation information of the billing node and broadcast the information.
  • the method further includes: a first receiving module 404, configured to receive the acknowledgement information broadcast by the first billing node and the acknowledgement information broadcast by the billing node;
  • the first processing module 403 is further configured to add the block to the blockchain when the received acknowledgement information satisfies the second set condition.
  • the first processing module 403 is further configured to determine, when the verification of the received confirmation information fails, the accounting node that broadcasts the confirmation information as a faulty node and broadcast the first faulty node. Remove request;
  • the verification module 402 is further configured to receive a second faulty node removal request, and verify the second faulty node removal request, where the second failed node removal request is determined by the other billing node to determine The first faulty node removal request is generated and broadcasted after the verification is passed;
  • the first broadcast module 401 is further configured to: when the received second faulty node removal request satisfies the fourth set condition, broadcast a billing node reselection request, so that the non-accounting node receives the record After the account node reselection request, the broadcast campaign request participates in the accounting node competition.
  • the billing node is a primary billing node, and the other billing nodes are backup billing nodes, and the main billing node is carried in the N billing nodes during the campaign request
  • the billing node having the largest currency age information, the backup billing node being a billing node other than the main billing node among the N billing nodes.
  • the node 500 includes:
  • the second receiving module 501 is configured to receive an election request broadcast by the M campaign nodes, and determine N campaign nodes from the M campaign nodes according to the currency age information carried in the campaign request broadcast by the M campaign nodes;
  • a second broadcast module 502 configured to generate and broadcast campaign result information, where the campaign result information includes the N campaign nodes;
  • the second processing module 503 is configured to determine, when the selected campaign result information sent by the other node meets the third set condition, the N campaign nodes in the campaign result information as the billing node.
  • An embodiment of the present invention provides a terminal device, including at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program, and when the program is executed by the processing unit, the processing unit is caused to be The steps to implement the blockchain consensus approach.
  • FIG. 6 it is a schematic diagram of a hardware structure of a terminal device according to an embodiment of the present invention.
  • the terminal device may be a desktop computer, a portable computer, a smart phone, a tablet computer, or the like.
  • the terminal device may include a memory 601, a processor 602, and a computer program stored on the memory, and the processor 602 executes the program to implement the steps of any of the blockchain consensus methods in the foregoing embodiments.
  • the memory 601 may include a read only memory (ROM) and a random access memory (RAM), and provides the processor 602 with program instructions and data stored in the memory 601.
  • ROM read only memory
  • RAM random access memory
  • the terminal device described in the embodiment of the present application may further include an input device 603, an output device 604, and the like.
  • the input device 603 can include a keyboard, a mouse, a touch screen, etc.;
  • the output device 604 can include a display device such as a liquid crystal display (LCD), a cathode ray tube (CRT), a touch screen, and the like.
  • the memory 601, the processor 602, the input device 603, and the output device 604 may be connected by a bus or other means, as exemplified by a bus connection in FIG.
  • the processor 602 calls the program instructions stored in the memory 601 and executes the blockchain consensus method provided in the above embodiment according to the obtained program instructions.
  • An embodiment of the present invention further provides a computer readable storage medium storing a computer program executable by a terminal device, and when the program is run on the terminal device, causing the terminal device to perform a blockchain consensus method step .
  • FIG. 7 is a schematic structural diagram of an electronic device provided by the present application.
  • the electronic device includes a processor 701, a memory 702, a transceiver 703, and a bus interface 704; wherein the processor 701, the memory 702, the transceiver 703, and the bus interface 704 are connected to one another via a bus 705.
  • the memory 702 is for storing a program; specifically, the program may include program code, and the program code includes computer operation instructions.
  • the memory 702 may include a volatile memory such as a random-access memory (RAM); the memory may also include a non-volatile memory such as a flash memory (flash) Memory), hard disk drive (HDD) or solid-state drive (SSD); the memory 702 may also include a combination of the above types of memory.
  • RAM random-access memory
  • flash flash memory
  • HDD hard disk drive
  • SSD solid-state drive
  • the memory 702 stores the following elements, executable modules or data structures, or a subset thereof, or an extended set thereof:
  • Operation instructions include various operation instructions for implementing various operations.
  • Operating system Includes a variety of system programs for implementing various basic services and handling hardware-based tasks.
  • the bus 705 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 7, but it does not mean that there is only one bus or one type of bus.
  • the bus interface 704 can be a wired communication access port, a wireless bus interface, or a combination thereof, wherein the wired bus interface can be, for example, an Ethernet interface.
  • the Ethernet interface can be an optical interface, an electrical interface, or a combination thereof.
  • the wireless bus interface can be a WLAN interface.
  • the processor 701 can be a central processing unit (CPU), a network processor (NP) or a combination of a CPU and an NP. It can also be a hardware chip.
  • the hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof.
  • the PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a general array logic (GAL) or any combination.
  • the processor 701 is configured to read a program in the memory 702, and perform the following method: generating a block, and broadcasting, by the transceiver 703, the billing node to other billing nodes of the N billing nodes. Verification information, the N billing nodes are determined according to the coin age information carried in the campaign request broadcast by the M campaign nodes, M is greater than or equal to 1, N is greater than or equal to 1, and M is greater than or equal to N; receiving the receiver through the transceiver 703 Determining information broadcast by other billing nodes, and verifying the confirmation information broadcast by the other billing nodes, wherein the confirmation information broadcast by the other billing node is the second billing received by the first billing node Generating and broadcasting when the preparation information of the node satisfies the first setting condition; the preparation information of the second accounting node is generated and broadcast by the second accounting node when the verification information of the accounting node is verified
  • the first billing node and the second billing node are any one of the other billing nodes; when the received confirmation information broadcast
  • the memory 702 is configured to store one or more executable programs, and may store data used by the processor 501 when performing operations.
  • the processor 701 is further configured to receive the preparation information broadcast by the other billing node, and perform verification; when the received preparation information of the other billing node satisfies the first setting condition, generate The confirmation information of the accounting node is broadcasted.
  • the transceiver 703 is further configured to receive the acknowledgement information broadcast by the first billing node and the acknowledgement information broadcast by the billing node, and the processor 701 is further configured to: when the received confirmation information meets the first When the condition is set, the block is added to the blockchain.
  • the processor 701 is further configured to: when it is determined that the received confirmation information fails to pass, determine, by the accounting node that broadcasts the confirmation information, as a faulty node, and broadcast a first faulty node removal request; 701.
  • the method further includes: receiving a second faulty node removal request, and verifying the second faulty node removal request, where the second faulty node removal request is that the other billing node determines to receive the a faulty node removal request is generated and broadcasted after the verification is passed;
  • the transceiver 703 is further configured to: when the received second faulty node removal request satisfies the fourth set condition, broadcast the billing node reselection request to The non-billing node is caused to broadcast the campaign request to participate in the billing node competition after receiving the billing node reselection request.
  • the billing node is a primary billing node, and the other billing node is a backup billing node, and the main billing node is a currency age carried in the N billing nodes when the campaign request is carried.
  • the division of each unit above is only a division of a logical function, and the actual implementation may be integrated into one physical entity in whole or in part, or may be physically separated.
  • the first broadcast module 401 and the first receiving module 404 can be implemented by the transceiver 703, and the first processing module 403 of the verification module 402 can be implemented by the processor 701.
  • the electronic device 700 can include a processor 701, a transceiver 703, and a memory 702.
  • the memory 702 may be used to store a program/code pre-installed when the electronic device 700 is shipped from the factory, or may store a code or the like for execution of the processor 701.
  • the efficiency of determining the accounting node is improved, and on the other hand, the resource consumption is reduced.
  • the block is generated by the accounting node, and the information of the accounting node and the information of the block are broadcasted. After the broadcasted information is verified by other accounting nodes, the accounting node can add the block to the local block. Chain, thus ensuring the consistency and security of the blockchain network.
  • the accounting node can immediately implement consensus after generating the block, and the consensus process does not need to solve the problem of proof of workload, thereby improving the consensus efficiency.
  • FIG. 8 is a schematic structural diagram of an electronic device provided by the present application.
  • the electronic device includes a processor 801, a memory 802, a transceiver 803, and a bus interface 804; wherein the processor 801, the memory 802, the transceiver 803, and the bus interface 804 are connected to one another via a bus 805.
  • the memory 802 is for storing a program; specifically, the program may include program code, and the program code includes computer operation instructions.
  • the memory 802 may include a volatile memory such as a random-access memory (RAM); the memory may also include a non-volatile memory such as a flash memory (flash) A hard disk drive (HDD) or a solid-state drive (SSD); the memory 802 may also include a combination of the above types of memories.
  • Memory 802 stores the following elements, executable modules or data structures, or subsets thereof, or their extended sets:
  • Operation instructions include various operation instructions for implementing various operations.
  • Operating system Includes a variety of system programs for implementing various basic services and handling hardware-based tasks.
  • the bus 805 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 7, but it does not mean that there is only one bus or one type of bus.
  • the bus interface 804 can be a wired communication access port, a wireless bus interface, or a combination thereof, wherein the wired bus interface can be, for example, an Ethernet interface.
  • the Ethernet interface can be an optical interface, an electrical interface, or a combination thereof.
  • the wireless bus interface can be a WLAN interface.
  • the processor 801 can be a central processing unit (CPU), a network processor (NP) or a combination of a CPU and an NP. It can also be a hardware chip.
  • the hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof.
  • the PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a general array logic (GAL) or any combination.
  • the processor 801 is configured to read a program in the memory 802, and perform the following method: when the selected campaign result information sent by other nodes meets the third setting condition, the N of the campaign result information The campaign node is determined as a billing node; when the campaign result information sent by the other nodes that meets the third meets the third set condition, the N campaign nodes in the campaign result information are determined as billing nodes;
  • the transceiver 803 is configured to receive an election request broadcast by the M campaign nodes, and determine N campaign nodes from the M campaign nodes according to the currency age information carried in the campaign request broadcast by the M campaign nodes; generate a campaign The result information is broadcasted, and the campaign result information includes the N campaign nodes.
  • the second broadcast module 502 and the second receiving module 501 can be implemented by the transceiver 803, and the second processing module 503 can be implemented by the processor 801.
  • electronic device 800 can include a processor 801, a transceiver 803, and a memory 802.
  • the memory 802 can be used to store a program/code pre-installed at the time of shipment of the electronic device 800, and can also store a code or the like for execution of the processor 801.
  • embodiments of the invention may be provided as a method, system, or computer program product.
  • embodiments of the invention may be in the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware.
  • embodiments of the invention may take the form of a computer program product embodied on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • Embodiments of the invention are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG.
  • These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • Databases & Information Systems (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Data Mining & Analysis (AREA)
  • Technology Law (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Software Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

一种区块链共识方法、记账节点及节点,记账节点生成区块并向N个记账节点中的其他记账节点广播记账节点的验证信息。然后接收其他记账节点广播的确认信息并对确认信息进行验证。在接收的确认信息满足第二设定条件时将区块添加至区块链,由于根据币龄从竞选节点中选出多个记账节点,而不是通过解工作量证明的难题来确定记账节点,从而提高了确定记账节点的效率,降低了资源消耗。由记账节点生成区块并将记账节点的信息以及区块的信息进行广播,广播的信息经其它记账节点验证通过后,记账节点将区块添加至本地区块链,从而保证了区块链网络的一致性和安全性,记账节点在生成区块后可以马上进行共识,从而提高了共识效率。

Description

一种区块链共识方法、记账节点及节点
本申请要求在2018年05月03日提交中国专利局、申请号为201810414927.8、发明名称为“一种区块链共识方法、记账节点及节点”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明实施例涉及区块链技术领域,尤其涉及一种区块链共识方法、记账节点及节点。
背景技术
现有技术中,区块链使用工作量证明(Proof of Work,简称PoW)共识机制,挖矿过程是共识机制的核心。挖矿即争取记账权的过程,获得记账权的节点将自己接收到的所有合法交易打包放在区块内,将区块连接到主链上获取比特币奖励。比特币网络中的节点都可以竞争记账,而最终只能由先解出工作量证明难题的一个节点来完成记账。由于PoW需要节点进行一系列的计算来争取记账权,这个过程需要消耗大量的计算资源和电力,同时需要较长的计算时间,无法满足很多对效率要求较高的项目要求。
发明内容
本发明实施例提供了一种区块链共识方法、记账节点及节点,用于提高区块链的共识效率。
第一方面,本发明实施例提供了一种区块链共识方法,该方法包括:记账节点生成区块,并向N个记账节点中的其他记账节点广播所述记账节点的验证信息,所述N个记账节点是根据M个竞选节点广播的竞选请求中携带的币龄信息确定的,M大于等于1,N大于等于1,M大于等于N;所述记账节点接收所述其他记账节点广播的确认信息,并对所述其他记账节点广播的确认信息进行验证,其中,所述其他记账节点广播的确认信息是第一记账节点 在接收的第二记账节点的准备信息满足第一设定条件时生成并广播的;所述第二记账节点的准备信息是所述第二记账节点在对所述记账节点的验证信息验证通过时生成并广播的;所述第一记账节点和所述第二记账节点为所述其他记账节点中的任一个;所述记账节点在接收的所述其他记账节点广播的确认信息满足第二设定条件时,将所述区块添加至区块链。
由于根据竞选节点的币龄从竞选节点中选出多个记账节点,而不是通过解工作量证明的难题来确定记账节点,从而提高了确定记账节点的效率,另一方面降低资源消耗。其次,记账节点生成区块,其中,生成区块的记账节点根据记账节点的币龄确定,可以将币龄最大的记账节点确定为生成区块的记账节点,也可以根据币龄随机选择记账节点作为生成区块的记账节点。将记账节点的信息以及区块的信息进行广播,广播的信息只有经过其它记账节点验证通过后,记账节点才能将区块添加至本地区块链,从而保证了区块链网络的一致性和安全性。另外,记账节点在生成区块后可以马上进行共识,共识的过程不需要解工作量证明的难题,从而提高了共识效率。
在一个可能的设计中,所述记账节点接收所述其他记账节点广播的准备信息,并进行验证;所述记账节点在接收的所述其他记账节点的准备信息满足所述第一设定条件时,生成所述记账节点的确认信息并广播。
在一个可能的设计中,所述第二记账节点接收所述第一记账节点广播的确认信息及所述记账节点广播的确认信息;所述第二记账节点在接收的确认信息满足所述第二设定条件时,将所述区块添加至区块链。
在一个可能的设计中,针对任意一个节点,所述节点接收M个竞选节点广播的竞选请求,并按照所述M个竞选节点广播的竞选请求中携带的币龄信息从所述M个竞选节点中确定N个竞选节点;所述节点生成竞选结果信息并广播,所述竞选结果信息包括所述N个竞选节点;所述节点在接收的其他节点发送的竞选结果信息满足第三设定条件时,将所述竞选结果信息中的N个竞选节点确定为记账节点。由于竞选节点广播竞选请求后,由区块链网络中的其他节点根据接收的竞选请求中的币龄对竞选节点进行排序,然后将排序 结果进行广播。任意一个节点在接收的排序结果满足第三设定条件时,确定排序结果中的竞选节点为记账节点,整个过程不需要解工作量证明的难题,从而一方面提高了确定记账节点的效率,另一方面降低资源消耗。
在一个可能的设计中,所述记账节点在确定接收的所述确认信息验证不通过时,将广播所述确认信息的记账节点确定为故障节点并广播第一故障节点移除请求;所述记账节点接收第二故障节点移除请求,并对所述第二故障节点移除请求进行验证,所述第二故障节点移除请求是所述其他记账节点确定接收的所述第一故障节点移除请求验证通过后生成并广播的;所述记账节点在接收的所述第二故障节点移除请求满足第四设定条件时,广播记账节点重选请求,以使非记账节点在接收到所述记账节点重选请求后广播竞选请求参与记账节点竞争。由于记账节点在发现故障节点时,广播故障节点移除请求,故障节点移除请求被其它记账节点认同后,广播记账节点重选请求,故避免了故障节点对区块链网络带来的干扰,提高了区块链网络的稳定性。
在一个可能的设计中,所述记账节点为主记账节点,所述其它记账节点为备份记账节点,所述主记账节点是所述N个记账节点中在竞选请求时携带的币龄信息最大的记账节点,所述备份记账节点是所述N个记账节点中除所述主记账节点之外的记账节点。由于权益越多的节点越有动力维护系统安全,故根据币龄信息从N个记账节点中确定主记账节点和备份记账节点后,由主记账节点发起共识过程,能进一步提高了系统的安全性。
第二方面,本发明实施例提供了一种记账节点,包括:第一广播模块,用于生成区块,并向N个记账节点中的其他记账节点广播所述记账节点的验证信息,所述N个记账节点是根据M个竞选节点广播的竞选请求中携带的币龄信息确定的,M大于等于1,N大于等于1,M大于等于N;验证模块,用于接收所述其他记账节点广播的确认信息,并对所述其他记账节点广播的确认信息进行验证,其中,所述其他记账节点广播的确认信息是第一记账节点在接收的第二记账节点的准备信息满足第一设定条件时生成并广播的;所述第二记账节点的准备信息是所述第二记账节点在对所述记账节点的验证信息 验证通过时生成并广播的;所述第一记账节点和所述第二记账节点为所述其他记账节点中的任一个;第一处理模块,用于在接收的所述其他记账节点广播的确认信息满足第二设定条件时,将所述区块添加至区块链。
在一个可能的设计中,所述验证模块还用于接收所述其他记账节点广播的准备信息,并进行验证;所述第一处理模块还用于在接收的所述其他记账节点的准备信息满足所述第一设定条件时,生成所述记账节点的确认信息并广播。
在一个可能的设计中,还包括:第一接收模块,用于接收所述第一记账节点广播的确认信息及所述记账节点广播的确认信息;所述处理模块还用于在接收的确认信息满足所述第二设定条件时,将所述区块添加至区块链。
在一个可能的设计中,所述第一处理模块还用于在确定接收的所述确认信息验证不通过时,将广播所述确认信息的记账节点确定为故障节点并广播第一故障节点移除请求;所述验证模块还用于接收第二故障节点移除请求,并对所述第二故障节点移除请求进行验证,所述第二故障节点移除请求是所述其他记账节点确定接收的所述第一故障节点移除请求验证通过后生成并广播的;所述第一广播模块还用于在接收的所述第二故障节点移除请求满足第四设定条件时,广播记账节点重选请求,以使非记账节点在接收到所述记账节点重选请求后广播竞选请求参与记账节点竞争。
在一个可能的设计中,所述记账节点为主记账节点,所述其它记账节点为备份记账节点,所述主记账节点是所述N个记账节点中在竞选请求时携带的币龄信息最大的记账节点,所述备份记账节点是所述N个记账节点中除所述主记账节点之外的记账节点。
第三方面,本发明实施例提供了一种节点,包括:
第二接收模块,用于接收M个竞选节点广播的竞选请求,并按照所述M个竞选节点广播的竞选请求中携带的币龄信息从所述M个竞选节点中确定N个竞选节点;第二广播模块,用于生成竞选结果信息并广播,所述竞选结果信息包括所述N个竞选节点;第二处理模块,用于在接收的其他节点发送的 竞选结果信息满足第三设定条件时,将所述竞选结果信息中的N个竞选节点确定为记账节点。
第四方面,本发明实施例提供了一种终端设备,包括至少一个处理单元、以及至少一个存储单元,其中,所述存储单元存储有计算机程序,当所述程序被所述处理单元执行时,使得所述处理单元执行上述任一项所述方法的步骤。
第五方面,本发明实施例中提供了一种电子设备,包括:处理器、存储器、收发器和总线接口,其中,处理器、存储器、收发器和总线接口之间通过总线连接;
所述处理器,用于读取所述存储器中的程序,执行下列方法:生成区块,并通过收发器向N个记账节点中的其他记账节点广播所述记账节点的验证信息,所述N个记账节点是根据M个竞选节点广播的竞选请求中携带的币龄信息确定的,M大于等于1,N大于等于1,M大于等于N;通过收发器接收所述其他记账节点广播的确认信息,并对所述其他记账节点广播的确认信息进行验证,其中,所述其他记账节点广播的确认信息是第一记账节点在接收的第二记账节点的准备信息满足第一设定条件时生成并广播的;所述第二记账节点的准备信息是所述第二记账节点在对所述记账节点的验证信息验证通过时生成并广播的;所述第一记账节点和所述第二记账节点为所述其他记账节点中的任一个;在通过收发器接收的所述其他记账节点广播的确认信息满足第二设定条件时,将所述区块添加至区块链。
所述存储器,用于存储一个或多个可执行程序,可以存储所述处理器在执行操作时所使用的数据。
第六方面,本发明实施例中提供了一种电子设备,包括:处理器、存储器、收发器和总线接口,其中,处理器、存储器、收发器和总线接口之间通过总线连接;
所述处理器,用于读取所述存储器中的程序,执行下列方法:在通过收发器接收的其他节点发送的竞选结果信息满足第三设定条件时,将所述竞选 结果信息中的N个竞选节点确定为记账节点;收发器,用于在处理器的控制下,接收M个竞选节点广播的竞选请求,并按照所述M个竞选节点广播的竞选请求中携带的币龄信息从所述M个竞选节点中确定N个竞选节点;生成竞选结果信息并广播,所述竞选结果信息包括所述N个竞选节点;
所述存储器,用于存储一个或多个可执行程序,可以存储所述处理器在执行操作时所使用的数据。
第七方面,本申请实施例提供一种非暂态计算机可读存储介质,计算机存储介质中存储有指令,当其在计算机上运行时,使得计算机执行第一方面或第一方面的任意可能的实现方式中的方法。
第八方面,本申请实施例提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行第一方面或第一方面的任意可能的实现方式中的方法。
本发明实施例中,由于根据竞选节点的币龄从竞选节点中选出多个记账节点,而不是通过解工作量证明的难题来确定记账节点,从而一方面提高了确定记账节点的效率,另一方面降低资源消耗。其次,由记账节点生成区块,并将记账节点的信息以及区块的信息进行广播,广播的信息只有经过其它记账节点验证通过后,记账节点才能将区块添加至本地区块链,从而保证了区块链网络的一致性和安全性。另外,记账节点在生成区块后可以马上进行共识,共识的过程不需要解工作量证明的难题,从而提高了共识效率。
附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例提供的一种区块链共识方法的流程示意图;
图2a为本发明实施例提供的一种确定记账节点的方法的流程示意图;
图2b为本发明实施例提供的一种确定记账节点的方法的流程示意图;
图3为本发明实施例提供的一种故障节点检测方法的流程示意图;
图4为本发明实施例提供的一种记账节点的结构示意图;
图5为本发明实施例提供的一种节点的结构示意图;
图6为本发明实施例提供的一种终端设备的结构示意图;
图7为本发明实施例提供的一种电子设备的结构示意图;
图8为本发明实施例提供的一种电子设备的结构示意图。
具体实施方式
为了使本发明的目的、技术方案及有益效果更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
为了使本发明的目的、技术方案及有益效果更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
在本文中,需要理解的是,附图中的任何元素数量均用于示例而非限制,以及任何命名都仅用于区分,而不具有任何限制含义。为了方便理解,下面对本发明实施例中涉及的名词进行解释。
区块链:狭义来讲,区块链是一种按照时间顺序将数据区块以顺序相连的方式组合成的一种链式数据结构,并以密码学方式保证的不可篡改和不可伪造的分布式账本。广义来讲,区块链技术是利用块链式数据结构来验证与存储数据、利用分布式节点共识算法来生成和更新数据、利用密码学的方式保证数据传输和访问的安全、利用由自动化脚本代码组成的智能合约来编程和操作数据的一种全新的分布式基础架构与计算方式。
本发明实施例提供了一种区块链共识方法的流程,该方法的流程可以由记账节点执行,如图1所示,包括以下步骤:
步骤S101,记账节点生成区块,并向N个记账节点中的其他记账节点广 播记账节点的验证信息。
具体地,记账节点为区块链网络中将合法交易打包放入区块并将区块连接至区块链上的节点。验证信息用于指示记账节点的信息及记账节点的区块的信息。具体地,验证信息的格式如下所示:
<PRE-PREPARE,p,Block,sig(M)>
其中,p是区块号,区块号由记账节点在生成区块时确定,Block是区块内容,sig(M)是记账节点的消息签名。
N个记账节点是根据M个竞选节点广播的竞选请求中携带的币龄信息确定的,M大于等于1,N大于等于1,M大于等于N。
步骤S102,记账节点接收其他记账节点发送的确认信息,并对其他记账节点广播的确认信息进行验证。
其中,其他记账节点广播的确认信息是第一记账节点在接收的第二记账节点的准备信息满足第一设定条件时生成并广播的;第二记账节点的准备信息是第二记账节点在对记账节点的验证信息验证通过时生成并广播的;第一记账节点和第二记账节点为其他记账节点中的任一个。
具体地,第二记账节点在接收到记账节点广播的验证信息后进行验证,具体地,首选验证记账节点的消息签名是否合法,然后验证自身区块链中下一个要生成的区块的区块号是否与验证信息中的区块号一致,之后再验证是否没有收到过区块号相同但是记账节点的消息签名不同的验证信息。当上述三个验证条件均满足,即记账节点的消息签名合法、自身区块链中下一个要生成的区块的区块号与验证信息中的区块号一致、没有收到过区块号相同但是记账节点的消息签名不同的验证信息,第二记账节点生成准备信息,准备信息的格式如下所示:
<PREPARE,p,Block,sig(M)>
其中,p是区块号,Block是区块内容,sig(M)是第二记账节点的消息签名。第二记账节点将准备信息广播至其它记账节点。当上述三个验证条件存在一个验证条件不满足时,说明第二记账节点为故障节点,则将第二记账节 点移除并且重新选举记账节点来代替第二记账节点。
第一记账节点接收到准备信息后,对准备信息进行验证,具体地,首选验证准备信息中的消息签名是否合法,然后验证自身区块链中下一个要生成的区块的区块号是否与准备信息中的区块号一致,若上述两个验证条件均满足,则将接收的准备信息写入日志,在确定接收的准备信息满足第一设定条件时生成区块的确认信息并广播。可选地,第一设定条件可以为验证通过的准备信息的数量大于第一阈值,第一阈值可以为2f,f为故障节点的数量。具体地,确认信息的格式如下所示:
<COMMIT,p,Block,sig(M)>
其中,p是区块号,Block是区块内容,sig(M)是第一记账节点的消息签名。
当上述两个验证条件存在一个验证条件不满足时,说明第一记账节点为故障节点,则将第一记账节点移除并且重新选举记账节点来代替第一记账节点。
可选地,记账节点接收其他记账节点广播的准备信息并进行验证,在接收的其他记账节点的准备信息满足第一设定条件时,生成记账节点的确认信息并广播。具体实施中,记账节点对接收的准备信息进行验证以及生成确认信息的过程与第一记账节点对准备信息进行验证以及生成确认信息的过程相同,此处不再赘述。
步骤S103,记账节点在接收的其他记账节点广播的确认信息满足第二设定条件时,将区块添加至区块链。
记账节点接收到其他记账节点广播的确认信息后,对确认信息进行验证,具体地,首选验证确认信息中的消息签名是否合法,然后验证自身区块链中下一个要生成的区块的区块号是否与确认信息中的区块号一致,当上述两个验证条件均满足,则将接收的确认信息写入日志。在确定接收的确认信息满足第二设定条件时,将区块添加至区块链。可选地,第二设定条件为验证通过的确认信息大于第二阈值,第二阈值可以为2f+1,f为故障节点的数量。当 上述两个验证条件存在一个验证条件不满足时,说明记账节点为故障节点,则将记账节点移除并且重新选举记账节点来代替该记账节点。
可选地,第二记账节点接收第一记账节点广播的确认信息及记账节点广播的确认信息,在接收的确认信息满足第二设定条件时,将区块添加至区块链。具体实施中,第二记账节点根据接收的确认信息将区块添加至区块链的过程与记账节点根据接收的确认信息将区块添加至区块链的过程相同,此处不再赘述。
由于根据竞选节点的币龄从竞选节点中选出多个记账节点,而不是通过解工作量证明的难题来确定记账节点,从而提高了确定记账节点的效率,另一方面降低资源消耗。其次,由记账节点生成区块,并将记账节点的信息以及区块的信息进行广播,广播的信息只有经过其它记账节点验证通过后,记账节点才能将区块添加至本地区块链,从而保证了区块链网络的一致性和安全性。另外,记账节点在生成区块后可以马上进行共识,共识的过程不需要解工作量证明的难题,从而提高了共识效率。
下面具体介绍根据确定N个记账节点的方法的流程,该流程由区块链网络中任意一个节点执行,包括以下步骤,如图2a所示:
步骤S201,节点接收M个竞选节点广播的竞选请求,并按照M个竞选节点广播的竞选请求中携带的币龄信息从M个竞选节点中确定N个竞选节点。
步骤S202,节点生成竞选结果信息并广播,竞选结果信息包括N个竞选节点。
具体地,节点可以是参与记账节点竞选的竞选节点,也可以是没有参与记账节点竞选的普通节点。竞选节点在参与记账节点竞选时广播竞选请求,竞选请求的格式如下所示:
<CANDIDATE,addr,txs,sig(M)>
其中,addr为竞选节点的账户地址,txs为竞选节点新发起的交易,该交易带有竞选节点的私钥签名,该交易内容是将未花费的交易输出(Unspent  Transaction Output,简称UTXO)中的币支付给自己,更新交易时间,清空币龄,sig(M)为竞选节点的消息签名。
可选地,币龄为币数与天数的乘积,具体地,竞选节点的币龄可根据交易内容以及更新的交易时间确定,比如竞选节点A使用10个币参与记账节点竞争,竞争节点A获取这10个币的时间为2018年3月1日,交易内容为将UTXO中10个币支付给自己,交易时间更新为当前时间,即2018年3月31日,通过交易内容和交易时间可知竞争节点A的币龄为300。
其它节点接收到竞选请求后,首先检查txs中交易的合法性,具体检查交易发起方的币是否满足交易需求,交易接收方的账户地址是否合法等。如果txs中的交易不合法,忽略该竞选节点的竞选请求并将该竞选节点加入黑名单。若txs中的交易合法,则保存该竞选节点的竞选请求。当设定时间到达后,统计在该时间段内接收的竞选请求,根据竞选请求中的币龄将竞选节点进行排序。比如该时间段内验证通过了M个竞选节点的竞选请求,则按币龄将M个竞选节点从高到低进行排序,然后将排在前N的竞选节点依次放入list并广播竞选结果信息给其它节点,竞选结果信息的格式如下所示:
<RESULT,list,sig(M)>
其中,list是记账节点账户地址的列表,sig(M)是广播竞选结果信息的节点的消息签名。
步骤S203,节点在接收的其他节点发送的竞选结果信息满足第三设定条件时,将竞选结果信息中的N个竞选节点确定为记账节点。
任意一个节点接收到竞选结果信息后,首先对竞选结果信息中的消息签名进行验证,然后将接收到的各竞选结果信息中的list进行比较。当节点收到list相同的竞选结果信息的数量大于第三阈值,将list中的竞选节点确定为记账节点。
节点根据list可以确定自己是否当选为记账节点。当自己当选为记账节点时,广播记账节点确认信息,当自己没有当选为记账节点时,则不广播记账节点确认信息。记账节点确认信息的格式如下所示:
<CONFIRM,list,sig(M)>
其中,list是记账节点账户地址的列表,sig(M)是广播记账节点确认信息的节点的消息签名。
list中任意一个记账节点接收到list中其它记账节点广播的确认信息且接收的确认信息均一致时,确定list中的节点为选举成功的记账节点,各个记账节点可以根据list中的顺序确定自身的编号,并清空币龄。由于根据币龄从竞选节点中选出多个记账节点,而不是通过解工作量证明的难题来确定记账节点,从而提高了确定记账节点的效率,另一方面降低资源消耗。由于根据币龄的大小确定记账节点,并且在记账节点确认后清空记账节点的币龄,故不会让持有币多的人控制区块链网络,提高了区块链网络的安全性。
为了更好的解释本发明实施例,下面通过具体的实施场景描述本发明实施例提供的一种确定记账节点的方法的流程,如图2b所示,包括以下步骤:
步骤S01,开始记账节点选举。
步骤S02,针对区块链网络中任意一个节点,判断自身是否参与选举,若是,则执行步骤S03,否则执行步骤S04。
步骤S03,节点广播竞选请求成为竞选节点。
步骤S04,节点接收竞选请求并检查竞选请求的合法性。
步骤S05,节点判断设定时段内是否收到竞选请求,若是,则执行步骤S04,否则执行步骤S06。
步骤S06,节点根据接收的竞选请求将竞选节点按照币龄从大到小进行排序,并将排在前m的竞选节点作为记账节点,并将记账节点的账户地址放入list。
步骤S07,向记账节点广播包含list的竞选结果信息。
步骤S08,记账节点判断是否接收到2n/3条list一致的竞选结果信息,n为总节点数,若是,则执行步骤S09,否则执行步骤S13。
步骤S09,记账节点广播记账节点确认信息。
步骤S10,记账节点判断是否接收到所有记账节点的广播的记账节点确认 信息且记账节点确认信息均一致,若是,则执行步骤S11,否则执行步骤S13。
步骤S11,记账节点广播竞选请求中的交易信息。
步骤S12,记账节点选举结束。
步骤S13,记账节点广播记账节点移除请求将记账节点确认信息不一致的记账节点移除。
步骤S14,记账节点接收到2m/3条合法的记账节点移除请求后广播记账节点重选请求。
步骤S15,非记账节点接收到2m/3条合法的记账节点重选请求后,执行步骤S02。
由于N个记账节点中可能存在故障节点,而故障节点将影响整个区块链网络的安全性和稳定性,故需要在记账节点确认过程中以及在共识过程中检测故障节点并对故障节点进行处理,具体包括以下步骤,如图3所示:
步骤S301,记账节点在确定接收的确认信息验证不通过时,将广播确认信息的记账节点确定为故障节点并广播第一故障节点移除请求。
需要说明的是,记账节点并不仅限于通过对确认信息进行验证来检测故障节点,也可以是对验证信息、准备信进行验证来检测故障节点,还可以是在记账节点竞选阶段,根据接收的记账节点确认信息是否一致以及是否接收到list中其它所有记账节点广播的记账节点确认信息来检测故障节点。
下面以通过对确认信息进行验证来检测故障节点为例进行说明,记账节点接收到其它记账节点广播的确认信息后,对其它记账节点广播的确认信息进行验证,当出现确认信息验证不通过时,将广播确认信息的记账节点确定为故障节点并广播第一故障节点移除请求,第一故障节点移除请求的格式如下所示:
<REMOVE,addr,c,sig(M)>
其中,addr是故障节点的账户地址,c为故障节点广播的确认信息,sig(M)为广播第一记账节点移除请求的记账节点的消息签名。
步骤S302,记账节点接收第二故障节点移除请求,并对第二故障节点移 除请求进行验证。
第二故障节点移除请求是其他记账节点确定接收的第一故障节点移除请求验证通过后生成并广播的,第二故障节点移除请求的格式与第一故障节点移除请求的格式相同。具体地,其他记账节点在接收到第一记账节点移除请求后,对第一记账节点移除请求中的确认信息进行验证,若验证不通过,则将接收到的第一记账节点移除请求中的消息签名修改为自己的消息签名后生成第二记账节点移除请求并广播。
步骤S303,记账节点在接收的第二故障节点移除请求满足第四设定条件时,广播记账节点重选请求,以使非记账节点在接收到记账节点重选请求后广播竞选请求参与记账节点竞争。
记账节点在接收到针对相同故障节点的验证通过的第二记账节点移除请求的数量大于第四阈值时,生成记账节点重选请求并广播,记账节点重选请求的格式如下所示:
<REVOTE,n,sig(M)>
n为故障节点的编号,sig(M)为广播记账节点重选请求的记账节点的消息签名。
当非记账节点接收记账节点重选请求并进行验证,在确定接收的验证通过的记账节点重选请求的数量大于第五阈值时,广播竞选请求参与记账节点竞争。此时竞选出的记账节点的数量为故障节点的数量,并且竞选出的记账节点的编号对应故障节点在list中的编号。由于记账节点在发现故障节点时,广播故障节点移除请求,故障节点移除请求被其它记账节点认同后,广播记账节点重选请求,故避免了故障节点对区块链网络带来的干扰,提高了区块链网络的稳定性。
可选地,将N个记账节点分为主记账节点和备份记账节点,主记账节点是N个记账节点中在竞选请求时携带的币龄信息最大的记账节点,备份记账节点是N个记账节点中除主记账节点之外的记账节点。在区块链共识过程中,主记账节点生成区块,并向N个记账节点中的备份记账节点广播主记账节点 的验证信息。主记账节点接收备份记账节点广播的确认信息,并对备份记账节点广播的确认信息进行验证,其中,备份记账节点广播的确认信息是第一记账节点在接收的第二记账节点的准备信息满足第一设定条件时生成并广播的。第二记账节点的准备信息是第二记账节点在对主记账节点的验证信息验证通过时生成并广播的,第一记账节点和第二记账节点为备份记账节点中的任一个。由于权益越多的记账节点越有动力维护系统安全,故将N个记账节点中币龄最大的记账节点确定为主记账节点后,然后由主记账节点发起共识过程,能进一步提高了系统的安全性。
基于相同的技术构思,本发明实施例提供了一种记账节点,如图4所示,该记账节点400包括:
第一广播模块401,用于生成区块,并向N个记账节点中的其他记账节点广播所述记账节点的验证信息,所述N个记账节点是根据M个竞选节点广播的竞选请求中携带的币龄信息确定的,M大于等于1,N大于等于1,M大于等于N;
验证模块402,用于接收所述其他记账节点广播的确认信息,并对所述其他记账节点广播的确认信息进行验证,其中,所述其他记账节点广播的确认信息是第一记账节点在接收的第二记账节点的准备信息满足第一设定条件时生成并广播的;所述第二记账节点的准备信息是所述第二记账节点在对所述记账节点的验证信息验证通过时生成并广播的;所述第一记账节点和所述第二记账节点为所述其他记账节点中的任一个;
第一处理模块403,用于在接收的所述其他记账节点广播的确认信息满足第二设定条件时,将所述区块添加至区块链。
在一个可能的设计中,所述验证模块402还用于接收所述其他记账节点广播的准备信息,并进行验证;
所述第一处理模块403还用于在接收的所述其他记账节点的准备信息满足所述第一设定条件时,生成所述记账节点的确认信息并广播。
在一个可能的设计中,还包括:第一接收模块404,用于接收所述第一记 账节点广播的确认信息及所述记账节点广播的确认信息;
所述第一处理模块403还用于在接收的确认信息满足所述第二设定条件时,将所述区块添加至区块链。
在一个可能的设计中,所述第一处理模块403还用于在确定接收的所述确认信息验证不通过时,将广播所述确认信息的记账节点确定为故障节点并广播第一故障节点移除请求;
所述验证模块402还用于接收第二故障节点移除请求,并对所述第二故障节点移除请求进行验证,所述第二故障节点移除请求是所述其他记账节点确定接收的所述第一故障节点移除请求验证通过后生成并广播的;
所述第一广播模块401还用于在接收的所述第二故障节点移除请求满足第四设定条件时,广播记账节点重选请求,以使非记账节点在接收到所述记账节点重选请求后广播竞选请求参与记账节点竞争。
在一个可能的设计中,所述记账节点为主记账节点,所述其它记账节点为备份记账节点,所述主记账节点是所述N个记账节点中在竞选请求时携带的币龄信息最大的记账节点,所述备份记账节点是所述N个记账节点中除所述主记账节点之外的记账节点。
基于相同的技术构思,本发明实施例提供了一种节点,如图5所示,该节点500包括:
第二接收模块501,用于接收M个竞选节点广播的竞选请求,并按照所述M个竞选节点广播的竞选请求中携带的币龄信息从所述M个竞选节点中确定N个竞选节点;
第二广播模块502,用于生成竞选结果信息并广播,所述竞选结果信息包括所述N个竞选节点;
第二处理模块503,用于在接收的其他节点发送的竞选结果信息满足第三设定条件时,将所述竞选结果信息中的N个竞选节点确定为记账节点。
本发明实施例提供了一种终端设备,包括至少一个处理单元以及至少一个存储单元,其中,所述存储单元存储有计算机程序,当所述程序被所述处 理单元执行时,使得所述处理单元执行区块链共识方法的步骤。如图6所示,为本发明实施例中所述的终端设备的硬件结构示意图,该终端设备具体可以为台式计算机、便携式计算机、智能手机、平板电脑等。具体地,该终端设备可以包括存储器601、处理器602及存储在存储器上的计算机程序,所述处理器602执行所述程序时实现上述实施例中的任一区块链共识方法的步骤。其中,存储器601可以包括只读存储器(ROM)和随机存取存储器(RAM),并向处理器602提供存储器601中存储的程序指令和数据。
进一步地,本申请实施例中所述的终端设备还可以包括输入装置603以及输出装置604等。输入装置603可以包括键盘、鼠标、触摸屏等;输出装置604可以包括显示设备,如液晶显示器(Liquid Crystal Display,LCD)、阴极射线管(Cathode Ray Tube,CRT),触摸屏等。存储器601,处理器602、输入装置603和输出装置604可以通过总线或者其他方式连接,图6中以通过总线连接为例。处理器602调用存储器601存储的程序指令并按照获得的程序指令执行上述实施例提供的区块链共识方法。
本发明实施例还提供了一种计算机可读存储介质,其存储有可由终端设备执行的计算机程序,当所述程序在终端设备上运行时,使得所述终端设备执行区块链共识方法的步骤。
基于相同构思,本申请提供一种电子设备,可用于执行上述记账节点的方法流程。图7为本申请提供的一种电子设备的结构示意图。该电子设备包括处理器701、存储器702、收发器703和总线接口704;其中,处理器701、存储器702、收发器703和总线接口704通过总线705相互连接。
存储器702用于存储程序;具体地,程序可以包括程序代码,程序代码包括计算机操作指令。存储器702可以包括易失性存储器(volatile memory),例如随机存取存储器(random-access memory,简称RAM);存储器也可以包括非易失性存储器(non-volatile memory),例如快闪存储器(flash memory),硬盘(hard disk drive,简称HDD)或固态硬盘(solid-state drive,简称SSD);存储器702还可以包括上述种类的存储器的组合。
存储器702存储了如下的元素,可执行模块或者数据结构,或者它们的子集,或者它们的扩展集:
操作指令:包括各种操作指令,用于实现各种操作。
操作系统:包括各种系统程序,用于实现各种基础业务以及处理基于硬件的任务。
总线705可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,图7中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
总线接口704可以为有线通信接入口,无线总线接口或其组合,其中,有线总线接口例如可以为以太网接口。以太网接口可以是光接口,电接口或其组合。无线总线接口可以为WLAN接口。
处理器701可以是中央处理器(central processing unit,简称CPU),网络处理器(network processor,简称NP)或者CPU和NP的组合。还可以是硬件芯片。上述硬件芯片可以是专用集成电路(application-specific integrated circuit,简称ASIC),可编程逻辑器件(programmable logic device,简称PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,简称CPLD),现场可编程逻辑门阵列(field-programmable gate array,简称FPGA),通用阵列逻辑(generic array logic,简称GAL)或其任意组合。
所述处理器701,用于读取所述存储器702中的程序,执行下列方法:生成区块,并通过收发器703向N个记账节点中的其他记账节点广播所述记账节点的验证信息,所述N个记账节点是根据M个竞选节点广播的竞选请求中携带的币龄信息确定的,M大于等于1,N大于等于1,M大于等于N;通过收发器703接收所述其他记账节点广播的确认信息,并对所述其他记账节点广播的确认信息进行验证,其中,所述其他记账节点广播的确认信息是第一记账节点在接收的第二记账节点的准备信息满足第一设定条件时生成并广播 的;所述第二记账节点的准备信息是所述第二记账节点在对所述记账节点的验证信息验证通过时生成并广播的;所述第一记账节点和所述第二记账节点为所述其他记账节点中的任一个;在接收的所述其他记账节点广播的确认信息满足第二设定条件时,将所述区块添加至区块链;
所述存储器702,用于存储一个或多个可执行程序,可以存储所述处理器501在执行操作时所使用的数据。
可选地,处理器701,还用于接收所述其他记账节点广播的准备信息,并进行验证;在接收的所述其他记账节点的准备信息满足所述第一设定条件时,生成所述记账节点的确认信息并广播。
可选地,收发器703,还用于接收所述第一记账节点广播的确认信息及所述记账节点广播的确认信息;处理器701,还用于在接收的确认信息满足所述第二设定条件时,将所述区块添加至区块链。
可选地,处理器701,还用于在确定接收的所述确认信息验证不通过时,将广播所述确认信息的记账节点确定为故障节点并广播第一故障节点移除请求;处理器701,还用于接收第二故障节点移除请求,并对所述第二故障节点移除请求进行验证,所述第二故障节点移除请求是所述其他记账节点确定接收的所述第一故障节点移除请求验证通过后生成并广播的;收发器703,还用于在接收的所述第二故障节点移除请求满足第四设定条件时,广播记账节点重选请求,以使非记账节点在接收到所述记账节点重选请求后广播竞选请求参与记账节点竞争。
可选地,所述记账节点为主记账节点,所述其它记账节点为备份记账节点,所述主记账节点是所述N个记账节点中在竞选请求时携带的币龄信息最大的记账节点,所述备份记账节点是所述N个记账节点中除所述主记账节点之外的记账节点。
应理解,以上各个单元的划分仅仅是一种逻辑功能的划分,实际实现时可以全部或部分集成到一个物理实体上,也可以物理上分开。本申请实施例中,第一广播模块401和第一接收模块404可以由收发器703实现,验证模 块402第一处理模块403可以由处理器701实现。如图7所示,电子设备700可以包括处理器701、收发器703和存储器702。其中,存储器702可以用于存储电子设备700出厂时预装的程序/代码,也可以存储用于处理器701执行时的代码等。
从上述内容可以看出:本发明实施例中,由于根据竞选节点的币龄从竞选节点中选出多个记账节点,而不是通过解工作量证明的难题来确定记账节点,从而一方面提高了确定记账节点的效率,另一方面降低资源消耗。其次,由记账节点生成区块,并将记账节点的信息以及区块的信息进行广播,广播的信息只有经过其它记账节点验证通过后,记账节点才能将区块添加至本地区块链,从而保证了区块链网络的一致性和安全性。另外,记账节点在生成区块后可以马上进行共识,共识的过程不需要解工作量证明的难题,从而提高了共识效率。
基于相同构思,本申请提供一种电子设备,可用于执行上述记账节点的方法流程。图8为本申请提供的一种电子设备的结构示意图。该电子设备包括处理器801、存储器802、收发器803和总线接口804;其中,处理器801、存储器802、收发器803和总线接口804通过总线805相互连接。
存储器802用于存储程序;具体地,程序可以包括程序代码,程序代码包括计算机操作指令。存储器802可以包括易失性存储器(volatile memory),例如随机存取存储器(random-access memory,简称RAM);存储器也可以包括非易失性存储器(non-volatile memory),例如快闪存储器(flash memory),硬盘(hard disk drive,简称HDD)或固态硬盘(solid-state drive,简称SSD);存储器802还可以包括上述种类的存储器的组合。
存储器802存储了如下的元素,可执行模块或者数据结构,或者它们的子集,或者它们的扩展集:
操作指令:包括各种操作指令,用于实现各种操作。
操作系统:包括各种系统程序,用于实现各种基础业务以及处理基于硬件的任务。
总线805可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,图7中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
总线接口804可以为有线通信接入口,无线总线接口或其组合,其中,有线总线接口例如可以为以太网接口。以太网接口可以是光接口,电接口或其组合。无线总线接口可以为WLAN接口。
处理器801可以是中央处理器(central processing unit,简称CPU),网络处理器(network processor,简称NP)或者CPU和NP的组合。还可以是硬件芯片。上述硬件芯片可以是专用集成电路(application-specific integrated circuit,简称ASIC),可编程逻辑器件(programmable logic device,简称PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,简称CPLD),现场可编程逻辑门阵列(field-programmable gate array,简称FPGA),通用阵列逻辑(generic array logic,简称GAL)或其任意组合。
所述处理器801,用于读取所述存储器802中的程序,执行下列方法:在接收的其他节点发送的竞选结果信息满足第三设定条件时,将所述竞选结果信息中的N个竞选节点确定为记账节点;在接收的其他节点发送的竞选结果信息满足第三设定条件时,将所述竞选结果信息中的N个竞选节点确定为记账节点;
收发器803,用于接收M个竞选节点广播的竞选请求,并按照所述M个竞选节点广播的竞选请求中携带的币龄信息从所述M个竞选节点中确定N个竞选节点;生成竞选结果信息并广播,所述竞选结果信息包括所述N个竞选节点。
应理解,以上各个单元的划分仅仅是一种逻辑功能的划分,实际实现时可以全部或部分集成到一个物理实体上,也可以物理上分开。本申请实施例中,第二广播模块502和第二接收模块501可以由收发器803实现,第二处 理模块503可以由处理器801实现。如图8所示,电子设备800可以包括处理器801、收发器803和存储器802。其中,存储器802可以用于存储电子设备800出厂时预装的程序/代码,也可以存储用于处理器801执行时的代码等。
本领域内的技术人员应明白,本发明实施例可提供为方法、系统、或计算机程序产品。因此,本发明实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明实施例是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
显然,本领域的技术人员可以对本发明实施例进行各种改动和变型而不 脱离本申请的精神和范围。这样,倘若本发明实施例的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。

Claims (22)

  1. 一种区块链共识方法,其特征在于,包括:
    记账节点生成区块,并向N个记账节点中的其他记账节点广播所述记账节点的验证信息,所述N个记账节点是根据M个竞选节点广播的竞选请求中携带的币龄信息确定的,M大于等于1,N大于等于1,M大于等于N;
    所述记账节点接收所述其他记账节点广播的确认信息,并对所述其他记账节点广播的确认信息进行验证,其中,所述其他记账节点广播的确认信息是第一记账节点在接收的第二记账节点的准备信息满足第一设定条件时生成并广播的;所述第二记账节点的准备信息是所述第二记账节点在对所述记账节点的验证信息验证通过时生成并广播的;所述第一记账节点和所述第二记账节点为所述其他记账节点中的任一个;
    所述记账节点在接收的所述其他记账节点广播的确认信息满足第二设定条件时,将所述区块添加至区块链。
  2. 如权利要求1所述的方法,其特征在于,还包括:
    所述记账节点接收所述其他记账节点广播的准备信息,并进行验证;
    所述记账节点在接收的所述其他记账节点的准备信息满足所述第一设定条件时,生成所述记账节点的确认信息并广播。
  3. 如权利要求2所述的方法,其特征在于,还包括:
    所述第二记账节点接收所述第一记账节点广播的确认信息及所述记账节点广播的确认信息;
    所述第二记账节点在接收的确认信息满足所述第二设定条件时,将所述区块添加至区块链。
  4. 如权利要求1所述的方法,其特征在于,所述根据M个竞选节点广播的竞选请求中携带的币龄信息确定所述N个记账节点,包括:
    针对任意一个节点,所述节点接收M个竞选节点广播的竞选请求,并按照所述M个竞选节点广播的竞选请求中携带的币龄信息从所述M个竞选节点 中确定N个竞选节点;
    所述节点生成竞选结果信息并广播,所述竞选结果信息包括所述N个竞选节点;
    所述节点在接收的其他节点发送的竞选结果信息满足第三设定条件时,将所述竞选结果信息中的N个竞选节点确定为记账节点。
  5. 如权利要求1所述的方法,其特征在于,还包括:
    所述记账节点在确定接收的所述确认信息验证不通过时,将广播所述确认信息的记账节点确定为故障节点并广播第一故障节点移除请求;
    所述记账节点接收第二故障节点移除请求,并对所述第二故障节点移除请求进行验证,所述第二故障节点移除请求是所述其他记账节点确定接收的所述第一故障节点移除请求验证通过后生成并广播的;
    所述记账节点在接收的所述第二故障节点移除请求满足第四设定条件时,广播记账节点重选请求,以使非记账节点在接收到所述记账节点重选请求后广播竞选请求参与记账节点竞争。
  6. 如权利要求1至5任一项所述的方法,其特征在于,所述记账节点为主记账节点,所述其它记账节点为备份记账节点,所述主记账节点是所述N个记账节点中在竞选请求时携带的币龄信息最大的记账节点,所述备份记账节点是所述N个记账节点中除所述主记账节点之外的记账节点。
  7. 一种记账节点,其特征在于,包括:
    第一广播模块,用于生成区块,并向N个记账节点中的其他记账节点广播所述记账节点的验证信息,所述N个记账节点是根据M个竞选节点广播的竞选请求中携带的币龄信息确定的,M大于等于1,N大于等于1,M大于等于N;
    验证模块,用于接收所述其他记账节点广播的确认信息,并对所述其他记账节点广播的确认信息进行验证,其中,所述其他记账节点广播的确认信息是第一记账节点在接收的第二记账节点的准备信息满足第一设定条件时生成并广播的;所述第二记账节点的准备信息是所述第二记账节点在对所述记 账节点的验证信息验证通过时生成并广播的;所述第一记账节点和所述第二记账节点为所述其他记账节点中的任一个;
    第一处理模块,用于在接收的所述其他记账节点广播的确认信息满足第二设定条件时,将所述区块添加至区块链。
  8. 如权利要求7所述的记账节点,其特征在于,所述验证模块还用于接收所述其他记账节点广播的准备信息,并进行验证;
    所述第一处理模块还用于在接收的所述其他记账节点的准备信息满足所述第一设定条件时,生成所述记账节点的确认信息并广播。
  9. 如权利要求8所述的记账节点,其特征在于,还包括:
    第一接收模块,用于接收所述第一记账节点广播的确认信息及所述记账节点广播的确认信息;
    所述处理模块还用于在接收的确认信息满足所述第二设定条件时,将所述区块添加至区块链。
  10. 如权利要求7所述的记账节点,其特征在于,所述第一处理模块还用于在确定接收的所述确认信息验证不通过时,将广播所述确认信息的记账节点确定为故障节点并广播第一故障节点移除请求;
    所述验证模块还用于接收第二故障节点移除请求,并对所述第二故障节点移除请求进行验证,所述第二故障节点移除请求是所述其他记账节点确定接收的所述第一故障节点移除请求验证通过后生成并广播的;
    所述第一广播模块还用于在接收的所述第二故障节点移除请求满足第四设定条件时,广播记账节点重选请求,以使非记账节点在接收到所述记账节点重选请求后广播竞选请求参与记账节点竞争。
  11. 如权利要求7至10任一项所述的记账节点,其特征在于,所述记账节点为主记账节点,所述其它记账节点为备份记账节点,所述主记账节点是所述N个记账节点中在竞选请求时携带的币龄信息最大的记账节点,所述备份记账节点是所述N个记账节点中除所述主记账节点之外的记账节点。
  12. 一种节点,其特征在于,包括:
    第二接收模块,用于接收M个竞选节点广播的竞选请求,并按照所述M个竞选节点广播的竞选请求中携带的币龄信息从所述M个竞选节点中确定N个竞选节点;
    第二广播模块,用于生成竞选结果信息并广播,所述竞选结果信息包括所述N个竞选节点;
    第二处理模块,用于在接收的其他节点发送的竞选结果信息满足第三设定条件时,将所述竞选结果信息中的N个竞选节点确定为记账节点。
  13. 一种终端设备,其特征在于,包括至少一个处理单元、以及至少一个存储单元,其中,所述存储单元存储有计算机程序,当所述程序被所述处理单元执行时,使得所述处理单元执行权利要求1~6任一权利要求所述方法的步骤。
  14. 一种计算机可读介质,其特征在于,其存储有可由终端设备执行的计算机程序,当所述程序在终端设备上运行时,使得所述终端设备执行权利要求1~6任一所述方法的步骤。
  15. 一种电子设备,其特征在于,包括处理器、存储器、收发器、总线接口,其中处理器、存储器与收发器之间通过总线连接;
    所述收发器,用于生成区块,并向N个记账节点中的其他记账节点广播所述记账节点的验证信息,所述N个记账节点是根据M个竞选节点广播的竞选请求中携带的币龄信息确定的,M大于等于1,N大于等于1,M大于等于N;
    所述处理器,用于读取所述存储器中的程序,执行下列方法:接收所述其他记账节点广播的确认信息,并对所述其他记账节点广播的确认信息进行验证,其中,所述其他记账节点广播的确认信息是第一记账节点在接收的第二记账节点的准备信息满足第一设定条件时生成并广播的;所述第二记账节点的准备信息是所述第二记账节点在对所述记账节点的验证信息验证通过时生成并广播的;所述第一记账节点和所述第二记账节点为所述其他记账节点中的任一个;在接收的所述其他记账节点广播的确认信息满足第二设定条件 时,将所述区块添加至区块链。
    所述存储器,用于存储一个或多个可执行程序,可以存储所述处理器在执行操作时所使用的数据。
  16. 如权利要求15所述的电子设备,其特征在于,所述处理器,还用于:
    接收所述其他记账节点广播的准备信息,并进行验证;在接收的所述其他记账节点的准备信息满足所述第一设定条件时,生成所述记账节点的确认信息并广播。
  17. 如权利要求16所述的电子设备,其特征在于,所述收发器,还用于:
    接收所述第一记账节点广播的确认信息及所述记账节点广播的确认信息;
    所述处理器,还用于:在接收的确认信息满足所述第二设定条件时,将所述区块添加至区块链。
  18. 如权利要求15所述的电子设备,其特征在于,所述处理器,还用于:
    在确定接收的所述确认信息验证不通过时,将广播所述确认信息的记账节点确定为故障节点并广播第一故障节点移除请求;接收第二故障节点移除请求,并对所述第二故障节点移除请求进行验证,所述第二故障节点移除请求是所述其他记账节点确定接收的所述第一故障节点移除请求验证通过后生成并广播的;
    所述收发器,还用于在接收的所述第二故障节点移除请求满足第四设定条件时,广播记账节点重选请求,以使非记账节点在接收到所述记账节点重选请求后广播竞选请求参与记账节点竞争。
  19. 如权利要求15至18任一项所述的电子设备,其特征在于,所述记账节点为主记账节点,所述其它记账节点为备份记账节点,所述主记账节点是所述N个记账节点中在竞选请求时携带的币龄信息最大的记账节点,所述备份记账节点是所述N个记账节点中除所述主记账节点之外的记账节点。
  20. 一种电子设备,其特征在于,包括:处理器、存储器、收发器和总线接口,其中,处理器、存储器、收发器和总线接口之间通过总线连接;
    所述收发器,用于接收M个竞选节点广播的竞选请求,并按照所述M个竞选节点广播的竞选请求中携带的币龄信息从所述M个竞选节点中确定N个竞选节点;生成竞选结果信息并广播,所述竞选结果信息包括所述N个竞选节点;
    所述处理器,用于在接收的其他节点发送的竞选结果信息满足第三设定条件时,将所述竞选结果信息中的N个竞选节点确定为记账节点。
  21. 一种非暂态计算机可读存储介质,其特征在于,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令用于使所述计算机执行权利要求1~6任一所述方法。
  22. 一种计算机程序产品,其特征在于,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行权利要求1~6任一所述方法。
PCT/CN2019/073232 2018-05-03 2019-01-25 一种区块链共识方法、记账节点及节点 WO2019210714A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2020561790A JP7138726B2 (ja) 2018-05-03 2019-01-25 ブロックチェーンコンセンサス方法、アカウンティングノードおよびノード
US17/044,000 US11830001B2 (en) 2018-05-03 2019-01-25 Blockchain consensus method, accounting node and node
KR1020207034671A KR102469267B1 (ko) 2018-05-03 2019-01-25 블록 체인 합의 방법, 어카운팅 노드 및 노드

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810414927.8A CN108848055B (zh) 2018-05-03 2018-05-03 一种区块链共识方法、记账节点及节点
CN201810414927.8 2018-05-03

Publications (1)

Publication Number Publication Date
WO2019210714A1 true WO2019210714A1 (zh) 2019-11-07

Family

ID=64212561

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/073232 WO2019210714A1 (zh) 2018-05-03 2019-01-25 一种区块链共识方法、记账节点及节点

Country Status (5)

Country Link
US (1) US11830001B2 (zh)
JP (1) JP7138726B2 (zh)
KR (1) KR102469267B1 (zh)
CN (1) CN108848055B (zh)
WO (1) WO2019210714A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113014635A (zh) * 2021-02-19 2021-06-22 卓尔智联(武汉)研究院有限公司 区块链系统的节点类型划分方法、装置及区块链系统

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108848055B (zh) 2018-05-03 2020-06-23 中国银联股份有限公司 一种区块链共识方法、记账节点及节点
CN109936486B (zh) * 2019-01-02 2021-11-26 平安科技(深圳)有限公司 基于区块链的自动拨测方法、装置、设备和存储介质
CN109741039B (zh) * 2019-01-07 2021-01-19 深圳市红砖坊技术有限公司 记账方法、矿池服务器、终端设备、挖矿节点及矿池
CN110113383B (zh) * 2019-04-10 2021-08-24 广东工业大学 一种缓解PoS机制下记账权中心化的共识机制实现方法
CN112016012B (zh) * 2019-05-30 2023-09-08 中国移动通信集团浙江有限公司 资源服务质量智能拨测方法及装置
CN112116346A (zh) * 2019-06-20 2020-12-22 北京威宁特科技有限公司 快速确认交易的区块链和区块链上快速确认交易方法
CN110322352A (zh) * 2019-07-09 2019-10-11 深圳市炳德区块链技术有限公司 一种基于区块链的账本建立及查询方法、电子设备
CN110335156A (zh) * 2019-07-09 2019-10-15 广东投盟科技有限公司 区块链的规则维护方法及其系统
US11095443B1 (en) * 2019-10-11 2021-08-17 Shape Security, Inc. Proof-of-work based on runtime compilation
CN111191294B (zh) * 2019-12-27 2022-05-24 诚镌科技(广州)有限公司 基于区块链的单节点记账方法、系统、设备和存储介质
CN111311263B (zh) * 2020-03-18 2021-07-16 广州知弘科技有限公司 区块链节点本地安全记账方法
CN111368008B (zh) 2020-05-27 2020-08-25 腾讯科技(深圳)有限公司 基于区块链的数据处理方法、装置、设备及可读存储介质
CN112020018B (zh) * 2020-08-26 2022-05-17 山东浪潮科学研究院有限公司 区块链记账组生成方法、共识方法及区块链系统
CN112288415B (zh) * 2020-12-24 2021-06-11 南京可信区块链与算法经济研究院有限公司 一种用于utxo架构的币龄机制实现方法
CN113382073B (zh) * 2021-06-08 2022-06-21 重庆邮电大学 一种在云边端工业控制系统中边缘节点的监督系统及方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150332283A1 (en) * 2014-05-13 2015-11-19 Nant Holdings Ip, Llc Healthcare transaction validation via blockchain proof-of-work, systems and methods
US20160218879A1 (en) * 2015-01-23 2016-07-28 Daniel Robert Ferrin Method and apparatus for the limitation of the mining of blocks on a block chain
CN107124403A (zh) * 2017-04-14 2017-09-01 朱清明 区块链中共识区块的生成方法与计算设备
CN107231299A (zh) * 2017-06-07 2017-10-03 众安信息技术服务有限公司 一种链路由及实现区块链跨链通信的系统
CN108848055A (zh) * 2018-05-03 2018-11-20 中国银联股份有限公司 一种区块链共识方法、记账节点及节点

Family Cites Families (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11182781B2 (en) * 2014-06-16 2021-11-23 Bank Of America Corporation Block chain encryption tags
US20150363778A1 (en) * 2014-06-16 2015-12-17 Bank Of America Corporation Cryptocurrency electronic payment system
US10275772B2 (en) * 2014-06-16 2019-04-30 Bank Of America Corporation Cryptocurrency risk detection system
US20150363769A1 (en) * 2014-06-16 2015-12-17 Bank Of America Corporation Cryptocurrency Real-Time Conversion System
US20150363782A1 (en) * 2014-06-16 2015-12-17 Bank Of America Corporation Cryptocurrency transaction validation system
US20150363777A1 (en) * 2014-06-16 2015-12-17 Bank Of America Corporation Cryptocurrency suspicious user alert system
US20150363770A1 (en) * 2014-06-16 2015-12-17 Bank Of America Corporation Cryptocurrency Transaction Payment System
US10127552B2 (en) * 2014-06-16 2018-11-13 Bank Of America Corporation Cryptocurrency aggregation system
US10255600B2 (en) * 2014-06-16 2019-04-09 Bank Of America Corporation Cryptocurrency offline vault storage system
US20150363772A1 (en) * 2014-06-16 2015-12-17 Bank Of America Corporation Cryptocurrency online vault storage system
CN107145768B (zh) 2016-03-01 2021-02-12 华为技术有限公司 版权管理方法和系统
US10360191B2 (en) * 2016-10-07 2019-07-23 International Business Machines Corporation Establishing overlay trust consensus for blockchain trust validation system
KR101848896B1 (ko) * 2016-10-19 2018-04-13 한전케이디엔 주식회사 블록체인을 이용한 선불형 전력 판매 및 전력 사용 방법
US10554746B2 (en) * 2016-11-14 2020-02-04 International Business Machines Corporation Decentralized immutable storage blockchain configuration
US20180247191A1 (en) * 2017-02-03 2018-08-30 Milestone Entertainment Llc Architectures, systems and methods for program defined entertainment state system, decentralized cryptocurrency system and system with segregated secure functions and public functions
US20200067697A1 (en) * 2017-03-22 2020-02-27 NEC Laboratories Europe GmbH Method for operating a blockchain
CN109792437B (zh) * 2017-05-16 2021-01-12 北京大学深圳研究生院 一种用于去中心化域名系统的共识方法
CN107423978A (zh) * 2017-06-16 2017-12-01 郑州大学 一种基于联盟区块链的分布式能源交易认证方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150332283A1 (en) * 2014-05-13 2015-11-19 Nant Holdings Ip, Llc Healthcare transaction validation via blockchain proof-of-work, systems and methods
US20160218879A1 (en) * 2015-01-23 2016-07-28 Daniel Robert Ferrin Method and apparatus for the limitation of the mining of blocks on a block chain
CN107124403A (zh) * 2017-04-14 2017-09-01 朱清明 区块链中共识区块的生成方法与计算设备
CN107231299A (zh) * 2017-06-07 2017-10-03 众安信息技术服务有限公司 一种链路由及实现区块链跨链通信的系统
CN108848055A (zh) * 2018-05-03 2018-11-20 中国银联股份有限公司 一种区块链共识方法、记账节点及节点

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LIU, X.: "Research on Performance Improvement of Blockchain Based on Dynamic Authorization of Byzantine Fault Tolerance Consensus Algorithm", INFORMATION AND TECHNOLOGY, CHINA MASTER'S THESES FULL-TEXT DATABASE, no. 1, 15 January 2018 (2018-01-15), pages 26-27-38 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113014635A (zh) * 2021-02-19 2021-06-22 卓尔智联(武汉)研究院有限公司 区块链系统的节点类型划分方法、装置及区块链系统

Also Published As

Publication number Publication date
KR20210006934A (ko) 2021-01-19
US20210035095A1 (en) 2021-02-04
CN108848055A (zh) 2018-11-20
CN108848055B (zh) 2020-06-23
JP2021521555A (ja) 2021-08-26
US11830001B2 (en) 2023-11-28
KR102469267B1 (ko) 2022-11-22
JP7138726B2 (ja) 2022-09-16

Similar Documents

Publication Publication Date Title
WO2019210714A1 (zh) 一种区块链共识方法、记账节点及节点
TWI754133B (zh) 基於中心化與去中心化的雙重交易方法及系統
US10657526B2 (en) System and method to dynamically setup a private sub-blockchain based on agility of transaction processing
CN108648078B (zh) 一种交易预处理方法、装置及电子设备
EP4053711A1 (en) Consensus method for blockchain, and consensus node, electronic device and storage medium
CN109493204B (zh) 基于区块链的业务记账方法及终端设备
TWI727467B (zh) 聯盟鏈的可信度驗證方法、系統、裝置及設備
US11108541B1 (en) Methods and apparatuses for executing smart contract of blockchain, and electronic devices
WO2023016428A1 (zh) 一种拜占庭容错方法、装置、电子设备及存储介质
CN111414373A (zh) 一种共识方法和共识系统
US11403281B2 (en) Parallel blockchain processing
WO2023040453A1 (zh) 一种交易信息处理方法及装置
CN111985007A (zh) 一种基于区块链的合同签署与执行方法及装置
CN109325744B (zh) 支付处理方法、装置、介质及电子设备
CN111260488A (zh) 一种数据处理方法、装置及可读存储介质
US20220224541A1 (en) Preventing an incorrect transmission of a copy of a record of data to a distributed ledger system
US20210073197A1 (en) Byzantine consensus without centralized ordering
JP2020204898A (ja) 分散台帳システムの運用管理方法、分散台帳システムの運用管理システム、および分散台帳システムの運用管理プログラム
CN110532810B (zh) 信息处理方法、装置、电子设备及可读存储介质
CN111125240A (zh) 一种分布式事务实现方法、装置、电子设备及存储介质
CN112308700A (zh) 企业征信数据的处理方法、装置、计算机设备和存储介质
WO2020024473A1 (zh) 一种实现数字凭证交易记录整合的方法和装置
WO2020024474A1 (zh) 一种支持数字凭证交易的方法和装置
CN113592645B (zh) 数据验证的方法和装置
CN113835780A (zh) 一种事件响应方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19796496

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020561790

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 20207034671

Country of ref document: KR

Kind code of ref document: A

122 Ep: pct application non-entry in european phase

Ref document number: 19796496

Country of ref document: EP

Kind code of ref document: A1