Blockchain-based data processing method, data processing device, computer device, and computer program

The blockchain-based data processing method addresses security and continuity issues by using periodic private key fragments and distributed key generation, ensuring secure and uninterrupted blockchain operations.

JP7589886B2Active Publication Date: 2024-11-26TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
JP2023566965
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2021-06-02
Filing Date
2022-05-11
Publication Date
2024-11-26
Estimated Expiration
2042-05-11

AI Technical Summary

Technical Problem

Current blockchain systems face security vulnerabilities due to the use of traditional public key infrastructure (PKI) for consensus nodes, which can be exploited, and the frequent switching of consensus nodes disrupts the continuity and timeliness of blockchain services.

Method used

A blockchain-based data processing method that involves generating private key fragments associated with periodic consensus cycles, allowing seamless transition between consensus node sets by using distributed key generation protocols, ensuring security and continuity of services.

Benefits of technology

Enhances the security and continuity of blockchain services by preventing key leaks and minimizing disruptions during node set transitions, enabling real-time consensus authority transfer.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007589886000002
    Figure 0007589886000002
  • Figure 0007589886000003
    Figure 0007589886000003
  • Figure 0007589886000004
    Figure 0007589886000004
Patent Text Reader

Abstract

This application discloses a data processing method, device, equipment, and readable storage medium based on blockchain, which includes the steps of: starting to select a second consensus node set corresponding to a second consensus cycle when a block height generated in a first consensus cycle satisfies a consensus node set switching condition, and determining the height of the block generated when the second consensus node set is selected as a first block height; generating a first block by adding group information corresponding to the second consensus node set to a block corresponding to the first block height, and broadcasting the first block in a blockchain network, thereby causing a consensus node in the second consensus node set to generate a private key fragment associated with the second consensus cycle based on the group information in the first block within a transient consensus period; obtaining a private key fragment generation notification sent from a consensus node in the second consensus node set, the private key fragment generation notification having a notification signature attached thereto; and determining a consensus authority for the second consensus cycle of a consensus node in the second consensus node set based on the notification signature.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] This application claims priority to a Chinese patent application filed with the China Patent Office on June 2, 2021, bearing application number 202110616371.2 and titled "Blockchain-Based Data Processing Method, Apparatus, Device, and Readable Storage Medium."

[0002] The present application relates to the technical field of the Internet, and in particular to a data processing method, a data processing device, a computer device, and a computer program based on a blockchain. [Background technology]

[0003] With the rapid development of network technology and the importance of data security from governments and enterprises, blockchain has been widely applied. Nodes in a blockchain network may include consensus nodes and synchronization nodes. Among them, consensus nodes participate in bookkeeping consensus, while synchronization nodes mainly perform business operations, do not participate in bookkeeping consensus, and synchronize block data from consensus nodes through identity authentication.

[0004] Current blockchain consensus nodes adopt the traditional Public Key Infrastructure (PKI) system for data signing. That is, each consensus node generates its own public and private key pair, protects its own private key, and publishes its public key to the outside world. When consensus is achieved for a block, the consensus node attaches the data signed with its own private key. However, since the public and private key pair corresponding to each consensus node is associated only with the consensus node itself and is always the same, it is easy for an unauthorized party to use the node information of the consensus node to obtain the corresponding private key, in which case the security of the blockchain business service is not guaranteed.

[0005] In addition, the consensus node and the synchronization node are not fixed, and the consensus node has a term of office. Every time the term of office ends, the blockchain consensus node set (also called the blockchain consensus committee) needs to reselect (or elect) a new consensus node from among the blockchain nodes, and switch from the first blockchain consensus node set to the second blockchain consensus node set. In the process of the second blockchain consensus node set obtaining the consensus configuration information of the second consensus cycle and synchronizing blocks, the second blockchain consensus node set cannot start the consensus processing of the new block, which causes the blockchain network to interrupt the consensus processing of the new block, and further reduces the continuity and timeliness of the blockchain business service. Summary of the Invention [Problem to be solved by the invention]

[0006] The embodiments of the present application provide a blockchain-based data processing method, data processing device, computer equipment, and computer program that can not only improve the continuity and timeliness of blockchain business services, but also improve the security of blockchain business services. [Means for solving the problem]

[0007] In one aspect of an embodiment of the present application, there is provided a blockchain-based data processing method executed by a computing device, the method comprising: When the block height generated in the first consensus cycle satisfies a consensus node set switching condition, starting to select a second consensus node set corresponding to a second consensus cycle, and determining the height of the block generated when the second consensus node set is selected as a first block height, wherein the block corresponding to the maximum block height in the first consensus cycle is the block immediately before the block corresponding to the minimum block height in the second consensus cycle; generating a first block by adding collective information corresponding to the second consensus node set to a block corresponding to the first block height, and broadcasting the first block in a blockchain network, thereby causing consensus nodes in the second consensus node set to generate private key fragments associated with the second consensus cycle based on the collective information in the first block within a transient consensus period, where the transient consensus period refers to a time consumed by the first consensus node set corresponding to the first consensus cycle to perform consensus processing on blocks belonging to a transient block height interval, and all block heights included in the transient block height interval are greater than the first block height; obtaining a private key fragment generation notification sent from a consensus node in the second consensus node set, the private key fragment generation notification being accompanied by a notification signature, the notification signature being generated by a consensus node in the second consensus node set generating and signing a notification based on a private key fragment associated with the second consensus cycle; determining a consensus authority for the second consensus cycle of a consensus node in the second consensus node set based on the notification signature.

[0008] According to one aspect of the present embodiment, there is provided a data processing device based on a blockchain, the device comprising: a first determination module that starts selecting a second consensus node set corresponding to a second consensus cycle when the block height generated in the first consensus cycle satisfies a consensus node set switching condition, and determines the height of the block generated when the second consensus node set is selected as a first block height, where the block corresponding to the maximum block height in the first consensus cycle is the block immediately before the block corresponding to the minimum block height in the second consensus cycle; a first generating module that generates a first block by adding collective information corresponding to the second consensus node set to a block corresponding to the first block height, and broadcasts the first block in a blockchain network, thereby causing consensus nodes in the second consensus node set to generate private key fragments associated with the second consensus cycle based on the collective information in the first block within a transient consensus period, where the transient consensus period refers to a time consumed by the first consensus node set corresponding to the first consensus cycle to perform consensus processing on a block belonging to a transient block height interval, and all block heights included in the transient block height interval are greater than the first block height; a first acquisition module that acquires a private key fragment generation notification sent from a consensus node in the second consensus node set, the private key fragment generation notification being accompanied by a notification signature, the notification signature being generated by a consensus node in the second consensus node set generating and signing a notification based on a private key fragment associated with the second consensus cycle; and a second determination module that determines a consensus authority of a consensus node in the second consensus node set for the second consensus cycle based on the notification signature.

[0009] In one aspect of the present application, a computing device is provided that includes a processor, a memory, and a network interface.

[0010] The processor is connected to the memory and the network interface, the network interface providing a data communication function, the memory storing a computer program, and the processor calls the computer program to cause the computer device to execute a method in an embodiment of the present application.

[0011] In one aspect of the present application, a computer readable storage medium is provided having a computer program stored thereon, the computer program being configured to cause a processor to execute a method according to the present application when loaded by the processor.

[0012] In one aspect of an embodiment of the present application, a computer program product or computer program is provided that includes computer instructions, the computer instructions being stored in a computer-readable storage medium, such that a processor of a computing device reads the computer instructions from the computer-readable storage medium and, when executed by the processor, causes the computing device to perform a method in an embodiment of the present application. [Brief description of the drawings]

[0013] In order to more clearly describe the configuration of the embodiments of the present application or the prior art, the following briefly introduces drawings necessary for the description of the embodiments or the prior art. Obviously, the drawings in the following description only show some embodiments of the present application, and those skilled in the art can obtain other drawings from these drawings without creative labor. [Figure 1] FIG. 1 is a schematic diagram of a system architecture provided in an embodiment of the present application. [Diagram 2] FIG. 1 is a schematic diagram of a blockchain-based data processing scenario provided in an embodiment of the present application. [Diagram 3]FIG. 1 is a schematic diagram of the flow of a data processing method based on a blockchain provided in an embodiment of the present application. [Figure 4] FIG. 1 is a schematic diagram of a blockchain-based data processing scenario provided in an embodiment of the present application. [Diagram 5] FIG. 1 is a schematic diagram of a blockchain-based data processing scenario provided in an embodiment of the present application. [Figure 6] FIG. 1 is a schematic diagram of the flow of a data processing method based on a blockchain provided in an embodiment of the present application. [Figure 7] FIG. 1 is a schematic diagram of a blockchain-based data processing scenario provided in an embodiment of the present application. [Figure 8] FIG. 1 is a schematic diagram of a blockchain-based data processing scenario provided in an embodiment of the present application. [Figure 9] FIG. 1 is a schematic diagram of the flow of a data processing method based on a blockchain provided in an embodiment of the present application. [Figure 10] FIG. 1 is a schematic diagram of a blockchain-based data processing scenario provided in an embodiment of the present application. [Figure 11] FIG. 1 is a schematic diagram of a blockchain-based data processing scenario provided in an embodiment of the present application. [Figure 12] FIG. 1 is a schematic diagram of a blockchain-based data processing scenario provided in an embodiment of the present application. [Figure 13] FIG. 1 is a schematic diagram of the flow of a data processing method based on a blockchain provided in an embodiment of the present application. [Figure 14] FIG. 1 is a schematic diagram of the configuration of a data processing device based on a blockchain provided in an embodiment of the present application. [Figure 15] FIG. 2 is a schematic diagram of the configuration of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0014] Hereinafter, the configuration of the embodiment of the present application will be described clearly and completely with reference to the drawings of the embodiment of the present application. It is obvious that the described embodiment is only a part of the embodiment of the present application, not all of the embodiments. All other embodiments that a person skilled in the art can obtain from the embodiment of the present application without creative labor belong to the scope of protection of the present application.

[0015] For ease of understanding, first, some terms will be simply interpreted as follows:

[0016] 1. In a narrow sense, blockchain is a chain-type data structure with blocks as the basic unit, in which the transaction history acquired in the past is checked by digital digest in the block, and it is suitable for the needs of tamper prevention and scalability in distributed ledger scenarios. In a broad sense, it also refers to the distributed ledger technology realized by the blockchain structure, including distributed consensus, privacy security protection, point-to-point communication technology, network protocol, smart contract, etc. Blockchain aims to realize a distributed data record ledger where only addition is allowed and deletion is not allowed. The basic structure underlying the ledger is a linear linked list. A linked list is a series of each "block", and the hash value of the block is recorded in the next block. Whether each block (and the transaction in the block) is valid can be quickly verified by calculating the hash value. When a node in the network proposes to add a new block, the consensus confirmation of the block must be achieved through a consensus mechanism.

[0017] 2. A block is a data packet that carries transaction data on a blockchain network, and is a data structure with a timestamp and a hash value corresponding to the previous block. The network's consensus mechanism verifies and confirms transactions in a block. A block includes a block header and a block body. The block header can record meta information of the current block, including the current version number, the hash value corresponding to the previous block, a timestamp, a random number, the hash value of the Merkle Root, and other data. The block body can record detailed data generated within a certain period of time, including the verification of the current block, all transaction records generated during block creation, and other information, and may be understood as one of the representation forms of a ledger.

[0018] 3. A hash value, also called an information characteristic value or characteristic value, is generated by converting input data of any length into a cipher using a hash algorithm and outputting it in a fixed length. It is a one-way encryption function, and the original input data cannot be retrieved by decrypting the hash value. In a blockchain, each block (except the initial block) contains the hash value of the previous block, and the previous block is called the parent block of the current block. In blockchain technology, the hash value maintains the authenticity of data recording and viewing, as well as the integrity of the blockchain as a whole.

[0019] 4. In a blockchain network, blockchain nodes are divided into consensus nodes (also called core nodes) and synchronization nodes (which may include data nodes and light nodes). Among them, consensus nodes are responsible for the consensus work of the entire blockchain network, and synchronization nodes are responsible for synchronizing the ledger information of consensus nodes, that is, synchronizing the latest block data. Whether they are consensus nodes or synchronization nodes, their internal configuration includes a network communication component. This is because the blockchain network is essentially a peer-to-peer (P2P) network and needs to communicate with other nodes in the blockchain network through the P2P component. In a blockchain network, resources and services are distributed to each node, and the transmission of information and the realization of services are performed directly between nodes, so there is no need for an intermediate link or a centralized server (third party) to be involved.

[0020] 5. Consensus mechanism is a mathematical algorithm that establishes trust and acquires interests between different node devices in a blockchain system. In a blockchain system, the verification and confirmation of transactions can be completed in a short time through a voting mechanism (i.e., consensus mechanism) between node devices. For one transaction, if some unrelated node devices can reach consensus, it can be considered that all node devices in the system can also reach consensus on it.

[0021] 6. A public key and a private key are a pair of keys (i.e. one public key and one private key) derived by an algorithm, where the public key is the public part of the key pair and the private key is the private part. Public keys are usually used to encrypt data or verify digital signatures. The algorithm can guarantee that the resulting key pair is unique. When using such a key pair, if some data is encrypted with one key, the other key must be used to decrypt it. For example, if data is encrypted with the public key, the private key must be used to decrypt it, and if data is encrypted with the private key, the public key must be used to decrypt it, otherwise the decryption will not be successful.

[0022] 7. Distributed Key Generation (DKG) protocol is an important component of a distributed encryption system. In the DKG protocol, multiple participants (node ​​devices participating in consensus) cooperate to generate a global public key and their own private key fragments based on a pre-configured encryption system, without the need for any trusted third party. The global public key generated by the DKG protocol is output in a public form, while each private key fragment is shared by the participants in a secret sharing scheme. This shared private key fragment can be used for collective encryption systems, such as collective signing and collective decryption.

[0023] Please refer to FIG. 1. FIG. 1 is a schematic diagram of a system architecture provided in an embodiment of the present application. As shown in FIG. 1, the system architecture may be a blockchain network. Here, the blockchain network may include a consensus network 101 and a synchronization network 102. A node in the synchronization network 102 is called a synchronization node. The synchronization node mainly performs business, does not participate in bookkeeping consensus, and obtains block data from the consensus network 101 through identity authentication. The consensus network 101 is also called a core network. A node in the consensus network 101 is called a consensus node. The consensus node has the entire amount of data. Here, the consensus network 101 and the synchronization network 102 may be located in different network environments, and usually, the consensus network 101 is located in a private network, while the synchronization network 102 is located in a shared network, and the two communicate through a routing boundary.

[0024] Also, referring to FIG. 1 , the consensus network 101 may include a consensus node 1011, a consensus node 1012, ..., a consensus node 1013. As can be understood, the consensus network 101 may include one or more consensus nodes. Here, the number of the consensus nodes is not limited. The synchronization network 102 may include a synchronization node 1021, a synchronization node 1022, a synchronization node 1023, ..., a synchronization node 1024, and a synchronization node 1025. As can be understood, the synchronization network 102 may include one or more synchronization nodes. Here, the number of the synchronization nodes is not limited.

[0025] During normal operation, each node (including the consensus node in the consensus network 101 and the synchronization node in the synchronization network 102) can receive transaction data sent from a client, generate a block based on the received transaction data, and then add the block to the blockchain. In order to ensure data exchange between each node, a data connection may exist between each node, such as a data connection between the consensus node 1011 and the consensus node 1012, a data connection between the consensus node 1011 and the consensus node 1013, and a data connection between the synchronization node 1021 and the synchronization node 1023.

[0026] Furthermore, a data connection exists between the consensus network 101 and the synchronization network 102, for example, a data connection exists between the consensus node 1011 and the synchronization node 1022, and a data connection exists between the consensus node 1012 and the synchronization node 1023.

[0027] As can be seen, the nodes can transmit data or blocks through the data connections. The data connections between the nodes can be based on node identifiers. Each node in the blockchain network has a corresponding node identifier. Each node can store the node identifiers of other nodes with which it has a connection relationship so that it can subsequently broadcast acquired data or generated blocks to other nodes based on the node identifiers of the other nodes. For example, the consensus node 1011 can maintain a node identifier list. As shown in Table 1, the node identifier list stores the node names and node identifiers of other nodes.

[0028] [Table 1] Here, the node identifier may be a protocol (IP: Internet Protocol) address for interconnecting networks or any other information that can identify a node in a blockchain network. In Table 1, we will explain using only IP addresses as an example.

[0029] Assuming that the node identifier of the consensus node 1011 is 117.116.156.425, the consensus node 1011 can send a data synchronization request to the synchronization node 1021 by the node identifier 117.114.151.183, and the synchronization node 1021 can know that the data synchronization request is sent from the consensus node 1011 by the node identifier 117.116.156.425. Similarly, the synchronization node 1023 can send transaction data A to the consensus node 1011 by the node identifier 117.116.156.425, and the consensus node 1011 can know that the transaction data A is sent from the synchronization node 1023 by the node identifier 119.250.485.362. Data transmission between other nodes is similar, so it will not be described one by one.

[0030] As can be understood, the above data connection is not limited to a connection method, and may be directly or indirectly connected by a wired communication method, directly or indirectly connected by a wireless communication method, or may be connected by other methods. The present application is not limited thereto.

[0031] Here, the consensus node 1011, consensus node 1012, ..., consensus node 1013, synchronization node 1021, synchronization node 1022, synchronization node 1023, ..., synchronization node 1024, and synchronization node 1025 in Figure 1 may include mobile phones, tablet computers, laptops, palmtop computers, smart speakers, mobile internet devices (MIDs), point of sales (POS) equipment, wearable devices (e.g., smart watches, smart bracelets, etc.), etc.

[0032] As can be understood, the blockchain-based data processing method provided in the embodiments of the present application may be executed by a computer device, and the computer device may include, but is not limited to, a terminal or a server. The server may be an independent physical server, a server cluster or a distributed system consisting of multiple physical servers, or a cloud server providing base cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDNs, and big data and artificial intelligence platforms. The terminal may be, but is not limited to, a smartphone, a tablet computer, a laptop, a desktop computer, a smart speaker, a smart watch, etc. The terminal and the server may be directly or indirectly connected by a wired or wireless communication method. The present application is not limited thereto.

[0033] For convenience of explanation, in this application, a block with a block height of X is named block X, and a block height of X is described as block height X, where X is a positive integer. For example, a block with a block height of 1 is named block 1, and a block height of 1 is described as block height 1, a block with a block height of 98 is named block 98, and a block height of 98 is described as block height 98, and the names of blocks corresponding to other block heights are similar, and will not be described here one by one.

[0034] As can be seen from the above FIG. 1, the blockchain network includes a consensus network and a synchronization network, but the consensus nodes in the consensus network are not fixed and may be dynamically increased or decreased. The consensus process of the consensus network may be divided into consensus cycles, where in each consensus cycle, a fixed set of consensus nodes participate in the consensus, and other blockchain nodes are data synchronization nodes.

[0035] In the prior art, every time a cycle (i.e., term) ends, the blockchain consensus node set reselects a new consensus node from among the blockchain nodes. For example, the consensus nodes in the first blockchain consensus node set perform consensus processing on blocks corresponding to block height 1, block height 2, ..., block height n in the first consensus cycle. When the block corresponding to block height n is successfully added to the blockchain, the second blockchain consensus node set is reselected and switched from the first blockchain consensus node set to the second blockchain consensus node set. In this case, the second blockchain consensus committee must first obtain consensus configuration information for the second consensus cycle, such as the consensus block range and consensus node set, to complete the configuration operation, and also must complete block synchronization. Furthermore, the consensus nodes in the second-generation blockchain consensus node set will be able to normally perform consensus processing for blocks corresponding to block height n+1, block height n+2, ..., block height 2n in the second consensus cycle.

[0036] According to an embodiment of the present application, if the block height generated in the current consensus cycle meets the consensus node set switching condition, a consensus node set for the next consensus cycle that will participate in the consensus operation of the next consensus cycle is reselected.

[0037] In addition, in this application, after the consensus node set for the next consensus cycle is selected, the new consensus node set is not immediately assumed the consensus authority of the consensus node set for the previous consensus cycle, but is given a transitional period during which necessary preparations are completed, for example, the new consensus node set needs to generate key fragments for the new consensus cycle by distributed key components.

[0038] Please refer to FIG. 2. FIG. 2 is a schematic diagram of a data processing scenario based on a blockchain provided in an embodiment of the present application. As shown in FIG. 2, the blockchain node set 201 includes a blockchain node 201a, a blockchain node 202a, a blockchain node 203a, ..., a blockchain node 206a, and in a first consensus cycle (which can be understood as a current consensus cycle), the blockchain node 206a belongs to a first consensus node set 20c. Here, the consensus nodes (including the blockchain node 206a) in the first consensus node set 20c can be used to perform additional processing on blocks 1 to 100 in the first consensus cycle to the blockchain. The above first consensus node set can be understood as a blockchain consensus node set corresponding to the first consensus cycle, and the blockchain consensus node set is a node responsible for block consensus in the blockchain, and is also called a bookkeeper.

[0039] Also, referring to FIG. 2, the blockchain node 20a may be any one of the blockchain nodes in the blockchain node set 201. The blockchain node 20a may include a cycle management component 20b. The cycle management component 20b may include a consensus block range of the first consensus cycle, for example, block 1 to block 100 shown in FIG. 2, and may include a consensus node set switching condition for the first consensus cycle, for example, block 98 shown in FIG. 2. As can be understood, the "block 98" in the above consensus node set switching condition may refer to the first consensus node set 20c generating a block of block height 98, and may also refer to the block of block height 98 being successfully added to the blockchain. Here, the block state of block 98 is not limited and may be set according to the actual application scenario.

[0040] In the embodiment of the present application, an example will be described in which a certain consensus node in the first consensus node set 20c generates block 98 (i.e., block 20f in FIG. 2). As shown in FIG. 2, in this case, the height of the block generated in the first consensus cycle (i.e., block height 98) satisfies the consensus node set switching condition, so the blockchain node 20a starts selecting a consensus node corresponding to the second consensus cycle. Here, the consensus block range of the second consensus cycle may include block 101 to block 200. The blockchain node 20a adds the selected consensus node for the second consensus cycle to the second consensus node set 20d. Once the consensus nodes in the second consensus node set 20d are completely determined, the block being generated in the first consensus node set 20c (e.g., block 20g in FIG. 2) is determined as the first block, and the block height corresponding to the first block is determined as the first block height (assuming the first block is block 99, the first block height is equal to the block height 99). As can be understood, the first block may be a block being consensused in the first consensus node set 20c, or a block being added to the blockchain. Here, the block status of the first block is not limited, and may be set according to the actual application scenario.

[0041] The block producing nodes in the first consensus node set 20c may add set information 20e corresponding to the second consensus node set 20d to the block header of the first block (i.e., block 20g in FIG. 2) and broadcast the first block to the synchronization network once the consensus for the first block is adopted.

[0042] Unlike the conventional method, in the embodiment of the present invention, a transient block height interval is created in the replacement of the first consensus cycle and the second consensus cycle. The transient block height interval may be a fixed interval. For example, the blockchain node 20a first obtains the number of transient blocks. In the embodiment of the present application, the case where the number of transient blocks is 10 is taken as an example. With reference to the first block height (e.g., block height 99) and the number of transient blocks (10), the blockchain node 20a can determine that the transient blocks are block 100, block 101, block 102, ..., block 109. Among them, block 100 is a block in the first consensus cycle, and block 101, block 102, ..., block 109 are blocks in the second consensus cycle.

[0043] The consensus nodes in the first consensus node set 20c (including the blockchain node 206a) reach a consensus on block 100, and when the consensus is adopted, add block 100 to the blockchain. In this case, the blockchain consensus node set is not switched from the first consensus node set 20c to the second consensus node set 20d. That is, the consensus nodes in the first consensus node set 20c still reach a consensus on blocks 101, 102, ..., 109 in the second consensus cycle. While the first consensus node set 20c performs consensus processing on the transient block (e.g., block 100, block 101, block 102, ..., block 109), i.e., during the transient period, the consensus nodes in the second consensus node set 20d (including the blockchain node 201a and the blockchain node 206a) generate private key fragments associated with the second consensus cycle, for example, the private key fragment 201h, the private key fragment 202h, ... illustrated in Fig. 2, based on the collective information 20e in the first block (i.e., block 20g in Fig. 2). When the consensus on block 109 by the first consensus node set 20c is adopted, the blockchain consensus node set is switched from the first consensus node set 20c to the second consensus node set 20d.

[0044] As can be seen, the total number of private key fragments associated with the second consensus cycle is equal to the total number of consensus nodes in the second consensus node set 20d.

[0045] Optionally, the transient block height interval may be determined based on the first block height instead of a fixed interval. For example, the blockchain node 20a determines the transient start block based on the first block (i.e., block 20g in FIG. 2). For example, since block 20g is block 99, the transient start block is block 100. When any consensus node in the second consensus node set 20d generates its own private key fragment, for example, when the blockchain node 201a in the second consensus node set 20d generates its own private key fragment 201h and the blockchain node 206a in the second consensus node set 20d generates its own private key fragment 202h (obviously, the private key fragment of the blockchain node 206a in the first consensus node set 20c for the first consensus cycle is the private key fragment 203h, which is not equivalent to the private key fragment 202h of the blockchain node 206a for the second consensus cycle), each consensus node in the second consensus node set 20d may obtain a notification signature in the form of a notification (for example, the private key fragment generation notification 20i illustrated in FIG. 2) by generating a signature of the notification 20i for the private key fragment with the private key fragment associated with the second consensus cycle. For example, the blockchain node 206a obtains a notification signature for the blockchain node 206a by generating and signing a notification for its own private key fragment with the private key fragment 202h. Each consensus node in the second consensus node set 20d broadcasts a private key fragment generation notification 20i with the notification signature attached to it to the first consensus node set 20c, for example, the blockchain node 206a in the first consensus node set 20c illustrated in FIG. 2, to inform the first consensus node set 20c that the private key fragment of the consensus node in the second consensus node set 20d has been generated.

[0046] Then, the consensus nodes in the first consensus node set 20c (including the blockchain node 206a) perform signature verification of the notification signature, and if the signature verification passes, the block being processed by the first consensus node set 20c may be a transient end block. The transient period is the period from the consensus on the transient start block (e.g., block 100 in the above example) to the adoption of the consensus on the transient end block. For example, the blockchain system may set the number of transient blocks to be equal to 10. In this way, the blockchain system sets blocks 100, 101, 102, ..., 109 as default transient blocks, but the block to be consensus-held (e.g., block 103) of the first consensus node set 20c includes a notification signature sent from a consensus node in the second consensus node set 20d, and the consensus of block 103 is adopted, so that the blockchain consensus node set can be switched from the first consensus node set 20c to the second consensus node set 20d. That is, the first consensus node set 20c leaves the blockchain consensus node set, and the consensus node in the second consensus node set 20d joins the blockchain consensus node set and further has the consensus authority for blocks in the second consensus cycle. After that, the consensus node in the second consensus node set 20d performs consensus operations on blocks in the second consensus cycle, starting from block 104.

[0047] As described above, during the transition period, the consensus nodes in the second consensus node set 20d have generated private key fragments associated with the second consensus cycle. Therefore, when switching the blockchain consensus node set from the first consensus node set 20c to the second consensus node set 20d, there is no need to wait for the second consensus node set 20d to generate private key fragments associated with the second consensus cycle, and the consensus nodes in the second consensus node set 20d can have consensus authority in real time.

[0048] As can be seen from the above, an embodiment of the present application provides a method for replacing and switching a blockchain consensus node set, which can ensure that the newly selected consensus node set (i.e., the above second consensus node set 20d) can smoothly take over the accounting authority of the blockchain network, and allow the old consensus node set (i.e., the above first consensus node set 20c) to smoothly withdraw from the accounting authority of the blockchain network, and further improve the continuity and timeliness of blockchain business services.

[0049] In addition, a private key fragment of each consensus node is generated based on the set information corresponding to the consensus node set. Since the consensus node set has a periodic characteristic (for example, in the blockchain node 206a in FIG. 2, the private key fragment 203h for the first consensus cycle is not equal to the private key fragment 202h for the second consensus cycle), the private key fragment generated based on the set information also has periodicity and is not fixed. This avoids hidden security risks due to the leakage of private keys, thereby improving the security of blockchain business services.

[0050] Further, please refer to FIG. 3. FIG. 3 is a flow diagram of a data processing method based on a blockchain provided in an embodiment of the present application. The data processing method based on a blockchain may be executed by a computer device. The computer device may include any one of the consensus nodes in the first consensus node set, any one of the consensus nodes in the second consensus node set, any one of the consensus nodes belonging to the first consensus node set and any one of the consensus nodes belonging to the second consensus node set. As shown in FIG. 3, the data processing method based on a blockchain may include the following steps:

[0051] In step S101, if the block height generated in the first consensus cycle satisfies the consensus node set switching condition, start selecting a second consensus node set corresponding to the second consensus cycle, determine the block height generated when the second consensus node set is selected as the first block height, and the block corresponding to the maximum block height in the first consensus cycle is the block immediately before the block corresponding to the minimum block height in the second consensus cycle.

[0052] Specifically, obtain the maximum block height generated in the first consensus cycle, obtain the consensus node set switching condition for the first consensus cycle, match the maximum block height with the consensus node set switching condition, and if the matching between the maximum block height and the consensus node set switching condition is successful, assign an index including a consensus index for the second consensus cycle to each blockchain node in the blockchain node set, and add the blockchain node having the consensus index to the second consensus node set corresponding to the second consensus cycle.

[0053] Please also refer to FIG. 4. FIG. 4 is a schematic diagram of a scenario of data processing based on a blockchain provided in an embodiment of the present application. As shown in FIG. 4, currently, the generated blocks 40d of the first consensus cycle may include block 1 (i.e., block 401d in FIG. 4), block 2 (i.e., block 402d in FIG. 4), ..., block 98 (i.e., block 498d in FIG. 4). That is, the currently maximum block height is block height 98 corresponding to block 98. Therefore, the block height 98 is the above maximum block height. The blockchain node set 40c may include blockchain node 401c, blockchain node 402c, blockchain node 403c, ..., blockchain node 406c (which is a consensus node in the first consensus node set 4c), and other consensus nodes in the first consensus node set 4c.

[0054] The blockchain node 40a may be any one of the blockchain nodes in the blockchain node set 40c. The blockchain node 40a may include a cycle management component 40b. As shown in FIG. 4, the cycle management component 40b may include a consensus block range of the first consensus cycle, for example, block 1 to block 100 shown in FIG. 4, and may include a consensus node set switching condition for the first consensus cycle (also referred to as the first switching condition in FIG. 4). Please refer to the detailed description of the consensus node set switching condition in the embodiment corresponding to FIG. 2 above. Here, further description is omitted.

[0055] The cycle management component 40b may include a first consensus index for the first consensus cycle. Here, the index in this application is a node index identifier, which is different from the node identifier of the blockchain node itself (for example, the node identifier shown in Table 1 above). The first consensus index is for representing the index of the consensus node (including the blockchain node 406c) in the first consensus node set 4c. As shown in FIG. 4, the first consensus index may include index 001, ..., index 010. Among them, the index of the blockchain node 406c is index 001. As can be understood, in different consensus cycles, the index of the same blockchain node may change, so that in different consensus cycles, the consensus node corresponding to the same index may be different.

[0056] The cycle management component 40b can verify whether the node itself (i.e., the blockchain node 40a) is selected as a node in the next blockchain consensus node set. If the node itself is selected as a node in the next blockchain consensus node set, it is added to the second consensus node set 40e. The cycle management component 40b can also verify whether the designated node is a block proposer, i.e., a block generating node, and whether it has a function such as a consensus message signature. In an embodiment of the present application, the cycle management component 40b can maintain a blockchain consensus node set transition period. The transition period is represented by consecutive blocks. For example, when a new blockchain consensus node set (e.g., the second consensus node set 40e) is selected, the previous blockchain consensus node set (e.g., the first consensus node set 4c) continues the consensus process of 10 blocks. After that, the new blockchain consensus node set takes over the bookkeeping. At this time, the previous blockchain consensus node set leaves the bookkeeping. The 10 blocks are transition blocks within a transition period.

[0057] Also, referring to FIG. 4, the blockchain node 40a obtains a consensus node set switching condition (i.e., a first switching condition) for the first consensus cycle from the cycle management component 40b, and matches the maximum block height (i.e., the block height of block 498d in FIG. 2, which is assumed to be block height 98) with the consensus node set switching condition. If the first switching condition is block height 99, the matching of the maximum block height with the first switching condition fails, and the blockchain node 40a waits for the generation of the next block. If the first switching condition is block height 98, the matching of the maximum block height with the first switching condition succeeds. As shown in FIG. 4, the blockchain node 40a assigns an index for the second consensus cycle to each blockchain node in the blockchain node set 40c. Assume that the index of the blockchain node 405c is index 001 and the index of the blockchain node 406c is index 020 for the second consensus cycle. Assuming that the second consensus index (i.e., the consensus index for the second consensus cycle) includes index 001 and does not include index 020, as shown in FIG. 4, blockchain node 405c is added to the second consensus node set 40e, but blockchain node 406c is not added to the second consensus node set 40e.

[0058] 4, the blockchain node 40a determines the second consensus node set 40e when generating the block 99 (equivalent to the block 499d in FIG. 4) in the generated block 40f of the first consensus cycle, and therefore determines the block height 99 as the first block height. The block 499d is the first block, and is equivalent to the block 20g in FIG. 2.

[0059] In step S102, the set information corresponding to the second consensus node set is added to the block corresponding to the first block height to generate a first block, and the first block is broadcast in the blockchain network, so that the consensus nodes in the second consensus node set generate private key fragments associated with the second consensus cycle based on the set information in the first block within a transient consensus period, where the transient consensus period refers to the time consumed by the first consensus node set corresponding to the first consensus cycle to perform consensus processing on blocks belonging to a transient block height interval, and all block heights included in the transient block height interval are greater than the first block height.

[0060] Specifically, if the consensus node belongs to the second consensus node set, obtain the collective information in the first block, generate a secret integer associated with the collective information by a distributed key component, generate a target local public key according to the secret integer, and generate at least two secret shares according to the secret integer, where the total number of the at least two secret shares is equal to the total number of the consensus nodes in the second consensus node set. c where c is a positive integer and is less than or equal to the total number of nodes, and at least two secret shares are c If it contains the target local public key and secret share M c Consensus node G c and consensus node G c The local public key U sent from c and Secret Share E c Obtain the local public key U c and Secret Share E c In both cases, consensus node G c , which is associated with a secret integer corresponding to c , broadcast the result of the validation to the consensus nodes in the second consensus node set, and generate a secret share Ec and secret share M c and generating a second target private key fragment based on the target local public key and the local public key U c Based on the above, generate a global public key associated with the second consensus node set.

[0061] Please also refer to FIG. 5. FIG. 5 is a schematic diagram of a scenario of data processing based on a blockchain provided in an embodiment of the present application. As shown in FIG. 5, the blockchain node set 40c may include a blockchain node 401c, a blockchain node 402c, a blockchain node 403c, ..., a blockchain node 406c (which is a consensus node in the first consensus node set 4c), other consensus nodes in the first consensus node set 4c, a blockchain node 50b (which is a consensus node in the second consensus node set 40e), and other consensus nodes in the second consensus node set 40e (including the blockchain node 405c). Here, the blockchain node 50a in FIG. 5 may be any one of the consensus nodes in the first consensus node set 4c. In addition, the blockchain node 50a generates a block 499d as a block generating node. The block 499d is equivalent to the block 499d in FIG. 4, that is, it is the block (i.e., the first block) corresponding to when the second consensus node set 40e is selected. Here, the block 499d includes a block header and a block body, and the block header may store the characteristic value of the input information of the current block, the characteristic value of the block header of the parent block (equivalent to the hash value of the parent block in FIG. 5), a version number, a timestamp, and a difficulty value, etc., and the block body stores the input information. According to an embodiment of the present application, the set information corresponding to the second consensus node set 40e is also stored in the block header in the block 499d. Then, the blockchain node 50a broadcasts the block 499d (i.e., the above-mentioned first block) in the blockchain network.

[0062] In the embodiment of the present application, taking the case where the blockchain node 50b is any one of the consensus nodes in the second consensus node set 40e as an example, when the blockchain node 50b acquires the block 499d during the transition period, first, the blockchain node 50b performs signature verification of the aggregate signature attached to the block 499d with the global public key associated with the first consensus node set 4c, and if the signature verification result is a signature verification pass result, the blockchain node 50b generates a private key fragment associated with the second consensus cycle based on the set information in the block 499d. Here, the aggregate signature attached to the block 499d is generated based on the signature shares corresponding to each of the consensus nodes in the first consensus node set 4c. That is, each of the consensus nodes in the first consensus node set 4c acquires its own signature share by signing the block 499d with the private key fragment associated with the first consensus cycle. Then, the blockchain node 50b acquires the aggregate signature attached to the block 499d by performing an aggregation process of the signature shares corresponding to each of the consensus nodes in the first consensus node set 4c.

[0063] As can be understood, the blockchain node 50a and the blockchain node 50b may not be the same blockchain node. That is, the blockchain node 50a is a consensus node in the first consensus node set 4c, but is not a consensus node in the second consensus node set 4e. Optionally, the blockchain node 50a and the blockchain node 50b may be the same blockchain node. In this case, the blockchain node 50a is not only a consensus node in the first consensus node set 4c, but also a consensus node in the second consensus node set 4e.

[0064] As can be seen from the above, when consensus nodes dynamically join or leave the consensus network, the consensus node set of the consensus network changes accordingly. That is, the first consensus node set is not equivalent to the second consensus node set. Therefore, any blockchain node in both the first consensus node set and the second consensus node set has a different private key fragment associated with the first consensus node set and a different private key fragment associated with the second consensus node set. For example, the blockchain node 206a illustrated in FIG. 2 has a different private key fragment 203h associated with the first consensus node set 20c and a different private key fragment 202h associated with the second consensus node set 20d. Therefore, the distributed key component needs to recalculate the private key fragment based on the new set information.

[0065] During the blockchain consensus node set transition period, the old consensus node set (e.g., the first consensus node set 4c in FIG. 5) continues to have the authority of consensus and block generation, and adds the set information corresponding to the newly selected consensus node set (e.g., the second consensus node set 40e in FIG. 5) to the data of the block being processed. When the new consensus node set (i.e., the second consensus node set 40e) is synchronized to the block (i.e., the first block equivalent to block 499d in FIG. 5), it notifies the distributed key component of the set information corresponding to the new consensus node set. Upon receiving the set information, the distributed key component starts to execute the DKG protocol to calculate its own key fragment.

[0066] In the embodiment of the present application, first, a distributed key component that does not need to approve a trust medium is designed. The distributed key component can guarantee the security of the private key fragments of the participants in the consensus network and the validity of the global public key for verifying the aggregate signature. When the consensus nodes in the consensus network are known (e.g., the first consensus node set 4c and the second consensus node set 40e), the flow of the distributed key component generating private key fragments as a participant is as follows:

[0067] 1. Each consensus node in the consensus network has a consensus module component and a distributed key component, and the consensus module component of each consensus node registers an event in the distributed key component of its own node, and the event is for monitoring the generation status of the private key fragment of its own node. In order to facilitate the explanation and understanding of the consensus node generating the private key fragment, in the embodiment of the present application, the consensus node in the second consensus node set 40e (for example, the blockchain node 50b and the blockchain node 405c in FIG. 5) is taken as an example for explanation. The process of other consensus nodes generating their own private key fragments can be seen in the following process.

[0068] 2. The distributed key component of the blockchain node 50b (it should be noted that the blockchain node 50b here specifically refers to any one of the consensus nodes in the second consensus node set 40e, which has the consensus authority and block generation authority) randomly generates a secret integer belonging to itself, and then shares the secret integer to the consensus network according to the DKG protocol. This process can also be seen in FIG. 6. FIG. 6 is a schematic diagram of the flow of a data processing method based on the blockchain provided in an embodiment of the present application. Here, node 1, node 2, node 3, and node 4 in FIG. 6 are all consensus nodes in the second consensus node set 40e. It can be understood that any consensus node in the second consensus node set 40e performs the following process. In the embodiment of the present application, for the sake of aesthetics and visibility of FIG. 6, we only take the example that node 1 represents the blockchain node 50b and node 2 represents the blockchain node 405c. As shown in FIG. 6, the method may include a preparation stage, a distribution stage, a broadcast stage and a calculation stage, and the roles of each stage are as follows:

[0069] a, in the preparation stage, on the one hand, the blockchain node 50b generates a target local public key 50c based on a secret integer, and on the other hand, the blockchain node 50b calculates a secret share 50d to be shared with the consensus node for its own secret integer based on a verifiable secret sharing scheme. As shown in FIG. 5, the secret share 50d may include secret shares 501d, ..., secret shares 502d, and the total number of secret shares 50d is equal to the total number of nodes of the consensus node in the consensus network. The above verifiable secret sharing scheme is not limited to the embodiment of the present application, and may be any one scheme such as the information-theoretically secure non-interactive verifiable secret sharing scheme (Pedersen-VSS: Pedersen-Verifiable Secret Sharing) proposed by Pedersen and the Feldman-Verifiable Secret Sharing (Feldman-VSS) scheme proposed by Feldman.

[0070] b. In the distribution phase, the blockchain node 50b distributes the secret share calculated in the preparation phase and the target local public key 50c to the corresponding consensus node, for example, distributing the secret share 502d to itself and distributing the secret share 501d to the blockchain node 405c (the blockchain node 405c here specifically refers to any one of the consensus nodes in the second consensus node set 40e, which has consensus authority and block generation authority).

[0071] c. In the broadcast phase, after each consensus node receives the secret shares and the corresponding target local public keys distributed from other consensus nodes, for example, after blockchain node 405c obtains secret share 501d and target local public key 50c distributed from blockchain node 50b, ..., secret share 50e and target local public key 50g distributed from itself, based on the Pedersen-VSS scheme, blockchain node 405c respectively verifies the validity of the obtained secret shares, and then broadcasts the verification result to other consensus nodes in the second consensus node set 40e, for example, blockchain node 50b.

[0072] d, in the calculation stage, on the one hand, based on the Pedersen-VSS scheme, the blockchain node 405c uses the secret shares (e.g., the secret shares 501d and 50e illustrated in FIG. 5) distributed to it from each of all the consensus nodes as input to calculate the private key fragment it has, for example, the private key fragment 50f illustrated in FIG. 5, and on the other hand, the blockchain node 405c uses the target local public key (e.g., the target local public key 50c and the target local public key 50g illustrated in FIG. 5) obtained by it as input to calculate its own global public key 50h. Here, the global public keys corresponding to each of the consensus nodes in the second consensus node set 40e are the same.

[0073] 3. When the distributed key component of the blockchain node 405c discovers that its private key fragment has been generated, it sends a notification signal to an event registered with the consensus module component to inform it that the private key fragment is ready.

[0074] 4. After receiving the notification, the consensus module component obtains the generated private key fragment and uses it for subsequent consensus voting signatures. At the same time, the consensus module component can launch the consensus authority.

[0075] In step S103, a private key fragment generation notification sent from a consensus node in the second consensus node set is obtained, and the private key fragment generation notification is accompanied by a notification signature, which is generated by a consensus node in the second consensus node set generating and signing the notification with a private key fragment associated with the second consensus cycle.

[0076] Specifically, after each consensus node in the second consensus node set calculates its own private key fragment, it signs it in the form of a notification (i.e., a private key fragment generation notification), i.e., it generates and signs a notification for one private key fragment with its private key fragment, and then broadcasts the private key fragment generation notification with the notification signature to the consensus nodes in the first consensus node set, i.e., it informs the first consensus node set that its private key fragment has been generated.

[0077] Also refer to FIG. 7. FIG. 7 is a schematic diagram of a scenario of data processing based on the blockchain provided in an embodiment of the present application. As shown in FIG. 7, a consensus node in the second consensus node set (for example, the blockchain node 405c illustrated in FIG. 7) first generates a private key fragment generation notification, then generates and signs the notification for the private key fragment with its own private key fragment 50f to obtain a notification signature 50i, and then broadcasts the private key fragment generation notification with the notification signature 50i to the consensus node in the first consensus node set, for example, the blockchain node 70a illustrated in FIG. 7.

[0078] In step S104, a consensus authority for the second consensus cycle of the consensus nodes in the second consensus node set is determined based on the notification signature.

[0079] Specifically, the second consensus node set includes consensus node G a (where a is a positive integer and is less than or equal to the total number of consensus nodes in the second consensus node set), and the notification signature includes the signature of consensus node G a Notification signature for T a The notification signature T a By performing signature verification of the first signature verification result J a and obtain the first signature verification result J a The first signature verification result J includes a signature verification failure result or a signature verification pass result. a If the signature verification fails, the notification signature T a , and the first signature verification result J a If the signature verification is successful, the notification signature T a to the set of valid signatures. Based on the set of valid signatures, determine the consensus authority of the consensus nodes in the second consensus node set for the second consensus cycle.

[0080] Here, the private key fragment generation notification is sent to consensus node G. a Private key fragment generation notification sent from Z a , and the first signature verification result J a The specific process of obtaining the notification signature T a obtaining a first digital digest by decrypting the secret key fragment generation notification Z a and comparing the first digital digest with the second digital digest; and if the first digital digest and the second digital digest are the same, obtaining a first signature verification result J. a determining that the first digital digest is a passing signature verification result J if the first digital digest and the second digital digest are different; ais a signature verification failure result.

[0081] Here, a specific process of determining the consensus authority of a consensus node in the second consensus node set for the second consensus cycle based on the set of valid signatures may include: aggregating the total number of signatures of notification signatures in the set of valid signatures; determining a first quantitative ratio of the total number of nodes to the total number of signatures and comparing the first quantitative ratio with a first quantitative ratio threshold; determining that the consensus node in the second consensus node set does not have consensus authority for the second consensus cycle if the first quantitative ratio is less than the first quantitative ratio threshold; and determining that the consensus node in the second consensus node set has consensus authority for the second consensus cycle if the first quantitative ratio is greater than or equal to the first quantitative ratio threshold.

[0082] When the consensus node in the first consensus node set receives the private key fragment generation notification, it checks the validity of the notification signature based on a new global public key (equal to the global public key associated with the second consensus cycle, not equal to the global public key associated with the first consensus cycle), and if it is invalid, it deletes it, and if it is valid, it buffers it. After receiving enough private key fragment generation notifications sent from each of the consensus nodes in the second consensus node set, the block generating node in the first consensus node set obtains an aggregate signature by performing an aggregation process of the valid notification signatures by an aggregate signature algorithm, packs the aggregate signature into the block being processed, and informs other consensus nodes in the first consensus node set that the consensus node set (i.e., the second consensus node set) of the next consensus cycle is ready. When the first consensus node set achieves consensus on the block, the first consensus node set can leave the consensus, and the second consensus node set takes over the consensus authority.

[0083] Referring also to FIG. 7, after receiving the private key fragment generation notification sent from the consensus node in the second consensus node set, any one of the consensus nodes in the first consensus node set performs the following steps. Here, the blockchain node 70a in FIG. 7 indicates any one of the consensus nodes in the first consensus node set, and the blockchain node 405c in FIG. 7 indicates any one of the consensus nodes in the second consensus node set. The blockchain node 70a obtains a first digital digest by decrypting the notification signature 50i with the global public key 50h (equivalent to the global public key 50h in FIG. 5) associated with the second consensus node set. The blockchain node 70a may obtain a second digital digest of the private key fragment generation notification by a hash algorithm. The blockchain node 70a compares the first digital digest with the second digital digest. If the first digital digest and the second digital digest are different, the first signature verification result for the notification signature 50i is determined to be a signature verification failure result, in which case the blockchain node 70a deletes the notification signature 50i. If the first digital digest and the second digital digest are the same, the first signature verification result for the notification signature 50i is determined to be a signature verification success result, in which case the blockchain node 70a adds the notification signature 50i to the valid signature set 70b.

[0084] Further, FIG. 8 is also referred to. FIG. 8 is a schematic diagram of a scenario of data processing based on a blockchain provided in an embodiment of the present application. As shown in FIG. 8, the consensus node in the first consensus node set counts up the total number of signatures of the notification signatures in the valid signature set 70c. Here, the valid signature set 70c illustrated in FIG. 8 includes notification signatures 50i, ..., notification signature 501i, where the notification signature 50i may be a notification signature of a consensus node (equivalent to the blockchain node 405c) in the second consensus node set 40e (equivalent to the second consensus node set 40e in FIG. 5), and the notification signature 501i may be a notification signature of a consensus node (equivalent to the blockchain node 50b) in the second consensus node set 40e. The consensus node in the first consensus node set 4c determines a first quantitative ratio between the total number of nodes and the total number of signatures. As can be seen, the total number of signatures is less than or equal to the total number of nodes, so the first quantitative ratio is less than or equal to 1. The first quantity ratio is compared with the first quantity ratio threshold. Assuming that the first quantity ratio is 0.9, when the first quantity ratio threshold is equal to 0.95, it is determined that the first quantity ratio is smaller than the first quantity ratio threshold. Furthermore, it can be determined that the consensus nodes in the second consensus node set 40e do not have consensus authority for the second consensus cycle, that is, the consensus nodes in the first consensus node set still perform the consensus work. When the first quantity ratio threshold is equal to 0.85, it can be determined that the first quantity ratio is greater than the first quantity ratio threshold, so that the consensus nodes in the second consensus node set have consensus authority for the second consensus cycle.

[0085] In the embodiment of the present application, when the consensus nodes in the consensus network dynamically increase or decrease, the aggregate signature distributed key system can be automatically updated, and there is no need to stop the consensus service. In addition, the aggregate signature method adopts a distributed key system in which multiple consensus nodes jointly participate, and all consensus nodes cannot predict the private key fragment for signing, which can prevent a small number of nodes from acting maliciously.

[0086] As can be seen from the above, the transient block height interval allows the present application to avoid waiting for the consensus nodes in the second consensus node set to generate a private key fragment associated with the second consensus cycle when switching from the first consensus node set to the second consensus node, thereby allowing the consensus nodes in the second consensus node set to have consensus authority more smoothly and avoiding long-term interruptions in block consensus when switching consensus node sets. This allows the present application to improve the continuity and timeliness of blockchain business services.

[0087] In addition, the private key fragment associated with the second consensus cycle in the present application is associated with the set information corresponding to the second consensus node set. That is, the private key fragment for signing in the first consensus cycle (associated with the set information corresponding to the first consensus node set) is different from the private key fragment for signing in the second consensus cycle. Therefore, the present application can improve the security of blockchain business services.

[0088] Further, please refer to FIG. 9. FIG. 9 is a flow diagram of a data processing method based on a blockchain provided in an embodiment of the present application. The data processing method based on a blockchain may be executed by a computer device. The computer device may include any one of the consensus nodes in the first consensus node set, any one of the consensus nodes in the second consensus node set, any one of the consensus nodes belonging to the first consensus node set and any one of the consensus nodes belonging to the second consensus node set. As shown in FIG. 9, the data processing method based on a blockchain further includes the following steps in addition to steps S101 to S104.

[0089] In step S205, if a consensus node in the second consensus node set has consensus authority for the second consensus cycle, it performs an aggregation process of the notification signatures to obtain a first aggregate signature.

[0090] Specifically, after receiving enough private key fragment generation notifications sent from each of the consensus nodes in the second consensus node set, the block generating node in the first consensus node set obtains an aggregate signature by performing an aggregation process of the valid notification signatures through a signature aggregation algorithm. Also, referring to FIG. 8, if the first quantity ratio is equal to or greater than the first quantity ratio threshold, the consensus node in the first consensus node set can determine that the consensus node in the second consensus node set has consensus authority for the second consensus cycle. In this case, the consensus node in the first consensus node set obtains a first aggregate signature 70d by performing an aggregation process of the notification signatures in the valid signature set 70c (including the notification signature 50i and the notification signature 501i illustrated in FIG. 8). The signature aggregation algorithm is not limited to the embodiment of the present application, and may be set according to the actual application scenario, and may include the BLS signature algorithm. The signature algorithm can realize signature aggregation and key aggregation, i.e., multiple keys can be aggregated into one key and multiple signatures can be aggregated into one signature. The signature aggregation algorithm may include a digital signature algorithm, such as the Schnorr signature algorithm.

[0091] In step S206, a signature verification block including the first aggregate signature is generated, and a consensus process is performed on the signature verification block to obtain a consensus result, and the second block height corresponding to the signature verification block belongs to the transient block height interval.

[0092] Specifically, a block producing node in the first consensus node set packs a first aggregate signature into the block being processed and informs other consensus nodes in the first consensus node set that the consensus node set for the next consensus cycle (i.e., the second consensus node set) is ready. Once the first consensus node set achieves consensus on the block, the first consensus node set can leave the consensus and the second consensus node set takes over consensus authority.

[0093] Please also refer to FIG. 10. FIG. 10 is a schematic diagram of a scenario of data processing based on a blockchain provided in an embodiment of the present application. A blockchain node 80a in FIG. 10 is a block generating node in the first consensus node set 4c, and generates a signature verification block 80b including a first aggregate signature. The signature verification block 80b includes a block header and a block body, and the block body may include input information 1 (equivalent to transaction data), and the block header may include data such as a hash value of a parent block, a characteristic value of the input information 1 (equivalent to the characteristic value of the input information 1 in FIG. 10), and a first aggregate signature. As can be understood, the hash value of the parent block in the signature verification block 80b is not equivalent to the hash value of the parent block in the block 499d (i.e., the first block) in FIG. 5. From the description of Figure 5, it can be determined that the parent block hash value of block 499d in Figure 5 is the hash value for block 98, but the parent block hash value of signature verification block 80b is the hash value for the block immediately preceding signature verification block 80b, and if signature verification block 80b is block 102, then that immediately preceding block points to block 101.

[0094] The blockchain node 80a obtains a signature share 80c belonging to itself by signing the signature verification block 80b with a private key fragment associated with the first consensus cycle, and performs consensus within the consensus network for the signature verification block 80b to which the signature share 80c is attached. As can be understood, the consensus network in this case is composed of the first consensus node set 4c. When the consensus result for the signature verification block 80b by the consensus network is obtained and the consensus result is a consensus failure result, the blockchain node 80a does not perform an addition process for the signature verification block 80b to the blockchain, and when the consensus result is a consensus adoption result, the blockchain node 80a performs an addition process for the signature verification block 80b to the blockchain. Specifically, the following step S207 may be included.

[0095] As can be seen, if a consensus on the signature verification block 80b is adopted by the consensus network, the blockchain node 80a can obtain an aggregate signature for the signature verification block 80b based on the signature share 80c and the signature shares corresponding to each of the other consensus nodes in the first consensus node set 4c, and the aggregate signature is attached to the signature verification block 80b when it is added to the blockchain.

[0096] In step S207, based on the consensus result and the association relationship between the blockchain node and the second consensus node set, business processing associated with the consensus node set switching event is performed, where the blockchain node is a consensus node in the first consensus node set, and the consensus node in the first consensus node set has the authority to generate blocks.

[0097] Specifically, if the consensus result is a consensus adoption result, decide to switch the blockchain consensus node set from the first consensus node set to the second consensus node set, determine an association relationship between the blockchain node and the second consensus node set, and if the association relationship indicates that the blockchain node does not belong to the second consensus node set, leave the blockchain consensus node set, interrupt the consensus processing of the block in the second consensus cycle, and synchronize the block adopted by consensus by the second consensus node set to the data ledger.

[0098] Specifically, the private key fragment associated with the second consensus cycle includes a second target private key fragment; if the consensus result is a consensus adoption result, determine to switch the blockchain consensus node set from the first consensus node set to a second consensus node set; determine an association relationship between the blockchain node and the second consensus node set; if the association relationship indicates that the blockchain node belongs to the second consensus node set, obtain a second consensus message pool corresponding to the second consensus cycle; generate a second consensus target block based on data in the second consensus message pool; sign the second consensus target block with the second target private key fragment to obtain a second signature share; and perform an add process to the blockchain for the second consensus target block to which the second signature share is attached, wherein the second signature share is for indicating that the consensus node in the second consensus node set performs source authenticity signature verification on the second consensus target block.

[0099] Here, the second consensus node set includes consensus node G b (b is a positive integer and is less than or equal to the total number of consensus nodes in the second consensus node set), and the private key fragment associated with the second consensus cycle includes the private key fragment of consensus node G b The private key fragment Pb The specific process of adding the second consensus target block to which the second signature share is attached to the blockchain includes the steps of broadcasting the second consensus target block to which the second signature share is attached within the consensus network, and b Second signature share sent from F b obtaining a second signature share F b is a consensus node G b is the private key fragment P b Consensus results in S b The consensus result S b is a consensus node G b and a second signature share F b By performing signature verification of the second signature verification result D b and obtaining a second signature verification result D b and determining the second consensus target block as the second block based on the second consensus target block.

[0100] Here, the second signature verification result D b includes a signature verification failure result or a signature verification pass result, and the second signature verification result D b The specific process of determining the second consensus target block as the second block based on the second signature verification result D b If the signature verification fails, the second signature share F b and deleting the second signature verification result D b If the signature verification is successful, the second signature share F bin a valid share set; determining a total number of shares of the second signature shares in the valid share set, determining a second quantitative ratio of the total number of nodes to the total number of shares, comparing the second quantitative ratio with a second quantitative ratio threshold; and determining the second consensus target block as the second block if the second quantitative ratio is greater than or equal to the second quantitative ratio threshold.

[0101] Furthermore, a second aggregate signature is obtained by performing an aggregation process of the second signature shares in the valid share set, the second aggregate signature is added to a second block, and the second block with the second aggregate signature is stored in the data ledger. A block synchronization request for the second block transmitted from the blockchain node is obtained, and the blockchain network includes a blockchain node. Based on the block synchronization request, the second block with the second aggregate signature is returned to the blockchain node. As a result, the blockchain node obtains a third signature verification result by performing signature verification of the second aggregate signature based on the global public key, and synchronizes the second block based on the third signature verification result.

[0102] Referring to the above step S206 and FIG. 10, if the consensus result of the first consensus node set 4c on the signature verification block 80b is a consensus adoption result, the blockchain node 80a decides to switch the blockchain consensus node set from the first consensus node set 4c to the second consensus node set 40e. Furthermore, it determines the association relationship between the blockchain node 80a and the second consensus node set 40e. As can be understood, some blockchain nodes may be in both the first consensus node set 4c and the second consensus node set 40e. If the blockchain node 80a does not belong to the second consensus node set 40e, that is, if the blockchain node 80a is not included in the second consensus node set 40e, the blockchain node 80a leaves the blockchain consensus node set and interrupts the consensus process of the block (e.g., block 80d) in the second consensus cycle. Here, the signature verification block 80b is the block immediately before the block 80d. In this case, the blocks (including block 80d) for which the consensus of the second consensus node set 40e has been adopted are synchronized to the data ledger 80e, for example, block 80d is synchronized to the data ledger 80e. The data ledger 80e may include block 498d. The block height corresponding to block 498d (for example, block height 98 in FIG. 4) meets the consensus node set switching condition in the first consensus cycle. The data ledger 80e may include block 499d, i.e., the first block. The block height of block 499d is 99. The data ledger 80e may include the signature verification block 80b or may include block 80d.As can be understood, if the blockchain node 80a belongs to the first consensus node set 4c and does not belong to the second consensus node set 40e, the blockchain node 80a can participate in the consensus process of block 498d, block 499, ..., signature verification block 80b based on the private key fragment associated with the first consensus cycle (specifically referring to the private key fragment of the blockchain node 80a itself), but does not participate in the consensus process of block 80d.

[0103] If the blockchain node 80a belongs to the second consensus node set 40e, i.e., if the blockchain node 80a is included in the second consensus node set 40e, the blockchain node 80a may have consensus authority and block generation authority. Assuming that the blockchain node 80a is still considered to be a block generation node, it may obtain a second consensus message pool 80f corresponding to the second consensus cycle. Furthermore, it may generate a second consensus target block 80g based on the data in the second consensus message pool 80f (equivalent to transaction data). As can be seen, the signature verification block 80b is the block immediately before the second consensus target block 80g. In an embodiment of the present application, assuming that blockchain node 80a is equivalent to blockchain node 405c in the second consensus node set 40e, as can be seen from the explanation of Figure 5 above, the second target private key fragment of blockchain node 80a is equivalent to private key fragment 50f, and blockchain node 80a obtains a second signature share 80h by signing the second consensus target block 80g with the second target private key fragment (i.e., private key fragment 50f in Figure 10).

[0104] Further, please refer to FIG. 11. FIG. 11 is a schematic diagram of a scenario of data processing based on a blockchain provided in an embodiment of the present application. As shown in FIG. 11, a blockchain node 80a (which is a block generating node in the second consensus node set 40e and is assumed to be equivalent to the blockchain node 405c) broadcasts a second consensus target block 80g to which a second signature share 80h is attached in a consensus network. As can be seen, the consensus network here is composed of the second consensus node set 40e. The blockchain node 80a obtains the second signature share sent from the consensus node in the second consensus node set 40e, and obtains the second signature share 80k sent from the blockchain node 50b as shown in FIG. 11. Here, the second signature share 80k is generated by the blockchain node 50b signing the consensus result 80j with a private key fragment 80i (associated with the second consensus cycle). The consensus result 80j represents the consensus result of the second consensus target block 80g by the blockchain node 50b. The blockchain 80a obtains the second signature verification result 80m by performing signature verification of the second signature share 80k with the global public key 50h associated with the second consensus node set. The signature verification process can refer to the signature verification process for the notification signature 50i in the embodiment corresponding to FIG. 7 above. Since these two signature verification processes are the same, the details of the signature verification are omitted here.

[0105] Furthermore, if the second signature verification result 80m is a signature verification failure result, the blockchain node 80a deletes the second signature share 80k. If the second signature verification result 80m is a signature verification pass result, the blockchain node 80a stores the second signature share 80k in the valid share set 80n. As shown in FIG. 11, the valid share set 80n includes the second signature shares 80h, ..., the second signature shares 80k. The blockchain node 80a determines the total number of second signature shares in the valid share set 80n, determines a second quantitative ratio between the total number of nodes and the total number of shares, and compares the second quantitative ratio with a second quantitative ratio threshold. If the second quantitative ratio is equal to or greater than the second quantitative ratio threshold, the blockchain node 80a determines the second consensus target block 80g as the second block.

[0106] Further, FIG. 12 is also referred to. FIG. 12 is a schematic diagram of a scenario of data processing based on a blockchain provided in an embodiment of the present application. As shown in FIG. 12, the blockchain node 80a obtains a second aggregate signature 80q by performing an aggregation process of the second signature shares in the valid share set 80n through a signature aggregation algorithm. Then, the blockchain node 80a adds the second aggregate signature 80q to a second block (which may be equivalent to the second consensus target block 80g in FIG. 12). The blockchain node 80a stores the second block to which the second aggregate signature 80q is attached in a data ledger 80p. The data ledger 80p may include a block 498d. The block height corresponding to the block 498d (for example, the block height 98 in FIG. 4) meets the consensus node set switching condition in the first consensus cycle. The data ledger 80p may include a block 499d, i.e., the first block. The block height of the block 499d is 99. The data ledger 80p may include a signature verification block 80b, and may also include a second block.

[0107] As can be understood, if the blockchain node 80a belongs to both the first consensus node set 4c and the second consensus node set 40e, the blockchain node 80a can participate in the consensus process of blocks 498d, 499, ..., signature verification block 80b based on a private key fragment associated with the first consensus cycle (specifically referring to the private key fragment of the blockchain node 80a itself), and can participate in the consensus process of the second block based on a private key fragment associated with the second consensus cycle, for example, the private key fragment 50f illustrated in FIG. 10.

[0108] Also, referring to FIG. 12, the blockchain node 80a receives a block synchronization request for a second block (equivalent to the second consensus target block 80g illustrated in FIG. 12) sent from the blockchain node 90a. As can be understood, the blockchain node 90a may be any one of the blockchain nodes in the blockchain network. Based on the block synchronization request, the blockchain node 80a returns the second block to which the second aggregate signature 80q is attached to the blockchain node 90a. Thereby, the blockchain node 90a obtains a third signature verification result by performing signature verification of the second aggregate signature 80q with the global public key 50h. If the third signature verification result is a signature verification pass result, the blockchain node 90a synchronizes the second block.

[0109] As can be understood, in the embodiment of the present application, for the convenience of understanding and explanation, the block generating node of the signature verification block 80b and the block of the second block are both set to the blockchain node 80a, but in actual applications, the block generating nodes corresponding to each of these two blocks do not need to be the same consensus node.

[0110] Optionally, if the consensus result is a consensus adoption result, the second block height is compared with a maximum block height in a transitional block height interval. If the second block height is equal to the maximum block height, a business process associated with the consensus node set switching event is performed based on an association relationship between the blockchain node and the second consensus node set. If the second block height is smaller than the maximum block height, a first consensus message pool corresponding to the first consensus cycle is obtained. Based on data in the first consensus message pool, a first consensus target block is generated, and a first signature share is obtained by signing the first consensus target block with a first target private key fragment. The first target private key fragment is a private key fragment associated with the first consensus cycle. An addition process is performed on the first consensus target block to which the first signature share is attached to the blockchain. The first signature share is for indicating that the consensus nodes in the first consensus node set perform source authenticity signature verification on the first consensus target block.

[0111] The transition period in the above embodiment is from when the first block is determined to when the addition of the signature verification block to the blockchain is completed. In practical applications, the transition period may be determined based on the first block and the transition block height section. For specific processes, please also refer to the description of the embodiment corresponding to FIG. 2. Here, detailed explanations are omitted. For the step of performing business processing associated with the consensus node set switching event based on the association relationship with the second consensus node set, please refer to the description in the above step S207. Here, detailed explanations are also omitted.

[0112] As mentioned above, FIG. 13 is also referred to. FIG. 13 is a schematic diagram of the flow of a data processing method based on a blockchain provided in an embodiment of the present application. As shown in FIG. 13, in an embodiment of the present application, it is assumed that there are a total of four consensus nodes in the consensus node set, which are consensus node N1, consensus node N2, consensus node N3, and consensus node N4, respectively. The data processing method may include four steps S1 to S4. The role of each step is as follows:

[0113] In S1, each consensus node obtains a signature share by digitally signing the block with its private key fragment.

[0114] As can be seen, consensus nodes in the same consensus cycle correspond to the same global public key, although their corresponding private key fragments do not match, and consensus nodes in different consensus cycles also do not match their corresponding private key fragments.

[0115] In S2, each consensus node broadcasts its signature share to other consensus nodes.

[0116] In S3, when each consensus node receives signature shares from other consensus nodes, it checks the validity of each signature share with a global public key, discards invalid signature shares, and buffers valid signature shares. When the number of collected valid signature shares meets the signature quantity threshold, it runs the signature aggregation algorithm with the collected valid signature shares as input, and obtains an aggregate signature of a fixed size by combining the valid signature shares. Each consensus node adds the generated aggregate signature to a block and writes it to storage.

[0117] In S4, if there is a blockchain node that synchronizes the above block data from the consensus node and checks the block, it only needs to check the validity of the aggregate signature with the global public key.

[0118] As described above, in the embodiment of the present application, a signature aggregation method of a consensus network is provided, which can automatically update the aggregated signature distributed key system when the consensus network nodes dynamically increase or decrease, and does not need to stop the consensus service. In addition, the size of the generated signature data is fixed in the method, and the availability and scalability of the blockchain are greatly improved. In addition, the method can effectively reduce the storage space and transmission cost of network traffic, and can also improve the calculation efficiency of signature verification.

[0119] Further, please refer to FIG. 14. FIG. 14 is a schematic diagram of the configuration of a data processing device based on blockchain provided in the embodiment of the present application. The above-mentioned data processing device based on blockchain may be a computer program (including program code) executed on a computer device, for example, the data processing device based on blockchain is application software. The device can be used to perform corresponding steps in the method provided in the embodiment of the present application. As shown in FIG. 14, the data processing device 1 may include a first determination module 11, a first generation module 12, a first acquisition module 13, and a second determination module 14.

[0120] When the block height generated in the first consensus cycle satisfies a consensus node set switching condition, the first determination module 11 starts selecting a second consensus node set corresponding to a second consensus cycle, and determines the block height generated when the second consensus node set is selected as a first block height, and the block corresponding to the maximum block height in the first consensus cycle is the block immediately before the block corresponding to the minimum block height in the second consensus cycle.

[0121] The first generation module 12 generates a first block by adding collective information corresponding to the second consensus node set to a block corresponding to the first block height, and broadcasts the first block in a blockchain network, thereby causing consensus nodes in the second consensus node set to generate private key fragments associated with the second consensus cycle based on the collective information in the first block within a transient consensus period, where the transient consensus period refers to the time consumed by the first consensus node set corresponding to the first consensus cycle to perform consensus processing on blocks belonging to a transient block height interval, and all block heights included in the transient block height interval are greater than the first block height.

[0122] The first acquisition module 13 acquires a private key fragment generation notification sent from a consensus node in the second consensus node set, and the private key fragment generation notification is accompanied by a notification signature, which is generated by a consensus node in the second consensus node set generating and signing a notification based on a private key fragment associated with the second consensus cycle.

[0123] A second determination module 14 determines a consensus authority of a consensus node in the second consensus node set for the second consensus cycle based on the notification signature.

[0124] Here, for the specific implementation of the functions of the first determination module 11, the first generation module 12, the first acquisition module 13, and the second determination module 14, refer to steps S101 to S104 in the embodiment corresponding to Fig. 3. Here, further explanation is omitted.

[0125] Also, referring to FIG. 14, the second consensus node set includes a consensus node G a(where a is a positive integer and is less than or equal to the total number of consensus nodes in the second consensus node set), and the notification signature includes the signature of consensus node G a Notification signature for T a Includes: The second determination module 14 may include a first signature verification unit 141 , a second signature verification unit 142 , a third signature verification unit 143 and a first determination unit 144 .

[0126] The first signature verification unit 141 verifies the notification signature T a By performing signature verification of the first signature verification result J a and obtain the first signature verification result J a includes a signature verification failure result or a signature verification pass result.

[0127] The second signature verification unit 142 receives the first signature verification result J a If the signature verification fails, the notification signature T a Delete.

[0128] The third signature verification unit 143 receives the first signature verification result J a If the signature verification is successful, the notification signature T a Add it to the set of valid signatures.

[0129] The first determination unit 144 determines the consensus authority of the consensus nodes in the second consensus node set for the second consensus cycle based on the set of valid signatures.

[0130] Here, for the specific implementation methods of the functions of the first signature verification unit 141, the second signature verification unit 142, the third signature verification unit 143, and the first determination unit 144, refer to step S104 in the embodiment corresponding to Fig. 3 above. Here, further explanation is omitted.

[0131] Also, referring to FIG. 14, the first determining unit 144 may include a quantity tabulating subunit 1441, a first determining subunit 1442, and a second determining subunit 1443.

[0132] The quantity tallying subunit 1441 tallies the total number of notification signatures in the set of valid signatures.

[0133] The first determining subunit 1442 determines a first quantity ratio of the total number of nodes and the total number of signatures, and compares the first quantity ratio with a first quantity ratio threshold.

[0134] The second determination subunit 1443 determines that the consensus node in the second consensus node set does not have consensus authority for the second consensus cycle if the first quantity ratio is less than the first quantity ratio threshold.

[0135] The second determining subunit 1443 further determines that a consensus node in the second consensus node set has consensus authority for the second consensus cycle if the first quantity ratio is greater than or equal to the first quantity ratio threshold.

[0136] Here, the specific function implementation manner of the quantity tallying subunit 1441, the first determining subunit 1442, and the second determining subunit 1443 can be referred to step S104 in the embodiment corresponding to the above Fig. 3. Here, further description is omitted.

[0137] Also, referring to FIG. 14, the private key fragment generation notification includes the following: a Private key fragment generation notification sent from Z a Includes: The first signature verification unit 141 may include a first obtaining subunit 1411 , a second obtaining subunit 1412 , and a third determining subunit 1413 .

[0138] The first acquisition subunit 1411 generates a notification signature T ato obtain a first digital digest by decrypting the first digital digest.

[0139] The second acquisition subunit 1412 receives the private key fragment generation notification Z a and comparing the first digital digest with the second digital digest.

[0140] The third determining subunit 1413 determines the first signature verification result J if the first digital digest and the second digital digest are the same. a It is determined that the signature verification passes.

[0141] The third determining subunit 1413 further determines if the first digital digest and the second digital digest are different, the first signature verification result J a It is determined that the signature verification failed.

[0142] Here, the specific function implementation manner of the first obtaining subunit 1411, the second obtaining subunit 1412, and the third determining subunit 1413 can be referred to step S104 in the embodiment corresponding to the above FIG. 3. Here, further description is omitted.

[0143] Moreover, referring to FIG. 14, the data processing device 1 may further include a first processing module 15, a second generating module 16, and a second processing module 17.

[0144] When a consensus node in the second consensus node set has consensus authority for the second consensus cycle, the first processing module 15 performs an aggregation process of the notification signatures to obtain a first aggregate signature.

[0145] The second generation module 16 generates a signature verification block including the first aggregate signature, and obtains a consensus result by performing a consensus process on the signature verification block, and the second block height corresponding to the signature verification block belongs to the transient block height interval.

[0146] The second processing module 17 performs business processing associated with a consensus node set switching event based on the consensus result and the association relationship between the blockchain node and the second consensus node set, where the blockchain node is a consensus node in the first consensus node set, and the consensus node in the first consensus node set has block generation authority.

[0147] Here, for the specific implementation methods of the functions of the first processing module 15, the second generating module 16, and the second processing module 17, refer to steps S205 to S207 in the embodiment corresponding to Fig. 9. Here, further explanation is omitted.

[0148] Also, referring to FIG. 14, the second processing module 17 may include a height comparison unit 171, a first processing unit 172, a message acquisition unit 173, a first generation unit 174, and a second processing unit 175.

[0149] If the consensus result is a consensus adoption result, the height comparison unit 171 compares the second block height with the maximum block height within the transition block height interval.

[0150] When the second block height is equal to the maximum block height, the first processing unit 172 performs a transaction process associated with the consensus node set switching event based on the association relationship with the second consensus node set.

[0151] The message obtaining unit 173 obtains a first consensus message pool corresponding to the first consensus period when the second block height is smaller than the maximum block height.

[0152] The first generation unit 174 generates a first consensus target block based on the data in the first consensus message pool, and obtains a first signature share by signing the first consensus target block with a first target private key fragment, where the first target private key fragment is a private key fragment associated with the first consensus cycle.

[0153] The second processing unit 175 performs processing to add the first consensus target block having the first signature share to the blockchain, where the first signature share is intended to indicate that the consensus nodes in the first consensus node set will perform source authenticity signature verification on the first consensus target block.

[0154] Here, the specific functional implementation manner of the height comparison unit 171, the first processing unit 172, the message acquisition unit 173, the first generation unit 174, and the second processing unit 175 can be referred to step S207 in the embodiment corresponding to the above Fig. 9. Here, further description is omitted.

[0155] Also, referring to FIG. 14, the second processing module 17 may include a second determining unit 176 and a third determining unit 177.

[0156] The second decision-making unit 176 decides to switch the blockchain consensus node set from the first consensus node set to the second consensus node set if the consensus result is a consensus adoption result.

[0157] The third determination unit 177 determines the association relationship between the blockchain node and the second consensus node set, and if the association relationship indicates that the blockchain node does not belong to the second consensus node set, leaves the blockchain consensus node set and interrupts the consensus processing of blocks in the second consensus cycle.

[0158] The third decision unit 177 further synchronizes the block adopted by consensus by the second set of consensus nodes to the data ledger.

[0159] Here, for the specific implementation of the functions of the second determination unit 176 and the third determination unit 177, refer to step S207 in the embodiment corresponding to Fig. 9. Here, further description is omitted.

[0160] Also, referring to FIG. 14, the private key fragments associated with the second consensus cycle include a second target private key fragment; The second processing module may include a second generating unit 178 and a third processing unit 179.

[0161] The second decision-making unit 176 further decides to switch the blockchain consensus node set from the first consensus node set to the second consensus node set if the consensus result is a consensus adoption result.

[0162] The third determination unit 177 further determines the association relationship between the blockchain node and the second consensus node set, and if the association relationship indicates that the blockchain node belongs to the second consensus node set, obtains a second consensus message pool corresponding to the second consensus period.

[0163] The second generation unit 178 generates a second consensus-subject block based on the data in the second consensus message pool, and obtains a second signature share by signing the second consensus-subject block with the second target private key fragment.

[0164] The third processing unit 179 performs processing to add the second consensus target block having the second signature share to the blockchain, where the second signature share is intended to indicate that the consensus nodes in the second consensus node set will perform source authenticity signature verification on the second consensus target block.

[0165] Here, the specific function implementation manner of the second determination unit 176, the third determination unit 177, the second generation unit 178, and the third processing unit 179 can be referred to step S207 in the embodiment corresponding to the above Fig. 9. Here, further description is omitted.

[0166] Also, referring to FIG. 14, the second consensus node set includes a consensus node G b (b is a positive integer and is less than or equal to the total number of consensus nodes in the second consensus node set), and the private key fragment associated with the second consensus cycle includes the private key fragment of consensus node G b The private key fragment P b Includes: The third processing unit 179 may include a block broadcast subunit 1791, a third acquiring subunit 1792, a fourth acquiring subunit 1793, and a fourth determining subunit 1794.

[0167] The block broadcast subunit 1791 broadcasts the second consensus target block, which has the second signature share attached thereto, within the consensus network.

[0168] The third acquisition subunit 1792 is a consensus node G b Second signature share sent from F b Get the second signature share F b is consensus G b is the private key fragment P b Consensus results in S b The consensus result S b is a consensus node Gb This is to represent the consensus result for the second consensus target block by

[0169] The fourth acquisition subunit 1793 acquires a second signature share F with a global public key associated with the second set of consensus nodes. b By performing signature verification of the second signature verification result D b Get the.

[0170] The fourth determination subunit 1794 determines the second signature verification result D b Based on this, the second consensus target block is determined as the second block.

[0171] Here, the specific function implementation manner of the block broadcast subunit 1791, the third acquiring subunit 1792, the fourth acquiring subunit 1793, and the fourth determining subunit 1794 can be referred to step S207 in the embodiment corresponding to the above FIG. 9. Here, further description is omitted.

[0172] Referring to FIG. 14, the second signature verification result D b includes a signature verification failure result or a signature verification pass result, The fourth determination subunit 1794 may include a first share subunit 17941, a second share subunit 17942, a ratio comparison subunit 17943, and a first block subunit 17944.

[0173] The first share subunit 17941 is the second signature verification result D b If the signature verification fails, the second signature share F b Delete.

[0174] The second share subunit 17942 is the second signature verification result D b If the signature verification is successful, the second signature share F b is stored in the valid share set.

[0175] The ratio comparison subunit 17943 determines a total number of shares of the second signature shares in the valid share set, determines a second quantitative ratio of the total number of nodes to the total number of shares, and compares the second quantitative ratio with a second quantitative ratio threshold.

[0176] The first block subunit 17944 determines the second consensus target block as the second block if the second quantity ratio is greater than or equal to the second quantity ratio threshold.

[0177] Here, the specific function implementation manner of the first share subunit 17941, the second share subunit 17942, the ratio comparison subunit 17943, and the first block subunit 17944 can be referred to step S207 in the embodiment corresponding to the above FIG. 9. Here, further description is omitted.

[0178] Also, referring to FIG. 14, the fourth determining subunit 1794 may further include a third share subunit 17945, a synchronization request subunit 17946, and a second block subunit 17947.

[0179] The third share subunit 17945 obtains a second aggregate signature by performing an aggregation process on the second signature shares in the set of valid shares, adds the second aggregate signature to a second block, and stores the second block with the second aggregate signature in the data ledger.

[0180] The synchronization request subunit 17946 obtains a block synchronization request for a second block sent from a blockchain node, and the blockchain network includes the blockchain node.

[0181] The second block subunit 17947 returns the second block having the second aggregate signature to the blockchain node based on the block synchronization request, so that the blockchain node performs signature verification of the second aggregate signature with the global public key to obtain a third signature verification result, and synchronizes the second block based on the third signature verification result.

[0182] Here, the specific function implementation manner of the third share subunit 17945, the synchronization request subunit 17946, and the second block subunit 17947 can be referred to step S207 in the embodiment corresponding to the above Fig. 9. Here, further description is omitted.

[0183] Also, referring to FIG. 14, the data processing device 1 may further include a second acquisition module 18.

[0184] The second obtaining module 18 obtains the collective information in the first block if the consensus node belongs to the second consensus node set, and generates a secret integer associated with the collective information by the distributed key component.

[0185] The second generation module 16 further generates a target local public key based on the secret integer, and generates at least two secret shares based on the secret integer, where the total number of the at least two secret shares is equal to the total number of the consensus nodes in the second consensus node set, and the consensus nodes in the second consensus node set include a consensus node G c where c is a positive integer and is less than or equal to the total number of nodes, and at least two secret shares include a secret share M c Includes:

[0186] The second acquisition module 18 further acquires the target local public key and secret share M c Consensus node G c and consensus node G c The local public key U sent from c and Secret Share E c Obtain the local public key U c and Secret Share E c In both cases, consensus node G c is associated with a secret integer corresponding to

[0187] The second acquisition module 18 further acquires the secret share E c The validity verification is performed and the result of the validity verification is broadcast to the consensus nodes in the second consensus node set.

[0188] The second generation module 16 further generates a secret share E c and secret share M c and generating a second target private key fragment based on the target local public key and the local public key U c Based on the above, generate a global public key associated with the second consensus node set.

[0189] Here, the specific implementation manner of the functions of the second generating module 16 and the second obtaining module 18 can be referred to step S102 in the embodiment corresponding to Fig. 3. Here, further description is omitted.

[0190] Further, please refer to FIG. 15. FIG. 15 is a schematic diagram of a configuration of a computer device provided in an embodiment of the present application. As shown in FIG. 15, the computer device 1000 may be a computer device in an embodiment corresponding to FIG. 3 above. The computer device 1000 may include at least one processor 1001, such as a CPU, at least one network interface 1004, a user interface 1003, a memory 1005, and at least one communication bus 1002. Here, the communication bus 1002 is used to realize the connection communication between these components. Here, the user interface 1003 may include a display and a keyboard, and the network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., a WI-FI interface). The memory 1005 may be a high-speed RAM or a non-volatile memory, such as at least one disk storage device.

[0191] In the computer device 1000 shown in FIG. 15, the network interface 1004 can provide a network communication function, the user interface 1003 is mainly used to provide an input interface to a user, and the processor 1001 can be used to call up a device control application stored in the memory 1005 to realize the description of the data processing method based on the blockchain in the embodiment corresponding to FIG. 3, FIG. 6, FIG. 9, and FIG. 13 above, and can also execute the description of the data processing device 1 based on the blockchain in the embodiment corresponding to FIG. 14 above. Further description is omitted here. In addition, the description of the beneficial effects of the same method is also omitted.

[0192] In an embodiment of the present application, a computer-readable storage medium storing a computer program is further provided, the computer program including program instructions, which, when executed by a processor, realize the data processing method based on the blockchain provided in each step of Figure 3, Figure 6, Figure 9, and Figure 13. Specifically, refer to the implementation forms provided in each step of Figure 3, Figure 6, Figure 9, and Figure 13 above. Further description is omitted here. In addition, the description of the beneficial effects of the same method is also omitted.

[0193] The computer-readable storage medium may be the blockchain-based data processing device provided in any one of the above embodiments, or the internal storage unit of the computer device, such as a hard disk or internal memory of the computer device. The computer-readable storage medium may 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., installed in the computer device.

[0194] In an embodiment of the present application, a computer program product or computer program including computer instructions is further provided. The computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and when the processor executes the computer instructions, the computer device executes the description of the data processing method based on the blockchain in the embodiment corresponding to Figure 3, Figure 6, Figure 9, and Figure 13 above. Further description is omitted here.

[0195] The terms "first", "second", and the like in the description, claims, and drawings of the embodiments of the present application are intended to distinguish different objects, and not to describe a particular order. Also, the term "comprises" and any variations thereof are intended to cover a non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the steps or modules listed, and optionally includes steps or modules that are not listed, or optionally includes other steps or units that are inherent to the process, method, apparatus, product, or device.

[0196] Those skilled in the art can recognize that the units and algorithm steps of each example described in connection with the embodiments disclosed herein can be realized by electronic hardware, computer software, or a combination of both. In order to clearly explain the compatibility of hardware and software, the above description generally describes the configurations and steps of each example by function.

[0197] The methods and related devices provided in the embodiments of the present application are described with reference to the flowcharts and / or schematic diagrams of the methods provided in the embodiments of the present application, and in particular, each flow and / or block of the flowcharts and / or schematic diagrams of the methods, and combinations of flows and / or blocks in the flowcharts and / or block diagrams, may be realized by computer program instructions.

[0198] The above are merely preferred embodiments of the present application, and of course, they do not limit the scope of the present application. Therefore, equivalent modifications according to the claims of the present application still belong to the scope of the present application.

Claims

1. 1. A blockchain-based data processing method implemented by a computing device, comprising: When the block height generated in the first consensus cycle satisfies a consensus node set switching condition, starting to select a second consensus node set corresponding to a second consensus cycle, and determining the height of the block generated when the second consensus node set is selected as a first block height, wherein the block corresponding to the maximum block height in the first consensus cycle is the block immediately before the block corresponding to the minimum block height in the second consensus cycle; generating a first block by adding group information corresponding to the second consensus node set to a block corresponding to the first block height, and broadcasting the first block in a blockchain network, thereby causing consensus nodes in the second consensus node set to generate private key fragments associated with the second consensus cycle based on the group information in the first block within a transient consensus period, where the transient consensus period refers to a time consumed by the first consensus node set corresponding to the first consensus cycle to perform consensus processing on blocks belonging to a transient block height interval, and all block heights included in the transient block height interval are greater than the first block height; obtaining a private key fragment generation notification sent from a consensus node in the second consensus node set, the private key fragment generation notification being accompanied by a notification signature, the notification signature being generated by a consensus node in the second consensus node set generating and signing a notification based on a private key fragment associated with the second consensus cycle; determining a consensus authority for the second consensus cycle of a consensus node in the second consensus node set based on the notification signature; Data processing methods, including:

2. The second consensus node set includes a consensus node G a (a is a positive integer and is equal to or less than the total number of the consensus nodes in the second consensus node set), and the notification signature includes the consensus node G a Notification signature for T a Includes: determining a consensus authority of a consensus node in the second consensus node set for the second consensus cycle based on the notification signature, The notification signature T is generated using a global public key associated with the second consensus node set. a By performing signature verification of the first signature verification result J a a step of obtaining the first signature verification result J a includes a signature verification failure result or a signature verification pass result; The first signature verification result J a If the signature verification fails, the notification signature T a and deleting The first signature verification result J a If the signature verification is successful, the notification signature T a adding the set of valid signatures to the set of valid signatures; determining a consensus authority for the second consensus cycle of a consensus node in the second consensus node set based on the set of valid signatures; 2. The data processing method according to claim 1.

3. determining a consensus authority of a consensus node in the second consensus node set for the second consensus cycle based on the set of valid signatures, counting the total number of notification signatures in the set of valid signatures; determining a first quantitative ratio between the total number of nodes and the total number of signatures, and comparing the first quantitative ratio to a first quantitative ratio threshold; determining that a consensus node in the second consensus node set does not have consensus authority for the second consensus cycle if the first quantity ratio is less than the first quantity ratio threshold; if the first quantity ratio is greater than or equal to the first quantity ratio threshold, determining that a consensus node in the second consensus node set has consensus authority for the second consensus cycle. The data processing method according to claim 2.

4. The private key fragment generation notification includes the a Private key fragment generation notification Z sent from a Includes: The notification signature T is generated using a global public key associated with the second consensus node set. a By performing signature verification of the first signature verification result J a The steps to obtain The notification signature T a obtaining a first digital digest by decrypting the Private key fragment generation notification Z a obtaining a second digital digest of the first digital digest and comparing the first digital digest with the second digital digest; If the first digital digest and the second digital digest are the same, the first signature verification result J a is the signature verification passing result; If the first digital digest and the second digital digest are different, the first signature verification result J a is the signature verification failure result. The data processing method according to claim 2.

5. When a consensus node in the second consensus node set has consensus authority for the second consensus cycle, performing an aggregation process of the notification signature to obtain a first aggregate signature; generating a signature verification block including the first aggregate signature, and performing a consensus process on the signature verification block to obtain a consensus result, wherein a second block height corresponding to the signature verification block belongs to the transient block height interval; A step of performing a business process associated with a consensus node set switching event based on the consensus result and an association relationship between a blockchain node and the second consensus node set, where the blockchain node is a consensus node in the first consensus node set, and the consensus node in the first consensus node set has block generation authority; The data processing method of claim 1 , further comprising:

6. The step of performing business processing associated with a consensus node set switching event based on the consensus result and the association relationship between the blockchain node and the second consensus node set includes: If the consensus result is a consensus adopted result, comparing the second block height with a maximum block height within the transition block height interval; When the second block height is equal to the maximum block height, performing a business process associated with the consensus node set switching event based on the association relationship between the blockchain node and the second consensus node set; if the second block height is less than the maximum block height, obtaining a first consensus message pool corresponding to the first consensus period; generating a first consensus-to-be-block based on data in the first consensus message pool and obtaining a first signature share by signing the first consensus-to-be-block with a first target private key fragment, the first target private key fragment being a private key fragment associated with the first consensus cycle; adding the first consensus target block to which the first signature share is attached to a blockchain, the first signature share being for indicating that a consensus node in the first consensus node set will perform source authenticity signature verification on the first consensus target block; The data processing method according to claim 5.

7. The step of performing business processing associated with a consensus node set switching event based on the consensus result and the association relationship between the blockchain node and the second consensus node set includes: If the consensus result is a consensus adoption result, determining to switch a blockchain consensus node set from the first consensus node set to the second consensus node set; determining an association relationship between the blockchain node and the second consensus node set, and if the association relationship indicates that the blockchain node does not belong to the second consensus node set, withdrawing from the blockchain consensus node set and interrupting the consensus process of blocks in the second consensus cycle; and synchronizing the block adopted by the consensus of the second set of consensus nodes to a data ledger. The data processing method according to claim 5.

8. the private key fragment associated with the second consensus cycle includes a second target private key fragment; The step of performing business processing associated with a consensus node set switching event based on the consensus result and the association relationship between the blockchain node and the second consensus node set includes: If the consensus result is a consensus adoption result, determining to switch a blockchain consensus node set from the first consensus node set to the second consensus node set; determining an association relationship between the blockchain node and the second consensus node set, and if the association relationship indicates that the blockchain node belongs to the second consensus node set, obtaining a second consensus message pool corresponding to the second consensus period; generating a second consensus-to-be-generated block based on data in the second consensus message pool and signing the second consensus-to-be-generated block with the second target private key fragment to obtain a second signature share; adding the second consensus target block to which the second signature share is attached to a blockchain, the second signature share being for indicating that a consensus node in the second consensus node set will perform source authenticity signature verification on the second consensus target block; The data processing method according to claim 5.

9. The second consensus node set includes a consensus node G b (b is a positive integer and is less than or equal to the total number of the consensus nodes in the second consensus node set), and the private key fragment associated with the second consensus cycle includes the consensus node G b The private key fragment P b Includes: The step of adding the second consensus target block to which the second signature share is attached to a blockchain includes: broadcasting the second consensus target block having the second signature share attached thereto within a consensus network; The consensus node G b The second signature share F sent from b obtaining the second signature share F b is the consensus node G b is the private key fragment P b The consensus result is S b The consensus result S b is the consensus node G b and expressing a consensus result on the second consensus target block by the The second signature share F is a global public key associated with the second consensus node set. b By performing signature verification of the second signature verification result D b and obtaining The second signature verification result D b determining the second consensus target block as a second block based on the second consensus target block; The data processing method according to claim 8.

10. The second signature verification result D b includes a signature verification failure result or a signature verification pass result, The second signature verification result D b The step of determining the second consensus target block as a second block based on The second signature verification result D b If the signature verification fails, the second signature share F b and deleting The second signature verification result D b If the signature verification passes, the second signature share F b storing the value in a valid share set; determining a total number of shares of the second signature shares in the set of valid shares, determining a second quantitative ratio of the total number of nodes to the total number of shares, and comparing the second quantitative ratio to a second quantitative ratio threshold; If the second quantity ratio is equal to or greater than the second quantity ratio threshold, determining the second consensus target block as the second block.

10. The data processing method according to claim 9.

11. aggregating second signature shares in the set of valid shares to obtain a second aggregate signature, adding the second aggregate signature to the second block, and storing the second block to which the second aggregate signature is attached in a data ledger; obtaining a block synchronization request for the second block sent from a blockchain node, the blockchain network including the blockchain node; and a step of returning the second block to which the second aggregate signature is attached to the blockchain node based on the block synchronization request, so that the blockchain node performs signature verification of the second aggregate signature with the global public key to obtain a third signature verification result, and synchronizes the second block based on the third signature verification result; The data processing method of claim 10, further comprising:

12. If a consensus node belongs to the second consensus node set, obtaining the set information in the first block and generating a secret integer associated with the set information by a distributed key component; generating a target local public key based on the secret integer; generating at least two secret shares based on the secret integer, the total number of the at least two secret shares being equal to a total number of nodes of the consensus nodes in the second consensus node set, the consensus nodes in the second consensus node set including a consensus node G c where c is a positive integer and is less than or equal to the total number of nodes, and the at least two secret shares include a secret share M c and The target local public key and the secret share M c The consensus node G c and the consensus node G c The local public key U sent from c and Secret Share E c obtaining the local public key U c and Secret Share E c Each of the consensus nodes G c and a secret integer corresponding to The secret share E c and broadcasting the validity verification result to the consensus nodes in the second consensus node set; The secret share E c and secret share M c generating a second target private key fragment based on The target local public key and the local public key U c generating a global public key associated with the second consensus node set based on The data processing method according to any one of claims 1 to 11, further comprising:

13. A blockchain-based data processing device, comprising: a first determination module that starts selecting a second consensus node set corresponding to a second consensus cycle when the block height generated in the first consensus cycle satisfies a consensus node set switching condition, and determines the height of the block generated when the second consensus node set is selected as a first block height, where the block corresponding to the maximum block height in the first consensus cycle is the block immediately before the block corresponding to the minimum block height in the second consensus cycle; a first generation module that generates a first block by adding group information corresponding to the second consensus node set to a block corresponding to the first block height, and broadcasts the first block in a blockchain network, thereby causing consensus nodes in the second consensus node set to generate private key fragments associated with the second consensus cycle based on the group information in the first block within a transient consensus period, where the transient consensus period refers to a time consumed by the first consensus node set corresponding to the first consensus cycle to perform consensus processing on a block belonging to a transient block height interval, and all block heights included in the transient block height interval are greater than the first block height; a first acquisition module that acquires a private key fragment generation notification sent from a consensus node in the second consensus node set, the private key fragment generation notification being accompanied by a notification signature, the notification signature being generated by a consensus node in the second consensus node set generating and signing a notification based on a private key fragment associated with the second consensus cycle; and a second determination module that determines a consensus authority of a consensus node in the second consensus node set for a second consensus cycle based on the notification signature; 2. A data processing device comprising:

14. 1. A computer device comprising: A processor, a memory, and a network interface, The processor is connected to the memory and the network interface, the network interface provides a data communication function, the memory stores a computer program, and the processor causes the computer device to execute the data processing method according to any one of claims 1 to 11 by calling the computer program.

1. A computer device comprising:

15. A computer program product for causing a computer to execute the data processing method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Consensus period updating method and related equipment

    CN110912990A

  • Block chain node management method and device, computer and readable storage medium

    CN112200680A

  • Data processing method and device based on block chain, equipment and readable storage medium

    CN112398956A

  • Distributed system, message processing method, node, client, and storage medium

    JP2020512708A

  • System and method for terminating a view change protocol

    JP2020519959A