EP4325811A1 - Procédé et appareil de traitement de données pour réseau de consensus, produit-programme, dispositif et support - Google Patents

Procédé et appareil de traitement de données pour réseau de consensus, produit-programme, dispositif et support Download PDF

Info

Publication number
EP4325811A1
EP4325811A1 EP23790211.9A EP23790211A EP4325811A1 EP 4325811 A1 EP4325811 A1 EP 4325811A1 EP 23790211 A EP23790211 A EP 23790211A EP 4325811 A1 EP4325811 A1 EP 4325811A1
Authority
EP
European Patent Office
Prior art keywords
consensus
block
node
network
nodes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
EP23790211.9A
Other languages
German (de)
English (en)
Inventor
Zhuguang SHAO
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from CN202210800712.6A external-priority patent/CN117411894A/zh
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Publication of EP4325811A1 publication Critical patent/EP4325811A1/fr
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures

Definitions

  • This application relates to the field of blockchain technologies, and in particular, to a data processing method and apparatus for a consensus network, a program product, a device, and a medium.
  • a blockchain is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, and an encryption algorithm. Chaining processing can be performed on a block in a blockchain network only after consensus on the block is successful in a consensus network.
  • the consensus processing needs to be performed after the block is broadcast between consensus nodes in the consensus network.
  • a scale of the consensus network is excessively large, and there are a large quantity of consensus nodes, a communication volume during broadcast and consensus on the block in the consensus network is excessively large. As a result, processing performance of the whole consensus network is greatly degraded.
  • This application provides a data processing method and apparatus for a consensus network, a program product, a device, and a medium, which can reduce a communication volume during consensus on a block in the consensus network, and improve efficiency and performance for consensus on the block in the consensus network.
  • An aspect of this application provides a data processing method for a consensus network.
  • the consensus network includes N consensus nodes, N being a positive integer, and the N consensus nodes include a first master node.
  • the method is executable by a first consensus node of the N consensus nodes other than the first master node.
  • the method includes:
  • An aspect of this application provides a data processing apparatus for a consensus network.
  • the consensus network includes N consensus nodes, N being a positive integer, and the N consensus nodes include a first master node.
  • the apparatus is applicable to a first consensus node of the N consensus nodes other than the first master node.
  • the apparatus includes:
  • An aspect of this application provides a computer device, including a memory and a processor, the memory storing a computer program, the computer program, when executed by the processor, causing the processor to perform the method according to an aspect of this application.
  • An aspect of this application provides a computer-readable storage medium, storing a computer program including program instructions, the program instructions, when executed by a processor, causing the processor to perform the method according to the foregoing aspect.
  • An aspect of this application provides a computer program product, including a computer program, the computer program being stored in a computer-readable storage medium.
  • a processor of a computer device reads the computer program from the computer-readable storage medium, and executes the computer program, so that the computer device performs the method according to the various optional implementations according to the foregoing aspect.
  • the consensus network includes N consensus nodes.
  • a first master node in the consensus network may initiate a consensus process for a first block.
  • a first consensus node may receive the first block broadcast by a second consensus node in a second consensus sub-network.
  • the second consensus sub-network includes K consensus nodes of the N consensus nodes, both the first consensus node and the second consensus node belong to the second consensus sub-network, and the second consensus node is any one of the N consensus nodes other than the first consensus node, K being a positive integer less than N.
  • the second consensus sub-network is a small-scale network.
  • Consensus processing is performed on the first block in the second consensus sub-network to obtain a consensus result of the first consensus node for the first block.
  • the first block is broadcast in a first consensus sub-network to which the first consensus node belongs, to continue to perform the consensus processing on the first block in the first consensus sub-network.
  • the first consensus sub-network includes M consensus nodes of the N consensus nodes, M being a positive integer less than N.
  • the first consensus sub-network is also a small-scale network. In this way, consensus in the large-scale consensus network is converted into consensus in several small-scale consensus sub-networks.
  • each consensus node can broadcast a block in a small network (for example, the first consensus sub-network and the second consensus sub-network) of the consensus network, to further perform consensus processing on the block in the small network, which can reduce a communication volume during consensus on the block, and improve efficiency and performance for consensus on the block in the consensus network.
  • a small network for example, the first consensus sub-network and the second consensus sub-network
  • the blockchain is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, and an encryption algorithm.
  • the blockchain is essentially a decentralized database and a series of associated data blocks generated by cryptographic methods. Each data block includes information about a batch of network transactions for verifying the validity of the information (for anti-counterfeiting) and generating a next block.
  • the blockchain may include a blockchain underlying platform, a platform product service layer, and an application service layer.
  • the blockchain includes a series of blocks that are consecutive in a chronological order of generation. Once a new block is added to the blockchain, the new block is no longer removed.
  • the block records recorded data submitted by the node in the blockchain system.
  • a large-scale consensus network may be converted into several small-scale consensus sub-networks to implement consensus processing on a block, to improve performance and efficiency for consensus processing on the block in the consensus network.
  • This application may relate to a cloud technology, for example, blockchain nodes (for example, consensus nodes) can communicate with each other through "cloud”.
  • blockchain nodes for example, consensus nodes
  • All data (for example, a block and service data in the block) acquired in this application is acquired in a case that on object (for example, a user) to which the service data belongs agrees and authorizes separately, and acquisition, use, and processing of related data need to comply with the relevant laws and standards of the relevant countries and regions.
  • FIG. 1 is a schematic structural diagram of a network architecture of a consensus network according to this application.
  • the consensus network may include a plurality of consensus nodes, including a consensus node 1 to a consensus node N, where N is a positive integer, and a value of N is determined based on an actual application scenario.
  • Any consensus node may include one or more computer devices.
  • the computer device may be a terminal device, or may be a server, or the like.
  • the server may be an independent physical server, or may be a server cluster including a plurality of physical servers or a distributed system, or may be a cloud server providing basic cloud computing services, such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, a middleware service, a domain name service, a security service, a content delivery network (CDN), big data, and an artificial intelligence platform.
  • basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, a middleware service, a domain name service, a security service, a content delivery network (CDN), big data, and an artificial intelligence platform.
  • the terminal device may be a smart terminal such as a smartphone, a tablet computer, a notebook computer, a desktop computer, a smart television, or an in-vehicle terminal.
  • FIG. 2 is a schematic diagram of a scenario of block consensus according to this application.
  • rotation may be performed on a master node in the consensus network
  • the consensus node 1 may be a master node that currently initiates proposal consensus on a block.
  • the consensus node 1 may first broadcast, to a corresponding consensus sub-network 1, a block on which consensus processing is to be performed.
  • the consensus sub-network 1 may include the consensus node 1, a consensus node 2, a consensus node 3, and a consensus node 4.
  • consensus processing may be performed on a block initiated by the consensus node 1 in the consensus sub-network 1.
  • each consensus node in the consensus sub-network 1 may respectively obtain a consensus result of the consensus node for the block.
  • the consensus result is a consensus result (for example, a consensus success result or a consensus failure result) of each consensus node respectively for the block, instead of a final consensus result of all consensus nodes in the consensus sub-network 1 for the block.
  • Consensus results of consensus nodes for the block may be the same or different.
  • consensus node 2 may further continue to broadcast the block to a corresponding consensus sub-network 2.
  • the consensus sub-network 2 may include the consensus node 2, a consensus node 5, a consensus node 6, and a consensus node 7. Further, consensus processing may be continued on the block initiated by the consensus node in the consensus sub-network 2. After consensus processing is completed, each consensus node in the consensus sub-network 2 may also respectively obtain a consensus result of the consensus node for the block.
  • consensus node 3 may further continue to broadcast the block to a corresponding consensus sub-network 3.
  • the consensus sub-network 3 may include the consensus node 3, a consensus node 8, a consensus node 9, and a consensus node 10. Further, consensus processing may be continued on the block initiated by the consensus node in the consensus sub-network 3. After consensus processing is completed, each consensus node in the consensus sub-network 3 may also respectively obtain a consensus result of the consensus node for the block.
  • consensus node 4 may further continue to broadcast the block to a corresponding consensus sub-network 4.
  • the consensus sub-network 4 may include the consensus node 4, a consensus node 11, a consensus node 12, and a consensus node 13. Further, consensus processing may be continued on the block initiated by the consensus node in the consensus sub-network 4. After consensus processing is completed, each consensus node in the consensus sub-network 4 may also respectively obtain a consensus result of the consensus node for the block.
  • a consensus node in the consensus node 5, the consensus node 6, the consensus node 7, the consensus node 8, the consensus node 9, the consensus node 10, the consensus node 11, the consensus node 12, and the consensus node 13 that succeeds in consensus on the block may further continue to broadcast the block to more consensus nodes in the consensus network (for example, broadcast to a corresponding consensus sub-network), to continue to perform the consensus processing on the block, so that consensus processing is performed on the block in the whole consensus network after broadcast and consensus processing are performed on the block in each consensus sub-network.
  • a consensus node that succeeds in block consensus in the consensus network may broadcast a respective consensus success result for the block in the whole network (the whole consensus network).
  • a quantity of consensus results for the block obtained by consensus nodes in the consensus network is greater than or equal to a quantity threshold, it indicates that consensus processing on the block is successful in the whole network, and chaining processing may be performed on the block, for example, the block may be added to a blockchain to which the consensus network belongs.
  • consensus processing is performed on a block in each small network (for example, each small-scale consensus sub-network) instead of being performed on a block in the whole consensus network, to reduce communication complexity during consensus processing on the block, reduce a communication volume during consensus processing on the block, improve efficiency of consensus on the block, and improve performance of consensus on the block in the whole consensus network.
  • each small network for example, each small-scale consensus sub-network
  • FIG. 3 is a schematic flowchart of a data processing method for a consensus network according to this application. As shown in FIG. 3 , the method may include the following steps S101 to S103.
  • S101 Receive a first block broadcast by a second consensus node in a second consensus sub-network, the second consensus sub-network including K consensus nodes in the N consensus nodes, both the first consensus node and the second consensus node belonging to the second consensus sub-network, K being a positive integer less than N, the second consensus node being any one of the N consensus nodes other than the first consensus node, and a consensus process for the first block being initiated by the first master node.
  • the consensus network may include N consensus nodes, the N consensus nodes may be blockchain nodes that perform consensus processing on a block on which chaining processing is to be performed, N is a positive integer, and a specific value of N may be determined based on an actual application scenario.
  • Any consensus node may include one or more computer devices.
  • the computer device may be a server or a terminal device, which may alternatively be determined based on an actual application scenario, and is not limited herein.
  • the N consensus nodes may include a first master node.
  • the first master node is a master node that currently initiates proposal consensus on a block.
  • the first master node may be a consensus node.
  • the first master node may be a consensus node that is currently configured to initiate consensus processing on the block. Therefore, it may be understood that, an execution entity in this embodiment of this application may be a first consensus node, and the first consensus node may be any consensus node in the N consensus nodes other than the first master node.
  • the first consensus node may receive a first block broadcast by the second consensus node in the second consensus sub-network.
  • the first block is a block on which consensus processing currently is to be performed.
  • the consensus process for the first block may be initiated by the first master node, a proposal on the first block may be first initiated by the first master node, the first block may be generated by the first master node, and the first block may include any service data on which chaining processing is to be performed, for example, transaction data, and the like.
  • the method according to this embodiment of this application may be performed to improve a consensus process of TendermintBFT (TBFT for short, which is a consensus algorithm).
  • TendermintBFT for short, which is a consensus algorithm
  • rotation may be performed on a master node in the consensus network.
  • There may be a plurality of rotation manners.
  • each consensus node in the consensus network may respectively has a corresponding node number, so that the master node in the consensus network may sequentially perform rotation based on a node number of each consensus node, or the master node in the consensus network may also perform rotation based on another policy, where each consensus node in the consensus network can know a rotation policy of the master node.
  • each consensus node may know which consensus node is a master node at a moment without notifying each other.
  • the method according to this application may be performed to convert a large-scale consensus network in the TBFT into several small networks (for example, several consensus sub-networks) to perform consensus processing on a block, to reduce a data volume during data broadcast in consensus processing, and reduce communication complexity during data broadcast in consensus processing.
  • the second consensus node may be any consensus node in the N consensus nodes other than the first consensus node.
  • the second consensus sub-network may be understood as a consensus sub-network corresponding to the second consensus node, the second consensus sub-network may be a sub-network (which is also referred to as a small network or a small-scale network) in the consensus network, and the second consensus sub-network may include K consensus nodes, where K is a positive integer less than N, K may be relatively less than N, and a value of N may be determined based on an actual application scenario.
  • Both the first consensus node and the second consensus node belong to the second consensus sub-network, that is, the second consensus sub-network includes the first consensus node and the second consensus node.
  • First remaining consensus nodes in the K consensus nodes may be K-1 consensus nodes that are selected (which may be randomly selected) by the second consensus node from the N consensus nodes and are interconnected (i.e., communicated) with the second consensus node.
  • the K-1 consensus nodes may be consensus nodes to which the second consensus node may broadcast a block when obtaining the block on which consensus processing is to be performed.
  • the first remaining consensus nodes may be consensus nodes in the K consensus nodes other than the second consensus node.
  • the K-1 consensus nodes may also be consensus nodes that are selected based on a routing table and have a shorter route to the second consensus node, or the K-1 consensus nodes may be preset consensus nodes to which the second consensus node may broadcast the block on which consensus processing is to be performed.
  • the K-1 consensus nodes may be intermittently updated, for example, updated at intervals (for example, periodically). During update, a value of K may also be updated, that is, a quantity of consensus nodes to which the second consensus node may broadcast the block on which consensus processing is to be performed may also be changed.
  • consensus nodes to which the second consensus node may broadcast the block on which consensus processing is to be performed may be periodically updated and dynamically changed.
  • how to determine the second consensus sub-network corresponding to the second consensus node may be determined based on an actual application scenario, which is not limited herein.
  • the second consensus sub-network may be understood as a virtual consensus sub-network configured to broadcast the first block, which is generated when the second consensus node broadcasts the first block.
  • the consensus sub-network may not be an independent sub-network obtained through division in advance.
  • the first block broadcast by the second consensus node may be generated by the second consensus node, and the second consensus node initiates the consensus process for the first block.
  • the first block broadcast by the second consensus node may be obtained by a third consensus node in the N consensus nodes broadcasting to the second consensus node, where the third consensus node is any consensus node in the N consensus nodes other than the first consensus node and the second consensus node.
  • a principle of broadcasting the first block to the second consensus node by the third consensus node in the N consensus nodes is the same as a principle of broadcasting the first block to the first consensus node by the second consensus node, for example, the first block may be broadcast to a corresponding consensus sub-network, where the consensus sub-network may include the second consensus node.
  • the first block may initially be generated by the first master node and broadcast to a corresponding consensus sub-network
  • the first block received by each consensus node in a consensus sub-network corresponding to the first master node may be broadcast by the first master node
  • the first block received by remaining consensus nodes in the N consensus nodes may be broadcast by consensus nodes in the N consensus nodes other than the first master node.
  • the remaining consensus nodes may be consensus nodes in the N consensus nodes other than consensus nodes included in the consensus sub-network corresponding to the first master node.
  • S102 Perform consensus processing on the first block in the second consensus sub-network, to obtain a consensus result of the first consensus node for the first block, and in response to determining that the consensus result of the first consensus node for the first block is a consensus success result, broadcast the first block in a first consensus sub-network to which the first consensus node belongs, to continue to perform the consensus processing on the first block in the first consensus sub-network, the first consensus sub-network including M consensus nodes in the N consensus nodes, and M being a positive integer less than N.
  • the first consensus node may perform consensus processing on the first block in the second consensus sub-network, to obtain the consensus result of the first consensus node for the first block.
  • consensus nodes in the second consensus sub-network may perform consensus processing on the first block together.
  • each consensus node in the second consensus sub-network may perform consensus processing on the first block by using a BTFT consensus algorithm.
  • the consensus processing may include three consensus phases, including a propose phase, a prevote phase, and a precommit phase. In the prevote phase and the precommit phase, data (for example, voting data for the first block) to be broadcast to each other exists in the consensus nodes in the second consensus sub-network.
  • each consensus node in the second consensus sub-network may obtain a respective consensus result of the consensus node for the first block.
  • the consensus result may be a consensus success result or a consensus failure result, and consensus results obtained by different consensus nodes for the first block may be the same or different.
  • the consensus success result indicates that consensus processing on the first block is successful, and chaining processing is agreed to be performed on the first block.
  • the consensus failure result indicates that consensus processing on the first block is not successful, and chaining processing is not agreed to be performed on the first block.
  • the first master node is a master node of the current whole consensus network and is configured to propose for a block.
  • the second consensus node may be understood as a "master node" in the second consensus sub-network, which may be understood that, in the second consensus sub-network, proposal consensus on the first block is initiated by the second consensus node.
  • the first consensus node may continue to broadcast the first block in a corresponding consensus sub-network (which may be referred to as the first consensus sub-network), to continue to perform the consensus processing on the first block in the first consensus sub-network.
  • the first consensus sub-network may be a sub-network (a small network) in the consensus network, and the first consensus sub-network may include M consensus nodes, where M is a positive integer less than N, a value of M and the value of K may be the same or different, which may be specifically determined based on an actual application scenario.
  • Second remaining consensus nodes in the M consensus nodes may be M-1 consensus nodes that are selected (for example, randomly selected) by the first consensus node from the N consensus nodes and are interconnected with the first consensus node.
  • the second remaining consensus nodes may be consensus nodes in the M consensus nodes other than the first consensus node.
  • the M-1 consensus nodes may be consensus nodes to which a block may be broadcast when the first consensus node obtains the block (for example, the first block) on which consensus processing is to be performed.
  • the M-1 consensus nodes may be consensus nodes that are selected based on a routing table and have a shorter route to the first consensus node, or the M-1 consensus nodes may be preset consensus nodes to which the first consensus node may broadcast the block on which consensus processing is to be performed.
  • the M-1 consensus nodes may also be intermittently updated, for example, updated at intervals (for example, periodically).
  • a value of M may also be updated, that is, a quantity of consensus nodes to which the first consensus node may broadcast the block on which consensus processing is to be performed may also be changed.
  • consensus nodes to which the first consensus node may broadcast the block on which consensus processing needs to be performed may be periodically updated and dynamically changed.
  • how to determine the first consensus sub-network corresponding to the first consensus node may be determined based on an actual application scenario, which is not limited herein.
  • the first consensus sub-network may also be understood as a virtual consensus sub-network configured to broadcast the first block, which is generated when the first consensus node broadcasts the first block.
  • the consensus sub-network may not be an independent sub-network obtained through division in advance.
  • the first consensus node does not need to continue to broadcast the first block to a corresponding first consensus sub-network, but only needs to record a consensus failure result for the first block.
  • each consensus node in the first consensus sub-network may continue to perform the consensus processing including the three phases on the first block, and obtain a consensus result of the consensus node for the first block.
  • the consensus result may be a consensus success result or a consensus failure result.
  • a consensus node in the first consensus sub-network that obtains the consensus success result for the first block may continue to broadcast the first block to a corresponding consensus sub-network, to continue to perform the consensus processing on the first block in the consensus sub-network.
  • the first master node may be a master node in the current whole consensus network and is configured to propose for a block.
  • the first consensus node may be understood as a "master node" in the first consensus sub-network, which may be understood that, in the first consensus sub-network, proposal consensus on the first block is initiated by the first consensus node.
  • the first block is continuously broadcast between consensus sub-networks, a whole consensus process (including the three consensus phases) may be performed on the first block in the consensus sub-networks, and finally consensus processing on the first block in the whole consensus network can be implemented.
  • consensus data for example, voting data
  • the communication complexity is O(N 2 ) in a case that the data is broadcast to each other in the whole consensus network including N consensus nodes.
  • consensus nodes broadcast the consensus data to each other only in a corresponding consensus sub-network without broadcasting the consensus data to each other in the whole large-scale consensus network, thereby reducing a volume of data to be broadcast and transmitted during consensus processing, and reducing communication complexity during consensus processing.
  • the manner of continuously broadcasting and performing consensus processing on the first block based on each consensus sub-network is implemented based on a principle of a gossip protocol (which is a communication protocol).
  • a large-scale node consensus is converted into several small-scale node consensuses, which can improve consensus performance of a whole blockchain.
  • FIG. 4a and FIG. 4b are schematic diagrams of scenarios of block broadcast according to this application.
  • consensus nodes in the consensus network may include a node 1 to a node 14.
  • the node 1 may be the first master node.
  • the node 1 may first broadcast, to a corresponding consensus sub-network, the first block on which consensus processing is to be performed, where the consensus sub-network corresponding to the node 1 may include the node 1, the node 2, the node 3, and the node 4, so that each consensus node in the consensus sub-network corresponding to the node 1 may perform consensus processing on the first block.
  • a consensus node in the consensus sub-network that succeeds in consensus processing on the first block may continue to broadcast the first block to a consensus sub-network corresponding to this consensus node, and each consensus node in the consensus sub-network may continue to perform the consensus processing on the first block.
  • the node 2 may be the second consensus node in this case, and the node 2 may continue to broadcast the first block to a corresponding consensus sub-network (for example, the second consensus sub-network).
  • the consensus sub-network corresponding to the node 2 may include the node 2, the node 5, the node 6, and the node 7.
  • each consensus node in the consensus sub-network corresponding to the node 2 may continue to perform the consensus processing on the first block, and a consensus node in the consensus sub-network that succeeds in consensus on the first block may further continue to broadcast the first block to a consensus sub-network corresponding to this consensus node, so that each consensus node in this consensus sub-network may continue to perform the consensus processing on the first block.
  • the node 6 may be the first consensus node in this case, and the node 6 may continue to broadcast the first block to a corresponding consensus sub-network (for example, the first consensus sub-network).
  • the consensus sub-network corresponding to the node 6 may include the node 6, the node 8, the node 9, and the node 14.
  • a consensus node in a consensus sub-network corresponding to the node 6, which that succeeds in consensus on the first block may further continue to broadcast the first block to a consensus sub-network corresponding to this consensus node, so that each consensus node in this consensus sub-network may continue to perform the consensus processing on the first block, to finally implement consensus processing on the first block in the whole consensus network.
  • Each consensus node in the consensus network may broadcast a same block to a corresponding consensus sub-network only once.
  • FIG. 5 is a schematic diagram of a scenario of block consensus according to this application.
  • N consensus nodes in the consensus network may include a node 0 to a node 30, where the node 0 may be the first master node.
  • the node 0 may first broadcast, in a corresponding consensus sub-network (including the node 0 to the node 4), a first block on which consensus processing is to be performed, so that consensus processing may be performed on the first block in the consensus sub-network.
  • all the node 1 to the node 4 may continue to broadcast the first block to respective consensus sub-networks.
  • a consensus sub-network corresponding to the node 1 may include the node 1, the node 5, the node 6, and the node 7. Therefore, the node 1 may continue to broadcast the first block to the node 5, the node 6, and the node 7.
  • a consensus sub-network corresponding to the node 2 may include the node 2, the node 8, the node 9, and the node 10. Therefore, the node 2 may continue to broadcast the first block to the node 8, the node 9, and the node 10.
  • a consensus sub-network corresponding to the node 3 may include the node 3, the node 11, the node 12, and the node 13. Therefore, the node 3 may continue to broadcast the first block to the node 11, the node 12, and the node 13.
  • a consensus sub-network corresponding to the node 4 may include the node 4, the node 14, the node 15, and the node 16. Therefore, the node 4 may continue to broadcast the first block to the node 14, the node 15, and the node 16.
  • a consensus node in each consensus sub-network succeeds in consensus on the first block may continue to broadcast the first block to a corresponding consensus sub-network for consensus processing, and may subsequently perform chaining processing on the first block as long as a quantity of consensus nodes in the consensus network that succeed in consensus on the first block is greater than or equal to a quantity threshold.
  • a consensus node in each consensus sub-network that fails in consensus on the first block does not broadcast the first block to more consensus nodes.
  • S103 Broadcast the consensus success result of the first consensus node for the first block in the consensus network, obtain a first quantity of consensus success results for the first block in the consensus network, and perform chaining processing on the first block based on the first quantity.
  • the first consensus node may broadcast a consensus success result of the first consensus node for the first block in the consensus network, so that another consensus node in the consensus network may obtain the consensus success result of the first consensus node for the first block.
  • the first consensus node does not broadcast a consensus failure result of the first consensus node for the first block.
  • the first consensus node may first broadcast the consensus success result of the first consensus node for the first block to a corresponding consensus sub-network based on the principle of the gossip protocol, and then a consensus node in the consensus sub-network corresponding to the first consensus node continues to broadcast the consensus success result of the first consensus node for the first block to a corresponding consensus sub-network.
  • broadcast is continuously performed, and finally the consensus success result of the first consensus node for the first block is broadcast in the whole consensus network.
  • each consensus node in the consensus network that succeeds in consensus on the first block may respectively broadcast a consensus success result of the consensus node for the first block in the consensus network based on a principle in which the first consensus node broadcasts the consensus success result of the first consensus node for the first block in the consensus network. Therefore, each consensus node in the consensus network may obtain a consensus success result of another consensus node for the first block.
  • the first consensus node may further obtain a quantity (which may be referred to as a first quantity) of consensus success results for the first block in the consensus network.
  • the first quantity is a total quantity of consensus success results of consensus nodes for the first block that are obtained by the first consensus node in the whole consensus network.
  • the first consensus node may perform chaining processing on the first block based on the first quantity.
  • the first quantity is greater than or equal to the quantity threshold, it indicates that consensus on the first block is successful in the whole consensus network, and the first consensus node may perform chaining processing on the first block, that is, add the first block to a blockchain network.
  • the first consensus node may discard the first block, that is, skip performing chaining processing on the first block.
  • the quantity threshold may be set based on actual requirements.
  • the quantity threshold may be set based on a maximum quantity of malicious nodes supported in the consensus network, for example, the quantity threshold may be 2f+1, where f is the maximum quantity of malicious nodes supported in the consensus network (that is, a maximum acceptable quantity of malicious consensus nodes).
  • f the maximum quantity of malicious nodes supported in the consensus network
  • N is also related to the maximum quantity of malicious nodes supported in the consensus network, for example, N is greater than or equal to 3f+1.
  • a consensus success result of any consensus node in the consensus network for any block may be a node signature of the any consensus node for the any block.
  • the first consensus node may cache a node signature set associated with the first block.
  • the node signature set is used for storing a node signature (that is, the consensus success result) of each consensus node in the consensus network for the first block.
  • the node signature set may include a node signature of the first consensus node for the first block.
  • the first consensus node may receive a node signatures broadcast by third remaining consensus nodes for the first block (where a node signature of the consensus node for the first block may be broadcast, or a received node signature of another consensus node for the first block may be broadcast), and add all received node signatures for the first block to the node signature set associated with the first block.
  • the third remaining consensus nodes are consensus nodes in the N consensus nodes other than the first consensus node.
  • the first consensus node may obtain a quantity of node signatures in the node signature set associated with the first block, where this quantity is the first quantity. In this way, in a case that the first quantity is greater than or equal to the quantity threshold, the first consensus node may perform chaining processing on the first block (that is, storage, for example, adding to a local account book of the first consensus node).
  • each consensus node in the consensus network may perform chaining processing on the first block based on a received consensus success result for the first block.
  • FIG. 6 is a schematic diagram of a scenario of block proposal content according to this application.
  • content that is, broadcast content
  • content proposed by any consensus node in a corresponding consensus sub-network may include a block (for example, a first block), a signature of a master node for the block (for example, a signature of a first master node for the first block), a node signature set, a current round consensus node identifier (ID) set (where the set may include node IDs of all consensus nodes in a current consensus sub-network), and a current node signature (that is, a node signature of a "master node" in the current consensus sub-network for a block).
  • ID current round consensus node identifier
  • the block in the proposed content may carry a block height corresponding to the block and a consensus round, where the block height and the consensus round may be used to uniquely identify the block.
  • the signature of a master node for example, the first master node, where the master node without quotation marks represents a master node in the whole consensus network
  • for the block in the proposed content may be used for confirming the proposed content, that is, confirming that consensus processing on a current block is initiated by a current master node.
  • the node signature set in the proposed content may be used for recording a node signature of each consensus node in the consensus network for the first block, where the node signature is a consensus success result for the first block. It may be understood that, when the "master node” (where the "master node” with quotation marks is used for representing a consensus node acting as the master node in a corresponding consensus sub-network) in the consensus sub-network initially broadcast the proposed content to the corresponding consensus sub-network, the node signature set initially may include only a node signature of the "master node” for the first block, and may be continually updated subsequently.
  • the current round consensus node ID set in the proposed content may be used for enabling each consensus node in the current consensus sub-network to clearly know with which consensus nodes to complete consensus processing on the block together.
  • the current node signature is used for confirming that the current proposed content is broadcast by the consensus node used as the "master node” in the current consensus sub-network.
  • the K consensus nodes may include a second master node.
  • the second master node may be a next master node in the N consensus nodes for master node rotation from the first master node, that is, the second master node may be a next master node for block proposal after the first master node.
  • the second master node initiates a consensus process for a second block in the consensus network.
  • a principle of initiating the consensus process for the second block by the second master node is the same as the principle of initiating the consensus process for the first block by the first master node, for example, by first broadcasting a respective block to a corresponding consensus sub-network, and then diffusively broadcasting consensus between consensus sub-networks of the consensus network.
  • a block height corresponding to the second block may be a next block height of the block height corresponding to the first block.
  • a block height corresponding to any block on which consensus processing is to be performed is a block height of the block after it is chained, after consensus on the block is successful in the whole consensus network.
  • a current master node in the consensus network may preferentially broadcast the block to a next master node (that is, a consensus sub-network corresponding to the current master node may include the next master node of the current master node), so that the next master node can initiate a consensus process for a next block (for example, the second block) in advance after completing consensus processing on the block broadcast by the current master node.
  • a next master node that is, a consensus sub-network corresponding to the current master node may include the next master node of the current master node
  • the consensus process for the next block and a consensus process for the current block may be synchronously performed, to improve efficiency of consensus processing on the block.
  • the consensus network includes N consensus nodes.
  • a first master node in the consensus network may initiate a consensus process for a first block.
  • a first consensus node may receive the first block broadcast by a second consensus node in a second consensus sub-network.
  • the second consensus sub-network includes K consensus nodes in the N consensus nodes, both the first consensus node and the second consensus node belong to the second consensus sub-network, and the second consensus node is any one of the N consensus nodes other than the first consensus node, K being a positive integer less than N.
  • the second consensus sub-network is a small-scale network.
  • Consensus processing is performed on the first block in the second consensus sub-network to obtain a consensus result of the first consensus node for the first block.
  • the first block is broadcast in a first consensus sub-network to which the first consensus node belongs, to continue to perform the consensus processing on the first block in the first consensus sub-network.
  • the first consensus sub-network includes M consensus nodes in the N consensus nodes, M being a positive integer less than N.
  • the first consensus sub-network is also a small-scale network. In this way, consensus in the large-scale consensus network is converted into consensus in several small-scale consensus sub-networks.
  • each consensus node can broadcast a block in a small network (for example, the first consensus sub-network and the second consensus sub-network) of the consensus network, to further perform consensus processing on the block in the small network, which can reduce a communication volume during consensus on the block, and improve efficiency and performance for consensus on the block in the consensus network.
  • a small network for example, the first consensus sub-network and the second consensus sub-network
  • FIG. 7 is a schematic flowchart of a block processing method according to this application. As shown in FIG. 7 , the method includes the following steps S201 and S202.
  • S201 Obtain a third block on which consensus processing is to be performed, where the third block is a block, on which consensus processing is to be performed, initiated by a third master node in a case of failing to obtain the first block within a preset time period , a block height corresponding to the third block is a first block height, and the third master node is a consensus node, in the N consensus nodes, for master node rotation after the first master node .
  • an execution entity of this embodiment of this application may alternatively be the first consensus node.
  • the block height corresponding to the first block may be the first block height, that is, the first block is a block proposed at the first block height.
  • consensus on the first block is successful (for example, a quantity of consensus success results for the first block in the consensus network is greater than or equal to the quantity threshold) in the whole network (for example, the whole consensus network)
  • a block height of the first block after the first block is chained is the first block height.
  • the preset time period may be a time period set based on an actual requirement, and used as a time limit for the third master node to wait to receive the first block. In a case that the third master node does not receive the first block within the preset time period, it may be determined that waiting times out, and in this case, the third master node may initiate the third block on which consensus processing is to be performed. There may be many reasons that the third master node does not receive the first block within the preset time period, for example, transmission delay, a network failure, or the like.
  • the first consensus node may obtain the third block on which consensus processing is to be performed.
  • the third block may be a block, on which consensus processing is to be performed, that is initiated by the third master node in a case of failing to obtain the first block after timeout.
  • the third block may be a block, on which consensus processing is to be performed, that is generated by the third master node in a case of failing to obtain (which may be due to transmission delay, a network failure, or the like) the block proposed at the first block height after timeout.
  • a block height corresponding to the third block may also be the first block height, that is, the block height corresponding to the first block may be the same as the block height corresponding to the third block.
  • one or more rounds of consensus processing on a block may be initiated at a same block height.
  • One round of consensus processing corresponds to one block on which consensus processing is to be performed.
  • consensus processing may be successful in the whole network on a block in only one round, that is, at the same block height, consensus processing is successful in the whole network only on one block.
  • the first block and the third block may be blocks corresponding to a same block height but different consensus rounds.
  • the third master node may be a consensus node, in the N consensus nodes, for master node rotation after the first master node.
  • the third master node may be the 1 st master node (for example, the second master node) after the first master node, or the third master node may alternatively be the 2 nd master node after the first master node, or the third master node may alternatively be the 3 rd master node after the first master node, or the like.
  • the third block obtained by the first consensus node may be broadcast by the third master node.
  • the third block obtained by the first consensus node may not be broadcast by the third master node, but is broadcast by another consensus node that has received the third block initiated by the first consensus node.
  • a principle of broadcasting and performing consensus processing on the third block by the third master node in the consensus network may be the same as the principle of broadcasting and performing consensus processing on the first block by the first master node in the consensus network, for example, diffusively broadcasting consensus between consensus sub-networks.
  • S202 Perform consensus processing on the third block, and cache the third block in a case that the consensus processing on the third block is completed.
  • the first consensus node may perform consensus processing on the received third block, cache the third block in a case that consensus processing on the second block is completed, and continue to obtain a consensus success result of another consensus node for the third block in the consensus network.
  • the first consensus node may obtain a consensus result for the third block, where the consensus result may be a consensus success result or a consensus failure result.
  • the first consensus node may first cache the third block, to continue to obtain consensus success results of other consensus nodes for the third block in the consensus network, thereby flexibly processing the first block based on an actual situation.
  • one consensus node can succeed in consensus only on one block, that is, one consensus node can only vote for (that is, consensus succeeds, and in other words, a consensus success result is obtained) a block in one of several rounds of consensus processing at the same block height.
  • one consensus node cannot subsequently vote against (that is, consensus fails, and in other words, a consensus failure result is obtained) the block.
  • a consensus node votes against a block, in a case that a quantity of consensus success results for the block in the consensus network is obtained, and the quantity is greater than or equal to the quantity threshold, it indicates that consensus on the block is successful in the whole consensus network, and the consensus node may switch from voting against to voting for the block.
  • the first consensus node may also cache the first block, and subsequently continue to obtain a consensus success result of another consensus node for the first block in the consensus network, thereby flexibly processing the first block based on an actual situation.
  • the first consensus node may also obtain a quantity (which may be referred to as a second quantity) of consensus success results for the third block in the consensus network.
  • a quantity which may be referred to as a second quantity
  • the second quantity is greater than or equal to the quantity threshold, it indicates that consensus on the third block is successful in the whole consensus network.
  • the first consensus node may perform chaining processing on the third block, and delete the first block.
  • the first quantity of consensus success results for the first block in the consensus network is inevitably not greater than or equal to the quantity threshold.
  • consensus on the third block is successful (that is, consensus succeeds) in the whole consensus network
  • consensus on the first block is not successful in the whole consensus network, so that correctness of block consensus is ensured.
  • the second quantity will not be greater than or equal to the quantity threshold.
  • consensus on the first block is successful in the whole consensus network, and the first consensus node may perform chaining processing on the first block, and delete the cached third block.
  • proposal consensus may be performed on a plurality of blocks at a same block height, that is, the first consensus node may cache a plurality of blocks at the same block height, and block heights corresponding to the plurality of blocks are the same. Therefore, the following describes a process of how to determine, when a block of a next block height is obtained, a parent block of the block of the next block height from the cached plurality of blocks.
  • a block weight may be provided for each cached block, and subsequently, a parent block of each block is selected based on the block weight.
  • a larger block weight indicates that a corresponding block is more reliable at a current block height, and a smaller block weight indicates that the corresponding block is less reliable at the current block height. Descriptions are provided below by using the first block and the third block as an example. In a case that there are more blocks at the same block height, processing logic between each two of the blocks is similar, as described below.
  • the first consensus node may obtain a block weight of the first block based on a quantity of child blocks of the cached first block.
  • the block weight of the first block may be equal to the quantity of child blocks of the first block cached by the first consensus node.
  • the first consensus node may further obtain a block weight of the third block based on a quantity of child blocks of the cached third block.
  • the block weight of the third block may be equal to the quantity of child blocks of the third block cached by the first consensus node.
  • the block weight of the first block and the block weight of the third block are used for determining a parent block of a fourth block, a block height corresponding to the fourth block is a second block height, and the second block height is a next block height of the first block height.
  • a child block of any block may include a block a having the block as a parent block, a block b having the block a as a parent block, a block c having the block b as a parent block, a block d having the block c as a parent block, and so on.
  • a child block of any block may include all blocks that can be traced back to the any block when continuously tracing upward (that is, backward) a parent block.
  • a same-level block of any block may refer to all blocks whose block heights are the same as a block height corresponding to the any block. Since both the first block and the third block correspond to the first block height, the first block and the third block are same-level blocks of each other.
  • a block weight of a block indicates that consensus processing is performed on more subsequent blocks based on the block; or otherwise, in a case that a block weight of a block is smaller, it indicates that consensus processing is performed on fewer subsequent blocks based on the block. Therefore, a larger block weight indicates that a corresponding block is more reliable at a current block height.
  • the first consensus node may obtain a fourth block on which consensus processing is to be performed.
  • a block height corresponding to the fourth block may be referred to as a second block height, and the second block height may be a next block height of the first block height.
  • the first block height is 99, and the second block height may be 100.
  • the fourth block may be the second block, or a same-level block of the second block.
  • the first consensus node may determine the first block as the parent block of the fourth block, and perform consensus processing on the fourth block.
  • the first consensus node may determine the third block as the parent block of the fourth block, and perform consensus processing on the fourth block.
  • the first consensus node may randomly select one block from the first block and the third block as the parent block of the fourth block, and perform consensus processing on the fourth block.
  • the first consensus node may also cache the fourth block.
  • the first consensus node may also obtain a quantity of consensus success results for the fourth block in the consensus network. It may be understood that, in a case that consensus processing on a block is successful in the consensus network, consensus processing on all parent blocks to which the block can be traced back is successful. Therefore, in a case that the quantity of consensus success results for the fourth block in the consensus network is greater than or equal to the quantity threshold and the parent block of the fourth block is the first block, it indicates that consensus processing on the fourth block and the first block is successful in the whole consensus network, and the first consensus node may delete the cached third block and a same-level block of the fourth block, and perform chaining processing on the cached first block and the fourth block.
  • the first consensus node may wait, and perform chaining processing on the first block and the fourth block after the quantity of consensus success results for the first block obtained from the consensus network is greater than or equal to the quantity threshold.
  • the first consensus node may delete the cached first block and the same-level block of the fourth block, and perform chaining processing on the cached third block and fourth block.
  • chaining processing may be performed on the block and all parent blocks to which the block can be traced back (that is, traced upward, for example, to blocks whose block heights are less than a block height corresponding to the block), a same-level block of the block and same-level blocks of all the parent blocks to which the block can be traced back may be deleted.
  • the first consensus node may further update the block weight of the first block, the block weight of the third block, and a block weight of the fourth block based on the cached fourth block and the parent block of the fourth block.
  • the updating the block weight of the first block may be adding 1 to an existing block weight of the first block; and in a case that the parent block of the fourth block is the third block, the updating the block weight of the third block may be adding 1 to an existing block weight of the third block, and a block weight provided for a latest cached fourth block may be equal to 0.
  • FIG. 8 is a schematic diagram of a scenario of setting a block weight according to this application.
  • the first consensus node may cache a block 1, a block 2, a block 22, a block 3, a block 33, a block 4, a block 44, and a block 444.
  • the block 2 and the block 22 are same-level blocks.
  • a block height corresponding to the block 2 is the same as a block height corresponding to the block 22.
  • the block 2 and the block 22 are blocks on which proposal consensus is performed at a same block height but in different rounds, and consensus processing may be initiated on the block 2 and the block 22 by different consensus nodes.
  • the block 3 and the block 33 are same-level blocks.
  • a block height corresponding to the block 3 is the same as a block height corresponding to the block 33.
  • the block 3 and the block 33 are blocks on which proposal consensus is performed at a same block height but in different rounds, and consensus processing may be initiated on the block 3 and the block 33 by different consensus nodes.
  • the block 4, the block 44, and the block 444 are same-level blocks.
  • a block height corresponding to the block 4, a block height corresponding to the block 44, and a block height corresponding to the block 444 are the same.
  • the block 4, the block 44, and the block 444 may be blocks on which proposal consensus is performed at the same block height but in different rounds, and consensus processing may be initiated on the block 4, the block 44, and the block 444 by different consensus nodes.
  • Another block pointed by an arrow from any block may be a parent block of the any block.
  • a parent block of each of the block 2 and the block 22 is the block 1
  • a parent block of the block 3 is the block 2
  • a parent block of the block 33 is the block 22
  • a parent block of each of the block 4 is the block 3.
  • the block weight may be denoted as ⁇ .
  • Child blocks of the block 1 may include 7 blocks, namely, the block 2, the block 22, the block 3, the block 33, the block 4, the block 44, and the block 444. Therefore, a block weight of the block 1 is 7.
  • Child blocks of the block 2 may include 4 blocks, namely, the block 3, the block 4, the block 44, and the block 444. Therefore, a block weight of the block 2 is 4.
  • Child blocks of the block 22 include one block, namely, the block 33. Therefore, a block weight of the block 22 is 1.
  • Child blocks of the block 3 include 3 blocks, namely, the block 4, the block 44, and the block 444. Therefore, a block weight of the block 3 is 3.
  • the block 33 is not followed by a child block, and therefore, a block weight of the block 33 is 0.
  • the block 4, the block 44, and the block 444 are not followed by child blocks, and therefore, block weights of the block 4, the block 44, and the block 444 are 0.
  • the block x may have the block 2 as a parent block thereof, because the block weight of the block 2, namely, 4 is greater than the block weight of the block 22, namely, 1.
  • FIG. 9 is a schematic diagram of a scenario of block processing according to this application.
  • the first consensus node may currently cache a block 1, a block 2, a block 22, a block 3, a block 33, a block 4, a block 44, a block 444, a block 5, a block 55, and a block 555.
  • the block 2 and the block 22 may be same-level blocks of each other
  • the block 3 and the block 33 may be same-level blocks of each other
  • the block 4, the block 44, and the block 444 may be same-level blocks of each other
  • the block 5, the block 55, and the block 555 may be same-level blocks of each other.
  • the first consensus node may delete same-level blocks (including the block 22 and the block 33) of all the parent blocks to which the block can be traced back, same-level blocks (including the block 4 and the block 44) of the block 444, and child blocks (including the block 5 and the block 55) of the same-level blocks of the block 444. Because a final consensus result for the block 555 in the consensus network is not currently determined, the cached block 555 is retained, that is, keeping the block 555 cached.
  • the quantity threshold that is, 2f+1
  • a corresponding block weight may be provided for each cached block, and subsequently, a parent block of a newly cached block may be accurately located based on the block weight provided for each cached block, thereby improving accuracy of consensus on the block in the whole network.
  • FIG. 10 is a schematic flowchart of block consensus according to this application. As shown in FIG. 10 , the procedure may be performed by any consensus node.
  • FIG. 11 is a schematic flowchart of an additional method according to this application. As shown in FIG. 11 , the procedure may be performed by any consensus node.
  • FIG. 12 is a schematic structural diagram of a data processing apparatus for a consensus network according to this application.
  • the data processing apparatus for a consensus network may be a computer program (including program code) run on a computer device; for example, the data processing apparatus for a consensus network is application software.
  • the data processing apparatus for a consensus network may be configured to perform the corresponding steps in the method according to the embodiments of this application.
  • the consensus network includes N consensus nodes, N being a positive integer, and the N consensus nodes include a first master node.
  • the apparatus is applied to a first consensus node, and the first consensus node is any one of the N consensus nodes other than the first master node.
  • the data processing apparatus 1 for a consensus network may include: a receiving module 11, a consensus module 12, and an obtaining module 13.
  • the receiving module 11 is configured to receive a first block broadcast by a second consensus node in a second consensus sub-network, the second consensus sub-network including K consensus nodes in the N consensus nodes, both the first consensus node and the second consensus node belonging to the second consensus sub-network, K being a positive integer less than N, the second consensus node being any one of the N consensus nodes other than the first consensus node, and a consensus process for the first block being initiated by the first master node.
  • the consensus module 12 is configured to perform consensus processing on the first block in the second consensus sub-network, to obtain a consensus result of the first consensus node for the first block, and in response to determining that the consensus result of the first consensus node for the first block is a consensus success result, broadcast the first block in a first consensus sub-network to which the first consensus node belongs, to continue to perform the consensus processing on the first block in the first consensus sub-network, the first consensus sub-network including M consensus nodes in the N consensus nodes, and M being a positive integer less than N.
  • the obtaining module 13 is configured to broadcast the consensus success result of the first consensus node for the first block in the consensus network, obtain a first quantity of consensus success results for the first block in the consensus network, and perform chaining processing on the first block based on the first quantity.
  • first remaining consensus nodes in the K consensus nodes are K-1 consensus nodes that are selected by the second consensus node from the N consensus nodes and are in communication with the second consensus node, where the first remaining consensus nodes are consensus nodes in the K consensus nodes other than the second consensus node, and second remaining consensus nodes in the M consensus nodes are M-1 consensus nodes that are selected by the first consensus node from the N consensus nodes and that are in communication with the first consensus node, where the second remaining consensus nodes are consensus nodes in the M consensus nodes other than the first consensus node;
  • the first block broadcast by the second consensus node is generated by the second consensus node, and in a case that the second consensus node is not the first master node, the first block broadcast by the second consensus node is obtained by broadcasting by a third consensus node in the N consensus nodes to the second consensus node, where the third consensus node is any consensus node in the N consensus nodes other than the first consensus node and the second consensus node.
  • a consensus success result of any consensus node in the consensus network for any block is a node signature of the any consensus node for the any block, the first block has an associated node signature set, and the node signature set includes a node signature of the first consensus node for the first block; and the obtaining module 13 obtains the first quantity of the consensus success results for the first block in the consensus network and perform chaining processing on the first block based on the first quantity by:
  • the K consensus nodes includes a second master node in a case that the second consensus node is the first master node, where the second master node is a next master node in the N consensus nodes for master node rotation from the first master node; and the second master node is configured to initiate a consensus process for a second block in the consensus network after determining that a consensus result of the second consensus node for the first block is a consensus success result, and a block height corresponding to the second block is a next block height of a block height corresponding to the first block.
  • a block height corresponding to the first block is a first block height
  • the apparatus 1 is further configured to:
  • the apparatus 1 is further configured to:
  • the obtaining module 13 performs the chaining processing on the first block based on the first quantity by:
  • the apparatus 1 is further configured to:
  • the cached third block and a same-level block of the fourth block are deleted, and chaining processing is performed on the first block and the fourth block;
  • the apparatus 1 is further configured to:
  • the steps involved in the data processing method for a consensus network shown in FIG. 3 may be performed by the modules in the data processing apparatus 1 for a consensus network shown in FIG. 12 .
  • S101 shown in FIG. 3 may be performed by the receiving module 11 shown in FIG. 12
  • S102 shown in FIG. 3 may be performed by the consensus module 12 shown in FIG. 12
  • S103 shown in FIG. 3 may be performed by the obtaining module 13 shown in FIG. 12 .
  • the consensus network includes N consensus nodes.
  • a first master node in the consensus network may initiate a consensus process for a first block.
  • a first consensus node may receive the first block broadcast by a second consensus node in a second consensus sub-network.
  • the second consensus sub-network includes K consensus nodes in the N consensus nodes, both the first consensus node and the second consensus node belong to the second consensus sub-network, and the second consensus node is any one of the N consensus nodes other than the first consensus node, K being a positive integer less than N.
  • the second consensus sub-network is a small-scale network.
  • Consensus processing is performed on the first block in the second consensus sub-network to obtain a consensus result of the first consensus node for the first block.
  • the first block is broadcast in a first consensus sub-network to which the first consensus node belongs, to continue to perform the consensus processing on the first block in the first consensus sub-network.
  • the first consensus sub-network includes M consensus nodes in the N consensus nodes, M being a positive integer less than N.
  • the first consensus sub-network is also a small-scale network. In this way, consensus in the large-scale consensus network is converted into consensus in several small-scale consensus sub-networks.
  • each consensus node can broadcast a block in a small network (for example, the first consensus sub-network and the second consensus sub-network) of the consensus network, to further perform consensus processing on the block in the small network, which can reduce a communication volume during consensus on the block, and improve efficiency and performance for consensus on the block in the consensus network.
  • a small network for example, the first consensus sub-network and the second consensus sub-network
  • the modules in the data processing apparatus 1 for a consensus network shown in FIG. 12 may be separately or wholly combined into one or several units, or one (or more) of the units herein may be further divided into a plurality of subunits of smaller functions. In this way, the same operations can be implemented without affecting implementation of the technical effects of the embodiments of this application.
  • the foregoing modules are divided based on logical functions. During practical application, a function of one module may alternatively be implemented by a plurality of units, or functions of a plurality of modules are implemented by one unit.
  • the data processing apparatus 1 for a consensus network may also include other units. During actual application, the functions may also be cooperatively implemented by other units and may be cooperatively implemented by a plurality of units.
  • a computer program (including program code) that can perform the steps in the corresponding method shown in FIG. 3 may be run on a general-purpose computer device, such as a computer, which includes processing elements and storage elements such as a central processing unit (CPU), a random access memory (RAM), and a read-only memory (ROM), to construct the data processing apparatus 1 for a consensus network shown in FIG. 12 and implement the data processing method for a consensus network in the embodiments of this application.
  • the computer program may be recorded on, for example, a computer-readable recording medium, and loaded into the foregoing computing device by using the computer-readable recording medium and run on the computing device.
  • FIG. 13 is a schematic structural diagram of a computer device according to this application.
  • the computer device 1000 may include: a processor 1001, a network interface 1004, and a memory 1005.
  • the computer device 1000 may include: a user interface 1003 and at least one communication bus 1002.
  • the communication bus 1002 is configured to implement connection and communication between these components.
  • the user interface 1003 may include a display and a keyboard.
  • the user interface 1003 may further include a standard wired interface and a wireless interface.
  • the network interface 1004 may include a standard wired interface or wireless interface (for example, a Wi-Fi interface).
  • the memory 1005 may be a high-speed RAM, or may be a non-volatile memory, for example, at least one magnetic disk memory.
  • the memory 1005 may alternatively be at least one storage apparatus located away from the processor 1001.
  • the memory 1005 used as a computer storage medium may include an operating system, a network communication module, a user interface module, and a device-control application.
  • the network interface 1004 may provide a network communication function
  • the user interface 1003 is mainly configured to provide an input interface for a user
  • the processor 1001 may be configured to invoke the device-control application stored in the memory 1005 to implement the method according to the foregoing embodiments, for example, implement the following steps:
  • the computer device 1000 described in this embodiment of this application can implement the data processing method for a consensus network described in the foregoing embodiment corresponding to FIG. 3 , and can also implement the data processing apparatus 1 for a consensus network described in the foregoing embodiment corresponding to FIG. 12 , which are not described herein again.
  • the beneficial effects of the same method are not described herein again.
  • this application further provides a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program executed by the data processing apparatus 1 for a consensus network described above, and the computer program includes program instructions.
  • the processor can perform the data processing method for a consensus network described in the foregoing embodiment corresponding to FIG. 3 , which are therefore not described herein again.
  • the beneficial effects of the same method are not described herein again.
  • program instructions may be deployed on one computer device for execution, or deployed on a plurality of computer devices at one location for execution, or executed on a plurality of computer devices that are distributed at a plurality of locations and are interconnected through a communication network.
  • the plurality of computer devices that are distributed at a plurality of locations and are interconnected through a communication network may form a blockchain system.
  • the foregoing computer-readable storage medium may be an internal storage unit of the data processing apparatus for a consensus network according to any one of the foregoing embodiments or the foregoing computer device, for example, a hard disk or a memory of the computer device.
  • the computer-readable storage medium may alternatively be an external storage device of the computer device, for example, a removable hard disk, a smart media card (SMC), a secure digital (SD) card, or a flash card equipped on the computer device.
  • the computer-readable storage medium may also include both the internal storage unit and the external storage device of the computer device.
  • the computer-readable storage medium is configured to store the computer program and other programs and data for the computer device.
  • the computer-readable storage medium may further be configured to temporarily store data that has been output or data to be output.
  • the computer program product includes a computer program, and the computer program is stored in a computer-readable storage medium.
  • a processor of a computer device reads the computer program from the computer-readable storage medium, and executes the computer program, so that the computer device performs the data processing method for a consensus network described in the embodiment corresponding to FIG. 3 , which therefore are not described herein again.
  • the beneficial effects of the same method are not described herein again.
  • These computer program instructions may be provided to a general-purpose computer, a dedicated computer, an embedded processor, or a processor of another programmable data processing apparatus to generate a machine, so that the instructions executed by the computer or the processor of the another programmable data processing apparatus generate an apparatus for implementing a specific function in one or more processes in the flowcharts and/or in one or more blocks in the schematic structural diagrams.
  • These computer program instructions may alternatively be stored in a computer-readable memory that can instruct a computer or another programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate an artifact that includes an instruction apparatus.
  • the instruction apparatus implements a specific function in one or more procedures in the flowcharts and/or in one or more blocks in the schematic structural diagrams.
  • the computer program instructions may also be loaded onto a computer or another programmable data processing device, so that a series of steps and steps are performed on the computer or the another programmable device, thereby achieving computer-implemented processing. Therefore, the instructions executed on the computer or the another programmable device provide steps for implementing a specific function in one or more processes in the flowcharts and/or in one or more blocks in the schematic structural diagrams.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
EP23790211.9A 2022-07-08 2023-04-23 Procédé et appareil de traitement de données pour réseau de consensus, produit-programme, dispositif et support Pending EP4325811A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210800712.6A CN117411894A (zh) 2022-07-08 2022-07-08 共识网络的数据处理方法、装置、程序产品、设备和介质
PCT/CN2023/090018 WO2024007689A1 (fr) 2022-07-08 2023-04-23 Procédé et appareil de traitement de données pour réseau de consensus, produit-programme, dispositif et support

Publications (1)

Publication Number Publication Date
EP4325811A1 true EP4325811A1 (fr) 2024-02-21

Family

ID=89430973

Family Applications (1)

Application Number Title Priority Date Filing Date
EP23790211.9A Pending EP4325811A1 (fr) 2022-07-08 2023-04-23 Procédé et appareil de traitement de données pour réseau de consensus, produit-programme, dispositif et support

Country Status (3)

Country Link
US (1) US20240015037A1 (fr)
EP (1) EP4325811A1 (fr)
KR (1) KR20240007749A (fr)

Also Published As

Publication number Publication date
KR20240007749A (ko) 2024-01-16
US20240015037A1 (en) 2024-01-11

Similar Documents

Publication Publication Date Title
US11501533B2 (en) Media authentication using distributed ledger
EP3780553B1 (fr) Procédé et appareil de traitement de consensus de transaction sur la base d'une chaîne de blocs et dispositif électronique
CN107294729B (zh) 区块链中不同节点之间的通信方法及装置
WO2022188831A1 (fr) Procédé de consensus de blocs basé sur une chaîne de blocs et dispositif associé
EP4300323A1 (fr) Procédé et appareil de traitement de données pour réseau à chaîne de blocs, dispositif informatique, support de stockage lisible par ordinateur et produit de programme informatique
WO2023045620A1 (fr) Procédé et appareil de traitement de données de transaction, dispositif informatique et support de stockage
CN110851537A (zh) 一种基于区块链分片技术的共识方法
CN112600678B (zh) 一种数据处理方法、装置、设备及存储介质
WO2023016428A1 (fr) Procédé et appareil de tolérance aux pannes byzantines, et dispositif électronique et support d'enregistrement
CN111679893A (zh) 运行系统构建方法、装置、电子设备及存储介质
US20230259938A1 (en) Blockchain-based data processing method and apparatus, device, readable storage medium and computer program product
US20230370285A1 (en) Block-chain-based data processing method, computer device, computer-readable storage medium
CN110597922A (zh) 数据处理方法、装置、终端及存储介质
CN111327680B (zh) 认证数据同步方法、装置、系统、计算机设备和存储介质
US20230259930A1 (en) Cross-chain transaction processing method and apparatus, electronic device, and storage medium
EP4325811A1 (fr) Procédé et appareil de traitement de données pour réseau de consensus, produit-programme, dispositif et support
CN108882230B (zh) 通话记录管理方法、装置及系统
WO2024007689A1 (fr) Procédé et appareil de traitement de données pour réseau de consensus, produit-programme, dispositif et support
CN117010889A (zh) 数据处理方法、装置及设备、介质、产品
CN111083221B (zh) 一种交易验证方法及装置
CN117118757B (zh) 工控环境下的终端登录方法、装置、设备及介质
CN113379542B (zh) 一种区块链交易的查询方法、装置、介质及电子设备
CN112884579A (zh) 区块链交易共识方法和装置
CN115577039A (zh) 区块处理方法、装置、验证节点及存储介质
CN117255130A (zh) 一种基于区块链的数据处理方法、装置、设备及介质

Legal Events

Date Code Title Description
STAA Information on the status of an ep patent application or granted ep patent

Free format text: STATUS: UNKNOWN

STAA Information on the status of an ep patent application or granted ep patent

Free format text: STATUS: THE INTERNATIONAL PUBLICATION HAS BEEN MADE

PUAI Public reference made under article 153(3) epc to a published international application that has entered the european phase

Free format text: ORIGINAL CODE: 0009012

STAA Information on the status of an ep patent application or granted ep patent

Free format text: STATUS: REQUEST FOR EXAMINATION WAS MADE

17P Request for examination filed

Effective date: 20231026

AK Designated contracting states

Kind code of ref document: A1

Designated state(s): AL AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HR HU IE IS IT LI LT LU LV MC ME MK MT NL NO PL PT RO RS SE SI SK SM TR