Block consensus method, device, computer, readable storage medium and program product

By using a pipeline consensus method, proposal blocks are directly verified and added to the blockchain, simplifying the block consensus process, solving the problem of long consensus time in existing technologies, and achieving efficient blockchain data consensus and synchronization.

CN116192394BActive Publication Date: 2025-12-09TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111431218.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-29
Publication Date
2025-12-09
Estimated Expiration
2041-11-29

AI Technical Summary

Technical Problem

In existing blockchain technologies, the consensus process for transaction blocks is time-consuming and inefficient, failing to meet the needs for efficient data synchronization and information transmission.

Method used

The pipeline consensus method is adopted. By receiving and verifying the aggregated signature and transaction data in the proposal block, it directly adds them to the cached blockchain. The two-stage consensus process of implicitly passing the predecessor block when looking up the block to be added to the chain is simplified into a single-stage consensus process.

Benefits of technology

The efficiency of block consensus has been improved. By merging the two-phase consensus process of proposal blocks, the system throughput and data synchronization efficiency have been increased.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116192394B_ABST
    Figure CN116192394B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a block consensus method and device, a computer, a readable storage medium and a program product. The method comprises the following steps: receiving a first proposal block, obtaining a first aggregated signature and first transaction data included in the first proposal block, the first aggregated signature being used to indicate that a target block is voted to pass, the target block being a predecessor block of the first proposal block, verifying the first aggregated signature and the first transaction data, if the verification is passed, adding the first proposal block to a cache blockchain, searching for a to-be-chained block corresponding to the first aggregated signature from the cache blockchain, if the to-be-chained block is found, determining that the to-be-chained block is consensus passed, and adding the to-be-chained block to a block ledger, the to-be-chained block corresponding to the first aggregated signature being a predecessor block of the target block. The efficiency of block consensus can be improved by using the present application.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of blockchains, and in particular to a block consensus method and device, a computer, a readable storage medium, and a program product. BACKGROUND

[0002] Due to the decentralized and tamper-proof nature of blockchains, the security of data in the blockchain is high, and the efficiency of synchronization, sharing, and information transmission is also high, thereby making the application of blockchain technology more and more widespread. In order to improve the security of block data, the consensus of transaction blocks in the blockchain is also very important. At present, a serial method is generally used to perform consensus on transaction blocks, that is, when a transaction block is generated or received, consensus is performed on the transaction block. When the consensus is passed, the transaction block is chained, and consensus is then performed on the next block of the transaction block, thereby causing the consensus process for transaction blocks to take a long time and be inefficient. SUMMARY

[0003] The present application provides a block consensus method, device, computer, readable storage medium, and program product, which can improve the efficiency of block consensus.

[0004] The present application provides a block consensus method, device, computer, readable storage medium, and program product, which can improve the efficiency of block consensus.

[0005] The first proposal block is received, and a first aggregated signature and first transaction data included in the first proposal block are obtained. The first aggregated signature is used to indicate that a vote for a target block is passed. The target block is a predecessor block of the first proposal block.

[0006] The first aggregated signature and the first transaction data are verified. If the verification is passed, the first proposal block is added to a cache blockchain.

[0007] The first aggregated signature is searched for a to-be-chained block corresponding to the first aggregated signature in the cache blockchain. If the to-be-chained block is found, it is determined that the to-be-chained block consensus is passed, and the to-be-chained block is added to a block ledger. The to-be-chained block corresponding to the first aggregated signature is a predecessor block of the target block.

[0008] The present application provides a block consensus device, which includes:

[0009] The block receiving module is configured to receive a first proposal block and obtain a first aggregated signature and first transaction data included in the first proposal block. The first aggregated signature is used to indicate that a vote for a target block is passed. The target block is a predecessor block of the first proposal block.

[0010] The block verification module is configured to verify the first aggregated signature and the first transaction data.

[0011] a block cache module, configured to add the first proposal block into a cache blockchain if the verification is passed;

[0012] a block chaining module, configured to search for a to-be-chained block corresponding to the first aggregated signature from the cache blockchain, and if the to-be-chained block is found, determine that consensus of the to-be-chained block is passed, and add the to-be-chained block into a block ledger; the to-be-chained block corresponding to the first aggregated signature is a predecessor block of a target block.

[0013] The block verification module comprises:

[0014] a target acquisition unit, configured to acquire a target block from the cache blockchain, and acquire a target aggregated signature and target transaction data from the target block;

[0015] a signature verification unit, configured to verify the first aggregated signature based on the target transaction data and the target aggregated signature;

[0016] a data detection unit, configured to perform data legality detection on the first transaction data;

[0017] a verification determination unit, configured to determine that the first aggregated signature and the first transaction data are verified if the verification of the first aggregated signature is passed and the data legality detection of the first transaction data is passed.

[0018] The signature verification unit comprises:

[0019] a signature verification generation subunit, configured to verify the target transaction data and the target aggregated signature, and generate a verification signature corresponding to the target transaction data and the target aggregated signature if the verification is passed;

[0020] a signature matching subunit, configured to determine that the first aggregated signature is verified if the first aggregated signature matches the verification signature.

[0021] The device further comprises:

[0022] a voting acquisition module, configured to acquire first associated voting information of N associated consensus nodes respectively for the first proposal block;

[0023] a voting aggregation module, configured to generate a second aggregated signature according to the first associated voting information of the N associated consensus nodes respectively if the first associated voting information of the N associated consensus nodes respectively satisfies a consensus passing condition; N is a positive integer;

[0024] a block generation module, configured to generate a second proposal block according to the second aggregated signature and second transaction data when the second transaction data is acquired, and broadcast the second proposal block to the N associated consensus nodes for consensus; the second proposal block is a successor block of the first proposal block.

[0025] The device further comprises:

[0026] The voting analysis module is configured to obtain, in the first associated voting information corresponding to the N associated consensus nodes respectively, a voting pass quantity of the first associated voting information with a voting result being a voting success result, and determine that the first associated voting information corresponding to the N associated consensus nodes respectively satisfies a consensus pass condition if the voting pass quantity is greater than or equal to a voting success threshold.

[0027] The voting aggregation module comprises:

[0028] The voting classification unit is configured to classify and integrate the first associated voting information corresponding to the N associated consensus nodes respectively based on voting results, wherein the voting results include a voting success result and a voting failure result.

[0029] The voting encryption unit is configured to obtain a node private key, and encrypt the first associated voting information corresponding to the N associated consensus nodes respectively after classification and integration by using the node private key to generate a second aggregated signature.

[0030] The device further comprises:

[0031] The voting broadcast module is configured to generate first node voting information for the first proposal block, and broadcast the first node voting information to the N associated consensus nodes, wherein N is a positive integer.

[0032] The data generation module is configured to obtain the first associated voting information of the N associated consensus nodes respectively for the first proposal block, and generate verification data according to the first node voting information and the first associated voting information corresponding to the N associated consensus nodes respectively.

[0033] The aggregation verification module is configured to, when receiving a third proposal block including a third aggregated signature and third transaction data, verify the third aggregated signature by using the verification data to obtain a first verification result, verify the third transaction data to obtain a second verification result, and generate second node voting information for the third proposal block according to the first verification result and the second verification result.

[0034] The voting broadcast module is further configured to broadcast the second node voting information to the N associated consensus nodes.

[0035] The device further comprises:

[0036] The block removal module is configured to remove the to-be-chained block from the cache blockchain when the to-be-chained block is added to the block ledger.

[0037] The upper chain sending module is configured to broadcast a block chain success result for the to-be-chained block to the N associated consensus nodes, so that the N associated consensus nodes chain the to-be-chained block based on the block chain success result.

[0038] The apparatus further comprises:

[0039] The height obtaining module is configured to obtain a signature block height corresponding to the first aggregated signature and a cache block height in the cache block chain; the cache block height is a maximum block height corresponding to the cache block chain.

[0040] The block requesting module is configured to broadcast a first block synchronization request to the N associated consensus nodes if the signature block height is different from the cache block height, and obtain a cache block requested by the first block synchronization request from any one of the N associated consensus nodes; N is a positive integer.

[0041] The cache verifying module is configured to verify the cache block.

[0042] The block storing module is configured to store the cache block if the verification is passed, and perform a process of obtaining the first aggregated signature and the first transaction data included in the first proposal block.

[0043] The cache verifying module comprises:

[0044] The transaction executing unit is configured to obtain executable transaction data in the cache block, execute a transaction process corresponding to the executable transaction data, and obtain a transaction execution result.

[0045] The transaction verifying unit is configured to verify the transaction execution result, and determine that the cache block is verified if the transaction execution result is legal.

[0046] The cache block carries a block storage state of the cache block.

[0047] The block storing module comprises:

[0048] The state obtaining unit is configured to obtain the block storage state carried by the cache block if the verification is passed.

[0049] The cache storing unit is configured to add the cache block to the cache block chain based on the block height of the cache block if the block storage state is a block caching state.

[0050] The ledger storing unit is configured to add the cache block to a block ledger based on the block height of the cache block if the block storage state is a block chaining state.

[0051] The apparatus further comprises:

[0052] The synchronization obtaining module is configured to obtain a block height synchronization interval carried in the second block synchronization request sent by the missing consensus node if the second block synchronization request is received.

[0053] The state determining module is configured to obtain a to-be-synchronized block corresponding to the block height synchronization interval from the cached blockchain and the block ledger, and determine a block storage state of the to-be-synchronized block based on a storage location of the to-be-synchronized block. The block storage state includes a block cache state and a block chaining state.

[0054] The synchronization response module is configured to send the to-be-synchronized block and the block storage state of the to-be-synchronized block to the missing consensus node, so that the missing consensus node performs synchronization processing on the to-be-synchronized block based on the block storage state of the to-be-synchronized block.

[0055] The present application embodiment provides a computer device in one aspect, comprising a processor, a memory, an input and output interface;

[0056] The processor is connected with the memory and the input and output interface respectively, wherein the input and output interface is configured to receive data and output data, the memory is configured to store a computer program, and the processor is configured to call the computer program, so that the computer device comprising the processor executes the block consensus method in one aspect of the present application embodiment.

[0057] The present application embodiment provides a computer readable storage medium in one aspect, which stores a computer program. The computer program is adapted to be loaded and executed by a processor, so that a computer device having the processor executes the block consensus method in one aspect of the present application embodiment.

[0058] The present application embodiment provides a computer program product or a computer program in one aspect, which comprises computer instructions stored in a computer readable storage medium. The processor of a computer device reads the computer instructions from the computer readable storage medium. The processor executes the computer instructions, so that the computer device executes the method provided in various optional manners in one aspect of the present application embodiment. In other words, the computer instructions are executed by the processor to realize the method provided in various optional manners in one aspect of the present application embodiment.

[0059] The implementation of the present application embodiment will have the following beneficial effects:

[0060] In the embodiment of the present application, a first proposal block is received, a first aggregated signature and first transaction data included in the first proposal block are obtained, the first aggregated signature is used to indicate that a target block is voted to pass, the target block is a predecessor block of the first proposal block, the first aggregated signature and the first transaction data are verified, if the verification is passed, the first proposal block is added to the cache blockchain, the to-be-chained block corresponding to the first aggregated signature is searched from the cache blockchain, if the to-be-chained block is found, it is determined that the to-be-chained block consensus passes, and the to-be-chained block is added to the block ledger. The to-be-chained block corresponding to the first aggregated signature refers to the predecessor block of the target block. Through the above process, each consensus node can directly perform consensus verification on the generated proposal block, that is, in the block consensus process, the pipeline consensus is realized. Specifically, the aggregated signature and the transaction data of the proposal block are included in each proposal block, the aggregated signature is used to indicate that the predecessor block of the proposal block where the aggregated signature is located is voted to pass, so that when the proposal block is voted to pass, the voting information (i.e. the aggregated signature) of the predecessor block of the proposal block is also implicitly approved, that is, the approval of the voting stage of the predecessor block of the proposal block is implicitly approved, that is, after the proposal block is voted to pass, it is considered that the predecessor block of the proposal block has passed two-stage consensus, and the predecessor block of the proposal block can be added to the block ledger. In this process, the consensus of the proposal block is voted, and the two-stage consensus of the proposal block is implicitly included in the voting information of the proposal block itself, and the consensus process of each proposal block is combined, thereby improving the efficiency of block consensus. BRIEF DESCRIPTION OF DRAWINGS

[0061] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0062] Figure 1a is a block consensus network schematic diagram provided by an embodiment of the present application;

[0063] Figure 1b is a node interaction architecture diagram provided by an embodiment of the present application;

[0064] Figure 2a is a structure schematic diagram of a block chain provided by an embodiment of the present application;

[0065] Figure 2b is a block consensus scene schematic diagram provided by an embodiment of the present application;

[0066] Figure 3 is a block consensus method flowchart provided by an embodiment of the application;

[0067] Figure 4 is an aggregated signature generation scenario diagram provided by an embodiment of the application;

[0068] Figure 5 is a block synchronization scenario diagram provided by an embodiment of the application;

[0069] Figure 6 is another block synchronization scenario diagram provided by an embodiment of the application;

[0070] Figure 7 is a block consensus device diagram provided by an embodiment of the application;

[0071] Figure 8 is a structural diagram of a computer device provided by an embodiment of the application. DETAILED DESCRIPTION

[0072] The technical solutions in the embodiments of the application will be described clearly and completely below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only part of the embodiments of the application, rather than all the embodiments of the application. Based on the embodiments in the application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the application.

[0073] In the application, a prompt interface or a pop-up window is displayed before and during data collection, the prompt interface or the pop-up window is used to prompt a user that XXXX data is being collected at present, and only after a confirmation operation of the user on the prompt interface or the pop-up window is obtained, the related steps of data acquisition are started to be executed, otherwise, the process is ended.

[0074] In the application, the related data of the proposal block and the voting information of each consensus node on the proposal block mentioned in the application can be stored and transmitted based on cloud technology, and the application is suitable for the field of data transmission in big data.

[0075] In the application, cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network in a wide area network or a local area network to realize the calculation, storage, processing, and sharing of data.

[0076] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology and other technologies based on cloud computing business model application, which can form a resource pool and be used on demand, and is flexible and convenient. Cloud computing technology will become an important support. The background service of the technical network system needs a large amount of computing and storage resources, such as video websites, picture websites and more portals. With the high development and application of the Internet industry, every item in the future may have its own identification mark and needs to be transmitted to the background system for logical processing. Different levels of data will be processed separately, and various industry data will need strong system support, which can only be realized through cloud computing.

[0077] Among them, big data refers to a collection of data that cannot be captured, managed and processed within a certain time range by conventional software tools, and is a massive, high-growth and diversified information asset that requires new processing modes to have stronger decision-making, insight discovery and process optimization capabilities. With the advent of the cloud era, big data has attracted more and more attention, and big data requires special technology to effectively process large amounts of data over time. The technology suitable for big data includes large-scale parallel processing database, data mining, distributed file system, distributed database, cloud computing platform, Internet and scalable storage system.

[0078] Optionally, the consensus node can store the related data of the proposal block mentioned in the application based on cloud storage technology.

[0079] In the embodiments of the present application, please refer to Figure 1a , Figure 1a is a block consensus network diagram provided by the embodiments of the present application, such as Figure 1aAs shown, the consensus network 100 refers to a network for data sharing between consensus nodes, and each consensus node can reach consensus on the obtained proposal block. The consensus network 100 can include a plurality of consensus nodes 101, which can be computer devices in the consensus network 100. Each consensus node 101 can receive input information when working normally, and maintain shared data in the consensus network 100 based on the received input information. To ensure information exchange in the consensus network 100, each consensus node 101 in the consensus network 100 can have an information connection, and the consensus nodes 101 can transmit information through the information connection. For example, when any consensus node in the consensus network 100 receives input information, other consensus nodes in the consensus network 100 obtain the input information according to a consensus algorithm, reach consensus on the input information, and store the input information as data in shared data when the input information is successfully consensus, so that all consensus nodes in the consensus network 100 store consistent data, and the data stored in each consensus node is consensus, improving the security of data in the blockchain.

[0080] Optionally, each consensus node 101 in the consensus network 100 can have a corresponding node identifier, and each consensus node in the consensus network 100 stores node identifiers of other consensus nodes in the consensus network 100, so that the generated transaction block or consensus result for the transaction block can be broadcast to other consensus nodes in the consensus network 100 according to the node identifiers of the other consensus nodes. For any consensus node, a node identifier list can be maintained, which includes node identifiers of other consensus nodes in the consensus network 100 and consensus node names corresponding to the node identifiers. The node identifier can be an IP (Internet Protocol) address or any other information that can be used to identify the consensus node (such as a factory identifier of the consensus node). The consensus nodes 101 in the consensus network 100 can also interact with each other through other network interconnection methods.

[0081] Specifically, as shown in FIG. 1, Figure 1b Figure 1b ​This is a node interaction architecture diagram improved in the embodiments of this application. The consensus network includes multiple consensus nodes, including an execution consensus node 103 and at least two other consensus nodes, such as consensus node 104a, consensus node 104b, and consensus node 104c, etc., and the consensus nodes can interact with each other. The execution consensus node 103 (also called the local consensus node or the master consensus node) can execute the scheme implemented in this application. The execution consensus node 103 can be any consensus node in the consensus network. The consensus nodes in the consensus network other than the execution consensus node 103 can be referred to as associated consensus nodes, such as associated consensus nodes 104a, associated consensus nodes 104b, and associated consensus nodes 104c, etc. For example, when consensus node 103 receives the first proposal block sent by associated consensus node 104b, it can verify the first aggregate signature and the first transaction data included in the first proposal block. If the verification is successful, it can be indirectly considered that the voting stage of the predecessor block of the first proposal block has been verified. Based on this implicit voting information of the proposal block, it can be considered that if the block height of the first proposal block is large, the first aggregate signature implies the voting information of the second stage (or voting stage) of a proposal block (denoted as the block to be added to the chain). That is, when the vote on the first aggregate signature is passed, it can be considered that the consensus of the block to be added to the chain has been passed, and the block to be added to the chain can be added to the block ledger. This allows the consensus nodes to vote on each proposal block to reach consensus, and the two-stage consensus of each proposal block is implied in the voting consensus process of the proposal block, merging the consensus process of each proposal block, thereby improving the efficiency of the block consensus.

[0082] Among them, see Figure 2a , Figure 2a This is a schematic diagram of a blockchain structure provided in an embodiment of this application. For example... Figure 2a As shown, a blockchain consists of blocks (referred to as proposal blocks in this application). Each block includes two parts: a block header and a block body. The block header includes a timestamp, a current hash value, and a predecessor hash value. The timestamp records the time the block was generated; the current hash value is the hash value of the block; the predecessor hash value is the hash value of the block's predecessor; and the block body contains the transaction information stored in the block. Specifically, as... Figure 2a As shown, the process can be as follows:

[0083] Taking the cache block chain as an example, a proposal block 201 with a block height of 1 is generated, and the proposal block 201 includes an aggregated signature in the block body. Since the block height is 1, the aggregated signature of the proposal block 201 can be empty. When generating the proposal block 202, the voting information for the proposal block 201 can be integrated to generate an aggregated signature for the proposal block 201. The aggregated signature for the proposal block 201 is added to the block body of the proposal block 202, and the aggregated signature included in the proposal block 202 can be used to indicate that the proposal stage consensus for the proposal block 201 is passed (that is, the voting for the proposal block 201 is passed). When generating the proposal block 203, the voting information for the proposal block 202 can be integrated to generate an aggregated signature for the proposal block 202. The aggregated signature for the proposal block 202 is added to the block body of the proposal block 203, and the aggregated signature included in the proposal block 203 can be used to indicate that the proposal stage consensus for the proposal block 202 is passed (that is, the voting for the proposal block 202 is passed). Since the proposal block 202 includes the aggregated signature for the proposal block 201, the proposal stage consensus for the proposal block 202 is passed, which implicitly indicates that the voting stage consensus for the proposal block 201 is passed, that is, the two-stage consensus for the proposal block 201 is achieved, and the proposal block 201 can be added to the block ledger. Similarly, the generation and chaining of other proposal blocks can be implemented.

[0084] For a proposal block, three stages are included, namely, a proposal stage, an endorsement stage, and a commit stage. The proposal stage refers to the stage of generating a proposal block. The endorsement stage refers to the stage of performing the first round of consensus on the generated proposal block. The commit stage refers to the stage of performing the second round of consensus on the generated proposal block, that is, the stage of performing consensus voting on the voting stage of the proposal block. Optionally, the consensus node from the proposal stage to the voting stage of the proposal block receives or generates the proposal block within the block voting period, or does not receive or generate the proposal block after exceeding the block voting period, and the like. The consensus node from the voting stage to the commit stage of the proposal block enters the commit stage when the voting information of the proposal block satisfies the first round of consensus passing condition. Optionally, since the present application simplifies the multiple stages of block consensus into a general consensus stage, only one consensus passing condition, that is, the first round of consensus passing condition, can exist.

[0085] For example, please refer to Figure 2b , Figure 2b is a block consensus scenario provided by an embodiment of the present application. In the Figure 2bThe label of the middle stage or later can be used to represent the corresponding block, for example, proposal stage 2 can be used to represent the proposal stage of proposal block 2, etc. As Figure 2bAs shown, in the proposal stage 1, the proposal block 1 is generated, and the proposal block 1 includes the aggregated signature 0. Assuming that the block height of the proposal block 1 is 1, the proposal block 1 has no predecessor block, and the aggregated signature 0 can be empty, or can be a default signature, or can be an invalid value, etc. In the proposal stage 2, the proposal block 1 can be voted on. When the proposal block 1 is voted on and passed, the aggregated signature 1 for the proposal block 1 is generated, which can be used to indicate that the first round of voting on the proposal block 1 is passed, that is, the proposal stage 2 can imply the voting stage 1 of the proposal block 1. In the proposal stage 3, the proposal block 2 can be voted on. When the proposal block 2 is voted on and passed, the aggregated signature 2 for the proposal block 2 is generated. Since the proposal block 2 includes the aggregated signature 1, the aggregated signature 2 can be used to indicate that the first round of voting on the proposal block 2 is passed, that is, the proposal stage 3 can imply the voting stage 2 of the proposal block 2. The aggregated signature 2 can also be used to indicate that the voting on the aggregated signature 1 is passed. As can be known from the meaning of the aggregated signature 1, the aggregated signature 2 can also be used to indicate that the first round of voting (i.e., the voting stage 1) on the proposal block 1 is passed, that is, the second round of voting on the proposal block 1 is passed. If the present application is based on two-stage consensus, it can be considered that the consensus of the proposal block 1 is completed, and the proposal block 1 can be determined as a block to be chained, that is, the proposal block 1 is added to the block ledger 204, that is, the proposal stage 3 can imply the submission stage 1 of the proposal block 1. In the proposal stage 4, the proposal block 3 can be voted on. When the proposal block 3 is voted on and passed, the aggregated signature 3 for the proposal block 3 is generated. Since the proposal block 3 includes the aggregated signature 2, the aggregated signature 3 can be used to indicate that the first round of voting on the proposal block 3 is passed, that is, the proposal stage 4 can imply the voting stage 3 of the proposal block 3. The aggregated signature 3 can also be used to indicate that the voting on the aggregated signature 2 is passed. As can be known from the meaning of the aggregated signature 2, the aggregated signature 3 can also be used to indicate that the first round of voting (i.e., the voting stage 2) on the proposal block 2 is passed, that is, the second round of voting on the proposal block 2 is passed. If the present application is based on two-stage consensus, it can be considered that the consensus of the proposal block 2 is completed, and the proposal block 2 can be determined as a block to be chained, that is, the proposal block 2 is added to the block ledger 204, that is, the proposal stage 4 can imply the submission stage 2 of the proposal block 2. Similarly, the proposal block 5 including the aggregated signature 4 can be generated. The aggregated signature 4 can be used to indicate that the first round of voting on the proposal block 4 is passed, that is, the proposal stage 5 of the proposal block 5 implies the voting stage 4 of the proposal block 4. It can be used to indicate that the second round of voting on the proposal block 3 is passed, that is, the proposal stage 5 implies the submission stage 3 of the proposal block 3, and the proposal block 3 is added to the block ledger 204, etc. Similarly, the consensus and chaining of the proposal block can be realized through the above process. Optionally, Figure 2bThe chain structure indicated by the area 205 in the figure can be considered as a cache block chain, can be considered as stored in a cache database, or stored in a consensus block data cache component.

[0086] Through the above process, the consensus process of each proposal block can be pipelined and expanded, and one proposal can be initiated in each round, so that the system throughput can be improved, the consensus protocol can be simplified, the original three-stage message (i.e., the proposal message in the proposal stage, the voting message in the voting stage, and the commit message in the commit stage) can be simplified into a general stage message, which can be considered as a consensus message of the proposal block, and thus the efficiency of block consensus can be improved.

[0087] It can be understood that the consensus node mentioned in the embodiments of the present application can be a computer device, and the computer device in the embodiments of the present application includes but is not limited to a terminal device or a server. In other words, the computer device can be a server or a terminal device, or a system composed of a server and a terminal device. The terminal device mentioned above can be an electronic device, including but not limited to a mobile phone, a tablet computer, a desktop computer, a notebook computer, a palm computer, a vehicle-mounted device, an augmented reality / virtual reality (AR / VR) device, a head-mounted display, a smart television, a wearable device, a smart speaker, a digital camera, a camera, and other mobile internet devices (MIDs) with network access capability, or terminal devices in scenes such as trains, ships, and aircraft. The server mentioned above can be a standalone physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, vehicle-road cooperation, content delivery networks (CDNs), and big data and artificial intelligence platforms, and other basic cloud computing services.

[0088] Optionally, the data involved in the embodiments of the present application can be stored in a computer device, or can be stored based on cloud storage technology, which is not limited herein.

[0089] Further, please refer to Figure 3 , Figure 3 is a block consensus method flowchart provided by the embodiments of the present application. As Figure 3As shown, the execution subject can be any consensus node in the consensus network, where the execution subject can be recorded as an execution consensus node, or a main consensus node, or a local consensus node, etc. The consensus nodes other than the execution subject can be recorded as associated consensus nodes. In essence, each consensus node in the consensus network can be considered the same, and only different names are used to distinguish the execution subject. Specifically, the block consensus process includes the following steps:

[0090] In step S301, a first proposal block is received, and a first aggregated signature and first transaction data included in the first proposal block are obtained.

[0091] In the embodiments of the present application, taking the first proposal block generated by other consensus nodes as an example, the execution consensus node can receive the first proposal block, and obtain the first aggregated signature and the first transaction data included in the first proposal block. The first aggregated signature is used to indicate that the target block is voted through, or in other words, the first aggregated signature is used to indicate that the target block is voted through in the first round of voting. The target block is the predecessor block of the first proposal block. Optionally, if the block height of the first proposal block is 1, it means that the first proposal block has no predecessor block (i.e. there is no target block), that is, the first aggregated signature does not point to the proposal block that needs to be voted, and it can also be considered that the first aggregated signature has no actual meaning. Therefore, the first aggregated signature can be empty, or a default signature, or an invalid value, etc., which is not limited here.

[0092] Optionally, when the execution consensus node receives the first proposal block, it can obtain the first aggregated signature and the first transaction data from the block body of the first proposal block. The first transaction data is the data used to generate the first proposal block.

[0093] In step S302, the first aggregated signature and the first transaction data are verified, and if the verification is passed, the first proposal block is added to the cache block chain.

[0094] In the embodiment of the present application, the consensus node can verify the first proposal block. If the verification is passed, it means that the first proposal block is approved, and the first proposal block can be added to the cache blockchain. The cache blockchain can be obtained from the cache database or the consensus block data cache component. Optionally, if the first proposal block is not verified, the voting information for the first proposal block can be broadcast to the N associated consensus nodes. At this time, the voting information is the voting failure information. The consensus node can wait for the successor block of the first proposal block. If the successor block of the first proposal block is obtained, it means that the voting for the first proposal block is passed, and the first proposal block can be added to the cache blockchain. N is a positive integer. Optionally, when the first proposal block is not verified, the voting information of the N associated consensus nodes for the first proposal block can also be obtained. If the voting information of the N associated consensus nodes for the first proposal block satisfies the consensus passing condition, that is, the voting information of the N associated consensus nodes for the first proposal block indicates that the voting for the first proposal block is passed, the first proposal block can be added to the cache blockchain. Optionally, the voting information of the N associated consensus nodes for the first proposal block can refer to the voting information of part or all of the N associated consensus nodes for the first proposal block. Specifically, the first proposal block includes a first aggregated signature and first transaction data. When verifying the first proposal block, the first aggregated signature and the first transaction data can be verified.

[0095] Specifically, the consensus node can obtain a target block from the cache blockchain, and obtain a target aggregated signature and target transaction data from the target block. The first aggregated signature is verified based on the target transaction data and the target aggregated signature, and the first transaction data is detected for legality. Specifically, the first aggregated signature can be considered as the voting information for the target transaction data and the target aggregated signature. Therefore, the first aggregated signature can be verified based on the target transaction data and the target aggregated signature. Further, if the first aggregated signature is verified and the first transaction data is detected for legality, it is determined that the first aggregated signature and the first transaction data are verified.

[0096] Optionally, when verifying the first aggregate signature based on the target transaction data and the target aggregate signature, assuming that the first aggregate signature is encrypted by the target transaction data and the target aggregate signature, the consensus node performing can generate a verification signature of the target transaction data and the target aggregate signature, and match the verification signature with the first aggregate signature. Optionally, the target transaction data and the target aggregate signature can be verified. If the verification is passed, a verification signature corresponding to the target transaction data and the target aggregate signature is generated. If the first aggregate signature matches the verification signature, it is determined that the verification of the first aggregate signature is passed. Alternatively, the public key of the proposer node of the first proposal block can be used to verify the first aggregate signature. If the verification is passed, it is determined that the verification of the first aggregate signature is passed. Optionally, after the target block is generated, the consensus node performing can also receive the voting information of the N associated consensus nodes for the target block. Therefore, when verifying the first aggregate signature based on the target transaction data and the target aggregate signature, the voting information of the N associated consensus nodes for the target block (specifically for the target transaction data and the target aggregate signature in the target block) can be obtained. If the first aggregate signature matches the voting information of the N associated consensus nodes for the target block, it is determined that the verification of the first aggregate signature is passed.

[0097] In step S303, the first aggregate signature corresponding to the to-be-chained block is searched from the cache blockchain. If the to-be-chained block is found, it is determined that the to-be-chained block consensus is passed, and the to-be-chained block is added to the block ledger.

[0098] In the embodiments of the present application, the to-be-chained block corresponding to the first aggregate signature is the predecessor block of the target block, that is, the predecessor block of the first proposal block where the first aggregate signature is located. Specifically, the first aggregate signature can be used to indicate that the voting for the target block is passed, that is, the first round of voting for the target block is passed. Accordingly, the voting for the target aggregate signature in the target block is passed, and the target aggregate signature is used to indicate the voting for the predecessor block of the target block. When the first aggregate signature indicates the voting for the target aggregate signature is passed, it can be considered that the voting information (i.e. the first round of voting) for the predecessor block of the target block indicated by the target aggregate signature is passed, that is, the second round of voting for the predecessor block of the target block is passed. If the block consensus in the present application is two-stage consensus, it can be considered that the consensus for the predecessor block of the target block is passed at this time, and the predecessor block of the target block can be determined as the to-be-chained block. Optionally, if the predecessor block of the target block is not found in the cache blockchain, that is, the to-be-chained block is not found, the first proposal block is voted.

[0099] When the to-be-chained block is added to the block ledger, the to-be-chained block is removed from the cache blockchain, that is, the cache blockchain can store the proposal block that has not been added to the block ledger. Further, the block chaining success result for the to-be-chained block can be broadcast to the N associated consensus nodes, so that the N associated consensus nodes chain the to-be-chained block based on the block chaining success result. In the present application, when messages are exchanged, each consensus node can synchronize blocks based on the received messages to improve the efficiency and effectiveness of block synchronization. When the consensus node adds the to-be-chained block to the block ledger, broadcasting the block chaining success result can further enable each consensus node to synchronize blocks, thereby improving the efficiency of block synchronization.

[0100] Further, the execution consensus node can obtain the first associated voting information of the N associated consensus nodes for the first proposal block, generate the first node voting information for the first proposal block, and broadcast the first node voting information to the N associated consensus nodes. If the first associated voting information of the N associated consensus nodes satisfies the consensus passing condition, specifically, if the first associated voting information of the N associated consensus nodes and the first node voting information satisfy the consensus passing condition, a second aggregated signature is generated according to the first associated voting information of the N associated consensus nodes. N is a positive integer. Taking the successor block of the first proposal block generated by the execution consensus node as an example, when the execution consensus node obtains the second transaction data, the second proposal block can be generated according to the second aggregated signature and the second transaction data, and the second proposal block is broadcast to the N associated consensus nodes for consensus. When the N associated consensus nodes receive the second proposal block, the consensus process of the second proposal block can refer to the consensus process of the first proposal block in steps S301-S303. The second proposal block refers to the successor block of the first proposal block generated by the execution consensus node.

[0101] Specifically, in the first associated voting information corresponding to the N associated consensus nodes respectively, the number of votes passed of the first associated voting information with the voting result being the voting success result is obtained, and if the number of votes passed is greater than or equal to the voting success threshold, it is determined that the first associated voting information corresponding to the N associated consensus nodes respectively meets the consensus passing condition. Alternatively, the total number of consensus nodes included in the consensus network is obtained, the consensus proportion of the number of votes passed and the total number of consensus is obtained, and if the consensus proportion is greater than or equal to the consensus proportion threshold, it is determined that the first associated voting information corresponding to the N associated consensus nodes respectively meets the consensus passing condition. Optionally, the consensus passing condition can be a consensus passing condition corresponding to a consensus mechanism, which can include but is not limited to a Byzantine consensus mechanism, a proof-of-work mechanism, and a proof-of-stake mechanism, etc., without limitation. For example, assuming that the consensus proportion threshold is 2 / 3, when the consensus proportion is greater than or equal to 2 / 3, it is determined that the first associated voting information corresponding to the N associated consensus nodes respectively meets the consensus passing condition. Optionally, the execution consensus node can obtain the target number of votes of the voting information with the voting result being the voting success result in the first associated voting information corresponding to the N associated consensus nodes respectively and the first node voting information, and if the target number of votes is greater than or equal to the voting success threshold, it is determined that the first associated voting information corresponding to the N associated consensus nodes respectively meets the consensus passing condition. That is, if the voting result of the first node voting information is the voting success result, the target number of votes is the sum of the number of votes passed and the number of the first node voting information; if the voting result of the first node voting information is the voting failure result, the target number of votes is the same as the number of votes passed. The target number of votes can be used to detect whether the first associated voting information corresponding to the N associated consensus nodes respectively meets the consensus passing condition.

[0102] Specifically, when the second aggregated signature is generated according to the first associated voting information corresponding to the N associated consensus nodes respectively, the first associated voting information and the first node voting information corresponding to the N associated consensus nodes respectively can be directly aggregated into the second aggregated signature, which is an aggregation of multiple voting information (or voting signature); or the first associated voting information and the first node voting information corresponding to the N associated consensus nodes respectively can be encrypted to obtain the second aggregated signature, etc.

[0103] Specifically, referring to Figure 4 , Figure 4 is a kind of aggregated signature generation scene schematic diagram provided by the embodiment of the application, as Figure 4As shown, N associated consensus nodes 401 can vote on the first proposal block, and send first associated voting information for the first proposal block to the execution consensus node 402. For example, the N associated consensus nodes 401 include an associated consensus node 401a, an associated consensus node 401b, and an associated consensus node 401c, etc. The execution consensus node 402 can receive the first associated voting information for the first proposal block sent by the N associated consensus nodes 401 respectively, i.e., obtain the voting information 403 for the first proposal block, including the first node voting information of the execution consensus node 402 for the first proposal block, and the first associated voting information of the N associated consensus nodes for the first proposal block, etc., such as the first associated voting information 1 to the first associated voting information N, etc.

[0104] Under a first aggregation signature generation process, the execution consensus node 402 can classify and integrate the voting information 403 for the first proposal block based on the voting results, to obtain first category voting information and second category voting information. The first category voting information is voting information with a voting result of a voting success result, and the second category voting information is voting information with a voting result of a voting failure result. The first category voting information and the second category voting information are aggregated to obtain a second aggregation signature 404a.

[0105] Under a second aggregation signature generation process, the execution consensus node 402 can obtain a node private key 405, encrypt the voting information 403 for the first proposal block using the node private key 405, and generate a second aggregation signature 404b. Optionally, the voting information 403 for the first proposal block carrying the second aggregation signature 404b can be recorded as a block permission credential 406. At this time, when generating the second proposal block according to the second aggregation signature and the second transaction data, the block permission credential 406 including the second aggregation signature 404b and the second transaction data can be used to generate the second proposal block.

[0106] Under a third aggregation signature generation process, the execution consensus node 402 can directly determine the voting information 403 for the first proposal block, including the first node voting information of the execution consensus node 402 for the first proposal block, and the first associated voting information of the N associated consensus nodes for the first proposal block, etc., as the second aggregation signature for the first proposal block.

[0107] In the fourth kind of aggregated signature generation process, the consensus node performing the consensus can classify and integrate the first associated voting information corresponding to the N associated consensus nodes based on the voting result; the voting result includes a voting success result and a voting failure result. Optionally, the first node voting information and the first associated voting information corresponding to the N associated consensus nodes can be classified and integrated. Further, the node private key 405 is obtained, and the first associated voting information corresponding to the N associated consensus nodes after classification and integration (or the N first associated voting information and the first node voting information) is encrypted using the node private key 405 to generate a second aggregated signature.

[0108] The above are only several kinds of generation processes of the aggregated signature, and other ways of carrying the voting information for the proposal block in the aggregated signature can also be used. Among them, the above processes are described in the generation of the second aggregated signature, and other generation processes of the aggregated signature in the present application can refer to the generation process of the second aggregated signature.

[0109] Further, the consensus node performing the consensus can generate first node voting information for the first proposal block and broadcast the first node voting information to the N associated consensus nodes; N is a positive integer. The first associated voting information of the N associated consensus nodes for the first proposal block is obtained, and the verification data is generated according to the first node voting information and the first associated voting information corresponding to the N associated consensus nodes. Taking the successor block of the first proposal block as an example, when the third proposal block including the third aggregated signature and the third transaction data is received, the third aggregated signature is verified using the verification data to obtain a first verification result, the third transaction data is verified to obtain a second verification result, and the second node voting information for the third proposal block is generated according to the first verification result and the second verification result. The second node voting information is broadcast to the N associated consensus nodes. Among them, the third proposal block refers to the successor block of the first proposal block generated by the associated consensus node. Among them, the second proposal block and the third proposal block are two independent cases, for the consensus node performing the consensus, if the successor block of the first proposal block is generated by the consensus node performing the consensus, the successor block of the first proposal block can be recorded as the second proposal block; if the successor block of the first proposal block is generated by the associated consensus node of the consensus node performing the consensus, the successor block of the first proposal block can be recorded as the third proposal block, only the name of the different cases is different, and it does not mean that the definitions conflict. Since the consensus node performing the consensus can be any consensus node in the consensus network, that is, when voting for the first proposal block, there are consensus nodes in the consensus network performing the process related to the second proposal block, and there are consensus nodes performing the process related to the third proposal block.

[0110] Wherein, when receiving the message, the block synchronization can be performed based on the received message. For example, the consensus node can obtain the signature block height corresponding to the first aggregated signature, and obtain the cached block height in the cached block chain. The cached block height is the maximum block height corresponding to the cached block chain. For details, please refer to Figure 5 , Figure 5 is a block synchronization scenario provided by an embodiment of the present application. As shown in Figure 5 , the consensus node can obtain the first aggregated signature in the first proposal block 501, and obtain the signature block height corresponding to the first aggregated signature. The signature block height refers to the block height of the proposal block whose vote is passed, which is the block height of the target block in this case. The cached block height is obtained from the block ledger 502 and the cached block chain 503. The cached block height can be considered as the maximum block height of the proposal block stored by the consensus node, for example, Figure 5 , the block ledger 502 includes proposal block 1 to proposal block s, and s is a positive integer. The cached block chain 503 includes proposal block (s+1) to proposal block t, and t is a positive integer. The proposal blocks in the block ledger 502 are composed of the consensus passed blocks in the cached block chain 503, so the cached block height shown in Figure 5 is t. Further, if the signature block height and the cached block height are different, it means that other consensus nodes have already reached consensus on the proposal block with the signature block height, while the consensus node only records the proposal block with the cached block height. The block synchronization can be performed through synchronization blocking. Specifically, the first block synchronization request can be broadcast to N associated consensus nodes 504, and the cached block requested by the first block synchronization request can be obtained from any one of the N associated consensus nodes 504, such as associated consensus node 504a, associated consensus node 504b, and associated consensus node 504c. N is a positive integer. Optionally, the N associated consensus nodes can also perform block synchronization based on the first block synchronization request. For example, the associated consensus node 504a receives the first block synchronization request, which can include a request height interval, the request height interval is from the cached block height to the signature block height, the associated consensus node 504a searches the stored proposal block, and if the block height of the stored proposal block does not reach the signature block height, the block synchronization can be performed based on the signature block height. The consensus node can verify the cached block, and if the verification is passed, the cached block is stored, and the process of obtaining the first aggregated signature and the first transaction data included in the first proposal block is performed.

[0111] Specifically, when verifying the cache block, the executing consensus node can verify the cache transaction data and the cache aggregated signature in the cache block. If the verification is passed, it means that the cache block is verified. Optionally, executable transaction data in the cache block can be obtained, and a transaction process corresponding to the executable transaction data is executed to obtain a transaction execution result. The transaction execution result is verified. If the transaction execution result is legal, it is determined that the cache block is verified.

[0112] Optionally, the cache block carries a block storage state of the cache block. When storing the cache block, if the verification is passed, the block storage state carried by the cache block is obtained. If the block storage state is a block cache state, the cache block is added to the cache block chain based on the block height of the cache block. If the block storage state is a block chaining state, the cache block is added to the block ledger based on the block height of the cache block. That is, the missing proposal block of the executing consensus node can not only be a block that is not chained. At this time, the executing consensus node can store the cache block based on the block storage state of the cache block. In this application, the block chaining refers to adding the proposal block to the block ledger. The cache block chain is not an actual block chain, but a storage format that can cache the proposal block.

[0113] Optionally, when the executing consensus node receives the voting information sent by the N associated consensus nodes, it can also determine the theoretical block height based on the received voting information. The theoretical block height refers to the maximum block height of the proposal block that the executing consensus node should theoretically store. When determining the block loss, the block synchronization can be performed based on the theoretical block height.

[0114] Optionally, the executing consensus node can also receive a block synchronization request sent by other consensus nodes and respond to the block synchronization request. Specifically, if the second block synchronization request sent by the missing consensus node is received, the block height synchronization interval carried by the second block synchronization request is obtained. The to-be-synchronized block corresponding to the block height synchronization interval is obtained from the cache block chain and the block ledger. The block storage state of the to-be-synchronized block is determined based on the storage location of the to-be-synchronized block. The block storage state includes a block cache state and a block chaining state. The to-be-synchronized block and the block storage state of the to-be-synchronized block are sent to the missing consensus node, so that the missing consensus node synchronizes the to-be-synchronized block based on the block storage state of the to-be-synchronized block. For example, please refer to Figure 6 , Figure 6 is another block synchronization scenario provided by the embodiment of the application. As shown in Figure 6As shown, if the performing consensus node receives a second block synchronization request sent by the missing consensus node 601, the performing consensus node obtains a block height synchronization interval carried in the second block synchronization request. The missing consensus node 601 can be any consensus node in the consensus network. In other words, each consensus node mentioned in the present application can be any consensus node in the consensus network. In order to distinguish the execution object in different scenarios, different names are given to the consensus nodes in different scenarios. Further, the performing consensus node can obtain the to-be-synchronized blocks 604 corresponding to the block height synchronization interval from the block ledger 602 and the cache blockchain 603. For example, the block height synchronization interval is used to indicate the proposal block p to the proposal block t in the cache blockchain 603, and the to-be-synchronized blocks 604 include the proposal block p to the proposal block t, that is, the number of to-be-synchronized blocks 604 can be one or at least two, and p is a positive integer. The performing consensus node can obtain the block storage state of the to-be-synchronized blocks 604. For example, the block storage state of the to-be-synchronized blocks 604 includes the block cache state, the block storage state of the to-be-synchronized blocks 604 includes the block cache state, and the block storage state of the to-be-synchronized blocks 604 includes the block cache state. Figure 6 In the example shown in FIG. 6, the proposal block p to the proposal block t are stored in the cache blockchain 603, that is, the block storage state of the to-be-synchronized blocks 604 is the block cache state. The performing consensus node can send the to-be-synchronized blocks 604 and the block storage state of the to-be-synchronized blocks 604 to the missing consensus node 601. The missing consensus node 601 can synchronize the to-be-synchronized blocks 604 based on the block storage state of the to-be-synchronized blocks 604.

[0115] Based on the above description of block synchronization, any consensus node in the consensus network can determine the theoretical block height based on the message when receiving the message, and then detect whether block synchronization is needed based on the theoretical block height. If block synchronization is needed, the performing consensus node requests the proposal block from other consensus nodes based on the theoretical block height, and performs block synchronization, so that each consensus node can guarantee the synchronization degree of the proposal block as much as possible, and improve the block synchronization effectiveness and synchronization efficiency.

[0116] In the embodiment of the present application, a first proposal block is received, and a first aggregated signature and first transaction data included in the first proposal block are obtained; the first aggregated signature is used to indicate that a target block is voted to pass; the target block is a predecessor block of the first proposal block; the first aggregated signature and the first transaction data are verified, and if the verification is passed, the first proposal block is added to the cache blockchain; the first aggregated signature corresponds to a to-be-chained block in the cache blockchain, and if the to-be-chained block is found, it is determined that the to-be-chained block consensus passes, and the to-be-chained block is added to the block ledger. The to-be-chained block corresponding to the first aggregated signature is the predecessor block of the target block. Through the above process, each consensus node can directly perform consensus verification on the generated proposal block, that is, in the block consensus process, the pipeline consensus is realized. Specifically, each proposal block includes an aggregated signature and transaction data of the proposal block, and the aggregated signature is used to indicate that the predecessor block of the proposal block where the aggregated signature is located is voted to pass, so that when the proposal block is voted to pass, the voting information (i.e., the aggregated signature) of the predecessor block of the proposal block is also implicitly approved, that is, the voting stage of the predecessor block of the proposal block is implicitly approved, that is, after the proposal block is voted to pass, it is considered that the predecessor block of the proposal block has passed two-stage consensus, and the predecessor block of the proposal block can be added to the block ledger. In this process, the consensus of the proposal block is voted, and the two-stage consensus of the proposal block is implicitly included in the voting information of the proposal block itself, and the consensus process of each proposal block is combined, thereby improving the efficiency of block consensus.

[0117] Further, please refer to Figure 7 , Figure 7 is a block consensus device provided by an embodiment of the present application. The block consensus device can be a computer program (including program code, etc.) running in a computer device, for example, the block consensus device can be an application software; the device can be used to execute the corresponding steps in the method provided by the embodiments of the present application. As shown in Figure 7 , the block consensus device 700 can be used in the computer device in the embodiment corresponding to Figure 3 , specifically, the device can include a block receiving module 11, a block verification module 12, a block caching module 13, and a block chaining module 14.

[0118] The block receiving module 11 is configured to receive a first proposal block, and obtain a first aggregated signature and first transaction data included in the first proposal block; the first aggregated signature is used to indicate that a target block is voted to pass; the target block is a predecessor block of the first proposal block;

[0119] The block verification module 12 is configured to verify the first aggregated signature and the first transaction data.

[0120] a block caching module 13, configured to add the first proposal block into a cache blockchain if the verification is passed;

[0121] a block chaining module 14, configured to search for a to-be-chained block corresponding to the first aggregated signature from the cache blockchain, and add the to-be-chained block into a block ledger if the to-be-chained block is found, wherein the to-be-chained block corresponding to the first aggregated signature refers to a predecessor block of the target block.

[0122] The block verification module 12 includes:

[0123] a target acquisition unit 121, configured to acquire a target block from the cache blockchain, and acquire a target aggregated signature and target transaction data from the target block;

[0124] a signature verification unit 122, configured to verify the first aggregated signature based on the target transaction data and the target aggregated signature;

[0125] a data detection unit 123, configured to perform data legality detection on the first transaction data;

[0126] a verification determination unit 124, configured to determine that the first aggregated signature and the first transaction data are verified if the first aggregated signature is verified and the first transaction data is detected to be legal.

[0127] The signature verification unit 122 includes:

[0128] a signature verification generation sub-unit 1221, configured to verify the target transaction data and the target aggregated signature, and generate a verification signature corresponding to the target transaction data and the target aggregated signature if the verification is passed;

[0129] a signature matching sub-unit 1222, configured to determine that the first aggregated signature is verified if the first aggregated signature matches the verification signature.

[0130] The apparatus 700 further includes:

[0131] a voting acquisition module 15, configured to acquire first associated voting information of N associated consensus nodes respectively for the first proposal block;

[0132] a voting aggregation module 16, configured to generate a second aggregated signature according to the first associated voting information of the N associated consensus nodes respectively if the first associated voting information of the N associated consensus nodes respectively satisfies a consensus passing condition, wherein N is a positive integer.

[0133] The block generation module 17 is configured to generate a second proposal block according to the second aggregated signature and the second transaction data when the second transaction data is acquired, and broadcast the second proposal block to the N associated consensus nodes for consensus; the second proposal block is a successor block of the first proposal block.

[0134] The apparatus 700 further includes:

[0135] The voting analysis module 18 is configured to obtain, in the first associated voting information corresponding to the N associated consensus nodes respectively, a voting pass quantity of the first associated voting information with a voting success result, and determine that the first associated voting information corresponding to the N associated consensus nodes respectively satisfies a consensus pass condition if the voting pass quantity is greater than or equal to a voting success threshold.

[0136] The voting aggregation module 16 includes:

[0137] The voting classification unit 161 is configured to classify and integrate the first associated voting information corresponding to the N associated consensus nodes respectively based on a voting result; the voting result includes a voting success result and a voting failure result.

[0138] The voting encryption unit 162 is configured to obtain a node private key, and encrypt the first associated voting information corresponding to the N associated consensus nodes respectively after classification and integration by using the node private key to generate a second aggregated signature.

[0139] The apparatus 700 further includes:

[0140] The voting broadcast module 19 is configured to generate first node voting information for the first proposal block, and broadcast the first node voting information to the N associated consensus nodes; N is a positive integer.

[0141] The data generation module 20 is configured to obtain the first associated voting information of the N associated consensus nodes respectively for the first proposal block, and generate verification data according to the first node voting information and the first associated voting information corresponding to the N associated consensus nodes respectively.

[0142] The aggregation verification module 21 is configured to, when receiving a third proposal block including a third aggregated signature and third transaction data, verify the third aggregated signature by using the verification data to obtain a first verification result, verify the third transaction data to obtain a second verification result, and generate second node voting information for the third proposal block according to the first verification result and the second verification result.

[0143] The voting broadcast module 19 is further configured to broadcast the second node voting information to the N associated consensus nodes.

[0144] The apparatus 700 further includes:

[0145] The block removal module 22 is configured to remove the to-be-chained block from the cache blockchain when the to-be-chained block is added to the block ledger.

[0146] The chaining sending module 23 is configured to broadcast a block chaining success result for the to-be-chained block to the N associated consensus nodes, so that the N associated consensus nodes perform chaining on the to-be-chained block based on the block chaining success result.

[0147] The apparatus 700 further includes:

[0148] The height obtaining module 24 is configured to obtain a signature block height corresponding to the first aggregated signature, and obtain a cache block height in the cache blockchain; the cache block height is a maximum block height corresponding to the cache blockchain.

[0149] The block requesting module 25 is configured to broadcast a first block synchronization request to the N associated consensus nodes if the signature block height is different from the cache block height, and obtain a cache block requested by the first block synchronization request from any one of the N associated consensus nodes; N is a positive integer.

[0150] The cache verifying module 26 is configured to verify the cache block.

[0151] The block storing module 27 is configured to store the cache block if the verification is passed, and perform a process of obtaining the first aggregated signature and the first transaction data included in the first proposal block.

[0152] The cache verifying module 26 includes:

[0153] The transaction executing unit 261 is configured to obtain executable transaction data in the cache block, execute a transaction process corresponding to the executable transaction data, and obtain a transaction execution result.

[0154] The transaction verifying unit 262 is configured to verify the transaction execution result, and determine that the verification of the cache block is passed if the transaction execution result is legal.

[0155] The cache block carries a block storage state of the cache block.

[0156] The block storing module 27 includes:

[0157] The state obtaining unit 271 is configured to obtain the block storage state carried by the cache block if the verification is passed.

[0158] The cache storing unit 272 is configured to add the cache block to the cache blockchain based on the block height of the cache block if the block storage state is a block cache state.

[0159] The account storage unit 273 is configured to add the cached block into the block account based on the block height of the cached block if the block storage state is the block chaining state.

[0160] The apparatus 700 further includes:

[0161] The synchronization obtaining module 28 is configured to obtain a block height synchronization interval carried in the second block synchronization request if the second block synchronization request sent by the missing consensus node is received.

[0162] The state determining module 29 is configured to obtain the to-be-synchronized block corresponding to the block height synchronization interval from the cached block chain and the block account, and determine the block storage state of the to-be-synchronized block based on the storage position of the to-be-synchronized block. The block storage state includes the block caching state and the block chaining state.

[0163] The synchronization response module 30 is configured to send the to-be-synchronized block and the block storage state of the to-be-synchronized block to the missing consensus node, so that the missing consensus node performs synchronization processing on the to-be-synchronized block based on the block storage state of the to-be-synchronized block.

[0164] Embodiments of the present application provide a block consensus device, which can receive a first proposal block, obtain a first aggregated signature and first transaction data included in the first proposal block; the first aggregated signature is used to indicate that a target block is voted through; the target block is a predecessor block of the first proposal block; the first aggregated signature and the first transaction data are verified, and if the verification is passed, the first proposal block is added to a cached block chain; a to-be-chained block corresponding to the first aggregated signature is searched from the cached block chain, and if the to-be-chained block is found, it is determined that the to-be-chained block is consensus passed, and the to-be-chained block is added to a block account; the to-be-chained block corresponding to the first aggregated signature refers to a predecessor block of the target block. Through the above process, each consensus node can directly perform consensus verification on the generated proposal block, that is, in the block consensus process, the pipeline consensus implementation is realized, specifically, each proposal block includes an aggregated signature and transaction data of the proposal block, the aggregated signature is used to indicate that a predecessor block of the proposal block where the aggregated signature is located is voted through, so that when the proposal block is voted through, the voting information (i.e., the aggregated signature) of the predecessor block of the proposal block is also implicitly approved, that is, the approval of the voting stage of the predecessor block of the proposal block is implicitly approved, that is, after the proposal block is voted through, it is considered that the predecessor block of the proposal block has passed two-stage consensus, and the predecessor block of the proposal block can be added to the block account, so that in the process, each proposal block is consensus voted, and the two-stage consensus of the proposal block is implicitly included in the voting information of the proposal block itself, and the consensus process of each proposal block is combined, thereby improving the efficiency of block consensus.

[0165] Referring to Figure 8 , Figure 8 is a structural schematic diagram of a computer device provided by an embodiment of the present application. As shown in Figure 8 , the computer device in the embodiment of the present application can include one or more processors 801, a memory 802 and an input / output interface 803. The processor 801, the memory 802 and the input / output interface 803 are connected through a bus 804. The memory 802 is configured to store a computer program, the computer program including program instructions, the input / output interface 803 is configured to receive and output data, such as for data interaction between each consensus node; and the processor 801 is configured to execute the program instructions stored in the memory 802.

[0166] The processor 801 can perform the following operations:

[0167] receive a first proposal block, obtain a first aggregated signature and first transaction data included in the first proposal block; the first aggregated signature is used to indicate that a target block is voted to pass; the target block is a predecessor block of the first proposal block;

[0168] verify the first aggregated signature and the first transaction data, and if the verification is passed, add the first proposal block to a cache blockchain;

[0169] find a to-be-chained block corresponding to the first aggregated signature from the cache blockchain, and if the to-be-chained block is found, determine that the to-be-chained block is consensus passed, and add the to-be-chained block to a block ledger; the to-be-chained block corresponding to the first aggregated signature refers to a predecessor block of the target block.

[0170] In some possible implementation manners, the processor 801 can be a central processing unit (CPU), and the processor can also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.

[0171] The memory 802 can include read-only memory and random access memory, and provide instructions and data to the processor 801 and the input-output interface 803. A part of the memory 802 can also include non-volatile random access memory. For example, the memory 802 can also store device type information.

[0172] In specific implementations, the computer device can execute the implementation manners provided by each step in the method shown in the Figure 3 specific implementation manners provided by each step in the method shown in the Figure 3 specific implementation manners provided by each step in the method shown in the

[0173] The embodiment of the present application provides a computer device, which comprises a processor, an input-output interface, and a memory. The computer program in the memory is acquired by the processor, each step of the method shown in the Figure 3 The embodiment of the present application realizes the following: a first proposal block is received, a first aggregated signature and first transaction data included in the first proposal block are acquired, the first aggregated signature is used to indicate that a target block is voted to pass, the target block is a predecessor block of the first proposal block, the first aggregated signature and the first transaction data are verified, if the verification is passed, the first proposal block is added to a cache block chain, a to-be-chained block corresponding to the first aggregated signature is searched from the cache block chain, if the to-be-chained block is found, it is determined that the to-be-chained block is consensus passed, and the to-be-chained block is added to a block ledger, and the to-be-chained block corresponding to the first aggregated signature is a predecessor block of the target block. Through the above process, each consensus node can directly perform consensus verification on the generated proposal block, that is, in the block consensus process, the pipeline consensus implementation is realized, specifically, the aggregated signature and the transaction data of the proposal block are included in each proposal block, the aggregated signature is used to indicate that the predecessor block of the proposal block where the aggregated signature is located is voted to pass, so that when the proposal block is voted to pass, the voting information (that is, the aggregated signature) of the predecessor block of the proposal block is also implicitly approved, that is, the approval of the voting stage of the predecessor block of the proposal block is implicitly approved, that is, after the proposal block is voted to pass, it is considered that the predecessor block of the proposal block has passed two-stage consensus, and the predecessor block of the proposal block can be added to the block ledger, so that in the process, each proposal block is consensus voted, and the two-stage consensus of the proposal block is implicitly included in the voting information of the proposal block itself, and the consensus process of each proposal block is combined, thereby improving the efficiency of the block consensus.

[0174] The embodiment of the present application also provides a computer readable storage medium, which stores a computer program, the computer program is suitable for being loaded and executed by the processor Figure 3The block consensus method provided by each step can refer to the method provided by the step. Figure 3 The implementation manners provided by each step in the method are not described herein. In addition, the beneficial effects of the same method are not described herein. For technical details not disclosed in the computer-readable storage medium embodiments involved in the present application, refer to the description of the method embodiments of the present application. As an example, the computer program can be deployed to execute on one computer device, or on multiple computer devices located in one place, or on multiple computer devices distributed in multiple places and interconnected through a communication network.

[0175] The computer-readable storage medium can be an internal storage unit of the computer device, such as a hard disk or a memory of the computer device. The computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the computer-readable storage medium can include both the internal storage unit and the external storage device of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.

[0176] The computer program product or the computer program includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium. The processor executes the computer instructions, so that the computer device executes the method of the present application. Figure 3The method provided in various optional manners in the method can realize that each consensus node can directly perform consensus verification on the generated proposal block, that is, in the block consensus process, the pipeline consensus implementation is based on the pipeline consensus implementation. Specifically, each proposal block includes an aggregated signature and transaction data of the proposal block, and the aggregated signature is used to indicate that the predecessor block of the proposal block where the aggregated signature is located is voted to pass, so that when the proposal block is voted to pass, the voting information (that is, the aggregated signature) of the proposal block is also implicitly approved, that is, the voting stage of the predecessor block of the proposal block is implicitly approved, that is, after the proposal block is voted to pass, it can be considered that the predecessor block of the proposal block has passed two-stage consensus, and the predecessor block of the proposal block can be added to the block ledger, so that in the process, consensus voting is performed on the proposal block, and two-stage consensus of the proposal block is implicitly included in the voting information of the proposal block itself, and the consensus process of each proposal block is combined, thereby improving the efficiency of block consensus.

[0177] The terms "first", "second", and the like in the specification and claims of the present application and the accompanying drawings are used to distinguish different objects, and are not used to describe a specific order. In addition, the term "comprising" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, device, product or equipment including a series of steps or units is not limited to the listed steps or modules, but can optionally include steps or modules not listed, or can optionally include other steps or units inherent to the process, method, device, product or equipment.

[0178] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in general terms in the description. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0179] The method and related apparatus provided by the embodiments of the present application are described with reference to the method flowchart and / or structural schematic diagram provided by the embodiments of the present application, and each flow and / or block of the method flowchart and / or structural schematic diagram and the combination of the flows and / or blocks in the flowchart and / or block diagram can be implemented by computer program instructions. The computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable block consensus device to generate a machine, so that the instructions executed by the processor of the computer or other programmable block consensus device generate an apparatus for implementing the functions specified in one or more flows of the flowchart and / or one or more blocks of the structural schematic diagram. The computer program instructions can also be stored in a computer readable memory that can cause the computer or other programmable block consensus device to work in a specific manner, so that the instructions stored in the computer readable memory generate a product including instruction apparatus, which implements the functions specified in one or more flows of the flowchart and / or one or more blocks of the structural schematic diagram. The computer program instructions can also be loaded into the computer or other programmable block consensus device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more flows of the flowchart and / or one or more blocks of the structural schematic diagram.

[0180] The steps in the method embodiments of the present application can be adjusted, combined and deleted in sequence according to actual needs.

[0181] The modules in the apparatus embodiments of the present application can be combined, divided and deleted according to actual needs.

[0182] The above disclosure is only the preferred embodiments of the present application, and of course cannot limit the scope of the rights of the present application, so the equivalent changes made according to the claims of the present application still fall within the scope of the present application.

Claims

1. A block consensus method, characterized in that, The method comprises: receiving a first proposal block, obtaining a first aggregated signature and first transaction data included in a block body of the first proposal block; the first aggregated signature is used to indicate that a first round of voting for a target block is passed; the target block is a predecessor block of the first proposal block; the first aggregated signature is an aggregation of a plurality of voting information for the target block; the target block comprises a target aggregated signature and target transaction data, and the target aggregated signature is used to indicate that a voting for a predecessor block of the target block is passed; verifying the first aggregated signature and the first transaction data, and if the verification is passed, adding the first proposal block to a cache blockchain; finding a to-be-chained block corresponding to the first aggregated signature from the cache blockchain, and if the to-be-chained block is found, determining that the to-be-chained block is consensus passed, and adding the to-be-chained block to a block ledger; the to-be-chained block corresponding to the first aggregated signature refers to the predecessor block of the target block.

2. The method of claim 1, wherein, The verification of the first aggregated signature and the first transaction data comprises: obtaining the target block from the cache blockchain, and obtaining a target aggregated signature and target transaction data from the target block; verifying the first aggregated signature based on the target transaction data and the target aggregated signature, and performing data legality detection on the first transaction data; if the verification of the first aggregated signature is passed and the legality detection of the first transaction data is passed, it is determined that the verification of the first aggregated signature and the first transaction data is passed.

3. The method of claim 2, wherein, The verification of the first aggregated signature based on the target transaction data and the target aggregated signature comprises: verifying the target transaction data and the target aggregated signature, and if the verification is passed, generating a verification signature corresponding to the target transaction data and the target aggregated signature; if the first aggregated signature matches the verification signature, it is determined that the verification of the first aggregated signature is passed.

4. The method of claim 1, wherein, The method further comprises: obtaining first associated voting information of N associated consensus nodes for the first proposal block, and if the first associated voting information of the N associated consensus nodes satisfies a consensus passing condition, generating a second aggregated signature according to the first associated voting information of the N associated consensus nodes; N is a positive integer; when second transaction data is obtained, generating a second proposal block according to the second aggregated signature and the second transaction data, and broadcasting the second proposal block to the N associated consensus nodes for consensus; the second proposal block is a successor block of the first proposal block.

5. The method of claim 4, wherein, The method further comprises: in the first associated voting information of the N associated consensus nodes, obtaining a voting pass quantity of first associated voting information whose voting result is a voting success result, and if the voting pass quantity is greater than or equal to a voting success threshold, it is determined that the first associated voting information of the N associated consensus nodes satisfies the consensus passing condition. The second aggregate signature is generated according to the first associated voting information corresponding to the N associated consensus nodes respectively, and the method comprises the following steps: The first associated voting information corresponding to the N associated consensus nodes respectively is classified and integrated based on a voting result; the voting result comprises a voting success result and a voting failure result; A node private key is obtained, and the first associated voting information corresponding to the N associated consensus nodes respectively after classification and integration is encrypted by using the node private key to generate a second aggregate signature.

6. The method of claim 1, wherein, The method further comprises the following steps: First node voting information for the first proposal block is generated, and the first node voting information is broadcast to N associated consensus nodes; N is a positive integer; First associated voting information of the N associated consensus nodes respectively for the first proposal block is obtained, and verification data is generated according to the first node voting information and the first associated voting information corresponding to the N associated consensus nodes respectively; When a third proposal block including a third aggregate signature and third transaction data is received, the third aggregate signature is verified by using the verification data to obtain a first verification result, the third transaction data is verified to obtain a second verification result, and second node voting information for the third proposal block is generated according to the first verification result and the second verification result; The second node voting information is broadcast to the N associated consensus nodes.

7. The method of claim 1, wherein, The method further comprises the following steps: When the to-be-chained block is added to the block ledger, the to-be-chained block is removed from the cache blockchain; A block chaining success result for the to-be-chained block is broadcast to N associated consensus nodes, so that the N associated consensus nodes chain the to-be-chained block based on the block chaining success result.

8. The method of claim 1, wherein, The method further comprises the following steps: A signature block height corresponding to the first aggregate signature is obtained, and a cache block height in the cache blockchain is obtained; the cache block height is a maximum block height corresponding to the cache blockchain; If the signature block height is different from the cache block height, a first block synchronization request is broadcast to N associated consensus nodes, and a cache block requested by the first block synchronization request is obtained from any one of the N associated consensus nodes; N is a positive integer; The cache block is verified, and if the verification is passed, the cache block is stored, and the process of obtaining the first aggregate signature and the first transaction data included in the first proposal block is performed.

9. The method of claim 8, wherein, The verification of the cache block comprises the following steps: Executable transaction data in the cache block is obtained, a transaction process corresponding to the executable transaction data is executed, and a transaction execution result is obtained; The transaction execution result is verified, and if the transaction execution result is legal, it is determined that the cache block is verified.

10. The method of claim 8, wherein, The cache block carries a block storage state of the cache block; If the verification is passed, the block storage state carried by the cache block is obtained. ​ if the block storage state is a block cache state, adding the cache block into the cache block chain based on the block height of the cache block; if the block storage state is a block on-chain state, adding the cache block into the block ledger based on the block height of the cache block.

11. The method of claim 1, wherein, The method further comprises: if a second block synchronization request sent by a missing consensus node is received, obtaining a block height synchronization interval carried by the second block synchronization request; obtaining, from the cache block chain and the block ledger, a to-be-synchronized block corresponding to the block height synchronization interval, and determining a block storage state of the to-be-synchronized block based on a storage location of the to-be-synchronized block; the block storage state includes a block cache state and a block on-chain state; sending the to-be-synchronized block and the block storage state of the to-be-synchronized block to the missing consensus node, so that the missing consensus node performs synchronization processing on the to-be-synchronized block based on the block storage state of the to-be-synchronized block.

12. A block consensus device, comprising: The device comprises: a block receiving module, configured to receive a first proposal block, and obtain a first aggregated signature and first transaction data included in a block body of the first proposal block; the first aggregated signature is used to indicate that a first round of voting on a target block is passed; the target block is a predecessor block of the first proposal block; the first aggregated signature is an aggregation of a plurality of pieces of voting information for the target block; the target block includes a target aggregated signature and target transaction data, and the target aggregated signature is used to indicate that a predecessor block of the target block is voted through; a block verification module, configured to verify the first aggregated signature and the first transaction data, and if the verification is passed, add the first proposal block to a cache block chain; a block on-chain module, configured to find a to-be-added block corresponding to the first aggregated signature from the cache block chain, and if the to-be-added block is found, determine that the to-be-added block is consensus passed, and add the to-be-added block to a block ledger; the to-be-added block corresponding to the first aggregated signature refers to a predecessor block of the target block.

13. A computer device, comprising: comprise a processor, a memory, and an input / output interface; The processor is connected with the memory and the input / output interface respectively, wherein the input / output interface is configured to receive and output data, the memory is configured to store a computer program, and the processor is configured to call the computer program, so that the computer device executes the method in any one of claims 1-11.

14. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is adapted to be loaded and executed by the processor, so that the computer device with the processor executes the method in any one of claims 1-11.

15. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instruction is executed by the processor to implement the method in any one of claims 1-11.

Citation Information

Patent Citations

  • Block chain data consensus method and related equipment

    CN110247774A

  • Method, apparatus, computer readable storage medium, and computer program product for blockchain forming congesture

    CN110941859A

  • Consensus processing method and device for block chain network, medium and electronic equipment

    CN111931220A