WO2020216280A1 - 一种区块处理方法和节点以及系统 - Google Patents
一种区块处理方法和节点以及系统 Download PDFInfo
- Publication number
- WO2020216280A1 WO2020216280A1 PCT/CN2020/086351 CN2020086351W WO2020216280A1 WO 2020216280 A1 WO2020216280 A1 WO 2020216280A1 CN 2020086351 W CN2020086351 W CN 2020086351W WO 2020216280 A1 WO2020216280 A1 WO 2020216280A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- node
- transaction
- candidate block
- block
- transaction information
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/382—Payment protocols; Details thereof insuring higher security of transaction
- G06Q20/3825—Use of electronic signatures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/461—Saving or restoring of program or task context
- G06F9/463—Program control block organisation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/3236—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
- H04L9/3239—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/466—Transaction processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/542—Event management; Broadcasting; Multicasting; Notifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/382—Payment protocols; Details thereof insuring higher security of transaction
- G06Q20/3827—Use of message hashing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/40—Authorisation, 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/401—Transaction verification
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/02—Details
- H04L12/16—Arrangements for providing special services to substations
- H04L12/18—Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
- H04L12/1854—Arrangements for providing special services to substations for broadcast or conference, e.g. multicast with non-centralised forwarding system, e.g. chaincast
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
- H04L67/1087—Peer-to-peer [P2P] networks using cross-functional networking aspects
- H04L67/1089—Hierarchical topologies
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/06—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
- H04L9/0643—Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/50—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
Definitions
- This application relates to the field of computer technology, and in particular to a block processing method, node and system.
- the user can initiate a transaction through the client, and all transaction information recorded in the transaction will be packaged into a block for storage.
- blocks are linked to each other to form a blockchain, which is also called a ledger.
- the block chain is an open network ledger, and the block chain can include multiple blocks (Block).
- Blockchain has many forms, for example, it can include public chain, private chain and consortium chain. Public chain can include: Bitcoin series, Ethereum series, etc.
- node 1 When a new transaction arrives at a certain node in the blockchain (such as node 1), the node 1 first checks whether the transaction is legal, and then puts the legal transaction in the local transaction pool and sends it to other nodes in the blockchain Broadcast transaction information.
- the node 1 obtains the transaction list from the transaction pool, then packs the transaction list into a candidate block, signs the candidate block, and then prepares it through the blockchain The selected block is broadcasted.
- All nodes in the blockchain make a consensus on the candidate block received, save the candidate block after the consensus is successful, and finally node 1 executes the transaction in the candidate block.
- the above block generation method When the above block generation method is applied to the public chain, it can ensure the security of the underlying data of the block chain. But in alliance chains and private chains, the verification of security factors can be divided into multiple layers, not limited to the bottom layer of the blockchain. If the aforementioned block generation method is used as a consortium chain or private chain, there is a problem that the time required for block generation is too long, resulting in transactions that cannot be processed in time and lead to accumulation, which is likely to cause block chain congestion problems.
- the embodiments of the present application provide a block processing method, node, and system, which can be used to improve the speed of block generation and the performance of transaction processing.
- an embodiment of the present application provides a block processing method, the method is executed by a first node in a blockchain, the blockchain further includes a second node, and the first node is a leader node , The second node is a slave node, and the method includes:
- the first node packs the first transaction information in the transaction queue of the first node into a candidate block, and broadcasts the candidate block through the blockchain;
- the first node verifies the first transaction information in the candidate block to generate a first verification result, and executes the first transaction information in the candidate block to generate a first transaction execution result;
- the first node broadcasts the processing result of the first node through the blockchain, and the processing result of the first node includes: the first verification result and the first transaction execution result;
- the first node receives the second node processing result broadcast by the second node through the blockchain, and the second node processing result includes: the second node verifies the data in the candidate block A second verification result generated by the first transaction information, and a second transaction execution result generated by executing the first transaction information in the candidate block;
- the first node makes a consensus on the candidate block according to the processing result of the first node and the processing result of the second node, and then the first node saves the candidate block when the consensus of the candidate block succeeds.
- a candidate block and save the first transaction execution result when the first transaction information is successfully executed.
- an embodiment of the present application provides a block processing method, the method is executed by a second node in the blockchain, the blockchain further includes a first node, and the first node is a leader node , The second node is a slave node, and the method includes:
- the second node verifies the first transaction information in the candidate block to generate a second verification result, and executes the first transaction information in the candidate block to generate a second transaction execution result;
- the second node broadcasts the processing result of the second node through the blockchain, and the processing result of the second node includes: the second verification result and the second transaction execution result;
- the second node saves the candidate block when the first transaction information is successfully verified, and saves the second transaction execution result when the first transaction information is successfully executed.
- an embodiment of the present application provides a block processing method, the method is executed by a first node in a blockchain, the blockchain further includes a second node, and the first node is a leader node , The second node is a slave node, and the method includes:
- the first node In response to at least one client sending transaction information to the blockchain, the first node puts the transaction information sent by the client into the transaction queue of the first node;
- the first node checks whether the transaction queue meets a preset block generation condition
- the first node packs the first transaction information in the transaction queue of the first node into a candidate block, and signs the candidate block , And then broadcast the candidate block through the blockchain;
- the first node verifies the first transaction information in the candidate block to generate a first verification result, and executes the first transaction information in the candidate block to generate a first transaction execution result;
- the first node signs the processing result of the first node, and then broadcasts the processing result of the first node through the blockchain.
- the processing result of the first node includes: the first verification result and the first node 1. Transaction execution result;
- the first node receives the second node processing result broadcast by the second node through the blockchain, and the second node processing result includes: the second node verifies the data in the candidate block A second verification result generated by the first transaction information, and a second transaction execution result generated by executing the first transaction information in the candidate block;
- the first node agrees on the candidate block through the distributed consensus algorithm according to the processing result of the first node and the processing result of the second node, and then the first node is in the candidate area
- the candidate block is saved when the block consensus is successful, and the first transaction execution result is saved when the first transaction information is successfully executed.
- an embodiment of the present application provides a block processing method, the method is executed by a second node in the blockchain, the blockchain further includes a first node, and the first node is a leader node , The second node is a slave node, and the method includes:
- the second node verifies the first transaction information in the candidate block to generate a second verification result, and executes the first transaction information in the candidate block to generate a second transaction execution result;
- the second node signs the processing result of the second node, and then broadcasts the processing result of the second node through the blockchain.
- the processing result of the second node includes: the second verification result and the first 2. Transaction execution results;
- the second node saves the candidate block when the first transaction information is successfully verified, and saves the second transaction execution result when the first transaction information is successfully executed.
- an embodiment of the present application also provides a blockchain node, where the blockchain node is the first node in the blockchain, and the blockchain further includes a second node, and the first node is The leader node, the second node is a slave node, and the first node includes: a processing module and a transceiver module, wherein,
- the processing module is configured to package the first transaction information in the transaction queue of the first node into a candidate block
- the transceiver module is configured to broadcast the candidate block through the blockchain
- the processing module is further configured to verify the first transaction information in the candidate block to generate a first verification result, and execute the first transaction information in the candidate block to generate a first transaction execution result;
- the transceiver module is further configured to broadcast the processing result of the first node through the blockchain, and the processing result of the first node includes: the first verification result and the first transaction execution result;
- the transceiver module is further configured to receive a second node processing result broadcast by the second node through the blockchain, and the second node processing result includes: the second node verifies the candidate area A second verification result generated by the first transaction information in the block, and a second transaction execution result generated by executing the first transaction information in the candidate block;
- the processing module is further configured to make a consensus on the candidate block according to the processing result of the first node and the processing result of the second node, and then the first node performs a consensus on the candidate block when the consensus is successful Saving the candidate block, and saving the execution result of the first transaction when the execution of the first transaction information is successful.
- an embodiment of the present application also provides a blockchain node, the blockchain node is a second node in the blockchain, the blockchain further includes a first node, and the first node is The leader node, the second node is a slave node, and the second node includes: a processing module and a transceiver module, wherein,
- the transceiver module is configured to receive the candidate block broadcast by the first node through the blockchain;
- the processing module is configured to obtain first transaction information from the candidate block
- the processing module is also used to verify the first transaction information in the candidate block to generate a second verification result, and execute the first transaction information in the candidate block to generate a second transaction execution result;
- the transceiver module is further configured to broadcast the processing result of the second node through the blockchain, and the processing result of the second node includes: the second verification result and the second transaction execution result;
- the processing module is further configured to save the candidate block when the first transaction information is successfully verified, and save the second transaction execution result when the first transaction information is successfully executed.
- an embodiment of the present application also provides a blockchain node, the blockchain node is the first node in the blockchain, and the blockchain further includes a second node, and the first node is The leader node, the second node is a slave node, and the first node includes: a processing module and a transceiver module, wherein,
- the processing module is configured to respond to at least one client sending transaction information to the blockchain, and put the transaction information sent by the client into the transaction queue of the first node;
- the processing module is used to check whether the transaction queue meets preset block generation conditions
- the transceiver module is configured to package the first transaction information in the transaction queue of the first node into a candidate block in response to the transaction queue meeting the block-producing condition, and to check the candidate block Sign, and then broadcast the candidate block through the blockchain;
- the processing module is configured to verify the first transaction information in the candidate block to generate a first verification result, and execute the first transaction information in the candidate block to generate a first transaction execution result ;
- the transceiver module is configured to sign the processing result of the first node, and then broadcast the processing result of the first node through the blockchain.
- the processing result of the first node includes: the first verification result and the State the first transaction execution result;
- the transceiver module is configured to receive a second node processing result broadcast by the second node through the blockchain, and the second node processing result includes: the second node verifies the candidate block A second verification result generated by the first transaction information in the candidate block, and a second transaction execution result generated by executing the first transaction information in the candidate block;
- the processing module is configured to perform a consensus on the candidate block through the distributed consensus algorithm according to the processing result of the first node and the processing result of the second node, and then the consensus is successful in the candidate block Save the candidate block at the time, and save the execution result of the first transaction when the execution of the first transaction information is successful.
- an embodiment of the present application also provides a blockchain node, the blockchain node is a second node in the blockchain, the blockchain further includes a first node, and the first node is The leader node, the second node is a slave node, and the second node includes: a processing module and a transceiver module, wherein,
- the transceiver module is configured to receive the candidate block broadcast by the first node through the blockchain, and obtain first transaction information from the candidate block;
- the processing module is configured to verify the first transaction information in the candidate block to generate a second verification result, and execute the first transaction information in the candidate block to generate a second transaction execution result ;
- the transceiver module is configured to sign the processing result of the second node, and then broadcast the processing result of the second node through the blockchain.
- the processing result of the second node includes: the second verification result and the The second transaction execution result;
- the processing module is configured to save the candidate block when the first transaction information is successfully verified, and save the second transaction execution result when the first transaction information is successfully executed.
- an embodiment of the present application provides a blockchain node, the blockchain node is the first node in the blockchain, and the first node includes: a processor and a memory; the memory is used for storing instructions; and processing The processor is used to execute instructions in the memory, so that the first node executes the block processing method on the first node side.
- an embodiment of the present application provides a blockchain node, the blockchain node is a second node in the blockchain, and the second node includes: a processor and a memory; the memory is used for storing instructions; and processing The processor is used to execute instructions in the memory, so that the second node executes the block processing method on the second node side.
- an embodiment of the present application provides a block processing system, the block processing system includes: a first node and a second node;
- the first node is used to execute the block processing method on the first node side;
- the second node is used to execute the block processing method on the second node side.
- an embodiment of the present application provides a computer-readable storage medium that stores instructions in the computer-readable storage medium, which when run on a computer, causes the computer to execute the methods described in the above aspects.
- the embodiments of the present application provide a computer program product, which when the computer program product runs on a computer, causes the computer to execute the above method.
- the first node packs the first transaction information in the transaction queue of the first node into the candidate block, and passes The block chain broadcasts the candidate block, and then the first node verifies the first transaction information in the candidate block to generate the first verification result, and executes the first transaction information in the candidate block to generate the first transaction information
- a transaction execution result then the first node broadcasts the processing result of the first node through the blockchain, the processing result of the first node includes: the first verification result and the first transaction execution result, and then the first node receives the second The node processes the result of the second node broadcast by the blockchain.
- the first node makes a consensus on the candidate block according to the processing result of the first node and the second node. Then the first node saves the backup when the consensus of the candidate block succeeds. Select the block, and save the execution result of the first transaction when the execution of the first transaction information is successful.
- the first node serves as the leader node.
- the first node can buffer the transaction information to be processed through the transaction queue, and package the transaction information in the transaction queue into the candidate block before broadcasting the candidate area. Block, so that the slave nodes in the blockchain can perform transaction verification and transaction execution.
- the first node After broadcasting the candidate block, the first node can perform the following processing: transaction verification and transaction execution, and then the first node can broadcast the first node For the processing result, the first node makes a consensus on the candidate block according to the processing result of each node in the blockchain, and then executes the block save when the consensus is successful.
- the order of block generation is changed, so that all nodes in the blockchain can perform transaction verification and transaction execution, so that the speed of block generation and the performance of transaction processing can be improved.
- FIG. 1 is a schematic diagram of a blockchain system provided by an embodiment of the application
- FIG. 2 is a schematic diagram of a block structure provided by an embodiment of the application.
- FIG. 3 is a schematic diagram of the composition structure of a block processing system provided by an embodiment of the application.
- FIG. 4 is a schematic diagram of an interaction process between a leader node and a subordinate node provided by an embodiment of the application;
- FIG. 5 is a schematic block diagram of the flow of a block processing method executed by a leader node according to an embodiment of the application
- FIG. 6 is a block diagram of a block processing method of a block processing method executed by a slave node according to an embodiment of the application;
- FIG. 7 is a schematic diagram of an application scenario of a block generation process provided by an embodiment of the application.
- FIG. 8 is a schematic diagram of a Raft data submission process provided by an embodiment of the application.
- Figure 9 is a schematic diagram of a Bft-Raft data submission process provided by an embodiment of the application.
- FIG. 10 is a schematic diagram of the composition structure of a first node provided by an embodiment of this application.
- FIG. 11 is a schematic diagram of the composition structure of a second node provided by an embodiment of this application.
- FIG. 12 is a schematic diagram of the composition structure of a block processing method provided by an embodiment of the application applied to a server.
- the embodiments of the present application provide a block processing method, node, and system for improving the speed of block generation and the performance of transaction processing.
- the blockchain system is a data sharing system, that is, a system for data sharing between nodes. As shown in FIG. 1, it shows a schematic diagram of a blockchain system 100 provided by an embodiment of the present application.
- the blockchain system 100 may include multiple nodes 110 (also referred to as “blockchain nodes”), each node 110 can receive input information during normal work, and maintain the block based on the received input information Shared data within the chain system 100.
- each node 110 in the blockchain system 100 may have a direct or indirect information connection, and the nodes 110 may transmit information through the above-mentioned information connection.
- any node in the blockchain system 100 receives input information
- other nodes in the blockchain system 100 obtain the input information according to the consensus algorithm, and store the input information as data in the shared data, so that The data stored on all nodes in the blockchain system 100 are consistent.
- Each node 110 in the blockchain system 100 has a corresponding node identifier, and each node 110 in the blockchain system 100 can store the node identifiers of other nodes in the blockchain system 100, so that Subsequently, the generated block is broadcast to other nodes in the blockchain system according to the node identifiers of other nodes.
- Each node can maintain a node identification list as shown in the following table, and store the node name and node identification correspondingly in the node identification list.
- the node identifier may be an IP (Internet Protocol, protocol for interconnection between networks) address and any other information that can be used to identify the node. Table 1 only uses the IP address as an example for illustration.
- Each node 101 in the blockchain system 100 stores an identical blockchain.
- the blockchain is composed of multiple blocks. See Figure 2.
- the blockchain 200 is composed of multiple blocks 201.
- the founding block includes a block header and a block body.
- the block header stores the input information feature value, version number, Timestamp and difficulty value, the input information is stored in the block body; the next block of the founding block takes the founding block as the parent block, the next block also includes the block header and the block body, and the current block is stored in the block header.
- the block data stored in the block is related to ensure the security of the input information in the block.
- Figure 2 is an optional schematic diagram of a block structure provided by an embodiment of the present application.
- the node where the blockchain is located receives input information, verifies the input information, and stores the input information in the memory pool after the verification is completed. , And update the hash tree used to record the input information; after that, update the update timestamp to the time when the input information is received, and try different random numbers, and perform the feature value calculation multiple times, so that the calculated feature value can be Meet the following formula:
- SHA256 is the feature value algorithm used to calculate the feature value
- version (version number) is the version information of the relevant block protocol in the blockchain
- prev_hash is the block header feature value of the parent block of the current block
- merkle_root is the input information
- Ntime is the update time of the update timestamp
- nbits is the current difficulty, which is a fixed value within a period of time, and is determined again after a fixed period of time
- x is a random number
- TARGET is the characteristic value threshold, this feature The value threshold can be determined based on nbits.
- the node where the blockchain is located sends the newly generated blocks to other nodes in the blockchain system where it is located according to the node identifiers of other nodes in the blockchain system, and the other nodes perform the processing on the newly generated blocks. Verify, and add the newly generated block to its stored blockchain after verification.
- the block processing system may include at least two block chain nodes.
- the first node is a leader node
- the second node is a follower node.
- the first node and the second node can communicate with each other, for example, through a wireless network or a wired network.
- the leader node and the subordinate node can be determined by node role selection. For example, the Raft algorithm is run from all the nodes of the blockchain, and the leader node and the follower node are elected.
- the Raft algorithm is a distributed consensus algorithm that ensures that multiple nodes reach agreement on the state.
- the node is either in the Leader role or the Follower role, and the Follower role follows the Leader role.
- the algorithm used for node role selection in the embodiments of this application is not limited to the Raft algorithm.
- a BFT (Byzantine Fault Tolerance) algorithm can also be used for node role selection, such as PBFT (Practical Byzantine Fault Tolerance). , Practical Byzantine Fault Tolerance) algorithms, etc., are not limited here.
- the block processing method provided by an embodiment of the present application may be Including the following steps:
- the first node packs the first transaction information in the transaction queue of the first node into the candidate block, and transfers the backup through the blockchain
- the selected block is broadcasted.
- one leader node and at least one subordinate node can be determined by node role selection in the blockchain.
- the first node can manage a transaction queue, which is used to store transaction information sent by the client.
- the transaction information may also be referred to as a transaction.
- the first node packs the first transaction information in the transaction queue of the first node into a candidate block, where the candidate block is a block to be written to the blockchain ledger, and the first transaction information is packed into
- the first node can broadcast the candidate block through the blockchain.
- all nodes in the blockchain including the slave nodes and the leader) Node
- the first node may also sign the candidate block or the first transaction information to prevent the information being broadcast from being tampered with.
- the second node receives the candidate block broadcast by the first node through the blockchain, and obtains the first transaction information from the candidate block.
- the second node in the blockchain when the first node broadcasts the candidate block through the blockchain, the second node in the blockchain can receive the candidate block broadcast by the first node through the blockchain, and it is not limited However, other slave nodes in the blockchain can also receive the candidate block.
- the third node in the blockchain can also receive the candidate block sent by the first node.
- the processing of candidate blocks and transaction information by the second node is taken as an example.
- Other subordinate nodes in the blockchain can also refer to the execution process of the second node, which is not limited here.
- the second node may obtain the first transaction information packaged by the first node into the candidate block from the candidate block.
- the second node verifies the first transaction information in the candidate block to generate a second verification result, and executes the first transaction information in the candidate block to generate a second transaction execution result.
- the second node may verify the first transaction information, and may also perform a transaction execution operation on the first transaction information.
- the verification performed by the second node on the first transaction information may also be referred to as legality verification.
- the legitimacy verification may include at least one of the following verification methods: verifying the transaction data format and parameters, verifying whether there are duplicate transactions in the transaction list, verifying whether the input of the transaction is legal and double-spending, and verifying the transaction. Whether the signature is correct, check whether the input amount of the transaction is greater than or equal to the output amount.
- the execution of the first transaction information by the second node can generate the second transaction execution result. There can be multiple scenarios for executing the transaction, which are not limited here.
- the first node verifies the first transaction information in the candidate block to generate a first verification result, and executes the first transaction information in the candidate block to generate the first transaction execution result.
- the first node may verify the first transaction information, and may also perform a transaction execution operation on the first transaction information.
- the verification performed by the first node on the first transaction information may also be referred to as legality verification.
- the legitimacy verification may include at least one of the following verification methods: verifying the transaction data format and parameters, verifying whether there are duplicate transactions in the transaction list, verifying whether the input of the transaction is legal and double-spending, and verifying the transaction. Whether the signature is correct, check whether the input amount of the transaction is greater than or equal to the output amount.
- the execution of the first transaction information by the first node can generate the first transaction execution result, and there may be multiple scenarios for executing the transaction, which are not limited here.
- the first node broadcasts the processing result of the first node through the blockchain, and the processing result of the first node includes: a first verification result and a first transaction execution result.
- the first node may generate the first node processing result, and the first node processing result includes: the first verification result and the first transaction execution result.
- the first node broadcasts the processing result of the first node through the blockchain, and all nodes in the blockchain (including slave nodes and leader nodes) can receive the processing result of the first node.
- the second node broadcasts the processing result of the second node through the blockchain, and the processing result of the second node includes: a second verification result and a second transaction execution result.
- the second node may generate a second node processing result, and the second node processing result includes: a second verification result and a second transaction execution result.
- the second node broadcasts the processing result of the second node through the blockchain, and all nodes in the blockchain (including slave nodes and leader nodes) can receive the processing result of the second node.
- step 202 to step 203 and the execution order of step 211 to step 213 in the foregoing embodiment are not distinguished from each other.
- FIG. 2 is only a feasible implementation solution, and is not a reference to the embodiment of this application. limited.
- the first node receives the second node processing result broadcast by the second node through the blockchain, and the second node processing result includes: a second check generated by the second node by verifying the first transaction information in the candidate block The result, and the second transaction execution result generated by executing the first transaction information in the candidate block.
- the second node broadcasts the processing result of the second node through the blockchain
- the first node in the blockchain can receive the processing result of the second node broadcast by the second node through the blockchain.
- the first node makes a consensus on the candidate block according to the processing result of the first node and the processing result of the second node, and then the first node saves the candidate block when the consensus of the candidate block succeeds, and executes the first transaction information Save the first transaction execution result when successful.
- the first node receives the second node processing result broadcast by the second node through step 204, and the first node can agree on the candidate block according to the processing result of the first node and the processing result of the second node.
- the first node can use a distributed consensus algorithm for consensus.
- the distributed consensus algorithm can be the Raft algorithm.
- the distributed consensus algorithm in the embodiment of the application can also be the Bft-Raft algorithm.
- the Bft-Raft algorithm is a compatible Byzantine fault-tolerant Raft algorithm, Byzantine fault-tolerant (Bft) is used to deal with the unexpected failure behavior of nodes due to hardware errors, network failures and malicious attacks on network nodes.
- the first node makes a consensus on the candidate block, and then the first node saves the candidate block when the candidate block consensus is successful, thereby completing the block generation of the candidate block, and the first node returns
- the first transaction execution result may be saved when the first transaction information is successfully executed, so that the first transaction execution result corresponding to the first transaction information can be queried in the subsequent processing flow.
- the first node storing the candidate block when the candidate block consensus is successful includes:
- the first node saves the header information of the candidate block and the first transaction information that is successfully verified.
- the first transaction information is packaged in the candidate block. After the first node reaches a consensus on the candidate block, the first node can specifically save the candidate block's consensus when the candidate block consensus is successful. Header information, and save the first transaction information that is successfully verified.
- the header information of the candidate block is based on the data format of the candidate block, for example, it may include the hash value of the previous block, the root of the Merkel tree, the root of the state, the root of receipt, The node's signature, nonce, etc.
- the header information of the candidate block can be determined according to the application scenario, which is not limited here.
- the second node saves the candidate block when the first transaction information is successfully verified, and saves the second transaction execution result when the first transaction information is successfully executed.
- the second node can determine whether to save the candidate block according to whether the first transaction information is successfully verified. When the information verification is successful, the second node saves the candidate block to complete the generation of the candidate block. The second node can also save the second transaction execution result when the first transaction information is successfully executed, so that it can be used in the subsequent processing flow. The second transaction execution result corresponding to the first transaction information is queried.
- the first node packs the first transaction information in the transaction queue of the first node into the candidate node. Block, and broadcast the candidate block through the blockchain, and then the first node verifies the first transaction information in the candidate block to generate the first verification result, and executes the first in the candidate block
- the transaction information is used to generate the first transaction execution result, and then the first node broadcasts the processing result of the first node through the blockchain.
- the processing result of the first node includes: the first verification result and the first transaction execution result.
- a node receives the processing result of the second node broadcast by the second node through the blockchain.
- the first node makes a consensus on the candidate block according to the processing result of the first node and the processing result of the second node, and then the first node in the candidate block
- the candidate block is saved when the consensus is successful, and the first transaction execution result is saved when the first transaction information is successfully executed.
- the first node serves as the leader node.
- the first node can buffer the transaction information to be processed through the transaction queue, and package the transaction information in the transaction queue into the candidate block before broadcasting the candidate area. Block, so that the slave nodes in the blockchain can perform transaction verification and transaction execution.
- the first node After broadcasting the candidate block, the first node can perform the following processing: transaction verification and transaction execution, and then the first node can broadcast the first node For the processing result, the first node makes a consensus on the candidate block according to the processing result of each node in the blockchain, and then executes the block save when the consensus is successful.
- the order of block generation is changed, so that all nodes in the blockchain can perform transaction verification and transaction execution, so that the speed of block generation and the performance of transaction processing can be improved.
- an embodiment of the present application provides a block processing method, which mainly includes the following steps:
- the first node receives transaction information sent by at least one client to the blockchain.
- the above step 301 can also be replaced with the following step: the first node receives the transaction information obtained by the second node from at least one client.
- At least one client terminal may send the transaction information to the blockchain, for example, to the first node in the blockchain, or Send to the second node, the specific application scenario can be used to determine which transaction information transmission method to use. If the client sends the transaction information directly to the first node, the first node receives at least one client sent to the blockchain Trading Information. If the client sends transaction information directly to the second node, and the second node as a slave node receives the transaction information from the client, the second node sends the transaction information to the first node, and the first node can receive the transaction information from the second node. Transaction information obtained by at least one client.
- the first node puts the transaction information of at least one client into the transaction queue.
- the first node maintains a transaction queue. After the first node obtains transaction information of at least one client, the first node puts the transaction information of at least one client into the transaction queue.
- the first node checks whether the transaction queue meets a preset block generation condition.
- the first node may pre-configure the block generation condition for the transaction queue, so that when new transaction information is stored in the transaction queue, it checks whether the transaction queue meets the preset block generation condition. Refers to the execution condition of whether to set the block. If the transaction queue meets the block generation condition, the first node executes the block generation process. If the transaction queue does not meet the block generation condition, the first node does not execute the block generation process and continues It is judged whether the block generation condition is satisfied, and the block generation process can be executed only when the block generation condition is satisfied.
- step 303 the first node checks whether the transaction queue meets the preset block generation conditions, including:
- the first node checks whether the number of transaction information stored in the transaction queue exceeds the first threshold value. If the number of transaction information exceeds the first threshold value, it is determined that the transaction queue meets the block generation condition. If the number of transaction information does not exceed the first threshold Threshold value, which determines that the transaction queue does not meet the block generation conditions.
- the first node counts the number of transaction information stored in the transaction queue, and the number of transaction information indicates the size of the transaction queue, and checks whether the number of transaction information meets a preset first threshold, which is Indicate the block threshold.
- the first threshold can be 1000. When the number of transaction information contained in the transaction queue reaches 1000, it is determined that the transaction queue meets the block condition and the number of transaction information contained in the transaction queue does not reach 1000 When it is determined that the transaction queue does not meet the block generation conditions.
- step 303 the first node checks whether the transaction queue meets the preset block generation conditions, including:
- the first node checks whether the amount of data stored in the transaction queue exceeds the second threshold. If the size of the data exceeds the second threshold, it is determined that the transaction queue meets the block generation conditions. If the size of the data does not exceed the second threshold , Determine that the transaction queue does not meet the block generation conditions.
- the first node counts the amount of data stored in the transaction queue, and the size of the data indicates the storage space capacity occupied by the transaction queue, and checks whether the size of the data meets the preset second threshold.
- the second threshold is Point out the block threshold.
- the second threshold can be 1 megabyte (M).
- step 303 the first node checks whether the transaction queue meets the preset block generation conditions, including:
- the first node checks whether the time difference between the transaction queue from the last block generation time to the current time exceeds the block generation time threshold, if the time difference exceeds the block generation time threshold, it is determined that the transaction queue meets the block generation conditions, if the time difference is The block generation time threshold is not exceeded, and it is determined that the transaction queue does not meet the block generation conditions.
- the first node can also count the number of block generations in the transaction queue, record a block generation time each time a block is generated in the transaction queue, and count the time difference between the last block generation time and the current time in real time, and check Whether the time difference exceeds the block generation time threshold, if the time difference exceeds the block generation time threshold, it is determined that the transaction queue meets the block generation condition; if the time difference does not exceed the block generation time threshold, it is determined that the transaction queue does not meet the block generation condition, for example
- the block generation time threshold can be 5 seconds.
- the first node packs the first transaction information in the transaction queue of the first node into the candidate block, and broadcasts the candidate block through the blockchain.
- the first node when the first node detects that the transaction queue meets the block generation condition, the first node packs the first transaction information in the transaction queue of the first node into a candidate block, and performs Broadcast so that all nodes in the blockchain can receive candidate blocks.
- the first node verifies the first transaction information in the candidate block to generate a first verification result, and executes the first transaction information in the candidate block to generate the first transaction execution result.
- the first node broadcasts the processing result of the first node through the blockchain, and the processing result of the first node includes: a first verification result and a first transaction execution result.
- the first node receives the second node processing result broadcast by the second node through the blockchain, and the second node processing result includes: a second check generated by the second node by verifying the first transaction information in the candidate block The result, and the second transaction execution result generated by executing the first transaction information in the candidate block.
- the first node makes a consensus on the candidate block according to the processing result of the first node and the processing result of the second node, and then the first node saves the candidate block when the consensus of the candidate block succeeds, and executes the first transaction information Save the first transaction execution result when successful.
- step 304 to step 308 in the embodiment of the present application is similar to the execution flow of step 202 to step 205 in the previous embodiment, and will not be repeated here.
- the block generation processing method provided in the embodiment of the present application may further include the following steps:
- the first node When the first transaction information is packaged into the candidate block, the first node will package the second transaction information in the transaction queue into the candidate block, and broadcast the candidate block through the blockchain;
- the first node verifies the second transaction information in the candidate block to generate a third verification result, and executes the second transaction information in the candidate block to generate the third transaction execution result;
- the first node broadcasts the processing result of the third node through the blockchain, and the processing result of the third node includes: the third verification result and the third transaction execution result;
- the first node receives the processing result of the fourth node broadcast by the second node through the blockchain, and the processing result of the fourth node includes: the fourth verification result generated by the second node by verifying the second transaction information in the candidate block, And the fourth transaction execution result generated by executing the second transaction information in the candidate block;
- the first node makes a consensus on the candidate block based on the processing result of the third node and the processing result of the fourth node, and then the first node saves the candidate block when the consensus of the candidate block is successful, and when the second transaction information is successfully executed Save the third transaction execution result.
- the first transaction information and the second transaction information are stored in the transaction queue of the first node.
- the first node can also simultaneously
- the second transaction information is packaged, verified, executed, agreed, saved, and so on. Therefore, in the block generation process in the embodiment of the present application, a block concurrent verification algorithm is used, so that there are no mutually dependent blocks that are concurrently verified and executed. Thereby further improving the efficiency of block production.
- the first node in the embodiments of the application serves as the leader node, and the first node can cache the transaction information to be processed through the transaction queue, and pack the transaction information in the transaction queue into The candidate block can be broadcasted, so that the slave nodes in the blockchain can perform transaction verification and transaction execution.
- the first node can perform the following processing: transaction verification and After the transaction is executed, the first node can broadcast the processing result of the first node.
- the first node makes a consensus on the candidate block according to the processing result of each node in the blockchain, and then executes the block save when the consensus is successful.
- the order of block generation is changed, so that all nodes in the blockchain can perform transaction verification and transaction execution, so that the speed of block generation and the performance of transaction processing can be improved.
- an embodiment of the present application provides a block processing method, which mainly includes the following steps:
- the second node receives the candidate block broadcast by the first node through the blockchain, and obtains the first transaction information from the candidate block .
- the second node verifies the first transaction information in the candidate block to generate a second verification result, and executes the first transaction information in the candidate block to generate a second transaction execution result.
- the second node broadcasts the processing result of the second node through the blockchain, and the processing result of the second node includes: a second verification result and a second transaction execution result.
- step 401 to step 403 in the embodiment of the present application is similar to the execution flow of step 211 to step 213 in the embodiment of FIG. 4, and will not be repeated here.
- the second node receives the processing result of the first node broadcast by the first node through the blockchain, and the processing result of the first node includes: a first check generated by the first node by verifying the first transaction information in the candidate block The result, and the first transaction execution result generated by executing the first transaction information in the candidate block.
- the subordinate nodes in the blockchain can also perform consensus.
- the second node receives the processing result of the first node broadcast by the first node through step 404, and the second node can make a consensus on the candidate block according to the processing result of the first node and the processing result of the second node.
- the second node can use The distributed consensus algorithm performs consensus.
- the distributed consensus algorithm may be the Raft algorithm.
- the distributed consensus algorithm in the embodiment of the present application may also be the Bft-Raft algorithm.
- the second node makes a consensus on the candidate block according to the processing result of the first node and the processing result of the second node.
- the consensus of the candidate block is successful, the following steps are triggered: the second node saves the backup when the first transaction information is successfully verified. Select the block, and save the second transaction execution result when the first transaction information is successfully executed.
- the second node can make a consensus on the candidate block.
- the second node saves the candidate block when the first transaction information is successfully verified, and in the first transaction
- the second transaction execution result is saved.
- the second node broadcasts the processing result of the second node, so that all nodes in the blockchain receive the node processing results of other nodes, and each node According to the received processing result of the node, it is judged whether the data can be submitted and saved, instead of relying on the notification of the first node, the correct execution of the first transaction information is guaranteed.
- step 403 after the second node in step 403 broadcasts the processing result of the second node through the blockchain, in addition to performing step 404 to step 405, the embodiment of the present application may also perform step 404 to step 405 Use the following alternative steps:
- the second node receives the notification message sent by the first node when the consensus on the candidate block is successful
- the second node triggers the execution of the following steps according to the notification message: the second node saves the candidate block when the first transaction information is successfully verified, and saves the second transaction execution result when the first transaction information is successfully executed.
- the first node can make a consensus on the candidate block.
- the first node broadcasts a notification message
- the second node in the blockchain can receive the notification message and determine the consensus based on the notification message If successful, the second node saves the candidate block when the first transaction information is successfully verified, and saves the second transaction execution result when the first transaction information is successfully executed.
- the block generation processing method provided in the embodiment of the present application may further include the following steps:
- the second node receives the candidate block broadcast by the first node through the blockchain, and obtains the second transaction information from the candidate block;
- the second node verifies the second transaction information in the candidate block to generate a fourth verification result, and executes the second transaction information in the candidate block to generate a fourth transaction execution result;
- the second node broadcasts the processing result of the fourth node through the blockchain, and the processing result of the fourth node includes: the fourth verification result and the fourth transaction execution result;
- the second node saves the candidate block when the second transaction information is successfully verified, and saves the fourth transaction execution result when the second transaction information is successfully executed.
- the first transaction information and the second transaction information are stored in the transaction queue of the first node.
- the first node can also simultaneously
- the second transaction information is packaged, verified, executed, agreed, and saved.
- the second node receives the broadcast of the first node, the second node can also verify and execute the second transaction information. Therefore, in the embodiment of the application In the process of block generation, the block concurrent verification algorithm is adopted to perform concurrent verification of blocks that are not dependent on each other, thereby further improving the efficiency of block generation.
- the first node in the embodiments of the application serves as the leader node, and the first node can cache the transaction information to be processed through the transaction queue, and package the transaction information in the transaction queue into the candidate first.
- the candidate block can be broadcast so that the second node can perform transaction verification and transaction execution, and then the second node can broadcast the processing result of the second node, so that the first node can process according to each node in the blockchain
- a consensus on candidate blocks is carried out, and block storage is executed when the consensus is successful.
- the order of block generation is changed, so that all nodes in the blockchain can perform transaction verification and transaction execution, so that the speed of block generation and the performance of transaction processing can be improved.
- the embodiment of the present application provides a new block generation scheme.
- the first node is specifically a leader node and the second node is specifically a follower node as an example.
- the unverified series of transactions can be packaged into a candidate block, and the leader node of the bft-Raft algorithm can be broadcast to the follower node.
- the leader node and the follower node are used as consensus nodes, and the candidate block can be verified in the process Verify and execute the transaction at the same time, mark the transaction verification execution result as successful or failed, and finally all consensus nodes agree on the verification result of the candidate block.
- all nodes save the candidate block and save the candidate block Marked as successful transactions, remove failed transactions.
- FIG. 7 is a schematic diagram of an application scenario of a block generation process provided in an embodiment of this application, which mainly includes the following processes:
- users can send transactions to the blockchain through the terminal.
- the leader node For transactions sent to the leader node, the leader node is directly placed in the transaction queue. Or, for the transaction sent to the follower node, the follower node forwards the transaction to the leader node, and then the leader node puts the transaction received from the follower node into the transaction queue.
- the leader node checks whether the transaction in the transaction queue meets the block generation requirement.
- the leader node packs the transactions in the transaction queue into candidate blocks, and broadcasts the signature to the follower node.
- the leader node checks whether the transaction queue meets the block generation requirements, for example, it can detect whether the number of transactions stored in the transaction queue or the size of the transaction data meets the block generation requirements. If the block generation requirements are met, the transactions in the transaction queue are packaged into candidate blocks, signed and broadcast. If the block generation requirements are not met, check whether the block generation time has arrived. If the block generation time is reached, the leader node packs the transactions in the transaction queue into candidate blocks, signs and broadcasts them.
- the consensus node in the blockchain network performs verification to the candidate block, including verification of the transaction list in the candidate block.
- the consensus node signs and broadcasts the verification result of the candidate block.
- the leader node and follower nodes are used as consensus nodes to verify the candidate blocks.
- the legality of the transaction list in the candidate block is verified, and the transaction is marked as legal or illegal, and the transaction is executed And generate transaction execution results, and cache the legal transaction execution results.
- the consensus node in the blockchain network performs BFT judgment on the result, and saves candidate blocks and legal transactions after reaching a consensus.
- the leader node and the follower node sign the respective verification results and execution results of the foregoing step S106, and broadcast them. Then the received node signature results are agreed upon by the Byzantine fault-tolerant algorithm (Bft).
- the node signature results include verification results and transaction execution results.
- the node After the leader node and the follower node agree on the signature result of the node successfully, the node saves the header information of the candidate block, saves the legal transaction in the candidate block, and saves the transaction execution result cached in the candidate block.
- saving the legal transactions in the candidate block refers to saving the original transaction data sent by the user (that is, the transaction execution result is not included here), and saving the transaction execution result refers to the state of the saved transaction execution result.
- header information of the candidate block is based on the data format of the block, including the hash value of the previous block (hash), Merkel tree root, state root, receipt root, and node information Signature, random value, etc.
- FIG. 8 a schematic diagram of the Raft data submission process provided by an embodiment of this application.
- L represents the leader node and F represents the follower node, which mainly includes the following processes:
- the fault tolerance technology of the Raft algorithm itself is based on the leader node.
- the follower node receives the leader node's data, it caches the data and returns the result to the leader node.
- the leader node receives the result from the follower node for fault tolerance judgment When the number of nodes that receive the same result is greater than 50%, the data is considered successful, and then the leader node notifies the follower node to save the data state.
- a schematic diagram of the Bft-Raft data submission process provided by this embodiment of the application mainly includes the following processes:
- Client 1 generates transaction 1 and sends it to the leader node.
- Client 2 generates transaction 2 and sends it to the slave node 1.
- the slave node 1 sends transaction 2 to the leader node.
- broadcast The block sends a broadcast response to 3 subordinate nodes, 3 subordinate nodes send a broadcast response to the blockchain, the leader node and 3 subordinate nodes submit the block, and the leader node and 3 subordinate nodes make a consensus.
- the leader node and the three subordinate nodes send a submission success message to the client 1, and the leader node and three subordinate nodes send a submission success message to the client 2.
- the fault-tolerant technology shown in the embodiment of FIG. 8 cannot handle the situation where the leader node does evil. Therefore, the Byzantine fault-tolerant technology is added in this application.
- the above-mentioned follower node broadcasts the result, so that all the blockchain network All nodes receive the signature results of other nodes, and each node judges whether the data can be submitted for storage according to the received signature results, instead of relying on the leader node's notification.
- the above steps S101 to S107 can also use the block concurrent verification technology, that is, there are multiple transactions in a block, in the block generation process, the block concurrent verification algorithm is used to change There is no concurrent execution of interdependent blocks.
- a first node 800 in a block chain provided by an embodiment of the present application, the block chain further includes a second node, the first node is a leader node, and the second node is a subordinate Node, the first node 800 includes: a processing module 801 and a transceiver module 802, where:
- the processing module is configured to package the first transaction information in the transaction queue of the first node into a candidate block
- the transceiver module is configured to broadcast the candidate block through the blockchain
- the processing module is further configured to verify the first transaction information in the candidate block to generate a first verification result, and execute the first transaction information in the candidate block to generate a first transaction execution result;
- the transceiver module is further configured to broadcast the processing result of the first node through the blockchain, and the processing result of the first node includes: the first verification result and the first transaction execution result;
- the transceiver module is further configured to receive a second node processing result broadcast by the second node through the blockchain, and the second node processing result includes: the second node verifies the candidate area A second verification result generated by the first transaction information in the block, and a second transaction execution result generated by executing the first transaction information in the candidate block;
- the processing module is further configured to make a consensus on the candidate block according to the processing result of the first node and the processing result of the second node, and then the first node performs a consensus on the candidate block when the consensus is successful Saving the candidate block, and saving the execution result of the first transaction when the execution of the first transaction information is successful.
- the processing module before the transceiver module packs the first transaction information in the transaction queue of the first node into the candidate block, the processing module is also used to check whether the transaction queue Meet the preset block generation condition; if the transaction queue meets the block generation bar, trigger execution of the following step: pack the first transaction information in the transaction queue of the first node into a candidate block.
- the processing module is further configured to check whether the number of transaction information stored in the transaction queue exceeds a first threshold, and if the number of transaction information exceeds the first threshold, A limit value, determining that the transaction queue meets the block generation condition, and if the number of transaction information does not exceed the first threshold value, it is determined that the transaction queue does not meet the block generation condition.
- the processing module is further configured to check whether the amount of data stored in the transaction queue exceeds a second threshold, and if the amount of data exceeds the second threshold , Determining that the transaction queue meets the block generation condition, and if the size of the data volume does not exceed the second threshold, determine that the transaction queue does not meet the block generation condition.
- the processing module is further configured to check whether the time difference between the last block generation time and the current time of the transaction queue exceeds the block generation time threshold. If the time difference is If the block generation time threshold is exceeded, it is determined that the transaction queue meets the block generation condition, and if the time difference does not exceed the block generation time threshold, it is determined that the transaction queue does not meet the block generation condition.
- the transceiver module is further configured to receive transaction information sent by at least one client to the blockchain; or, the first node receives the second node from at least one Transaction information obtained by the client terminal;
- the processing module is also used to put the transaction information of the at least one client into the transaction queue.
- the processing module is further configured to pack the second transaction information in the transaction queue into the candidate area when the first transaction information is packed into the candidate block Piece;
- the transceiver module is also used to broadcast the candidate block through the blockchain;
- the processing module is also used to verify the second transaction information in the candidate block to generate a third verification result, and execute the second transaction information in the candidate block to generate a third transaction execution result;
- the transceiver module is further configured to broadcast a processing result of a third node through the blockchain, and the processing result of the third node includes: the third verification result and the third transaction execution result;
- the transceiver module is further configured to receive the processing result of the fourth node broadcast by the second node through the blockchain, and the processing result of the fourth node includes: the second node verifies the candidate area A fourth verification result generated by the second transaction information in the block, and a fourth transaction execution result generated by executing the second transaction information in the candidate block;
- the processing module is further configured to make a consensus on the candidate block according to the processing result of the third node and the processing result of the fourth node, and then the first node may succeed in the consensus of the candidate block Saving the candidate block, and saving the third transaction execution result when the second transaction information is successfully executed.
- the processing module is further configured to save the header information of the candidate block and save the first transaction information that is successfully verified when the consensus of the candidate block is successful .
- the first node when the first node is the leader node and the second node is the slave node, the first node packs the first transaction information in the transaction queue of the first node into the candidate block , And broadcast the candidate block through the blockchain, and then the first node verifies the first transaction information in the candidate block to generate the first verification result, and executes the first transaction information in the candidate block To generate the first transaction execution result, the first node broadcasts the processing result of the first node through the blockchain.
- the processing result of the first node includes: the first verification result and the first transaction execution result, and then the first node Receive the second node's processing result broadcast by the second node through the blockchain, the first node makes a consensus on the candidate block based on the first node's processing result and the second node's processing result, and then the first node succeeds in the consensus on the candidate block
- the candidate block is saved when the first transaction information is executed successfully, and the first transaction execution result is saved when the first transaction information is successfully executed.
- the first node serves as the leader node.
- the first node can buffer the transaction information to be processed through the transaction queue, and package the transaction information in the transaction queue into the candidate block before broadcasting the candidate area.
- the slave nodes in the blockchain can perform transaction verification and transaction execution.
- the first node After broadcasting the candidate block, the first node can perform the following processing: transaction verification and transaction execution, and then the first node can broadcast the first node
- the first node makes a consensus on the candidate block according to the processing result of each node in the blockchain, and then executes the block save when the consensus is successful.
- the order of block generation is changed, so that all nodes in the blockchain can perform transaction verification and transaction execution, so that the speed of block generation and the performance of transaction processing can be improved.
- a second node 900 in a block chain provided by an embodiment of the present application, the block chain also includes a first node, the first node is a leader node, and the second node is a subordinate Node, the second node 900 includes: a processing module 901 and a transceiver module 902, where:
- the transceiver module is configured to receive the candidate block broadcast by the first node through the blockchain;
- the processing module is configured to obtain first transaction information from the candidate block
- the processing module is also used to verify the first transaction information in the candidate block to generate a second verification result, and execute the first transaction information in the candidate block to generate a second transaction execution result;
- the transceiver module is further configured to broadcast the processing result of the second node through the blockchain, and the processing result of the second node includes: the second verification result and the second transaction execution result;
- the processing module is further configured to save the candidate block when the first transaction information is successfully verified, and save the second transaction execution result when the first transaction information is successfully executed.
- the transceiver module after the transceiver module broadcasts the processing result of the second node through the blockchain, it receives the processing result of the first node broadcast by the first node through the blockchain, so
- the first node processing result includes: the first verification result generated by the first node by verifying the first transaction information in the candidate block, and by executing the first transaction in the candidate block The first transaction execution result generated by the information;
- the processing module is further configured to make a consensus on the candidate block according to the processing result of the first node and the processing result of the second node, and trigger the execution of the following steps when the consensus of the candidate block succeeds: Saving the candidate block when the first transaction information is successfully verified, and saving the second transaction execution result when the first transaction information is successfully executed.
- the transceiver module after the transceiver module broadcasts the processing result of the second node through the blockchain, it receives a notification message sent by the first node when the consensus on the candidate block is successful;
- the processing module is further configured to trigger the execution of the following steps according to the notification message: save the candidate block when the first transaction information is successfully verified, and save the candidate block when the first transaction information is successfully executed.
- the second transaction execution result is further configured to trigger the execution of the following steps according to the notification message: save the candidate block when the first transaction information is successfully verified, and save the candidate block when the first transaction information is successfully executed. The second transaction execution result.
- the transceiver module is further configured to receive the candidate block broadcast by the first node through the blockchain, and obtain second transaction information from the candidate block,
- the processing module is also used to verify the second transaction information in the candidate block to generate a fourth verification result, and execute the second transaction information in the candidate block to generate a fourth transaction execution result;
- the transceiver module is further configured to broadcast the processing result of the fourth node through the blockchain, and the processing result of the fourth node includes: the fourth verification result and the fourth transaction execution result;
- the processing module is further configured to save the candidate block when the second transaction information is successfully verified, and save the fourth transaction execution result when the second transaction information is successfully executed.
- the first node in the embodiments of the application serves as the leader node, and the first node can cache the transaction information to be processed through the transaction queue, and package the transaction information in the transaction queue into the candidate first.
- the candidate block can be broadcast so that the second node can perform transaction verification and transaction execution, and then the second node can broadcast the processing result of the second node, so that the first node can process according to each node in the blockchain
- a consensus on candidate blocks is carried out, and block storage is executed when the consensus is successful.
- the order of block generation is changed, so that all nodes in the blockchain can perform transaction verification and transaction execution, so that the speed of block generation and the performance of transaction processing can be improved.
- an embodiment of the present application provides a first node 800 in another blockchain, the blockchain further includes a second node, and the first node is a leader node, The second node is a slave node, and the first node 800 includes: a processing module 801 and a transceiver module 802, where:
- the processing module is configured to respond to at least one client sending transaction information to the blockchain, and put the transaction information sent by the client into the transaction queue of the first node;
- the processing module is also used to check whether the transaction queue meets a preset block generation condition
- the transceiver module is configured to package the first transaction information in the transaction queue of the first node into a candidate block in response to the transaction queue meeting the block-producing condition, and to check the candidate block Sign, and then broadcast the candidate block through the blockchain;
- the processing module is further configured to verify the first transaction information in the candidate block to generate a first verification result, and execute the first transaction information in the candidate block to generate a first transaction execution result;
- the transceiver module is further configured to sign the processing result of the first node, and then broadcast the processing result of the first node through the blockchain, and the processing result of the first node includes: the first verification result and The first transaction execution result;
- the transceiver module is further configured to receive a second node processing result broadcast by the second node through the blockchain, and the second node processing result includes: the second node verifies the candidate area A second verification result generated by the first transaction information in the block, and a second transaction execution result generated by executing the first transaction information in the candidate block;
- the processing module is further configured to perform a consensus on the candidate block through the distributed consensus algorithm according to the processing result of the first node and the processing result of the second node, and then make a consensus on the candidate block Saving the candidate block when successful, and saving the first transaction execution result when the first transaction information is successfully executed.
- the transceiver module is further configured to package the second transaction information in the transaction queue into the standby block when the first transaction information is packaged into the candidate block. Select a block, sign the candidate block, and then broadcast the candidate block through the blockchain;
- the processing module is also used to verify the second transaction information in the candidate block to generate a third verification result, and execute the second transaction information in the candidate block to generate a third transaction execution result;
- the transceiver module is further configured to sign the processing result of the third node, and then broadcast the processing result of the third node through the blockchain, and the processing result of the third node includes: the third check The result and the third transaction execution result;
- the processing module is further configured to receive the processing result of the fourth node broadcast by the second node through the blockchain, and the processing result of the fourth node includes: the second node verifies the candidate A fourth verification result generated by the second transaction information in the block, and a fourth transaction execution result generated by executing the second transaction information in the candidate block;
- the processing module is also used for the first node to make a consensus on the candidate block according to the processing result of the third node and the processing result of the fourth node, and then when the consensus of the candidate block is successful Saving the candidate block, and saving the third transaction execution result when the second transaction information is successfully executed.
- the processing module is further configured to save the header information of the candidate block and save the first transaction information that is successfully verified when the consensus of the candidate block is successful ,
- the header information of the candidate block includes: the hash value of the previous block of the candidate block, the root of the Merkel tree, the root of the state, the root of receipt, the signature of the node, and the random value.
- the first node in the embodiments of the application serves as the leader node, and the first node can cache the transaction information to be processed through the transaction queue, and pack the transaction information in the transaction queue into The candidate block can be broadcasted, so that the slave nodes in the blockchain can perform transaction verification and transaction execution.
- the first node can perform the following processing: transaction verification and After the transaction is executed, the first node can broadcast the processing result of the first node.
- the first node makes a consensus on the candidate block according to the processing result of each node in the blockchain, and then executes the block save when the consensus is successful.
- the order of block generation is changed, so that all nodes in the blockchain can perform transaction verification and transaction execution, so that the speed of block generation and the performance of transaction processing can be improved.
- an embodiment of the present application provides a second node 900 in another blockchain, the blockchain further includes a first node, and the first node is a leader node, The second node is a slave node, and the second node 900 includes a processing module 901 and a transceiver module 902, where:
- the transceiver module is configured to receive the candidate block broadcast by the first node through the blockchain, and obtain first transaction information from the candidate block;
- the processing module is configured to verify the first transaction information in the candidate block to generate a second verification result, and execute the first transaction information in the candidate block to generate a second transaction execution result ;
- the transceiver module is configured to sign the processing result of the second node, and then broadcast the processing result of the second node through the blockchain.
- the processing result of the second node includes: the second verification result and the The second transaction execution result;
- the processing module is configured to save the candidate block when the first transaction information is successfully verified, and save the second transaction execution result when the first transaction information is successfully executed.
- the first node in the embodiments of the application serves as the leader node, and the first node can cache the transaction information to be processed through the transaction queue, and package the transaction information in the transaction queue into the candidate first.
- the candidate block can be broadcast so that the second node can perform transaction verification and transaction execution, and then the second node can broadcast the processing result of the second node, so that the first node can process according to each node in the blockchain
- a consensus on candidate blocks is carried out, and block storage is executed when the consensus is successful.
- the order of block generation is changed, so that all nodes in the blockchain can perform transaction verification and transaction execution, so that the speed of block generation and the performance of transaction processing can be improved.
- FIG. 12 is a schematic diagram of a server structure provided by an embodiment of the present application.
- the server may be the first node in the aforementioned block chain to implement the block processing method on the first node side, or the aforementioned block
- the second node in the chain implements the block processing method on the second node side.
- the server 1100 may have relatively large differences due to different configurations or performance, and may include one or more central processing units (CPU). ) 1122 (for example, one or more processors) and a memory 1132, and one or more storage media 1130 (for example, one or more storage devices) that store application programs 1142 or data 1144.
- the memory 1132 and the storage medium 1130 may be short-term storage or persistent storage.
- the program stored in the storage medium 1130 may include one or more modules (not shown in the figure), and each module may include a series of command operations on the server. Further, the central processing unit 1122 may be configured to communicate with the storage medium 1130, and execute a series of instruction operations in the storage medium 1130 on the server 1100.
- the server 1100 may also include one or more power supplies 1126, one or more wired or wireless network interfaces 1150, one or more input and output interfaces 1158, and/or one or more operating systems 1141, such as Windows Server TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM and so on.
- operating systems 1141 such as Windows Server TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM and so on.
- the block processing method steps executed by the first node in the above embodiment can be based on the server structure shown in FIG. 12; similarly, the block processing method steps executed by the second node in the above embodiment can be based on this figure.
- the device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physically separate
- the physical unit can be located in one place or distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
- the connection relationship between the modules indicates that they have a communication connection between them, which can be specifically implemented as one or more communication buses or signal lines. Those of ordinary skill in the art can understand and implement it without creative work.
- the embodiments of the present application can be implemented by means of software plus necessary general hardware. Of course, it can also be implemented by dedicated hardware including dedicated integrated circuits, dedicated CPUs, and dedicated Memory, dedicated components, etc. to achieve. Under normal circumstances, all functions completed by computer programs can be easily implemented with corresponding hardware. Moreover, the specific hardware structure used to achieve the same function can also be diverse, such as analog circuits, digital circuits or dedicated Circuit etc. However, for the embodiments of the present application, software program implementation is a better implementation in more cases. Based on this understanding, the technical solutions of the embodiments of the present application can be embodied in the form of a software product in essence or a part that contributes to the prior art.
- the computer software product is stored in a readable storage medium, such as a computer.
- a readable storage medium such as a computer.
- a computer program product is also provided.
- the computer program product When executed on the first node, it is used to implement the block processing method on the first node side; when the computer program product is When executed on the second node, it is used to implement the block processing method on the second node side.
Abstract
Description
节点名称 | 节点标识 |
节点1 | 117.114.151.174 |
节点2 | 117.116.189.145 |
… | … |
节点N | 119.123.789.258 |
Claims (20)
- 一种区块处理方法,所述方法由区块链中的第一节点执行,所述区块链中还包括第二节点,所述第一节点为领导者节点,所述第二节点为从属者节点,所述方法包括:所述第一节点将所述第一节点的交易队列中的第一交易信息打包到备选区块,以及通过所述区块链将所述备选区块广播出去;所述第一节点校验所述备选区块中的第一交易信息以生成第一校验结果,以及执行所述备选区块中的第一交易信息以生成第一交易执行结果;所述第一节点通过所述区块链将第一节点处理结果广播出去,所述第一节点处理结果包括:所述第一校验结果和所述第一交易执行结果;所述第一节点接收所述第二节点通过所述区块链广播的第二节点处理结果,所述第二节点处理结果包括:所述第二节点通过校验所述备选区块中的第一交易信息生成的第二校验结果,以及通过执行所述备选区块中的第一交易信息生成的第二交易执行结果;所述第一节点根据所述第一节点处理结果和所述第二节点处理结果对所述备选区块进行共识,然后所述第一节点在所述备选区块共识成功时保存所述备选区块,以及在所述第一交易信息执行成功时保存所述第一交易执行结果。
- 根据权利要求1所述的方法,所述第一节点将所述第一节点的交易队列中的第一交易信息打包到备选区块之前,所述方法还包括:所述第一节点检查所述交易队列是否满足预设的出块条件;若所述交易队列满足所述出块条件,触发执行如下步骤:所述第一节点将所述第一节点的交易队列中的第一交易信息打包到备选区块。
- 根据权利要求2所述的方法,所述第一节点检查所述交易队列是否满足预设的出块条件,包括:所述第一节点检查所述交易队列中存储的交易信息个数是否超过第一门限值,若所述交易信息个数超过所述第一门限值,确定所述交易队列满足所述出块条件,若所述交易信息个数没有超过所述第一门限值,确定所述交易队列不满足所述出块条件。
- 根据权利要求2所述的方法,所述第一节点检查所述交易队列是否满足预设的出块条件,包括:所述第一节点检查所述交易队列中存储的数据量大小是否超过第二门限值,若所述数据量大小超过所述第二门限值,确定所述交易队列满足所述出块条件,若所述数据量大小没有超过所述第二门限值,确定所述交易队列不满足所述出块条件。
- 根据权利要求2所述的方法,所述第一节点检查所述交易队列是否满足预设的出块条件,包括:所述第一节点检查所述交易队列从上一次出块时间到当前时间之间的时间差值是否超过出块时间阈值,若所述时间差值超过所述出块时间阈值,确定所述交易队列满足所述出块条件,若所述时间差值没有超过所述出块时间阈值,确定所述交易队列不满足所述出块条件。
- 根据权利要求1所述的方法,所述方法还包括:所述第一节点接收至少一个客户端发送到所述区块链中的交易信息;或者,所述第一节点接收所述第二节点从至少一个客户端获取到的交易信息;所述第一节点将所述至少一个客户端的交易信息放入到所述交易队列中。
- 根据权利要求1所述的方法,所述方法还包括:当所述第一交易信息打包到所述备选区块时,所述第一节点将所述交易队列中的第二交易信息打包到所述备选区块,以及通过所述区块链将所述备选区块广播出去;所述第一节点校验所述备选区块中的第二交易信息以生成第三校验结果,以及执行所述备选区块中的第二交易信息以生成第三交易执行结果;所述第一节点通过所述区块链将第三节点处理结果广播出去,所述第三节点处理结果包括:所述第三校验结果和所述第三交易执行结果;所述第一节点接收所述第二节点通过所述区块链广播的第四节点处理结果,所述第四节点处理结果包括:所述第二节点通过校验所述备选区块中的第二交易信息生成的第四校验结果,以及通过执行所述备选区块中的第二交易信息生成的第四交易执行结果;所述第一节点根据所述第三节点处理结果和所述第四节点处理结果对所述备选区块进行共识,然后所述第一节点在所述备选区块共识成功时保存所述备选区块,以及在所述第二交易信息执行成功时保存所述第三交易执行结果。
- 根据权利要求1至7中任一项所述的方法,所述第一节点在所述备选区块共识成功时保存所述备选区块包括:在所述备选区块共识成功时,所述第一节点保存所述备选区块的头部信息,以及保存校验成功的第一交易信息。
- 一种区块处理方法,所述方法由区块链中的第二节点执行,所述区块链中还包括第一节点,所述第一节点为领导者节点,所述第二节点为从属者节点,所述方法包括:所述第二节点接收所述第一节点通过所述区块链广播的备选区块,以及从所述备选区块中获取第一交易信息;所述第二节点校验所述备选区块中的第一交易信息以生成第二校验结果,以及执行所述备选区块中的第一交易信息以生成第二交易执行结果;所述第二节点通过所述区块链将第二节点处理结果广播出去,所述第二节点处理结果包括:所述第二校验结果和所述第二交易执行结果;所述第二节点在所述第一交易信息验证成功时保存所述备选区块,以及在所述第一交易信息执行成功时保存所述第二交易执行结果。
- 根据权利要求9所述的方法,所述第二节点通过所述区块链将第二节点处理结果广播出去之后,所述方法还包括:所述第二节点接收所述第一节点通过所述区块链广播的第一节点处理结果,所述第一节点处理结果包括:所述第一节点通过校验所述备选区块中的第一交易信息生成的第一校验结果,以及通过执行所述备选区块中的第一交易信息生成的第一交易执行结果;所述第二节点根据所述第一节点处理结果和所述第二节点处理结果对所述备选区块进行共识,当所述备选区块共识成功时触发执行如下步骤:所述第二节点在所述第一交易信息验证成功时保存所述备选区块,以及在所述第一交易信息执行成功时保存所述第二交易执行结果。
- 根据权利要求9所述的方法,所述第二节点通过所述区块链将第二节点处理结果广播出去之后,所述方法还包括:所述第二节点接收所述第一节点在对所述备选区块共识成功时发送的通知消息;所述第二节点根据所述通知消息触发执行如下步骤:所述第二节点在所述第一交易信息验证成功时保存所述备选区块,以及在所述第一交易信息执行成功时保存所述第二交易执行结果。
- 根据权利要求9至11中任一项所述的方法,所述方法还包括:所述第二节点接收所述第一节点通过所述区块链广播的备选区块,以及从所述备选区块中获取第二交易信息;所述第二节点校验所述备选区块中的第二交易信息以生成第四校验结果,以及执行所述备选区块中的第二交易信息以生成第四交易执行结果;所述第二节点通过所述区块链将第四节点处理结果广播出去,所述第四节点处理结果包括:所述第四校验结果和所述第四交易执行结果;所述第二节点在所述第二交易信息验证成功时保存所述备选区块,以及在所述第二交易 信息执行成功时保存所述第四交易执行结果。
- 一种区块处理方法,所述方法由区块链中的第一节点执行,所述区块链中还包括第二节点,所述第一节点为领导者节点,所述第二节点为从属者节点,所述方法包括:响应于至少一个客户端发送交易信息到所述区块链,所述第一节点将所述客户端发送的交易信息放入到所述第一节点的交易队列中;所述第一节点检查所述交易队列是否满足预设的出块条件;响应于所述交易队列满足所述出块条件,所述第一节点将所述第一节点的交易队列中的第一交易信息打包到备选区块,以及对所述备选区块进行签名,然后通过所述区块链将所述备选区块广播出去;所述第一节点校验所述备选区块中的第一交易信息以生成第一校验结果,以及执行所述备选区块中的第一交易信息以生成第一交易执行结果;所述第一节点对第一节点处理结果进行签名,然后通过所述区块链将第一节点处理结果广播出去,所述第一节点处理结果包括:所述第一校验结果和所述第一交易执行结果;所述第一节点接收所述第二节点通过所述区块链广播的第二节点处理结果,所述第二节点处理结果包括:所述第二节点通过校验所述备选区块中的第一交易信息生成的第二校验结果,以及通过执行所述备选区块中的第一交易信息生成的第二交易执行结果;所述第一节点根据所述第一节点处理结果和所述第二节点处理结果对所述备选区块通过所述分布式共识算法进行共识,然后所述第一节点在所述备选区块共识成功时保存所述备选区块,以及在所述第一交易信息执行成功时保存所述第一交易执行结果。
- 根据权利要求13所述的方法,其中,所述方法还包括:当所述第一交易信息打包到所述备选区块时,所述第一节点将所述交易队列中的第二交易信息打包到所述备选区块,以及对所述备选区块进行签名,然后通过所述区块链将所述备选区块广播出去;所述第一节点校验所述备选区块中的第二交易信息以生成第三校验结果,以及执行所述备选区块中的第二交易信息以生成第三交易执行结果;所述第一节点对第三节点处理结果进行签名,然后通过所述区块链将所述第三节点处理结果广播出去,所述第三节点处理结果包括:所述第三校验结果和所述第三交易执行结果;所述第一节点接收所述第二节点通过所述区块链广播的第四节点处理结果,所述第四节点处理结果包括:所述第二节点通过校验所述备选区块中的第二交易信息生成的第四校验结果,以及通过执行所述备选区块中的第二交易信息生成的第四交易执行结果;所述第一节点根据所述第三节点处理结果和所述第四节点处理结果对所述备选区块进行共识,然后所述第一节点在所述备选区块共识成功时保存所述备选区块,以及在所述第二交易信息执行成功时保存所述第三交易执行结果。
- 根据权利要求13或14所述的方法,其中,所述第一节点在所述备选区块共识成功时保存所述备选区块,包括:在所述备选区块共识成功时,所述第一节点保存所述备选区块的头部信息,以及保存校验成功的第一交易信息,其中,所述备选区块的头部信息包括:所述备选区块的上一个区块的哈希值、默克尔树根、状态根、收据根、节点的签名、随机数值。
- 一种区块处理方法,所述方法由区块链中的第二节点执行,所述区块链中还包括第一节点,所述第一节点为领导者节点,所述第二节点为从属者节点,所述方法包括:所述第二节点接收所述第一节点通过所述区块链广播的备选区块,以及从所述备选区块中获取第一交易信息;所述第二节点校验所述备选区块中的第一交易信息以生成第二校验结果,以及执行所述备选区块中的第一交易信息以生成第二交易执行结果;所述第二节点对第二节点处理结果进行签名,然后通过所述区块链将第二节点处理结果 广播出去,所述第二节点处理结果包括:所述第二校验结果和所述第二交易执行结果;所述第二节点在所述第一交易信息验证成功时保存所述备选区块,以及在所述第一交易信息执行成功时保存所述第二交易执行结果。
- 一种区块链节点,其中,所述区块链节点为区块链中的第一节点,所述第一节点包括:处理器和存储器;所述存储器,用于存储指令;所述处理器,用于执行所述存储器中的所述指令,执行如权利要求1至8中任一项所述的方法,或执行如权利要求13至15中任一项所述的方法。
- 一种区块链节点,其中,所述区块链节点为区块链中的第二节点,所述第二节点包括:处理器和存储器;所述存储器,用于存储指令;所述处理器,用于执行所述存储器中的所述指令,执行如权利要求9至12中任一项所述的方法,或执行如权利要求16所述的方法。
- 一种区块处理系统,其中,所述区块处理系统包括:第一节点和第二节点;所述第一节点用于执行如权利要求1至8中任一项所述的方法,所述第二节点用于执行如权利要求9至12中任一项所述的方法;或者,所述第一节点用于执行如权利要求13至15中任一项所述的方法,所述第二节点用于执行如权利要求16中所述的方法。
- 一种计算机可读存储介质,包括指令,当其在计算机上运行时,使得计算机执行如权利要求1至8中任一项所述的方法、或者执行如权利要求9至12中任一项所述的方法、或者执行如权利要求13至15中任一项所述的方法,或者执行如权利要求16所述的方法。
Priority Applications (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2021512837A JP7186862B2 (ja) | 2019-04-26 | 2020-04-23 | ブロック処理方法、ブロックチェーンノード、ブロック処理システム及びコンピュータプログラム |
SG11202101131QA SG11202101131QA (en) | 2019-04-26 | 2020-04-23 | Block processing methods, node and system |
KR1020217009871A KR102562558B1 (ko) | 2019-04-26 | 2020-04-23 | 블록 처리 방법들, 노드 및 시스템 |
US17/317,189 US20210263765A1 (en) | 2019-04-26 | 2021-05-11 | Block processing method, node, and system |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910345985.4A CN110046896B (zh) | 2019-04-26 | 2019-04-26 | 一种区块处理方法和节点以及系统 |
CN201910345985.4 | 2019-04-26 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US17/317,189 Continuation US20210263765A1 (en) | 2019-04-26 | 2021-05-11 | Block processing method, node, and system |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020216280A1 true WO2020216280A1 (zh) | 2020-10-29 |
Family
ID=67279655
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/086351 WO2020216280A1 (zh) | 2019-04-26 | 2020-04-23 | 一种区块处理方法和节点以及系统 |
Country Status (6)
Country | Link |
---|---|
US (1) | US20210263765A1 (zh) |
JP (1) | JP7186862B2 (zh) |
KR (1) | KR102562558B1 (zh) |
CN (2) | CN110648137B (zh) |
SG (1) | SG11202101131QA (zh) |
WO (1) | WO2020216280A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113543073A (zh) * | 2021-06-07 | 2021-10-22 | 中国联合网络通信集团有限公司 | 区块校验方法和区块链系统 |
Families Citing this family (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110648137B (zh) * | 2019-04-26 | 2021-08-20 | 腾讯科技(深圳)有限公司 | 一种区块处理方法和节点以及系统 |
CN110519287B (zh) * | 2019-08-30 | 2022-08-12 | 腾讯科技(深圳)有限公司 | 一种信息管理方法及相关设备 |
CN110570196A (zh) * | 2019-09-05 | 2019-12-13 | 腾讯科技(深圳)有限公司 | 交易数据处理方法、装置、终端设备以及存储介质 |
CN110648234B (zh) * | 2019-09-12 | 2022-08-19 | 广州蚁比特区块链科技有限公司 | 一种区块生成方法及装置 |
CN111078696A (zh) * | 2019-12-04 | 2020-04-28 | 杭州复杂美科技有限公司 | 区块生成方法、设备和存储介质 |
CN111199485A (zh) * | 2020-01-02 | 2020-05-26 | 支付宝(杭州)信息技术有限公司 | 用于在区块链节点处进行交易数据处理的方法及装置 |
CN111262918A (zh) * | 2020-01-13 | 2020-06-09 | 中孚安全技术有限公司 | 一种跨平台分布式一致性框架系统及其实现方法 |
CN111431696B (zh) * | 2020-03-26 | 2023-10-17 | 深圳市欧欣泰科技有限公司 | 一种基于身份的区块链封印机制 |
CN111724260B (zh) * | 2020-06-18 | 2022-08-05 | 清华大学 | 基于配置区块的多场景配置数据存储方法及系统 |
KR102473672B1 (ko) * | 2020-10-20 | 2022-12-02 | 주식회사 커먼컴퓨터 | 트리 구조의 상태 데이터베이스를 포함하는 블록체인에 대한 상태 관리 방법 및 시스템 |
CN112347193A (zh) * | 2020-11-27 | 2021-02-09 | 网易(杭州)网络有限公司 | 基于区块链的交易打包方法及装置、电子设备 |
CN113269637A (zh) * | 2020-12-28 | 2021-08-17 | 上海能链众合科技有限公司 | 一种基于区块链的智能设备数据的存证与验证方法 |
CN112804233B (zh) * | 2021-01-15 | 2023-05-02 | 欧冶云商股份有限公司 | 一种面向区块链多通道的区块打包方法、装置及存储介质 |
CN113922965B (zh) * | 2021-10-09 | 2024-04-16 | 筹远(上海)信息科技有限公司 | 一种拜占庭场景下的区块链数据共识方法及装置 |
CN113961349B (zh) * | 2021-10-28 | 2022-09-06 | 中国西安卫星测控中心 | 一种qpid集群控制方法及系统 |
CN117579633B (zh) * | 2024-01-17 | 2024-04-09 | 腾讯科技(深圳)有限公司 | 区块竞选方法、装置、设备及存储介质 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018119930A1 (zh) * | 2016-12-29 | 2018-07-05 | 深圳前海达闼云端智能科技有限公司 | 交易验证处理方法、装置及节点设备 |
US20180189755A1 (en) * | 2016-12-29 | 2018-07-05 | Red Hat, Inc. | Providing blockchain-based subscription-as-a-service management |
CN108876384A (zh) * | 2018-09-19 | 2018-11-23 | 联动优势科技有限公司 | 一种交易数据的处理方法及装置 |
WO2019001139A1 (zh) * | 2017-06-26 | 2019-01-03 | 华为技术有限公司 | 运行智能合约的方法和装置 |
CN110046896A (zh) * | 2019-04-26 | 2019-07-23 | 腾讯科技(深圳)有限公司 | 一种区块处理方法和节点以及系统 |
Family Cites Families (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10204341B2 (en) * | 2016-05-24 | 2019-02-12 | Mastercard International Incorporated | Method and system for an efficient consensus mechanism for permissioned blockchains using bloom filters and audit guarantees |
JP6775086B2 (ja) * | 2016-12-16 | 2020-10-28 | 株式会社日立製作所 | ブロックチェーン監視及び管理 |
CN111917864B (zh) * | 2017-02-22 | 2023-08-22 | 创新先进技术有限公司 | 一种业务校验的方法及装置 |
CN107196900B (zh) * | 2017-03-24 | 2020-04-24 | 创新先进技术有限公司 | 一种共识校验的方法及装置 |
US20200160943A1 (en) * | 2017-05-02 | 2020-05-21 | Sustainable Medicine, Inc. | Security system and node device used in same |
US10740733B2 (en) * | 2017-05-25 | 2020-08-11 | Oracle International Corporaton | Sharded permissioned distributed ledgers |
CN107402824B (zh) * | 2017-05-31 | 2020-06-02 | 创新先进技术有限公司 | 一种数据处理的方法及装置 |
US11055703B2 (en) * | 2017-06-19 | 2021-07-06 | Hitachi, Ltd. | Smart contract lifecycle management |
JP7064950B2 (ja) * | 2017-09-15 | 2022-05-11 | パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ | 電子投票システム、及び、制御方法 |
KR101924026B1 (ko) * | 2017-11-10 | 2018-11-30 | 부산대학교 산학협력단 | 해시 기반 서명 기법을 적용한 블록체인 시스템 및 방법 |
CN108182635A (zh) * | 2017-12-18 | 2018-06-19 | 深圳前海微众银行股份有限公司 | 区块链共识方法、系统和计算机可读存储介质 |
CN112767158A (zh) * | 2018-02-27 | 2021-05-07 | 创新先进技术有限公司 | 基于区块链的交易执行方法及装置、电子设备 |
CN109327459B (zh) * | 2018-11-12 | 2020-12-01 | 崔晓晖 | 一种联盟区块链网络的共识方法 |
CN109636389B (zh) * | 2018-12-13 | 2020-09-22 | 东软集团股份有限公司 | 区块链出块时间的确定方法、装置、设备及存储介质 |
-
2019
- 2019-04-26 CN CN201910906176.6A patent/CN110648137B/zh active Active
- 2019-04-26 CN CN201910345985.4A patent/CN110046896B/zh active Active
-
2020
- 2020-04-23 JP JP2021512837A patent/JP7186862B2/ja active Active
- 2020-04-23 WO PCT/CN2020/086351 patent/WO2020216280A1/zh active Application Filing
- 2020-04-23 SG SG11202101131QA patent/SG11202101131QA/en unknown
- 2020-04-23 KR KR1020217009871A patent/KR102562558B1/ko active IP Right Grant
-
2021
- 2021-05-11 US US17/317,189 patent/US20210263765A1/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018119930A1 (zh) * | 2016-12-29 | 2018-07-05 | 深圳前海达闼云端智能科技有限公司 | 交易验证处理方法、装置及节点设备 |
US20180189755A1 (en) * | 2016-12-29 | 2018-07-05 | Red Hat, Inc. | Providing blockchain-based subscription-as-a-service management |
WO2019001139A1 (zh) * | 2017-06-26 | 2019-01-03 | 华为技术有限公司 | 运行智能合约的方法和装置 |
CN108876384A (zh) * | 2018-09-19 | 2018-11-23 | 联动优势科技有限公司 | 一种交易数据的处理方法及装置 |
CN110046896A (zh) * | 2019-04-26 | 2019-07-23 | 腾讯科技(深圳)有限公司 | 一种区块处理方法和节点以及系统 |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113543073A (zh) * | 2021-06-07 | 2021-10-22 | 中国联合网络通信集团有限公司 | 区块校验方法和区块链系统 |
CN113543073B (zh) * | 2021-06-07 | 2023-05-09 | 中国联合网络通信集团有限公司 | 区块校验方法和区块链系统 |
Also Published As
Publication number | Publication date |
---|---|
CN110648137B (zh) | 2021-08-20 |
CN110648137A (zh) | 2020-01-03 |
KR20210055734A (ko) | 2021-05-17 |
CN110046896A (zh) | 2019-07-23 |
SG11202101131QA (en) | 2021-03-30 |
KR102562558B1 (ko) | 2023-08-03 |
CN110046896B (zh) | 2022-03-01 |
JP2022500742A (ja) | 2022-01-04 |
JP7186862B2 (ja) | 2022-12-09 |
US20210263765A1 (en) | 2021-08-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020216280A1 (zh) | 一种区块处理方法和节点以及系统 | |
WO2020168937A1 (zh) | 区块链多方见证方法、装置、设备及计算机可读存储介质 | |
TWI662435B (zh) | 分散式系統及訊息處理方法 | |
US9054958B2 (en) | System and method for reducing information loss in an aggregated information handling system | |
CN109189751B (zh) | 基于区块链的数据同步方法及终端设备 | |
JP7154234B2 (ja) | ブロックチェーン・ネットワークにおける高速伝搬のための方法及び特殊ネットワーク・ノード | |
WO2021244568A1 (zh) | 区块链中的共识方法和系统 | |
WO2019100598A1 (zh) | 交易处理方法、装置、计算机设备及存储介质 | |
WO2016115831A1 (zh) | 一种虚拟机容错的方法、装置及系统 | |
CN112600678B (zh) | 一种数据处理方法、装置、设备及存储介质 | |
WO2020063763A1 (zh) | 数据存储方法、装置、系统、服务器、控制节点及介质 | |
WO2017107827A1 (zh) | 一种环境隔离方法及设备 | |
WO2021217849A1 (zh) | 区块链的节点同步方法、装置、设备及存储介质 | |
CN111489256A (zh) | 用于多链区块链系统中的跨链处理方法、设备及系统 | |
JP6431197B2 (ja) | スナップショット処理方法および関係付けられたデバイス | |
WO2020024615A1 (zh) | 一种共识流程恢复方法及相关节点 | |
CN112395113B (zh) | 实用拜占庭容错共识方法及装置、可读存储介质 | |
JP2022523217A (ja) | 投票集計を伴うトポロジードリブンビザンチンフォールトトレラント合意プロトコル | |
WO2020042929A1 (zh) | 一种区块链系统 | |
CN110502581A (zh) | 分布式数据库系统监测方法及装置 | |
WO2019119269A1 (zh) | 一种网络故障探测方法及控制中心设备 | |
WO2021114774A1 (zh) | 聚合链路的处理方法及装置 | |
CN109039747B (zh) | Dpdk服务的双机热备控制方法及装置 | |
CN113626139B (zh) | 一种高可用的虚拟机存储方法及装置 | |
CN113765671A (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: 20795919 Country of ref document: EP Kind code of ref document: A1 |
|
ENP | Entry into the national phase |
Ref document number: 2021512837 Country of ref document: JP Kind code of ref document: A |
|
ENP | Entry into the national phase |
Ref document number: 20217009871 Country of ref document: KR Kind code of ref document: A |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20795919 Country of ref document: EP Kind code of ref document: A1 |