Block chain consensus method and device, computer equipment, medium and product

By using the hash fingerprint signature endorsement of the proposal node to process transaction blocks, the problem of large data volume of node certificates in the existing technology is solved, and the efficiency of blockchain consensus and data transmission are improved.

CN118628237APending Publication Date: 2024-09-10TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310269139.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-08
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

In a decentralized network environment based on consensus algorithms such as Byzantine, due to the large amount of node certificate data in existing blockchain scenarios, the amount of proposal message data after signature endorsement is relatively large, affecting consensus efficiency.

Method used

The hash fingerprint of the proposal node is used to perform signature endorsement processing on the transaction block, generate signature endorsement information, and assemble the hash fingerprint and transaction block into a proposal message for consensus processing, reducing the data volume of the proposal message.

Benefits of technology

By reducing the data volume of proposal messages, the network transmission volume between nodes is reduced, the consensus efficiency is improved, and the consensus among nodes is accelerated.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628237A
    Figure CN118628237A
Patent Text Reader

Abstract

The invention provides a block chain consensus method and device, computer equipment, a medium and a product. The method comprises the steps of obtaining a to-be-consensus transaction block, wherein the to-be-consensus transaction block is generated based on one or more to-be-packaged transaction data; the Hash fingerprint of the proposal node is adopted to perform signature endorsement processing on the transaction block to obtain signature endorsement information, and the Hash fingerprint is determined after performing Hash operation processing on certificate data corresponding to the proposal node; performing assembly processing on the signature endorsement information and the transaction block to generate proposal information; and broadcasting the proposal message to at least one verification node in the block chain to trigger each verification node to perform consensus processing on the proposal message according to the hash fingerprint of the proposal node in the proposal message. The data volume of proposal messages can be reduced, so that the consensus efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and in particular to a blockchain consensus method, a blockchain consensus device, a computer device, a computer-readable storage medium, and a computer program product. Background Art

[0002] In a decentralized network environment based on consensus algorithms such as the Byzantine algorithm, consensus nodes are operated by participants from different regions and organizations. In order to prevent attacks that cause multiple nodes in the network to be controlled by the same party and undermine the security of the consensus, it is necessary to use certificate-based security processing methods for defense in blockchain scenarios such as consortium chains.

[0003] Specifically, the principle of the certificate method is as follows: a credible institution or project party will review offline the nodes that are ready to participate in the consensus, and issue a valid node certificate to the validator that meets the requirements; when the node participant participates in the consensus on the chain, the issued node certificate can be used to sign the consensus message, and the signature and node certificate can be sent together with the consensus message as signature endorsement information to other consensus nodes participating in the consensus for consensus verification. In the existing scheme, the consensus node usually uses the complete certificate data of the node to sign and endorse the block, which will result in a large proportion of the proposal message data generated after the signature endorsement. Summary of the invention

[0004] The embodiments of the present application propose a blockchain consensus method, apparatus, computer equipment, medium and product, which can reduce the data volume of proposal messages and thus improve consensus efficiency.

[0005] On the one hand, an embodiment of the present application provides a blockchain consensus method, the method comprising:

[0006] Obtain the transaction block to be agreed upon. The transaction block to be agreed upon is generated based on one or more transaction data to be packaged;

[0007] The transaction block is signed and endorsed using the hash fingerprint of the proposal node to obtain the signature endorsement information. The hash fingerprint is determined by hashing the certificate data corresponding to the proposal node.

[0008] Assemble the signature endorsement information and transaction blocks to generate a proposal message;

[0009] The proposal message is broadcast to at least one verification node in the blockchain to trigger each verification node to perform consensus processing on the proposal message based on the hash fingerprint of the proposal node in the proposal message.

[0010] On the one hand, an embodiment of the present application provides a blockchain consensus method, the method comprising:

[0011] Get the proposal message sent by the proposal node. The proposal message is generated by assembling the signature endorsement information and the transaction block. The signature endorsement information is determined by signing and endorsing the transaction block based on the hash fingerprint of the proposal node. The hash fingerprint is determined by hashing the certificate data corresponding to the proposal node.

[0012] Parse the proposal message to obtain the hash fingerprint of the proposal node, and obtain the certificate data of the proposal node according to the hash fingerprint;

[0013] The proposal message is processed by consensus based on the acquired certificate data.

[0014] On the one hand, an embodiment of the present application provides a blockchain consensus device, the device comprising:

[0015] An acquisition unit, used to acquire a transaction block to be agreed upon, where the transaction block to be agreed upon is generated based on one or more transaction data to be packaged;

[0016] A processing unit, used to use the hash fingerprint of the proposal node to perform signature endorsement processing on the transaction block to obtain signature endorsement information, where the hash fingerprint is determined by performing hash operation processing on the certificate data corresponding to the proposal node;

[0017] The processing unit is also used to assemble and process the signature endorsement information and transaction blocks to generate proposal messages;

[0018] The sending unit is used to broadcast the proposal message to at least one verification node in the blockchain to trigger each verification node to perform consensus processing on the proposal message according to the hash fingerprint of the proposal node in the proposal message.

[0019] In a possible implementation, the processing unit is further configured to perform the following operations:

[0020] Receive the contract call transaction data sent by the operation node, the contract call transaction data includes: the contract identifier of the system contract;

[0021] The packaged transaction block is signed and endorsed according to the certificate data of the proposal node to generate the node proposal to be uploaded to the chain. The packaged transaction block includes the contract call transaction data;

[0022] If the blockchain consensus on the node proposal is confirmed to be passed, the certificate data of the proposal node will be uploaded to the chain according to the contract identifier of the system contract;

[0023] The contract identifier is used to instruct the proposing node and any verification node to store the certificate data of the proposing node in their respective contract databases, and the contract database maintains the system contract indicated by the contract identifier.

[0024] In a possible implementation, the processing unit performs signature endorsement processing on the packaged transaction block according to the certificate data of the proposal node, and after generating the node proposal to be uploaded to the chain, it is also used to perform the following operations:

[0025] Broadcast the node proposal to be put on the chain to at least one verification node in the blockchain to trigger each verification node to process the certificate data corresponding to the proposal node on the chain;

[0026] Receive voting results sent by each verification node. The voting result refers to the result generated by any verification node after consensus processing of the node proposal to be put on the chain;

[0027] If the blockchain consensus on the node proposal is passed according to the received voting results, the hash fingerprint of the certificate data of the proposal node is obtained, and the certificate data and hash fingerprint of the proposal node are associated and stored in the contract database of the proposal node.

[0028] In a possible implementation, the processing unit processes the certificate data of the proposal node on the chain according to the contract identifier of the system contract to perform the following operations:

[0029] If the node proposal consensus is passed according to the received voting results, a notification message of the node proposal consensus passing is generated, and the notification message carries the contract identifier of the system contract;

[0030] Send the notification message to each verification node in the blockchain. The notification message is used to trigger any verification node to store the certificate data of the proposal node in the corresponding contract database;

[0031] Among them, the system contract maintained in the contract database of any verification node records: the hash fingerprint and certificate data stored in association with the proposal node.

[0032] In a possible implementation, after the processing unit broadcasts the proposal message to at least one verification node in the blockchain, it is further configured to perform the following operations:

[0033] Receive voting messages sent by each verification node. Voting messages are generated by any verification node after consensus processing of proposal messages;

[0034] If the proposal message is determined to meet the consensus conditions based on the received voting messages, the transaction block corresponding to the proposal message will be uploaded to the chain;

[0035] Among them, the consensus processing performed by any verification node includes: verifying whether the transaction execution results of the proposal node for each transaction data in the transaction block are consistent with the transaction execution results of the verification node for each transaction data in the transaction block, and verifying whether the proposal message is generated by the proposal node.

[0036] In a possible implementation, there are multiple transaction data to be packaged; and the processing unit is further configured to perform the following operations:

[0037] Acquire the acquisition time of each transaction data to be packaged, and arrange the execution order of multiple transaction data according to the acquisition time of each transaction data to determine the transaction execution order of each transaction data;

[0038] Pack the transaction execution order into the proposal message;

[0039] Among them, the transaction execution order is used to trigger any verification node that receives the proposal message to execute each transaction data in the transaction block in the order indicated by the transaction execution order.

[0040] On the one hand, an embodiment of the present application provides a blockchain consensus device, the device comprising:

[0041] A receiving unit, used to receive a proposal message sent by a proposal node. The proposal message is generated by assembling the signature endorsement information and the transaction block. The signature endorsement information is determined by signing and endorsing the transaction block based on the hash fingerprint of the proposal node. The hash fingerprint is determined by hashing the certificate data corresponding to the proposal node.

[0042] A processing unit, used to parse the proposal message to obtain the hash fingerprint of the proposal node, and obtain the certificate data of the proposal node according to the hash fingerprint;

[0043] The processing unit is also used to perform consensus processing on the proposal message based on the acquired certificate data.

[0044] In a possible implementation, the processing unit obtains the certificate data of the proposing node according to the hash fingerprint, and performs the following operations:

[0045] Query data from the cache component of the verification node based on the hash fingerprint, and use the queried data as the certificate data of the proposal node; or

[0046] If the corresponding data is not found in the cache component of the verification node, the contract database of the verification node is queried according to the hash fingerprint to obtain the certificate data of the proposal node;

[0047] Among them, the cache component is used to store the certificate data queried from the contract database.

[0048] In a possible implementation, the processing unit is further configured to perform the following operations:

[0049] If the corresponding data is not found from the cache component according to the hash fingerprint, and the corresponding data is not found from the contract database according to the hash fingerprint, a voting message indicating that the consensus of the proposal message has not been passed is generated;

[0050] Send the voting message that the consensus fails to pass to the proposal node.

[0051] In a possible implementation, the processing unit performs consensus processing on the proposal message based on the acquired certificate data to perform the following operations:

[0052] Determine the proposal node associated with the obtained certificate data, and verify whether the proposal node is consistent with the master node elected in the current consensus view;

[0053] If they are consistent, the step of verifying the transaction data in the proposal message is triggered.

[0054] In a possible implementation, the processing unit is further configured to perform the following operations:

[0055] Execute each transaction data included in the transaction block in the proposal message and obtain the transaction execution result of each transaction data;

[0056] Parse the proposal message to obtain the transaction execution results of the proposal node for each transaction data in the transaction block;

[0057] If the transaction execution result corresponding to the verification node is the same as the transaction execution result of the proposal node, a voting message for the consensus passed for the proposal message is generated and sent to the proposal node.

[0058] In a possible implementation, the processing unit is further configured to perform the following operations:

[0059] Get the node proposal to be put on the chain sent by the proposing node. The node proposal to be put on the chain includes the certificate data of the proposing node;

[0060] Perform consensus processing on the node proposal based on the certificate data included in the node proposal. The consensus processing includes: verifying the identity of the proposing node, verifying the validity and security of the transaction data in the node proposal;

[0061] If the node proposal consensus is passed, the voting result of consensus passing is generated and sent to the proposing node.

[0062] On the one hand, an embodiment of the present application provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the above-mentioned blockchain consensus method.

[0063] On the one hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is read and executed by a processor of a computer device, the computer device executes the above-mentioned blockchain consensus method.

[0064] On the one hand, the embodiments of the present application provide a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned blockchain consensus method.

[0065] In the embodiment of the present application, during the blockchain consensus process, the verification node can receive a proposal message generated by the proposal node after assembling the signature endorsement information and the transaction block. The signature endorsement information is determined after the transaction block is signed and endorsed based on the hash fingerprint of the proposal message. The hash fingerprint is determined after hashing the certificate data corresponding to the proposal node; the verification node can parse the proposal message to obtain the hash fingerprint of the proposal node, and obtain the certificate data of the proposal node according to the hash fingerprint; finally, according to the obtained certificate data, the proposal message can be processed by consensus. It can be seen that the signature endorsement information in the proposal message is determined after signing the hash fingerprint of the proposal node. Compared with directly generating a proposal message based on the certificate data of the proposal node, the present application can reduce the volume of the consensus proposal and reduce the amount of data transmitted over the network between the proposal node and the verification node, thereby improving the consensus efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technical objects in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0067] Figure 1a It is a structural diagram of a blockchain system provided by an embodiment of the present application;

[0068] Figure 1b This is a schematic diagram of a block generation process provided by an embodiment of the present application;

[0069] Figure 1c This is a schematic diagram of the structure of a blockchain provided by an embodiment of the present application;

[0070] Figure 2a It is a structural diagram of a blockchain consensus system provided by an embodiment of the present application;

[0071] Figure 2b This is a schematic diagram of a consensus process of a proposal node provided in an embodiment of the present application;

[0072] Figure 2c This is a schematic diagram of a consensus process of a verification node provided in an embodiment of the present application;

[0073] Figure 3 It is a flowchart of a blockchain consensus method provided by an embodiment of the present application;

[0074] Figure 4 This is a flow chart of a certificate data chain provided by an embodiment of the present application;

[0075] Figure 5 It is a schematic diagram of a process of generating a proposal message provided in an embodiment of the present application;

[0076] Figure 6 It is a flowchart of another blockchain consensus method provided by an embodiment of the present application;

[0077] Figure 7 This is a schematic diagram of a process for querying certificate data provided by an embodiment of the present application;

[0078] Figure 8 This is a schematic diagram of a process for executing transaction data provided by an embodiment of the present application;

[0079] Fig. 9 It is an interactive flow chart of a blockchain consensus method provided by an embodiment of the present application;

[0080] Fig.10 It is a structural schematic diagram of a blockchain consensus device provided in an embodiment of the present application;

[0081] Fig.11 It is a structural schematic diagram of another blockchain consensus device provided in an embodiment of the present application;

[0082] Fig.12 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0083] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0084] The present application provides a blockchain consensus scheme. When constructing a proposal message, the blockchain consensus scheme can use the hash fingerprint of the proposal node (for example, the hash fingerprint of the node certificate, or the hash fingerprint of the public key) to replace the complete certificate data (that is, the node certificate or the public key) to sign and endorse the block, thereby reducing the proportion of the signature endorsement information in the proposal message, making the data volume of the constructed proposal message smaller, reducing memory usage, and thus improving consensus efficiency.

[0085] Specifically, the principle of the blockchain consensus scheme provided by the present application is as follows: when constructing a proposal message, the proposal node first packages the transaction data to be packaged to obtain a transaction block, and then determines the signature endorsement information after signing and endorsing the transaction block based on the hash fingerprint of the proposal node, and then constructs the proposal message based on the signature endorsement information and the transaction block; in the block consensus process, after receiving the proposal message sent by the proposal node, the verification node can parse the hash fingerprint of the proposal node in the proposal message, and obtain the complete certificate data of the proposal node according to the hash fingerprint, and finally the verification node performs consensus processing on the proposal message according to the obtained complete certificate data. It can be seen that the proposal message constructed in the consensus process is generated after the hash fingerprint signature endorsement of the proposal node. Compared with the signature endorsement based on the complete certificate data of the proposal node, the hash fingerprint occupies a smaller amount of data, thereby reducing the volume of the proposal message; further, the proposal message with a smaller volume can also reduce the amount of data transmission during the data transmission process, thereby accelerating the consensus efficiency. In addition, the fast and stable transmission of the proposal message can accelerate the consensus between nodes and further improve the consensus efficiency.

[0086] Next, the relevant technical terms involved in the blockchain consensus solution provided by this application are introduced in detail in conjunction with the relevant drawings:

[0087] 1. Blockchain technology:

[0088] Blockchain is essentially a decentralized database, a string of data blocks generated using cryptographic methods. Each data block contains relevant information, which is used to verify the validity of the information (anti-counterfeiting) and generate the next block.

[0089] (1) Blockchain system:

[0090] See also Figure 1a , Figure 1a This is a schematic diagram of the structure of a blockchain system provided by an embodiment of the present application. Figure 1aAs shown, the blockchain system can be a data sharing system. The so-called data sharing system refers to a system for sharing data between nodes. The data sharing system 100 may include: a blockchain node 101 and at least one blockchain node 102, wherein the blockchain node 201 may be a proposal node (also referred to as a master node or leader node), and the blockchain node 202 may be a verification node (also referred to as a slave node or follower node). The proposal node may be a node elected by all consensus nodes in the blockchain network based on a consensus algorithm. The proposal node and the verification node are collectively referred to as a consensus node. Any blockchain node may refer to a computer device in the data sharing system, and the computer device may be, for example, a terminal device or a server. Among them, each node in the data sharing system 200 may form a peer-to-peer (P2P, Peer To Peer) network. The P2P protocol is an application layer protocol running on the Transmission Control Protocol (TCP, Transmission Control Protocol) protocol, and the above data sharing system is maintained based on the TCP protocol.

[0091] In the embodiment of the present application, the proposal node 101 can generate a proposal message corresponding to the transaction block, and the proposal node 101 broadcasts the proposal message to each verification node 102 in the blockchain, thereby realizing the relevant process of blockchain consensus processing. Therefore, next, how to perform block consensus between nodes (proposal nodes and verification nodes) in the blockchain system and the relevant functions implemented by the nodes are introduced accordingly.

[0092] ①Block consensus between proposal nodes and verification nodes:

[0093] Specifically, in order to ensure information intercommunication within the blockchain system, there may be an information connection between each node in the blockchain system, and information may be transmitted between nodes through the above information connection. The above information connection does not limit the specific connection method, for example, it may be directly or indirectly connected through a wired communication method, or directly or indirectly connected through a wireless communication method, or through other connection methods, which are not limited in this application.

[0094] It is understandable that each blockchain node (proposal node 101 or verification node 102) can receive input information when performing normal work, and maintain the shared data in the data sharing system based on the received input information. For example, when the proposal node 101 in the blockchain system receives input information (for example, the proposal node can receive one or more transaction data sent by the user client), the proposal node 101 can package the received multiple transaction data to generate a transaction block, and then sign the transaction block based on the hash fingerprint of the proposal node, thereby generating a proposal message corresponding to the transaction block. For another example, the verification node 102 can also receive input information (for example, a proposal message sent by the proposal node 101), and the verification node 102 can parse the hash fingerprint in the proposal message, and obtain the complete certificate data of the proposal node according to the hash fingerprint, and finally perform consensus processing on the proposal message based on the complete certificate data. Finally, after the proposal node 101 and each verification node 102 in the blockchain reach a consensus on the proposal message, both the proposal node 101 and the verification node 102 can store the transaction block, thereby maintaining the shared data (each transaction data) in the above-mentioned data sharing system.

[0095] ② Functions of the nodes:

[0096] a. Application functions are used to be deployed in the blockchain to implement specific services according to actual business needs. The data related to the implementation of the functions are recorded to form record data (transaction data). For example, transaction data can refer to data used to implement resource transfer services; transaction data can refer to data used to implement electronic invoice services; transaction data can refer to data used to implement game services, etc. A digital signature (for example, signature endorsement information executed by the proposal node on the transaction block based on certificate data such as node certificates or public keys) can be carried in the record data to indicate the source of the task data, and the record data can be sent to other verification nodes in the blockchain system for other verification nodes to add the record data to the temporary block when the source and integrity of the record data are successfully verified. Subsequently, after the proposal node and the verification node reach a consensus on the transaction block, the transaction block including each transaction data can be added to the blockchain.

[0097] b. Routing function: a basic function possessed by any node in the blockchain system, used to support communication between nodes. Specifically, in the block consensus process between the proposal node 101 and the verification node 102, data interaction between nodes is involved. In the data interaction process, the data interaction process between nodes is realized based on the routing function of each node.

[0098] ③Node identification:

[0099] Each node (proposal node and verification node) in the blockchain system has a corresponding node ID, and each node in the blockchain system can store the node IDs of other nodes in the blockchain system, so that the generated blocks can be broadcast to other nodes in the blockchain system based on the node IDs of other nodes. Each node can maintain a node ID list as shown in the following table, and store the node name and node ID in the node ID list.

[0100] The node identifier may be an IP (Internet Protocol, a protocol for interconnecting networks) address or any other information that can be used to identify the node. Table 1 only uses the IP address as an example for illustration.

[0101] Table 1. Node ID list

[0102] Node Name Node ID Node 1 000.000.000.000 Node 2 111.111.111.111 … … Node N xxx.xxx.xxx.xxx

[0103] In an embodiment of the present application, each node in the blockchain system can carry its own node identification during the data interaction process (for example, the data interaction process in which the proposal node sends a proposal message to the verification node), so that other nodes can perform node verification processing based on the corresponding node identification before performing consensus processing, thereby improving the security of the blockchain consensus process.

[0104] (2) Block:

[0105] This application mainly involves block consensus. Before block consensus is reached, the proposal node needs to generate a corresponding transaction block based on the transaction data, so that the subsequent verification node can reach block consensus on the transaction block. Therefore, the following will explain in detail how to generate a block and the structure of the block.

[0106] ①Block generation:

[0107] See also Figure 1b , Figure 1b This is a schematic diagram of a block generation process provided by an embodiment of the present application. Figure 1b As shown in the figure, when generating a transaction block in the blockchain, the proposal node can verify the input information when receiving the input information (transaction data). After the verification is completed, the input information is stored in the memory pool (transaction pool) and the hash tree used to record the input information is updated; then, the update timestamp is updated to the time when the input information is received, and different random numbers are tried, and the eigenvalue calculation is performed multiple times, so that the calculated eigenvalue can satisfy the following formula:

[0108] SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x)) <TARGET

[0109] Among them, SHA256 is the eigenvalue algorithm used to calculate the eigenvalue; version (version number) is the version information of the relevant block protocol in the blockchain; prev_hash is the block header eigenvalue of the parent block of the current block; merkle_root is the eigenvalue of 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 exceeding the fixed time period; x is a random number; TARGET is the eigenvalue threshold, which can be determined based on nbits.

[0110] In this way, when the random number that satisfies the above formula is calculated, the information can be stored accordingly, the block header and block body can be generated, and the current transaction block can be obtained. Subsequently, the proposal node sends the proposal message of the newly generated transaction block to the verification nodes in the data sharing system where it is located according to the node identification of other nodes (verification nodes) in the data sharing system. The verification nodes reach a consensus on the transaction block and add the newly generated transaction block to the blockchain stored in it after reaching the consensus.

[0111] ②Block structure:

[0112] See also Figure 1c , Figure 1c This is a schematic diagram of the structure of a blockchain provided by an embodiment of the present application. Figure 1c As shown in the figure, the blockchain consists of multiple blocks, and each blockchain contains a genesis block. As the name implies, the so-called genesis block is the first block, the initial block. The genesis block includes a block header and a block body. The block header stores the input information feature value, version number, timestamp and difficulty value, and the block body stores the input information (such as various transaction data); the next block of the genesis block uses the genesis block as the parent block, and the next block also includes a block header and a block body. The block header stores the input information feature value of the current block, the block header feature value, version number, timestamp and difficulty value of the parent block, and so on, so that the block data stored in each block in the blockchain is associated with the block data stored in the parent block, ensuring the security of the transaction data in the block.

[0113] In an embodiment of the present application, when constructing a proposal message, the proposing node can package the voting qc (quorum certificate) data of the previous block into the proposal. Based on the structure of the blockchain, when the verification node subsequently receives the proposal message, it can verify that the parent block (previous block) referenced by the current block is consistent among most nodes based on the voting qc data in the proposal, thereby ensuring the reliability of the blockchain consensus.

[0114] 2. Cloud Technology:

[0115] In the blockchain consensus scheme of this application, the blockchain involves a lot of data calculation and data storage services, so a lot of computer operating costs are required. Then, this application can implement the specific operations involved in the blockchain consensus process based on cloud storage technology in cloud technology, including: for example, based on the data calculation service provided by cloud storage technology, the hash fingerprint of the proposal node can be used to sign and endorse the transaction block; for example, after the consensus on the proposal message block is passed, the certificate data of the proposal node can be stored in the DB database based on the data storage service provided by cloud storage technology.

[0116] The so-called cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool that can be used on demand and is flexible and convenient. Among them, cloud technology can include cloud storage technology. The so-called cloud storage is a new concept extended and developed from the concept of cloud computing. Distributed cloud storage system (hereinafter referred to as storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of different types of storage devices (storage devices are also called storage nodes) in the network through application software or application interfaces to work together and provide data storage and business access functions to the outside world.

[0117] It is particularly important to note that in the subsequent specific implementation methods of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, it is necessary to obtain the permission or consent of the object, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of relevant countries and regions.

[0118] Combined with the above description of the blockchain consensus scheme provided by this application and the related technical terms involved, next, combined with Figure 2a-2c The architecture of the blockchain consensus system provided in the embodiments of the present application is introduced in detail.

[0119] See also Figure 2a , Figure 2aIt is a schematic diagram of the architecture of a blockchain consensus system provided by an embodiment of the present application. The architecture diagram of the blockchain consensus system may include at least: a proposal node 201 and at least one verification node 202. It should be noted that the proposal node 201 and the verification node 202 can be collectively referred to as the consensus node in the blockchain system. The so-called consensus node is responsible for maintaining the data consistency of the entire blockchain network. Generally speaking, among the multiple consensus nodes corresponding to the block consensus process, the number of proposal nodes 201 (also known as the master node) is one, and the number of verification nodes 202 (also known as slave nodes) is multiple. Specifically, the proposal node can be a node selected by all consensus nodes in the blockchain network based on the consensus algorithm (such as Hotstuff's BFT consensus algorithm, HotStuff is a consensus protocol based on View (view), View represents a consensus unit, and the consensus process is composed of Views one after another. In a View, there is a Leader node to dominate the consensus protocol, and reach a consensus through three-stage voting, and then switch to the next View to continue consensus). The verification node refers to other consensus nodes in the blockchain network except the proposal node. In addition, a communication connection can be established between the proposal node 201 and each verification node 202 via wired or wireless means.

[0120] First, combine the attached Figure 2b-Figure 2c The consensus processes corresponding to the proposal node 201 and the verification node 202 in the blockchain consensus process are introduced respectively:

[0121] ① The consensus process of proposal node 201.

[0122] See also Figure 2b , Figure 2b This is a schematic diagram of a consensus process of a proposal node provided in an embodiment of the present application. Figure 2b As shown in the figure, the transaction data sent by the user can be uploaded to the consensus node in the blockchain for consensus. When the consensus node receives the transaction data, it can determine whether it is a leader node in the current view state. If not, the transaction data is ignored, that is, no processing operation is performed on the transaction data; if so, a transaction block is created based on the transaction data, and a proposal message is generated after signing and endorsing the transaction block, and finally the proposal message is broadcast to each slave node in the blockchain. It can be seen that the proposal node plays a key role in a round of block consensus. If the proposal node acts maliciously, packs invalid transactions, or the block structure is wrong, this round of consensus will not reach a consensus on any block.

[0123] ②Verify the consensus process of node 202.

[0124] See also Figure 2c , Figure 2cThis is a schematic diagram of a consensus process of a verification node provided in an embodiment of the present application. Figure 2c As shown, after receiving the proposal message sent by the proposal node 201, it is determined whether the proposal message is sent by the proposal node in the current view. If not, the proposal message is ignored, that is, no processing operation is performed on the proposal message; if so, the signature of the proposal message is verified. If the signature verification is successful, voting is performed and the voting message is generated after signing. Specifically, when the follower node verifies that the proposal message comes from the specified leader node and the user transaction execution result contained in the transaction block is consistent with the leader node, the hash of the block in the proposal is used to construct the voting message, and the hash fingerprint of the voting message is calculated for signing, and then the signature endorsement is put into the voting message and sent to the leader node to indicate that it approves the current proposal message. When the leader node receives at least 2f+1 votes in favor, the consensus nodes reach a consensus on the current proposal and enter the next view state.

[0125] It should be noted that the proposal node 201 and the verification node 202 may include but are not limited to: mobile phones, tablet computers, laptop computers, PDAs, mobile internet devices (MIDs), intelligent voice interaction devices, vehicle-mounted terminals, roadside devices, aircraft, wearable devices, smart home appliances, or wearable devices with blockchain consensus functions such as smart watches, smart bracelets, pedometers, etc. The proposal node 201 and the verification node 202 may also be independent physical servers, or server clusters or distributed systems composed of multiple physical servers, or cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, etc.

[0126] In a possible implementation, the blockchain consensus scheme provided by the above embodiment of the present application is described by taking the interaction process between the proposal node 201 and the verification node 202 as an example. First, the proposal node 201 can obtain one or more transaction data to be packaged, and package the acquired transaction data to generate a transaction block; then, the proposal node 201 can perform signature endorsement processing on the transaction block based on the hash fingerprint to obtain the signature endorsement information, and the hash fingerprint is determined after hashing the certificate data of the proposal node; next, the proposal node 201 assembles the signature endorsement information and the transaction block into a proposal message, and broadcasts the proposal message to the verification node 302 in the blockchain. Subsequently, after receiving the proposal message sent by the proposal node 201, the verification node 202 can parse the hash fingerprint in the proposal message and obtain the complete certificate data of the proposal node according to the hash fingerprint; finally, the proposal message is processed by consensus according to the acquired certificate data.

[0127] It can be understood that the blockchain consensus system described in the embodiment of the present application is to more clearly illustrate the technical solution of the embodiment of the present application, and does not constitute a limitation on the technical solution provided in the embodiment of the present application. It is known to those skilled in the art that with the evolution of the system architecture and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.

[0128] Based on the foregoing description of the blockchain consensus scheme and blockchain consensus system of the present application, the specific embodiments involved in the blockchain consensus scheme will be described in detail with reference to the accompanying drawings.

[0129] See also Figure 3 , Figure 3 This is a flowchart of a blockchain consensus method provided by an embodiment of the present application. Figure 2a The proposal node in the blockchain consensus system shown. The blockchain consensus method mainly includes but is not limited to the following steps S301 to S304:

[0130] S301: Obtain a transaction block to be agreed upon, where the transaction block to be agreed upon is generated based on one or more transaction data to be packaged.

[0131] In a possible implementation, the proposal node can obtain one or more transaction data to be packaged from the transaction pool, and then package the acquired transaction data to obtain a transaction block. Optionally, in the process of packaging and generating a transaction block, the proposal node can first obtain a preset number of transaction data, and then package a preset number (for example, 100) of transaction data to generate a transaction block; or, in the process of packaging and generating a transaction block, the proposal node can also obtain the transaction data received within a preset time period (for example, within 1 hour), so as to package the transaction data received within the preset time period to generate a transaction block.

[0132] In one possible implementation, the proposal node can obtain transaction data from the batch transaction pool in batches, that is, the transaction batches stored in the batch transaction pool. The so-called transaction batch refers to a collection of one or more transaction data. Then, the obtained transaction batches are packaged to generate transaction blocks. In this way, the method of obtaining transaction data in units of transaction batches and constructing transaction blocks can improve the efficiency of block construction.

[0133] S302: Use the hash fingerprint of the proposal node to sign and endorse the transaction block to obtain signature endorsement information. The hash fingerprint is determined by performing a hash operation on the certificate data corresponding to the proposal node.

[0134] Specifically, the certificate data of the proposal node refers to a type of data used to identify the identity of the proposal node. The certificate data may include, for example, node certificates, node public keys, and other content. Specifically, the node certificate may include: the start time of certificate issuance, the expiration time of the certificate, the organizational role corresponding to the proposal node, and other content. Among them, the so-called node certificate refers to an authoritative digital certificate (such as a CA certificate) issued by a certificate authority (i.e., an institution with public credibility) to a proposal node. One node corresponds to one node certificate. In addition, the data type of the node certificate may include, but is not limited to, tables, documents, files, and the like.

[0135] Specifically, the principle of the so-called signature endorsement processing is as follows: each node participating in the consensus process (proposal node, verification node) has a corresponding public-private key pair and node certificate (collectively referred to as certificate data). When generating a proposal message or a voting message, the node will perform a signature process based on the hash fingerprint of the corresponding message, and use the signature result and the certificate data (user certificate / public key) to form an endorsement as anti-counterfeiting data, which is added to the corresponding proposal message (or voting message) to identify the proposal message (voting message) as sent by the node itself. In short, signature endorsement processing is mainly a means to identify the identity of the node, and other nodes can verify the source of the message based on the signature endorsement information.

[0136] In a possible implementation, the proposal node can send a node certificate request to the certificate authority, which carries the identity information of the proposal node (such as the node identifier); after the certificate authority verifies the identity information of the proposal node, it can generate a corresponding node certificate for the proposal node. Subsequently, the proposal node can store its own node certificate locally to facilitate the signature and endorsement of the transaction block based on the hash fingerprint of the node certificate.

[0137] It should be understood that the hash fingerprint refers to the data determined by hashing the certificate data of the proposal node. Specifically, the hash fingerprint can be obtained by calculating the certificate data based on a hash algorithm (such as MD5, SHA-1, SHA-256, SHA-512, etc.). It stands to reason that the amount of data corresponding to the hash fingerprint of the proposal node is smaller than the amount of data corresponding to the certificate data of the proposal node.

[0138] In a possible implementation, before using the hash fingerprint of the proposal node to sign and endorse the transaction block, the proposal node can also serialize the transaction block to obtain a serialized transaction block; then, the serialized transaction block is signed and endorsed based on the hash fingerprint of the proposal node to obtain signature endorsement information. The so-called serialization process refers to serializing the transaction block into a binary array. This serialization process can facilitate data processing and transmission efficiency, thereby improving the efficiency of constructing proposal messages.

[0139] In one possible implementation, the hash fingerprint of the proposal node and the corresponding certificate data can be associated and stored in the node's local database (DB database, also referred to as the contract database later). For example, the hash fingerprint and certificate data are stored in the K (key)-V (value) storage format, where the node's hash fingerprint is used as the key and the certificate data is used as the value. It should be understood that before the hash fingerprint and certificate data of the storage node are associated, the certificate data of each node must be processed on the chain. Next, taking the proposal node as an example, the specific process of uploading the certificate data of the proposal node to the chain is described in detail:

[0140] (1) First, the proposal node can receive the contract call transaction data sent by the operation node, and the contract call transaction data includes: the contract identifier of the system contract. Among them, the system contract can be created by the proposal node after the proposal node receives the contract call transaction data, or it can be created by the operation node when building the blockchain, which is not limited in the embodiment of the present application.

[0141] (2) Then, the packaged transaction block is signed and endorsed according to the certificate data of the proposing node to generate a node proposal to be uploaded to the chain; if it is determined that the blockchain consensus on the node proposal is passed, the certificate data of the proposing node is uploaded to the chain according to the contract identifier of the system contract; wherein the contract identifier is used to instruct the proposing node and any verification node to store the certificate data of the proposing node in their respective contract databases, and the contract database maintains the system contract indicated by the contract identifier.

[0142] (3) Next, after the packaged transaction block is signed and endorsed according to the certificate data of the proposing node to generate the node proposal to be uploaded to the chain, it also includes: broadcasting the node proposal to be uploaded to the chain to at least one verification node in the blockchain to trigger each verification node to upload the certificate data corresponding to the proposing node to the chain; receiving the voting results sent by each verification node, the voting results refer to the results generated after any verification node performs consensus processing on the node proposal to be uploaded to the chain; if it is determined that the blockchain consensus on the node proposal is passed according to the received voting results, then obtaining the hash fingerprint of the certificate data of the proposing node, and storing the certificate data and hash fingerprint of the proposing node in association in the contract database of the proposing node.

[0143] For example, see Figure 4 , Figure 4 This is a flow chart of a certificate data chain provided by an embodiment of the present application. Figure 4 As shown, the node operator can create contract call transaction data and send it to the blockchain network. The contract call transaction data is used to indicate the call of the specified system contract. It should be understood that each consensus node in the blockchain network (such as consensus node A, consensus node B, and consensus node C) elects the leader node corresponding to the current view based on the consensus algorithm, assuming that it is consensus node A (the consensus node A is also called the proposal node). Specifically, ① after consensus node A receives the contract call transaction data, it can first package the contract call transaction data into a transaction block, for example, the contract call transaction data can be added to the transaction block to be packaged, and a new block can be created and the contract call transaction data can be added to the created new block to form a packaged transaction block. Then consensus node A (specifically executable by the consensus engine) can sign and endorse the packaged transaction block based on the certificate data (node ​​certificate or node public key) of the consensus node A, and after signing the transaction block, the full amount of node certificate / node public key is used as part of the proposal signature endorsement, thereby generating a node proposal. Finally, the node proposal is broadcast to other verification nodes (consensus node B and consensus node C) in the consensus network.

[0144] ② After consensus node B (or consensus node C) receives the node proposal containing the contract call transaction data, it uses the complete node certificate, signature, and block data in the signature endorsement of the node proposal to verify the validity of the proposal source (i.e., verify whether the current node proposal is sent by the leader node in the current view, verify whether the signature of the proposal is obtained by the current leader node signature, etc.); in addition, after the identity authentication is passed, the validity of the block data in the proposal can also be verified (for example, verify whether the block data contains sensitive transactions, illegal transactions, etc. If none of them are contained, it is determined that the block data in the proposal is valid; if it is contained, it is determined that the block data in the proposal is invalid). Finally, when the source and block data are verified, consensus node B can generate a voting result containing an approval vote and send the voting result to the leader node. It should be understood that the specific process of consensus processing of node proposals by each verification node is the same, and the embodiments of this application will not be repeated here.

[0145] ③ Consensus node A receives the voting results sent by each verification node (consensus node B and consensus node C), and determines whether the current node proposal has passed the blockchain consensus based on the received voting results. The specific judgment method can be that if consensus node A receives 2f+1 (f is the number of malicious nodes in the blockchain) votes of approval, it can be determined that the current node proposal meets the consensus conditions, that is, it is determined that the node proposal consensus has passed. In a possible implementation method, if consensus node A determines that the node proposal consensus has passed based on the received voting results, a notification message of the node proposal consensus passing is generated, and the notification message may carry the contract identifier of the system contract; consensus node A sends the notification message to each verification node in the blockchain, and the notification message is used to trigger any verification node to store the certificate data of the proposal node in their respective corresponding contract databases; wherein, the system contract maintained in the contract database of any verification node records: the hash fingerprint and certificate data associated with the storage of the proposal node. That is to say, after the node proposal passes the consensus, after the block data in the proposal is processed on the chain, the certificate data of the proposal node can also be stored in the contract database (DB database) of each consensus node (such as consensus node A, consensus node B, and consensus node C), thereby completing the chain processing of the certificate data of the proposal node. Among them, in the contract database, the certificate data of the proposal node and the hash fingerprint (determined after the certificate data is hashed) can be stored in association.

[0146] In this way, the complete certificate data of any other node on the chain can be stored in the contract database of each node to the system contract. Optionally, the node identification of the corresponding node can also be recorded in the system contract. As shown in Table 2 below, the storage format of the system contract maintained in the contract data of any node is as follows:

[0147] Table 2. Storage format of system contracts

[0148] Node ID Hash fingerprint Certificate data id1 hash1111 Node certificate 1, public key 1 id2 hash2222 Node certificate 2, public key 2 id3 hash3333 Node certificate 3, public key 3 ... ... ...

[0149] It should be noted that the above-mentioned process of uploading the certificate data to the chain can be applied to any node. For example, in the embodiment of the present application, after the certificate data of consensus node A is successfully uploaded to the chain, the certificate data of consensus node B can be uploaded to the chain next, and after the certificate data of consensus node B is successfully uploaded to the chain, the certificate data of consensus node B can be uploaded to the chain.

[0150] The certificate data of consensus node C is processed on the chain, and so on. It should be understood that the chain process of the certificate data of any node can be referred to the chain process of the certificate data of consensus node A above, and the embodiment of this application will not be repeated here.

[0151] Based on this, the transaction block is signed and endorsed based on the hash fingerprint of the node. Compared with the signature endorsement based on the complete certificate data of the node, the amount of data occupied by the signature endorsement information can be reduced, thereby reducing the amount of data of the generated proposal message; further, in the process of data transmission, the proposal message based on the smaller data volume can improve the efficiency of blockchain consensus. In addition, the node certificate on-chain transaction is similar to the conventional user transaction, and the same sending and consensus process is used, which can reduce the probability of introducing bugs due to changes.

[0152] S303: Assemble the signature endorsement information and the transaction block to generate a proposal message.

[0153] In specific implementation, the proposal node assembles the signature endorsement information and the transaction block to generate a proposal message, which may include: for example, the signature endorsement information and the transaction block may be packaged and compressed to obtain a proposal message; for another example, the signature endorsement information may be added to the block body of the transaction block to construct a proposal message; for another example, an extension field may be created for the transaction block, and then the signature endorsement information may be added to the extension field of the transaction block to generate a proposal message.

[0154] In one possible implementation, there are multiple transaction data to be packaged. Then, in the process of generating a proposal message, the proposal node can also obtain the acquisition time of each transaction data to be packaged, and arrange the execution order of multiple transaction data according to the acquisition time of each transaction data, and determine the transaction execution order of each transaction data; package the transaction execution order into the proposal message; wherein, the transaction execution order is used to trigger any verification node that receives the proposal message to execute each transaction data in the transaction block in the order indicated by the transaction execution order. Specifically, the proposal node can sort each transaction data in sequence according to the acquisition time of each transaction data obtained from the transaction pool, please refer to Figure 5 , Figure 5 is a schematic diagram of a process for generating a proposal message provided by an embodiment of the present application, such as Figure 5 As shown, the proposal node can obtain multiple transaction data from the transaction pool: tx1, tx2, tx3, and build a transaction block based on the obtained transaction data. At the same time, it can also determine the acquisition time of each transaction data: for example, the acquisition time of transaction data tx1 is 10:00, the acquisition time of transaction data tx2 is 10:01, and the acquisition time of transaction data tx2 is 10:02, then the transaction execution order can be: tx1>tx2>tx3, that is, each node can execute transaction data tx1 first, then execute transaction data tx2, and finally execute transaction data tx3. In this way, when the amount of transaction data is large, each verification node can execute the transaction data in the block according to a unified transaction execution order, thereby improving the consensus efficiency.

[0155] In a possible implementation, the proposal node can also execute each transaction data in the transaction block to obtain the transaction execution result of each transaction data. Then, when assembling the proposal message, the proposal node can write the transaction execution result of each transaction data into the proposal message.

[0156] S304: Broadcast the proposal message to at least one verification node in the blockchain to trigger each verification node to perform consensus processing on the proposal message according to the hash fingerprint of the proposal node in the proposal message.

[0157] In specific implementation, the above consensus processing may include: verifying whether the transaction execution results of the proposal node for each transaction data in the transaction block are consistent with the transaction execution results of the verification node for each transaction data in the transaction block, and verifying whether the proposal message is generated by the proposal node. More specifically, the verification node can execute each transaction data in the proposal message after verifying the source of the proposal message (validity of the signature endorsement information: whether it is signed by the leader node elected in the current view, for example, the signature endorsement information can be verified based on the public key of the proposal node), and obtain the transaction execution results of each transaction data, wherein the proposal message may also include the transaction execution results of the proposal node. If the two are consistent, the proposal message is voted in favor; if they are inconsistent, the proposal message is voted against.

[0158] In a possible implementation, after the proposal node broadcasts the proposal message to at least one verification node in the blockchain, it may also include: receiving voting messages sent by each verification node, where the voting message is generated by any verification node after consensus processing of the proposal message; if it is determined that the proposal message meets the consensus conditions based on the received voting messages, the transaction block corresponding to the proposal message is processed on the chain.

[0159] Among them, the voting message is used to indicate the consensus result of the verification node after consensus processing on the transaction block corresponding to the proposal message. The consensus result is consensus success or consensus failure. After the proposal node receives the voting messages sent by multiple verification nodes, it obtains the consensus result corresponding to each verification node. If the received consensus result is that the number of nodes that have successfully reached consensus is greater than or equal to the preset number threshold (2f+1), it is determined that the proposal message meets the consensus condition; if the received consensus result is that the number of nodes that have successfully reached consensus is less than the preset number threshold (2f+1), it is determined that the proposal message does not meet the consensus condition.

[0160] Specifically, if it is determined that the proposal message meets the consensus conditions based on the received voting messages, the following two transaction processing operations can be triggered: ① Delete each transaction data in the transaction block from the transaction pool. For example, if the transaction block includes transaction data tx1, tx2, tx3, and tx4, then delete the transaction data tx1, tx2, tx3, and tx4 in the transaction pool. ② Obtain the block height of the transaction block in the blockchain; obtain at least one reference block in the blockchain that matches the block height; store each reference transaction included in each reference block obtained in the transaction pool. It should be understood that the same block height corresponds to one or more blocks to be added, but ultimately one block is allowed to be submitted to the chain. Therefore, this application needs to prune other blocks corresponding to the block height of the block to be chained (the transaction block that has passed consensus) to ensure that the transaction block is submitted to the chain.

[0161] In the embodiment of the present application, when constructing a proposal message, the proposal node first packages the transaction data to be packaged to obtain a transaction block, and then determines the signature endorsement information after signing and endorsing the transaction block based on the hash fingerprint of the proposal node. Next, the proposal message is constructed based on the signature endorsement information and the transaction block; during the block consensus process, after receiving the proposal message sent by the proposal node, the verification node can parse the hash fingerprint of the proposal node in the proposal message, and obtain the complete certificate data of the proposal node according to the hash fingerprint, and finally the verification node performs consensus processing on the proposal message based on the obtained complete certificate data. It can be seen that the proposal message constructed in the consensus process is generated after signing and endorsing the hash fingerprint of the proposal node. Compared with signing and endorsing based on the complete certificate data of the proposal node, the amount of data occupied by the hash fingerprint is smaller, thereby reducing the volume of the proposal message; further, proposal messages with a smaller volume can also reduce the amount of data transmission during the data transmission process, thereby accelerating the consensus efficiency.

[0162] See also Figure 6 , Figure 6 This is a flow chart of another blockchain consensus method provided by the embodiment of the present application. Figure 2aThe verification node in the blockchain consensus system shown. The blockchain consensus method mainly includes but is not limited to the following steps S601 to S603:

[0163] S601: Obtain the proposal message sent by the proposal node. The proposal message is generated by assembling the signature endorsement information and the transaction block. The signature endorsement information is determined by signing and endorsing the transaction block based on the hash fingerprint of the proposal node. The hash fingerprint is determined by hashing the certificate data corresponding to the proposal node.

[0164] In an embodiment of the present application, any verification node may include: a consensus engine and a core engine. Specifically, the proposal message sent by the proposal node can be obtained based on the consensus engine, and then the proposal message received by the consensus engine can be sent to the core engine for consensus processing.

[0165] In a possible implementation, after receiving the proposal message sent by the proposal node, the verification node can also obtain the node identification of the proposal node; and verify the proposal node according to the node identification. If the verification passes, it triggers the execution of parsing the proposal message to obtain the hash fingerprint of the proposal node, and obtains the certificate data of the proposal node according to the hash fingerprint. Among them, the so-called verification process includes: any one or more of security verification and legality verification. In this way, the proposal node in the blockchain can be securely verified, thereby improving the security and reliability of the blockchain consensus.

[0166] S602: Parse the proposal message to obtain the hash fingerprint of the proposal node, and obtain the certificate data of the proposal node according to the hash fingerprint.

[0167] In specific implementation, the verification node can perform data analysis on the proposal message to obtain the signature endorsement information and the hash fingerprint in the signature endorsement information. The so-called data analysis can include: data decompression processing and key field analysis processing. For example, assuming that the proposal message is obtained after data compression processing in a preset format, the same format needs to be used for data decompression processing during the data decompression process; for another example, assuming that the proposal message includes an extension field, the proposal message can be analyzed for key fields to obtain the extension field, thereby obtaining the hash fingerprint stored in the extension field. Next, the specific process of how to obtain the certificate data of the proposal node according to the hash fingerprint is described in detail:

[0168] In a possible implementation, the verification node obtains the certificate data of the proposal node according to the hash fingerprint, which may include: querying data from the cache component of the verification node according to the hash fingerprint, and using the queried data as the certificate data of the proposal node; or, if the corresponding data is not queried from the cache component of the verification node, querying the contract database of the verification node according to the hash fingerprint to obtain the certificate data of the proposal node; wherein the cache component is used to store the certificate data queried from the contract database. Optionally, if the certificate data is queried from the contract database, the queried certificate data can also be stored in the LRU cache component of the current verification node, so as to facilitate the next query of the corresponding certificate data directly from the LRU cache component.

[0169] See also Figure 7 , Figure 7 This is a flow chart of querying certificate data provided by an embodiment of the present application. In specific implementation, after receiving the proposal message, the verification node preferentially queries the certificate data of the corresponding proposal node from the LRU (Least Recently Used) cache component in the node memory. If the certificate data corresponding to the hash fingerprint is not found in the LRU cache component, the data is queried from the contract database of the verification node. If the certificate data is obtained from the contract database, the queried certificate data can also be stored in the LRU cache component of the current node. It should be understood that when any verification node performs consensus processing on a proposal message for the first time, it is necessary to query the corresponding complete certificate data from the node's contract database according to the hash fingerprint of the proposal node x, and then the queried certificate data can be stored in the LRU cache component, so that when the proposal message signed by the hash fingerprint of the proposal node x is received again in the future, the complete certificate data of the proposal node x can be directly obtained from the LRU cache component without querying the data from the contract database. The purpose of doing this is because the contract database (DB database) of any node stores the certificate data of other nodes in the blockchain network, and the data volume is large, and the LRU cache component usually only stores the certificate data queried by the node during the consensus process. Therefore, the efficiency of the verification node querying the contract database is often lower than the efficiency of querying the LRU cache component, which can reduce the query time and thus improve the consensus efficiency.

[0170] In one possible implementation, if the corresponding data is not queried from the cache component according to the hash fingerprint, and the corresponding data is not queried from the contract database according to the hash fingerprint, a voting message for the consensus failure of the proposal message is generated; and the voting message for the consensus failure is sent to the proposal node. Specifically, if the corresponding certificate data is not queried from the LRU cache component and the contract database of the slave node, the signature endorsement can be considered invalid, and the verification node determines that the consensus verification of the proposal message containing it has failed, and thus votes against the proposal message (the voting message for the consensus failure). Optionally, if the corresponding certificate data is not queried from the LRU cache component and the contract database of the slave node, the node identifier of the proposal node can be obtained, and the certificate data can be queried from the system contract maintained in the contract database based on the node identifier. If the corresponding data is not queried, the signature endorsement is considered invalid; if it can be queried, the queried corresponding data is used as the certificate data of the proposal node.

[0171] In a possible implementation, before obtaining the proposal message sent by the proposal node, the verification node can also obtain the node proposal to be sent by the proposal node, and the node proposal to be sent includes the certificate data of the proposal node; the node proposal is processed by consensus according to the certificate data included in the node proposal, and the consensus processing includes: verifying the identity of the proposal node, verifying the validity and security of the transaction data in the node proposal; if the node proposal is passed by consensus, a voting result of consensus is generated and sent to the proposal node. In specific implementation, ① verifying the validity of block data can include: verifying whether the transaction is legal (whether it includes sensitive and bad information), verifying whether the transaction authority is available (for example, for transfer transactions, it can be verified whether the object initiating the transfer has the transfer authority; for data query transactions, it can be verified whether the object initiating the data query has the query authority, etc.). ② Verifying the identity of the proposal node can include: verifying whether the current node proposal is initiated by the designated leader node, whether the signature endorsement information is correct, etc.

[0172] That is to say, before querying data based on hash fingerprint, the verification node needs to participate in the chain processing of the certificate data of the proposal node (the chain processing is used to store the certificate data of the proposal node in the system contract of the contract database. For the specific process, please refer to Figure 3 The relevant processes involved in the embodiment) are performed so that when the corresponding certificate data needs to be queried, the certificate data of the proposal node can be queried from the contract database based on the specified hash fingerprint.

[0173] S603: Perform consensus processing on the proposal message based on the acquired certificate data.

[0174] In specific implementation, consensus processing may include: verifying whether the transaction execution results of the proposal node for each transaction data in the transaction block are consistent with the transaction execution results of the verification node for each transaction data in the transaction block, and verifying whether the proposal message is generated by the proposal node. Next, the above two verification methods are explained in detail:

[0175] ①Verify the source of the proposal message:

[0176] In one possible implementation, the process of the verification node verifying whether the proposal message is generated by the proposal node may include: determining the proposal node associated with the acquired certificate data, and verifying whether the proposal node is consistent with the master node elected in the current consensus view; if they are consistent, it is determined that the proposal message is generated by the leader node, and the step of verifying the transaction data in the proposal message may be triggered.

[0177] ②Verify whether the transaction execution results are consistent:

[0178] In a possible implementation, the process of the verification node verifying whether the transaction execution result is consistent may include: executing each transaction data included in the transaction block in the proposal message to obtain the transaction execution result of each transaction data; parsing the proposal message to obtain the transaction execution result of the proposal node for each transaction data in the transaction block; if the transaction execution result corresponding to the verification node is the same as the transaction execution result of the proposal node, then generating a voting message for the consensus passing of the proposal message, and sending the voting message to the proposal node. Optionally, the proposal message includes a transaction execution order, and the verification node can parse the transaction execution order in the proposal message, and execute each transaction data in the transaction block in turn according to the transaction execution order obtained by the parsing, and obtain the transaction execution result of each transaction data, and finally compare the transaction execution result of each transaction data obtained by itself with the transaction execution result of each transaction data corresponding to the proposal node. If they are consistent, the block data consensus is passed. In this way, executing each transaction data according to the transaction execution order of the proposal node for each transaction data can ensure that the order of executing transaction data between nodes is consistent, thereby improving the efficiency of consensus processing.

[0179] Specifically, each transaction data in the transaction block can be executed by calling the smart contract. For example, see Figure 8 , Figure 8 This is a schematic diagram of a process for executing transaction data provided by an embodiment of the present application. Figure 8 As shown, in the process of executing transaction data, the following steps S1-S6 are mainly included:

[0180] S1. Trigger the contract.

[0181] In specific implementation, the verification node can obtain the contract address of the smart contract according to the transaction type of the transaction data, and trigger the call of its corresponding smart contract based on the contract address.

[0182] S2. Analyze transaction data.

[0183] In the specific implementation, the verification node parses the transaction data, obtains the contract call address and contract name, and obtains the smart contract used to execute the corresponding business request (for example, including contract name, contract method, and contract input information).

[0184] S3. Load the contract’s storage information and the contract’s bytecode.

[0185] In specific implementation, the verification node obtains the corresponding contract bytecode and contract input from the transaction data and status database.

[0186] S4. Execute the contract.

[0187] In specific implementation, the contract code is executed in the verification node to complete the business logic indicated by the corresponding transaction data, such as digital resource transfer logic, invoicing logic, game logic and other business logic.

[0188] S5. Return the result and update the status database.

[0189] In specific implementation, the verification node writes the transaction execution results corresponding to the transaction data back to the status database to complete the update of the business status.

[0190] S6. Create a Merkle tree root and store it in the block.

[0191] In a possible implementation, after the verification node has processed the proposal message by consensus based on the acquired certificate data, it can also receive the voting confirmation message sent by the proposal node (which may include the qc data set consisting of the voting messages of each verification node). The so-called voting confirmation message means that after the proposal node receives 2f+1 affirmative votes, it can confirm that the current proposal message has reached a consensus among the majority of consensus nodes, so that a voting confirmation message of consensus passing can be generated. The voting confirmation message is used for each verification node to know that the current proposal message has reached a consensus among the majority of nodes, and then enter the next consensus stage.

[0192] In an embodiment of the present application, during the block consensus process, after receiving the proposal message sent by the proposal node, the verification node can parse the hash fingerprint of the proposal node in the proposal message, and obtain the complete certificate data of the proposal node according to the hash fingerprint. Finally, the verification node performs consensus processing on the proposal message based on the obtained complete certificate data. Among them, the present application can use the LRU cache record in the node memory to record the certificate data obtained from the system contract. When verifying the proposal message that uses the hash fingerprint as the signature endorsement, the hash fingerprint can be used to query from the LRU cache component in the memory first. If it does not exist, the system contract data in the DB database can be queried. This method can reduce the number of times the contract data in the DB database is queried when verifying the signature endorsement of the proposal message, thereby improving data query efficiency.

[0193] See also Fig. 9 , Fig. 9 This is a schematic diagram of the interaction process of a blockchain consensus method provided by an embodiment of the present application. This interaction process is applied to Figure 2a The proposal node and verification node in the blockchain consensus system shown. The interaction process of the blockchain consensus method mainly includes but is not limited to the following steps S901 to S909:

[0194] S901: The proposal node receives transaction data sent by the user client.

[0195] In specific implementation, the transaction data may be transaction data initiated by a user client in real time, or the transaction data may be transaction data obtained from a transaction pool.

[0196] S902: The proposal node constructs a transaction block.

[0197] In specific implementation, the transaction data obtained by the proposal node may be one or more, and the proposal node may add each transaction data obtained to the block body of the transaction block. Optionally, in the process of constructing the transaction block, the proposal node may store each transaction data in the transaction block in sequence according to the acquisition time of each transaction data. For example, if the time of acquiring transaction data tx1 is 10:00, the time of acquiring transaction data tx2 is 10:01, and the time of acquiring transaction data tx3 is 10:02, then transaction data tx1 may be added to the transaction block first, then transaction data tx2 may be added to the transaction block, and finally transaction data tx3 may be added to the transaction block. Optionally, during the process of constructing a transaction block, the proposal node may also store each transaction data in the transaction block in sequence according to the data volume of each transaction data. For example, the data volume of transaction data tx1 is data1, the data volume of transaction data tx2 is data2, the data volume of transaction data tx3 is data3, and data1>data2>data3, then transaction data tx3 may be added to the transaction block first, then transaction data tx2 may be added to the transaction block, and finally transaction data tx1 may be added to the transaction block.

[0198] S903: The proposal node performs signature endorsement processing on the transaction block based on the hash fingerprint.

[0199] In specific implementation, the hash fingerprint may include: the hash fingerprint of the node certificate or the hash fingerprint of the node public key. The hash fingerprint of the node certificate refers to the data obtained after the node certificate is hashed, and the hash fingerprint of the node public key refers to the data obtained after the node public key is hashed. After the transaction block is signed and endorsed based on the hash fingerprint of the proposal node, the signature endorsement information can be obtained.

[0200] S904: The proposal node generates a proposal message.

[0201] In specific implementation, the proposal node may assemble the signature endorsement information and the transaction block to obtain a proposal message. Optionally, the specific process of the proposal node generating the proposal message may include: for example, the signature endorsement information and the transaction block may be packaged and compressed to obtain the proposal message; for another example, the signature endorsement information may be added to the block body of the transaction block to construct the proposal message; for another example, an extension field may be created for the transaction block, and then the signature endorsement information may be added to the extension field of the transaction block to generate the proposal message.

[0202] S905: The proposing node broadcasts the proposal message to the verifying node.

[0203] In one possible implementation, the proposing node may send the proposal message to some or all verification nodes to trigger each verification node to perform consensus processing on the proposal message based on the hash fingerprint of the proposing node in the proposal message.

[0204] S906: The verification node obtains the certificate data of the proposing node according to the hash fingerprint in the proposal message.

[0205] In specific implementation, the verification node can parse the proposal message, obtain the hash fingerprint in the proposal message, and then obtain the certificate data of the proposal node based on the hash fingerprint obtained by the analysis. More specifically, the verification node proposal node obtains the certificate data of the proposal node according to the hash fingerprint in the proposal message, which may include: querying data from the cache component of the verification node according to the hash fingerprint, and using the queried data as the certificate data of the proposal node; or, if the corresponding data is not queried from the cache component of the verification node, querying the contract database of the verification node according to the hash fingerprint to obtain the certificate data of the proposal node; wherein the cache component is used to store the certificate data queried from the contract database. Optionally, if the certificate data is obtained from the contract database, the queried certificate data can also be stored in the LRU cache component of the current verification node, so as to facilitate the next query of the corresponding certificate data directly from the LRU cache component.

[0206] S907: The verification node performs consensus processing on the proposal message based on the certificate data.

[0207] In specific implementation, consensus processing may include: verifying whether the transaction execution results of the proposal node for each transaction data in the transaction block are consistent with the transaction execution results of the verification node for each transaction data in the transaction block, and verifying whether the proposal message is generated by the proposal node. It should be noted that the consensus process of the verification node on the proposal message can be specifically referred to Figure 6 The specific process performed by step S603 in the embodiment will not be repeated here in the embodiment of the present application.

[0208] S908: The verification node sends a voting message to the proposal node.

[0209] In specific implementation, after the verification node has processed the proposal message through consensus, it can generate a voting message. The voting message is used to indicate the voting result of the proposal message, for example, the voting result can include a yes vote or a no vote. Optionally, the verification node can sign the voting message and then send the signed voting message to the proposal node.

[0210] S909: The proposal node determines the consensus result and enters the next round of consensus.

[0211] In specific implementation, after receiving voting messages from each verification node, the proposal node determines the consensus result of the proposal message based on the received voting messages. If the number of received votes is greater than or equal to 2f+1, the consensus result can be determined to be a consensus success, which can trigger the next round of consensus; if the number of received votes is less than 2f+1, the consensus result can be determined to be a consensus failure. In addition, if it is determined that the consensus on the proposal message is successful, the transaction block can also be processed on the chain.

[0212] In the embodiment of the present application, when constructing a proposal message, the proposal node first packages the transaction data to be packaged to obtain a transaction block, and then performs signature endorsement processing on the transaction block based on the hash fingerprint of the proposal node to determine the signature endorsement information, and then constructs the proposal message based on the signature endorsement information and the transaction block; in the block consensus process, after receiving the proposal message sent by the proposal node, the verification node can parse the hash fingerprint of the proposal node in the proposal message, and obtain the complete certificate data of the proposal node according to the hash fingerprint, and finally the verification node performs consensus processing on the proposal message according to the obtained complete certificate data. When constructing a proposal message, the proposal node performs signature endorsement based on the hash fingerprint, which can reduce the volume of the proposal message and reduce the amount of message transmission between networks, thereby improving the consensus efficiency; in addition, in a weak network environment, the transmission efficiency and arrival rate of the proposal message can be improved due to the reduction in the amount of message transmission; the fast and stable transmission of the proposal message accelerates the achievement of consensus between nodes, further improving the consensus efficiency.

[0213] The above detailed description of the method of the embodiment of the present application. In order to facilitate the better implementation of the above scheme of the embodiment of the present application, the device of the embodiment of the present application is provided below accordingly. Next, in combination with the blockchain consensus scheme provided in the above embodiment of the present application, the relevant devices of the embodiment of the present application are introduced accordingly.

[0214] See also Fig.10 , Fig.10 This is a schematic diagram of the structure of a blockchain consensus device provided in an embodiment of the present application. Fig.10 As shown, the blockchain consensus device 1000 can be applied to the proposal node mentioned in the above embodiments (for example, it can be a terminal device or a server). Specifically, the blockchain consensus device 1000 can be a computer program (including program code) running in a computer device, for example, the blockchain consensus device 1000 is an application software; the blockchain consensus device 1000 can be used to execute the corresponding steps in the blockchain-based identity authentication method provided in the embodiment of the present application. The blockchain consensus device 1000 can specifically include:

[0215] An acquisition unit 1001 is used to acquire a transaction block to be agreed upon, where the transaction block to be agreed upon is generated based on one or more transaction data to be packaged;

[0216] The processing unit 1002 is used to perform signature endorsement processing on the transaction block using the hash fingerprint of the proposal node to obtain signature endorsement information, where the hash fingerprint is determined by performing hash operation processing on the certificate data corresponding to the proposal node;

[0217] The processing unit 1002 is further used to assemble the signature endorsement information and the transaction block to generate a proposal message;

[0218] The sending unit 1003 is used to broadcast the proposal message to at least one verification node in the blockchain to trigger each verification node to perform consensus processing on the proposal message according to the hash fingerprint of the proposal node in the proposal message.

[0219] In a possible implementation, the processing unit 1002 is further configured to perform the following operations:

[0220] Receive the contract call transaction data sent by the operation node, the contract call transaction data includes: the contract identifier of the system contract;

[0221] The packaged transaction block is signed and endorsed according to the certificate data of the proposal node to generate the node proposal to be uploaded to the chain. The packaged transaction block includes the contract call transaction data;

[0222] If the blockchain consensus on the node proposal is confirmed to be passed, the certificate data of the proposal node will be uploaded to the chain according to the contract identifier of the system contract;

[0223] The contract identifier is used to instruct the proposing node and any verification node to store the certificate data of the proposing node in their respective contract databases, and the contract database maintains the system contract indicated by the contract identifier.

[0224] In a possible implementation, the processing unit 1002 performs signature endorsement processing on the packaged transaction block according to the certificate data of the proposal node, and after generating the node proposal to be uploaded to the chain, is further used to perform the following operations:

[0225] Broadcast the node proposal to be put on the chain to at least one verification node in the blockchain to trigger each verification node to process the certificate data corresponding to the proposal node on the chain;

[0226] Receive voting results sent by each verification node. The voting result refers to the result generated by any verification node after consensus processing of the node proposal to be put on the chain;

[0227] If the blockchain consensus on the node proposal is passed according to the received voting results, the hash fingerprint of the certificate data of the proposal node is obtained, and the certificate data and hash fingerprint of the proposal node are associated and stored in the contract database of the proposal node.

[0228] In a possible implementation, the processing unit 1002 performs on-chain processing on the certificate data of the proposal node according to the contract identifier of the system contract, and performs the following operations:

[0229] If the node proposal consensus is passed according to the received voting results, a notification message of the node proposal consensus passing is generated, and the notification message carries the contract identifier of the system contract;

[0230] Send the notification message to each verification node in the blockchain. The notification message is used to trigger any verification node to store the certificate data of the proposal node in the corresponding contract database;

[0231] Among them, the system contract maintained in the contract database of any verification node records: the hash fingerprint and certificate data stored in association with the proposal node.

[0232] In a possible implementation, after the processing unit 1002 broadcasts the proposal message to at least one verification node in the blockchain, it is further configured to perform the following operations:

[0233] Receive voting messages sent by each verification node. Voting messages are generated by any verification node after consensus processing of proposal messages;

[0234] If the proposal message is determined to meet the consensus conditions based on the received voting messages, the transaction block corresponding to the proposal message will be uploaded to the chain;

[0235] Among them, the consensus processing performed by any verification node includes: verifying whether the transaction execution results of the proposal node for each transaction data in the transaction block are consistent with the transaction execution results of the verification node for each transaction data in the transaction block, and verifying whether the proposal message is generated by the proposal node.

[0236] In a possible implementation, there are multiple transaction data to be packaged; the processing unit 1002 is further configured to perform the following operations:

[0237] Acquire the acquisition time of each transaction data to be packaged, and arrange the execution order of multiple transaction data according to the acquisition time of each transaction data to determine the transaction execution order of each transaction data;

[0238] Pack the transaction execution order into the proposal message;

[0239] Among them, the transaction execution order is used to trigger any verification node that receives the proposal message to execute each transaction data in the transaction block in the order indicated by the transaction execution order.

[0240] In the embodiment of the present application, when constructing a proposal message, the proposal node first packages the transaction data to be packaged to obtain a transaction block, and then determines the signature endorsement information after signing and endorsing the transaction block based on the hash fingerprint of the proposal node. Next, the proposal message is constructed based on the signature endorsement information and the transaction block; during the block consensus process, after receiving the proposal message sent by the proposal node, the verification node can parse the hash fingerprint of the proposal node in the proposal message, and obtain the complete certificate data of the proposal node according to the hash fingerprint, and finally the verification node performs consensus processing on the proposal message based on the obtained complete certificate data. It can be seen that the proposal message constructed in the consensus process is generated after signing and endorsing the hash fingerprint of the proposal node. Compared with signing and endorsing based on the complete certificate data of the proposal node, the amount of data occupied by the hash fingerprint is smaller, thereby reducing the volume of the proposal message; further, proposal messages with a smaller volume can also reduce the amount of data transmission during the data transmission process, thereby accelerating the consensus efficiency.

[0241] See also Fig.11 , Fig.11 Schematic diagram of another blockchain consensus device provided by the embodiment of the present application. Fig.11 As shown, the blockchain consensus device 1100 can be applied to the verification node mentioned in the above embodiments (for example, it can be a terminal device or a server). Specifically, the blockchain consensus device 1100 can be a computer program (including program code) running in a computer device, for example, the blockchain consensus device 1100 is an application software; the blockchain consensus device 1100 can be used to execute the corresponding steps in the blockchain-based identity authentication method provided in the embodiment of the present application. The blockchain consensus device 1100 can specifically include:

[0242] The receiving unit 1101 is used to receive a proposal message sent by a proposal node. The proposal message is generated by assembling the signature endorsement information and the transaction block. The signature endorsement information is determined by signing and endorsing the transaction block based on the hash fingerprint of the proposal node. The hash fingerprint is determined by performing a hash operation on the certificate data corresponding to the proposal node.

[0243] The processing unit 1102 is used to parse the proposal message to obtain the hash fingerprint of the proposal node, and obtain the certificate data of the proposal node according to the hash fingerprint;

[0244] The processing unit 1102 is further used to perform consensus processing on the proposal message according to the acquired certificate data.

[0245] In a possible implementation, the processing unit 1102 obtains the certificate data of the proposing node according to the hash fingerprint, and performs the following operations:

[0246] Query data from the cache component of the verification node based on the hash fingerprint, and use the queried data as the certificate data of the proposal node; or

[0247] If the corresponding data is not found in the cache component of the verification node, the contract database of the verification node is queried according to the hash fingerprint to obtain the certificate data of the proposal node;

[0248] Among them, the cache component is used to store the certificate data queried from the contract database.

[0249] In a possible implementation, the processing unit 1102 is further configured to perform the following operations:

[0250] If the corresponding data is not found from the cache component according to the hash fingerprint, and the corresponding data is not found from the contract database according to the hash fingerprint, a voting message indicating that the consensus of the proposal message has not been passed is generated;

[0251] Send the voting message that the consensus fails to pass to the proposal node.

[0252] In a possible implementation, the processing unit 1102 performs consensus processing on the proposal message according to the acquired certificate data to perform the following operations:

[0253] Determine the proposal node associated with the obtained certificate data, and verify whether the proposal node is consistent with the master node elected in the current consensus view;

[0254] If they are consistent, the step of verifying the transaction data in the proposal message is triggered.

[0255] In a possible implementation, the processing unit 1102 is further configured to perform the following operations:

[0256] Execute each transaction data included in the transaction block in the proposal message and obtain the transaction execution result of each transaction data;

[0257] Parse the proposal message to obtain the transaction execution results of the proposal node for each transaction data in the transaction block;

[0258] If the transaction execution result corresponding to the verification node is the same as the transaction execution result of the proposal node, a voting message for the consensus passed for the proposal message is generated and sent to the proposal node.

[0259] In a possible implementation, the processing unit 1102 is further configured to perform the following operations:

[0260] Get the node proposal to be put on the chain sent by the proposing node. The node proposal to be put on the chain includes the certificate data of the proposing node;

[0261] Perform consensus processing on the node proposal based on the certificate data included in the node proposal. The consensus processing includes: verifying the identity of the proposing node, verifying the validity and security of the transaction data in the node proposal;

[0262] If the node proposal consensus is passed, the voting result of the consensus is generated and sent to the proposing node.

[0263] In an embodiment of the present application, during the block consensus process, after receiving the proposal message sent by the proposal node, the verification node can parse the hash fingerprint of the proposal node in the proposal message, and obtain the complete certificate data of the proposal node according to the hash fingerprint. Finally, the verification node performs consensus processing on the proposal message based on the obtained complete certificate data. Among them, the present application can use the LRU cache record in the node memory to record the certificate data obtained from the system contract. When verifying the proposal message that uses the hash fingerprint as the signature endorsement, the hash fingerprint can be used to query from the LRU cache component in the memory first. If it does not exist, the system contract data in the DB database can be queried. This method can reduce the number of times the contract data in the DB database is queried when verifying the signature endorsement of the proposal message, thereby improving data query efficiency.

[0264] See also Fig.12 , Fig.12It is a structural diagram of a computer device provided in an embodiment of the present application. The computer device 1200 is used to execute the steps performed by the proposal node and the verification node in the aforementioned method embodiment. The computer device 1200 includes: one or more processors 1201; one or more input devices 1202, one or more output devices 1203 and a memory 1204. The above-mentioned processor 1201, input device 1202, output device 1203 and memory 1204 are connected via a bus 1205. Among them, the processor 1201 (or CPU (Central Processing Unit)) is the processing core of the computer device, and the processor 1201 is suitable for implementing one or more program instructions, and is specifically suitable for loading and executing one or more program instructions to implement the above-mentioned blockchain consensus method process. In addition, the memory 1204 can be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk memory; optionally, it can also be at least one memory located away from the aforementioned processor. The memory 1204 provides a storage space, which is used to store the operating system of the content playback device. In addition, the storage space is also used to store a computer program, which includes program instructions, and the program instructions are suitable for being called and executed by a processor to execute the various steps of the blockchain consensus method in this application.

[0265] Specifically, the memory 1204 is used to store a computer program, where the computer program includes program instructions. The processor 1201 calls the program instructions stored in the memory 1204 to perform the following operations:

[0266] Obtain the transaction block to be agreed upon. The transaction block to be agreed upon is generated based on one or more transaction data to be packaged;

[0267] The transaction block is signed and endorsed using the hash fingerprint of the proposal node to obtain the signature endorsement information. The hash fingerprint is determined by hashing the certificate data corresponding to the proposal node.

[0268] Assemble the signature endorsement information and transaction blocks to generate a proposal message;

[0269] The proposal message is broadcast to at least one verification node in the blockchain to trigger each verification node to perform consensus processing on the proposal message based on the hash fingerprint of the proposal node in the proposal message.

[0270] In a possible implementation, the processor 1201 is further configured to perform the following operations:

[0271] Receive the contract call transaction data sent by the operation node, the contract call transaction data includes: the contract identifier of the system contract;

[0272] The packaged transaction block is signed and endorsed according to the certificate data of the proposal node to generate the node proposal to be uploaded to the chain. The packaged transaction block includes the contract call transaction data;

[0273] If the blockchain consensus on the node proposal is confirmed to be passed, the certificate data of the proposal node will be uploaded to the chain according to the contract identifier of the system contract;

[0274] The contract identifier is used to instruct the proposing node and any verification node to store the certificate data of the proposing node in their respective contract databases, and the contract database maintains the system contract indicated by the contract identifier.

[0275] In a possible implementation, the processor 1201 performs signature endorsement processing on the packaged transaction block according to the certificate data of the proposing node, and after generating the node proposal to be uploaded to the chain, is further used to perform the following operations:

[0276] Broadcast the node proposal to be put on the chain to at least one verification node in the blockchain to trigger each verification node to process the certificate data corresponding to the proposal node on the chain;

[0277] Receive voting results sent by each verification node. The voting result refers to the result generated by any verification node after consensus processing of the node proposal to be put on the chain;

[0278] If the blockchain consensus on the node proposal is passed according to the received voting results, the hash fingerprint of the certificate data of the proposal node is obtained, and the certificate data and hash fingerprint of the proposal node are associated and stored in the contract database of the proposal node.

[0279] In a possible implementation, the processor 1201 processes the certificate data of the proposal node on the chain according to the contract identifier of the system contract to perform the following operations:

[0280] If the node proposal consensus is passed according to the received voting results, a notification message of the node proposal consensus passing is generated, and the notification message carries the contract identifier of the system contract;

[0281] Send the notification message to each verification node in the blockchain. The notification message is used to trigger any verification node to store the certificate data of the proposal node in the corresponding contract database;

[0282] Among them, the system contract maintained in the contract database of any verification node records: the hash fingerprint and certificate data stored in association with the proposal node.

[0283] In a possible implementation, after the processor 1201 broadcasts the proposal message to at least one verification node in the blockchain, it is further configured to perform the following operations:

[0284] Receive voting messages sent by each verification node. Voting messages are generated by any verification node after consensus processing of proposal messages;

[0285] If the proposal message is determined to meet the consensus conditions based on the received voting messages, the transaction block corresponding to the proposal message will be uploaded to the chain;

[0286] Among them, the consensus processing performed by any verification node includes: verifying whether the transaction execution results of the proposal node for each transaction data in the transaction block are consistent with the transaction execution results of the verification node for each transaction data in the transaction block, and verifying whether the proposal message is generated by the proposal node.

[0287] In a possible implementation, there are multiple transaction data to be packaged; the processor 1201 is further configured to perform the following operations:

[0288] Acquire the acquisition time of each transaction data to be packaged, and arrange the execution order of multiple transaction data according to the acquisition time of each transaction data to determine the transaction execution order of each transaction data;

[0289] Pack the transaction execution order into the proposal message;

[0290] Among them, the transaction execution order is used to trigger any verification node that receives the proposal message to execute each transaction data in the transaction block in the order indicated by the transaction execution order.

[0291] Specifically, the memory 1204 is used to store a computer program, where the computer program includes program instructions. The processor 1201 calls the program instructions stored in the memory 1204 and is also used to perform the following operations:

[0292] Receive the proposal message sent by the proposal node. The proposal message is generated by assembling the signature endorsement information and the transaction block. The signature endorsement information is determined by signing and endorsing the transaction block based on the hash fingerprint of the proposal node. The hash fingerprint is determined by hashing the certificate data corresponding to the proposal node.

[0293] Parse the proposal message to obtain the hash fingerprint of the proposal node, and obtain the certificate data of the proposal node according to the hash fingerprint;

[0294] Based on the obtained certificate data, consensus processing is performed on the proposal message.

[0295] In a possible implementation, the processor 1201 obtains the certificate data of the proposing node according to the hash fingerprint, and performs the following operations:

[0296] Query data from the cache component of the verification node based on the hash fingerprint, and use the queried data as the certificate data of the proposal node; or

[0297] If the corresponding data is not found in the cache component of the verification node, the contract database of the verification node is queried according to the hash fingerprint to obtain the certificate data of the proposal node;

[0298] Among them, the cache component is used to store the certificate data queried from the contract database.

[0299] In a possible implementation, the processor 1201 is further configured to perform the following operations:

[0300] If the corresponding data is not found from the cache component according to the hash fingerprint, and the corresponding data is not found from the contract database according to the hash fingerprint, a voting message indicating that the consensus of the proposal message has not been passed is generated;

[0301] Send the voting message that the consensus fails to pass to the proposal node.

[0302] In a possible implementation, the processor 1201 performs consensus processing on the proposal message according to the acquired certificate data to perform the following operations:

[0303] Determine the proposal node associated with the obtained certificate data, and verify whether the proposal node is consistent with the master node elected in the current consensus view;

[0304] If they are consistent, the step of verifying the transaction data in the proposal message is triggered.

[0305] In a possible implementation, the processor 1201 is further configured to perform the following operations:

[0306] Execute each transaction data included in the transaction block in the proposal message and obtain the transaction execution result of each transaction data;

[0307] Parse the proposal message to obtain the transaction execution results of the proposal node for each transaction data in the transaction block;

[0308] If the transaction execution result corresponding to the verification node is the same as the transaction execution result of the proposal node, a voting message for the consensus passed for the proposal message is generated and sent to the proposal node.

[0309] In a possible implementation, the processor 1201 is further configured to perform the following operations:

[0310] Get the node proposal to be put on the chain sent by the proposing node. The node proposal to be put on the chain includes the certificate data of the proposing node;

[0311] Perform consensus processing on the node proposal based on the certificate data included in the node proposal. The consensus processing includes: verifying the identity of the proposing node, verifying the validity and security of the transaction data in the node proposal;

[0312] If the node proposal consensus is passed, the voting result of the consensus is generated and sent to the proposing node.

[0313] It can be seen that the proposal message constructed during the consensus process is generated based on the hash fingerprint signature endorsement of the proposal node. Compared with the signature endorsement based on the complete certificate data of the proposal node, the hash fingerprint occupies a smaller amount of data, thereby reducing the volume of the proposal message; further, the proposal message with a smaller volume can also reduce the amount of data transmission during the data transmission process, thereby accelerating the consensus efficiency. In addition, the fast and stable transmission of proposal messages can accelerate the consensus between nodes and further improve the consensus efficiency.

[0314] In addition, it should be pointed out here that: the embodiment of the present application also provides a computer storage medium, and a computer program is stored in the computer storage medium, and the computer program includes program instructions. When the processor executes the above program instructions, the method in the corresponding embodiment of the foregoing text can be executed, so it will not be repeated here. For technical details not disclosed in the computer storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application. As an example, the program instructions can be deployed on a computer device, or executed on multiple computer devices located in one place, or, executed on multiple computer devices distributed in multiple locations and interconnected by a communication network.

[0315] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes a computer instruction, and the computer instruction is stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device can execute the method in the above corresponding embodiment, so it will not be repeated here.

[0316] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the above-mentioned program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The above-mentioned storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0317] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.

Claims

1. A blockchain consensus method, characterized in that: include: Obtaining a transaction block to be agreed upon, where the transaction block to be agreed upon is generated based on one or more transaction data to be packaged; The transaction block is signed and endorsed using the hash fingerprint of the proposal node to obtain signature endorsement information, wherein the hash fingerprint is determined by performing a hash operation on the certificate data corresponding to the proposal node; Assembling the signature endorsement information and the transaction block to generate a proposal message; The proposal message is broadcast to at least one verification node in the blockchain to trigger each verification node to perform consensus processing on the proposal message according to the hash fingerprint of the proposal node in the proposal message.

2. The method according to claim 1, characterized in that The method further comprises: Receiving contract call transaction data sent by the operation node, wherein the contract call transaction data includes: a contract identifier of the system contract; Perform signature endorsement processing on the packaged transaction block according to the certificate data of the proposal node to generate a node proposal to be uploaded to the chain, wherein the packaged transaction block includes the contract call transaction data; If it is determined that the blockchain consensus on the node proposal is passed, the certificate data of the proposal node is uploaded to the chain according to the contract identifier of the system contract; The contract identifier is used to instruct the proposal node and any verification node to store the certificate data of the proposal node in their respective contract databases, and the contract database maintains the system contract indicated by the contract identifier.

3. The method according to claim 2, characterized in that After the packaged transaction block is signed and endorsed according to the certificate data of the proposal node to generate the node proposal to be put on the chain, it also includes: Broadcast the node proposal to be put on the chain to at least one verification node in the blockchain to trigger each verification node to process the certificate data corresponding to the proposal node on the chain; Receive voting results sent by each verification node, where the voting results refer to those generated after any verification node reaches consensus on the node proposal to be put on the chain; If the blockchain consensus on the node proposal is passed according to the received voting results, the hash fingerprint of the certificate data of the proposal node is obtained, and the certificate data of the proposal node and the hash fingerprint are associated and stored in the contract database of the proposal node.

4. The method according to claim 3, characterized in that The on-chain processing of the certificate data of the proposal node according to the contract identifier of the system contract includes: If it is determined that the node proposal consensus is passed according to the received voting results, a notification message of the node proposal consensus passing is generated, and the notification message carries the contract identifier of the system contract; Send the notification message to each verification node in the blockchain, and the notification message is used to trigger any verification node to store the certificate data of the proposal node in the corresponding contract database; Among them, the system contract maintained in the contract database of any verification node records: the hash fingerprint and the certificate data stored in association with the proposal node.

5. The method according to claim 1, characterized in that After broadcasting the proposal message to at least one verification node in the blockchain, the method further includes: Receive voting messages sent by each verification node, where the voting messages are generated by any verification node after consensus processing of the proposal message; If it is determined that the proposal message meets the consensus conditions based on the received voting messages, the transaction block corresponding to the proposal message is put on the chain for processing; Among them, the consensus processing performed by any verification node includes: verifying whether the transaction execution results of the proposal node for each transaction data in the transaction block are consistent with the transaction execution results of the verification node for each transaction data in the transaction block, and verifying whether the proposal message is generated by the proposal node.

6. The method according to claim 1, characterized in that The transaction data to be packaged is multiple; the method further includes: Acquire the acquisition time of each transaction data to be packaged, and arrange the execution order of multiple transaction data according to the acquisition time of each transaction data to determine the transaction execution order of each transaction data; Packing the transaction execution order into the proposal message; The transaction execution order is used to trigger any verification node that receives the proposal message to execute each transaction data in the transaction block in the order indicated by the transaction execution order.

7. A blockchain consensus method, characterized in that: include: Receive a proposal message sent by a proposal node, wherein the proposal message is generated by assembling signature endorsement information and a transaction block, wherein the signature endorsement information is determined by signing and endorsing the transaction block based on the hash fingerprint of the proposal node, and the hash fingerprint is determined by hashing the certificate data corresponding to the proposal node; Parsing the proposal message to obtain the hash fingerprint of the proposal node, and obtaining the certificate data of the proposal node according to the hash fingerprint; The proposal message is processed by consensus based on the acquired certificate data.

8. The method according to claim 7, characterized in that The obtaining the certificate data of the proposal node according to the hash fingerprint includes: According to the hash fingerprint, data is queried from the cache component of the verification node, and the queried data is used as the certificate data of the proposal node; or If no corresponding data is found in the cache component of the verification node, query the contract database of the verification node according to the hash fingerprint to obtain the certificate data of the proposal node; The cache component is used to store the certificate data obtained by querying from the contract database.

9. The method according to claim 8, characterized in that The method further comprises: If no corresponding data is found from the cache component according to the hash fingerprint, and no corresponding data is found from the contract database according to the hash fingerprint, a voting message indicating that the consensus of the proposal message has not been passed is generated; The voting message that the consensus fails is sent to the proposal node.

10. The method according to claim 7, characterized in that The consensus processing of the proposal message according to the acquired certificate data includes: Determine the proposal node associated with the obtained certificate data, and verify whether the proposal node is consistent with the master node elected in the current consensus view; If they are consistent, it triggers the step of verifying the transaction data in the proposal message.

11. The method according to claim 10, characterized in that The method further comprises: Execute each transaction data included in the transaction block in the proposal message to obtain the transaction execution result of each transaction data; Parsing the proposal message to obtain the transaction execution result of the proposal node for each transaction data in the transaction block; If the transaction execution result corresponding to the verification node is the same as the transaction execution result of the proposal node, a voting message for consensus passing of the proposal message is generated and sent to the proposal node.

12. The method according to claim 7, characterized in that The method further comprises: Obtaining a node proposal to be put on the chain sent by a proposing node, wherein the node proposal to be put on the chain includes the certificate data of the proposing node; Performing consensus processing on the node proposal according to the certificate data included in the node proposal, wherein the consensus processing includes: verifying the identity of the proposing node, and verifying any one or more of the validity and security of the transaction data in the node proposal; If the consensus on the node proposal is passed, a voting result of the consensus is generated and the voting result is sent to the proposing node.

13. A blockchain consensus device, characterized in that: The device comprises: An acquisition unit, used to acquire a transaction block to be agreed upon, wherein the transaction block to be agreed upon is generated based on one or more transaction data to be packaged; A processing unit, configured to perform signature endorsement processing on the transaction block using a hash fingerprint of a proposal node to obtain signature endorsement information, wherein the hash fingerprint is determined by performing a hash operation on certificate data corresponding to the proposal node; The processing unit is further used to assemble the signature endorsement information and the transaction block to generate a proposal message; A sending unit is used to broadcast the proposal message to at least one verification node in the blockchain to trigger each verification node to perform consensus processing on the proposal message according to the hash fingerprint of the proposal node in the proposal message.

14. A blockchain consensus device, characterized in that: The device comprises: A receiving unit, configured to receive a proposal message sent by a proposal node, wherein the proposal message is generated by assembling signature endorsement information and a transaction block, wherein the signature endorsement information is determined by signing and endorsing the transaction block based on a hash fingerprint of the proposal node, and the hash fingerprint is determined by performing a hash operation on certificate data corresponding to the proposal node; A processing unit, configured to parse the proposal message to obtain a hash fingerprint of the proposal node, and obtain certificate data of the proposal node according to the hash fingerprint; The processing unit is further used to perform consensus processing on the proposal message according to the acquired certificate data.

15. A computer device, characterized in that: include: storage devices and processors; a memory storing one or more computer programs; A processor, configured to load the one or more computer programs to implement the blockchain consensus method as described in any one of claims 1-6 or 7-12.

16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which is suitable for being loaded by a processor and executing the blockchain consensus method as described in any one of claims 1-6 or 7-12.

17. A computer program product, characterized in that The computer program product comprises a computer program, which is suitable for being loaded by a processor and executing the blockchain consensus method as described in any one of claims 1-6 or 7-12.