WO2021184878A1 - Node management method for block chain system, node, and computational device - Google Patents

Node management method for block chain system, node, and computational device Download PDF

Info

Publication number
WO2021184878A1
WO2021184878A1 PCT/CN2020/139713 CN2020139713W WO2021184878A1 WO 2021184878 A1 WO2021184878 A1 WO 2021184878A1 CN 2020139713 W CN2020139713 W CN 2020139713W WO 2021184878 A1 WO2021184878 A1 WO 2021184878A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
blockchain system
deleted
voting
transaction
Prior art date
Application number
PCT/CN2020/139713
Other languages
French (fr)
Chinese (zh)
Inventor
林鹏
Original Assignee
支付宝(杭州)信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 支付宝(杭州)信息技术有限公司 filed Critical 支付宝(杭州)信息技术有限公司
Publication of WO2021184878A1 publication Critical patent/WO2021184878A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/30Decision processes by autonomous network management units using voting and bidding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Definitions

  • the embodiments of this specification relate to the field of blockchain technology, and more specifically, to a method, node, and computing device for node management of a blockchain system.
  • Blockchain technology also known as distributed ledger technology, is a kind of emerging that several computing devices (also called nodes in this article) participate in “bookkeeping” and jointly maintain a complete distributed database. technology. Due to the various characteristics of blockchain technology such as decentralization, openness, transparency, and non-tamperability, blockchain technology has been widely used in many fields.
  • the embodiments of the present specification provide a method, a node, and a computing device for node management of a blockchain system.
  • the embodiments of the present specification provide a method for node management of a blockchain system, including: a first node in the blockchain system performs pre-voting interaction with each node in the blockchain system To determine whether the blockchain system is in the master node election process; in the case that the blockchain system is not in the master node election process, the first node executes to make the node to be deleted from the block The operation that is deleted in the chain system; in the case that the blockchain system is in the process of master node election, the first node determines not to perform the operation that causes the node to be deleted to be deleted from the blockchain system operate.
  • the embodiment of the present specification provides a method for node management of a blockchain system, including: the second node in the blockchain system and the first node in the blockchain system perform pre-processing. Voting interaction to assist the first node in determining whether the blockchain system is in the master node election process; if the first node requests the slave node when the blockchain system is not in the master node election process If the node to be deleted is deleted from the blockchain system, the second node performs an operation that causes the node to be deleted to be deleted from the blockchain system; wherein, if the blockchain system is at the master node During the election process, the node to be deleted cannot be deleted from the blockchain system.
  • the embodiment of this specification provides a node in a blockchain system, including: an interaction unit, configured to perform pre-voting interaction with each node in the blockchain system to determine the block Whether the chain system is in the master node election process; the execution unit is used to execute the task of deleting the node to be deleted from the blockchain system when the blockchain system is not in the master node election process Operation; In the case that the blockchain system is in the process of master node election, it is determined not to perform the operation that causes the node to be deleted to be deleted from the blockchain system.
  • the embodiment of the present specification provides a node in a blockchain system, including: an interaction unit for performing pre-voting interaction with the first node in the blockchain system to assist the first node
  • a node determines whether the blockchain system is in the master node election process; the execution unit is configured to: if the first node is not in the master node election process in the blockchain system, request a slave If the node to be deleted is deleted from the blockchain system, an operation is performed to make the node to be deleted be deleted from the blockchain system; wherein, if the blockchain system is in the master node election process, the The node to be deleted cannot be deleted from the blockchain system.
  • Fig. 1A is a schematic flowchart of a method for node management of a blockchain system according to an embodiment.
  • Fig. 1B is a schematic flowchart of a method for node management of a blockchain system according to an embodiment.
  • Figure 2 is an interactive schematic diagram of a scenario for node management in a blockchain system.
  • Fig. 3A is a schematic block diagram of a node in a blockchain system according to an embodiment.
  • Fig. 3B is a schematic block diagram of a node in a blockchain system according to an embodiment.
  • Fig. 4A is a hardware structure diagram of a computing device for node management of a blockchain system according to an embodiment.
  • Fig. 4B is a hardware structure diagram of a computing device for node management of a blockchain system according to an embodiment.
  • a blockchain system based on blockchain technology can include multiple nodes. Among these multiple nodes, one node can be elected as the master node, and the other nodes can be the slave nodes.
  • the master node can be responsible for initiating transaction consensus, and can be responsible for creating the latest block for the blockchain based on the transaction data passed by the consensus.
  • the master node can be dynamically generated according to different situations. For example, before the blockchain system performs consensus processing, the master node can be elected from each node first. For another example, when the master node and the slave node cannot communicate due to network delays, failure of the master node, etc., a new master node can be re-elected. For another example, when most nodes think that the master node is a malicious node (for example, sending fake data or wrong data, etc.), a new master node can be re-elected.
  • a malicious node for example, sending fake data or wrong data, etc.
  • the mechanism for electing the master node can be different.
  • the blockchain system can adopt various applicable consensus algorithms such as the RAFT algorithm and the Practical Byzantine Fault Tolerance (PBFT) algorithm.
  • RAFT RAFT
  • PBFT Practical Byzantine Fault Tolerance
  • the master node election process takes a certain amount of time to complete. During this process, if other operations are performed at the same time, bandwidth may be occupied and timeout may be caused, which may affect the stability of the entire blockchain system. For example, if a node is deleted from the blockchain system during the election of the master node, and the node may still participate in consensus processing, this may cause confusion in the message mechanism of the blockchain system, which will seriously affect the entire blockchain The reliability and stability of the system.
  • the first node in the blockchain system can interact with each node in pre-voting to determine whether the blockchain system is in the process of master node election. In the case that the blockchain system is not in the master node election process, the first node may perform an operation that causes the node to be deleted to be deleted from the blockchain system. In the case where the blockchain system is in the master node election process, the first node may determine not to perform an operation that causes the node to be deleted to be deleted from the blockchain system.
  • the blockchain system can include a public chain system, a private chain system, or a consortium chain system.
  • the blockchain system can be a consortium chain system composed of a third-party payment platform server, a domestic bank server, an overseas bank server, and several user nodes as members.
  • the operator of the alliance chain can rely on the alliance chain to deploy online services such as cross-border transfers and asset transfers based on the alliance chain.
  • Fig. 1A is a schematic flowchart of a method for node management of a blockchain system according to an embodiment.
  • the first node in the blockchain system can perform pre-voting interaction with each node in the blockchain system to determine whether the blockchain system is in the master node election process.
  • the first node may perform an operation that causes the node to be deleted to be deleted from the blockchain system.
  • step 106A when the blockchain system is in the master node election process, the first node may determine not to perform an operation that causes the node to be deleted to be deleted from the blockchain system.
  • the node to be deleted can be any node in the blockchain system.
  • the node can be deleted from the blockchain system for various reasons. For example, if the node needs to exit the blockchain system for its own reasons (for example, resource restrictions, management issues, etc.), the node can be deleted from the blockchain system. For another example, if the node cannot communicate with other nodes due to a certain failure, the node can be deleted from the blockchain system. For another example, if the node is a malicious node (for example, sending a fake message or an error message), the node can be deleted from the blockchain system.
  • the operation of deleting a node may be initiated by the node to be deleted.
  • the aforementioned first node may be a node to be deleted, that is, the first node and the node to be deleted refer to the same node.
  • the node deletion operation can also be initiated by nodes other than the node to be deleted in the blockchain system.
  • nodes in the blockchain system can reach an agreement on the need to delete a node offline.
  • the agreed nodes can convert the offline agreement on the need to delete the node into an online contract of the blockchain system. This process can be done using public and private keys.
  • the first node may be a node different from the node to be deleted.
  • the first node may be a non-Byzantine node.
  • the first node may send a pre-vote message to each node.
  • the pre-voting message may include information for identifying the node to be deleted.
  • the first node may broadcast a pre-voting message to each node.
  • the first node can send a pre-voting message to neighboring nodes, and then the neighboring nodes can forward the pre-voting message to other nodes, so that each node in the blockchain system receives the pre-voting message through the forwarding mechanism .
  • the first node may also use other applicable communication methods to send the pre-voting message, which is not limited in this specification.
  • the first node may receive a pre-vote-ack message sent by each node for the pre-vote message.
  • the first node may receive M pre-voting confirmation messages sent by M nodes. M is a positive integer.
  • the first node may receive the pre-voting confirmation message sent by all other nodes in the blockchain system.
  • M is equal to the value obtained by subtracting 1 from the total number of nodes in the blockchain system.
  • the first node may not receive the pre-voting confirmation messages sent by all other nodes due to various reasons (for example, network delay, node failure, etc.).
  • M can be less than the value obtained by subtracting 1 from the total number of nodes in the blockchain system.
  • the pre-voting confirmation message may indicate the consensus state of the node that sent the pre-voting confirmation message.
  • the consensus state may include the master node election state, synchronization state, normal processing state, initialization state, and so on.
  • the first node can determine whether the blockchain system is in the master node election process based on the received M pre-voting confirmation messages.
  • the pre-voting message may include the identification and network address of the node to be deleted.
  • the format of the pre-voting message may be as follows: pre-vote ⁇ i,address>, where i represents the identification of the node to be deleted, and address represents the network address of the node to be deleted.
  • the network address may include a domain name, Internet Protocol (IP) port, and so on.
  • the pre-voting confirmation message may include the consensus state information, identification, and the current master node identification of the node that sent the pre-voting confirmation message.
  • the format of the pre-vote confirmation message may be as follows: pre-vote-ack ⁇ consensus_status, leader_id, j>, where consensus_status may indicate the consensus status of the corresponding node, j may indicate the identity of the corresponding node, and leader_id may indicate the identity of the master node.
  • the node to be deleted may be the current master node. Then, the foregoing M pre-voting confirmation messages may be sent by M nodes after the blockchain system elects a new master node different from the node to be deleted through the master node election process.
  • nodes After receiving the pre-voting message of the first node, other nodes find that the node to be deleted is the current master node. In this way, other nodes can initiate the master node election process by reaching a consensus, thereby electing a node different from the node to be deleted as the new master node. After generating new master nodes, these nodes can return a pre-voting confirmation message for the pre-voting message. As a result, it is possible to effectively avoid stability and reliability problems caused by accidentally deleting the master node.
  • the first node can determine that the blockchain system is in the master node election process.
  • the majority of pre-voting confirmation messages here can be at least a quorum of pre-voting confirmation messages.
  • M may be greater than the legal number.
  • the quorum can be referred to as the quorum quantity.
  • the quorum is K.
  • the quorum K can be associated with the consensus algorithm used by the blockchain system.
  • the quorum can be f+1.
  • the quorum can be 2f+1.
  • the first node can determine that the blockchain system is in the master node election process; and if the M pre-voting confirmation messages The at least K pre-voting confirmation messages in all indicate another consensus state different from the master node election state, and the first node can determine that the blockchain system is not in the master node election process.
  • the first node may send a transaction request to each node.
  • the transaction request can be used to request the execution of a transaction to delete the node to be deleted.
  • Each node in the blockchain system executes the transaction after reaching a consensus to execute the transaction, so that the node to be deleted is deleted from the blockchain system. For example, after at least a quorum of nodes in the blockchain system reach a consensus to execute a transaction, these nodes will execute the transaction. For example, each node can update configuration information for the node to be deleted, for example, delete the information of the node to be deleted in the configuration information, etc., so that the node to be deleted is deleted from the blockchain system.
  • the first node may determine not to send a transaction request for requesting execution of a transaction to delete a node to be deleted to each node. In this way, it is possible to avoid affecting the stability of the blockchain system during the master node election process.
  • the first node still sends a transaction request for deleting the node to be deleted after determining that the blockchain system is electing the master node. At this time, the transaction request will not pass the consensus and therefore will not be executed. In other words, each node in the blockchain system will not execute the transaction when reaching a consensus, so as to avoid affecting the stability of the blockchain system in the master node election process.
  • the first node may be a node to be deleted, that is, the first node and the node to be deleted are the same node. At this time, the method shown in FIG. 1A is executed by the node to be deleted.
  • the node to be deleted (here also the first node) sends another transaction request to each node during or after the pre-voting interaction (for example, after the node to be deleted sends the pre-voting message).
  • the other transaction request is used to request execution of another transaction, which is different from the transaction for deleting the deleted node.
  • each node may refuse to execute the other transaction after reaching a consensus not to execute the other transaction.
  • the node to be deleted may be deleted, so in addition to the transaction request for deleting the node to be deleted, other transaction requests initiated by the node to be deleted will not be discriminated Nodes in the blockchain system accept.
  • the blockchain system will only accept the transaction request of the node to be deleted to delete itself, and will not accept other types of transaction requests. In this way, the stability and reliability of the blockchain system when a certain node is deleted can be further ensured.
  • Fig. 1B is a schematic flowchart of a method for node management of a blockchain system according to an embodiment.
  • the method in Figure 1B can be executed by any normal node in the blockchain system.
  • this node is referred to as the second node here.
  • the second node may be a non-Byzantine node.
  • the second node in the blockchain system can perform pre-voting interaction with the first node in the blockchain system to assist the first node in determining whether the blockchain system is the master node During the election process.
  • step 104B if the first node requests to delete the node to be deleted from the blockchain system when the blockchain system is not in the master node election process, the second node executes to make the node to be deleted from the blockchain system The operation that was deleted in.
  • the node to be deleted cannot be deleted from the blockchain system.
  • the node to be deleted is deleted from the blockchain system when the blockchain system is not in the master node election process, while the blockchain system is in the master node election process.
  • the nodes to be deleted will not be deleted. In this way, it can effectively avoid the confusion and other problems caused by the deletion of nodes in the master node election process of the blockchain system, thereby ensuring the stability of the blockchain system in the master node election process. And reliability.
  • the second node may receive a pre-voting message from the first node.
  • the pre-voting message may include information for identifying the node to be deleted.
  • the second node may send a pre-voting confirmation message for the pre-voting message to the first node.
  • the pre-voting confirmation message may indicate the consensus status of the second node.
  • the pre-voting message may include the identification and network address of the node to be deleted.
  • the pre-voting confirmation message may include the consensus status information, identification, and current master node identification of the second node.
  • the pre-voting message and the pre-voting confirmation message have been described in detail in the embodiment of FIG. 1A above, and will not be repeated here.
  • the node to be deleted may be the current master node.
  • the second node can wait to elect a new master node different from the node to be deleted.
  • the second node may send a pre-voting confirmation message to the first node.
  • the second node finds that the node to be deleted is the current master node. Then, the second node can reach a consensus with other nodes for master node election, thereby electing a new master node. After that, the second node can send a pre-voting confirmation message.
  • the second node receives the transaction request sent by the first node when the blockchain system is not in the master node election process.
  • the transaction request can be used to execute a transaction to delete the node to be deleted.
  • the second node can execute the transaction after reaching a consensus with other nodes to execute the transaction, so that the node to be deleted is deleted from the blockchain system. For example, the second node may determine that at least a quorum of nodes reach a consensus to execute the transaction. The quorum of nodes may include the second node itself. Then, the second node may execute the transaction, such as updating configuration information for the node to be deleted, so that the node to be deleted is deleted from the blockchain system.
  • the second node may receive a transaction request sent by the first node when the blockchain system is in the master node election process.
  • the transaction request is used to request the execution of a transaction to delete the node to be deleted.
  • the second node and other nodes reach a consensus not to execute the transaction, for example, at least a quorum of nodes reach the consensus. In this way, these nodes will refuse to execute the transaction.
  • the first node may be a node to be deleted.
  • the second node may receive another transaction request sent by the first node during or after the pre-voting interaction.
  • the second node receives another transaction request sent by the first node after sending the pre-voting message.
  • the another transaction request may be used to request the execution of another transaction, which is different from the transaction for deleting the node to be deleted.
  • the second node will reach a consensus with other nodes not to execute the other transaction, and thus refuse to execute the other transaction.
  • the blockchain system will only accept the transaction request of the node to be deleted to delete itself, and will not accept other types of transaction requests. In this way, the stability and reliability of the blockchain system when a certain node is deleted can be further ensured.
  • Figure 2 is an interactive schematic diagram of a scenario for node management in a blockchain system.
  • the blockchain system includes nodes R0, R1, R2, and R3, and the node to be deleted is R0.
  • the node R0 to be deleted decides to withdraw from the blockchain system. Therefore, the node R0 to be deleted can initiate a pre-voting interaction.
  • the node R0 to be deleted can send pre-vote messages to nodes R1, R2, and R3.
  • the pre-vote message may have the following format: pre-vote ⁇ identification of R0, network address of R0>.
  • the nodes R1, R2, and R3 After the nodes R1, R2, and R3 receive the pre-vote message, they can return the pre-vote-ack message to the node to be deleted.
  • the pre-vote-ack message may have the following format: pre-vote-ack ⁇ consensus_status, leader_id, j>.
  • nodes R1, R2, and R3 after receiving the pre-vote message, find that the node R0 to be deleted is the current master node, a consensus can be reached to conduct the master node election process, thereby electing new Master node. After that, nodes R1, R2, and R3 can send pre-vote-ack messages. For example, this stage is shown in FIG. 2.
  • the nodes R1, R2, and R3 can directly return the pre-vote-ack message after receiving the pre-vote message.
  • consensus_status can represent the consensus status of node R1
  • leader_id can represent the current master node ID
  • j can represent the ID of node R1.
  • consensus_status can represent the consensus status of node R2
  • leader_id can represent the current master node ID
  • j can represent the ID of node R2.
  • consensus_status can represent the consensus status of node R3
  • leader_id can represent the current master node ID
  • j can represent the ID of node R3.
  • the node to be deleted determines whether the blockchain system is in the process of master node election.
  • the node R0 to be deleted can determine the zone The blockchain system is in the state of election of the master node. At this time, the node R0 to be deleted may not send a transaction request for requesting execution of the transaction of deleting the node R0. In this way, when the blockchain system is in the master node election state, the node will not be deleted from the blockchain system.
  • the node R0 to be deleted can determine that the blockchain system is not in the master node election state.
  • the node R0 to be deleted can send a transaction request to the nodes R1, R2, and R3, and the transaction request is used to request the execution of a transaction to delete the node R0.
  • the nodes R1, R2, and R3 can all execute the transaction after reaching a consensus to execute the transaction, for example, update configuration information for the node R0.
  • the node R0 is deleted from the blockchain system.
  • stage For example, if the blockchain system is not in the process of master node election, after the transaction request stage, there is a consensus stage for executing the transaction, a stage for executing the transaction, and so on.
  • a node different from the node to be deleted may initiate the transaction of deleting the node to be deleted.
  • the node to be deleted is R1.
  • Nodes R0, R2, and R3 can reach a consensus to delete node R1 offline, and then convert them into an online contract of the blockchain system through the public key and private key.
  • the node R0 may send a pre-voting message.
  • the pre-voting message may include the identification and network address of the node R1.
  • Other nodes can return a pre-voting confirmation message.
  • the specific process is similar to the process in FIG. 2 described above, and will not be repeated here.
  • Fig. 3A is a schematic block diagram of a node in a blockchain system according to an embodiment.
  • the node 300A may include an interaction unit 302A and an execution unit 304A.
  • the interaction unit 302A can perform pre-voting interaction with each node in the blockchain system to determine whether the blockchain system is in the master node election process. In the case that the blockchain system is not in the process of master node election, the execution unit 304A may perform an operation that causes the node to be deleted to be deleted from the blockchain system. In the case that the blockchain system is in the process of master node election, the execution unit 304A may determine not to perform an operation that causes the node to be deleted to be deleted from the blockchain system.
  • the interaction unit 302A may send a pre-voting message to each node, where the pre-voting message includes information for identifying the node to be deleted.
  • the interaction unit 302A can receive M pre-voting confirmation messages sent by M nodes in each node for the pre-voting message, where each pre-voting confirmation message indicates the consensus state of the node that sent the pre-voting confirmation message, and M is a positive integer .
  • the interaction unit 302A may determine whether the blockchain system is in the master node election process based on the M pre-voting confirmation messages.
  • the node to be deleted may be the current master node.
  • the M pre-voting confirmation messages may be sent by the M nodes after the blockchain system elects a new master node different from the node to be deleted through the master node election process.
  • the interaction unit 302A can determine that the blockchain system is in the master node election process, where K It is a quorum determined based on the consensus algorithm used by the blockchain system.
  • the interaction unit 302A can determine that the blockchain system is not in the master node election process.
  • the pre-voting message may include the identification and network address of the node to be deleted.
  • each pre-voting confirmation message may include consensus state information, identification, and current master node identification of the node that sent the pre-voting confirmation message.
  • the execution unit 304A may send a transaction request to each node, where the transaction request is used to request execution of a transaction to delete the node to be deleted.
  • each node executes the transaction after reaching a consensus to execute the transaction, so that the node to be deleted is deleted from the blockchain system.
  • the execution unit 304A may determine not to send a transaction request to each node, where the transaction request is used to request execution of a transaction to delete the node to be deleted.
  • the node may be a node to be deleted.
  • the execution unit 304A may also send another transaction request to each node during or after the pre-voting interaction, where the other transaction request is used to request the execution of another transaction, and the other transaction is different from the transaction for deleting the node to be deleted. Among them, each node refuses to execute another transaction after reaching a consensus not to execute another transaction.
  • the blockchain system may include a consortium chain system.
  • Each unit of the device 300A can execute the corresponding steps in the method embodiment of FIG. 1A and FIG.
  • the foregoing apparatus 300A may be implemented by hardware, software, or a combination of software and hardware.
  • the device 300A when the device 300A is implemented by software, it can be formed by reading the corresponding executable instructions in the memory (such as non-volatile memory) into the memory by the processor of the device where it is located and running it.
  • the memory such as non-volatile memory
  • Fig. 3B is a schematic block diagram of a node in a blockchain system according to an embodiment.
  • the node 300B in FIG. 3B may include an interaction unit 302B and an execution unit 304B.
  • the interaction unit 302B may perform pre-voting interaction with the first node in the blockchain system to assist the first node in determining whether the blockchain system is in the master node election process.
  • the execution unit 304B can execute the process of causing the node to be deleted to be deleted from the blockchain system Operation; Among them, if the blockchain system is in the process of master node election, the node to be deleted cannot be deleted from the blockchain system.
  • the node to be deleted is deleted from the blockchain system when the blockchain system is not in the master node election process, while the blockchain system is in the master node election process.
  • the nodes to be deleted will not be deleted. In this way, it can effectively avoid the confusion and other problems caused by the deletion of nodes in the master node election process of the blockchain system, thereby ensuring the stability of the blockchain system in the master node election process. And reliability.
  • the interaction unit 302B may receive a pre-voting message from the first node, where the pre-voting message includes information for identifying the node to be deleted.
  • the interaction unit 304B may send a pre-voting confirmation message for the pre-voting message to the first node, where the pre-voting confirmation message indicates the consensus status of the node 300B.
  • the node to be deleted may be the current master node.
  • the interaction unit 302B may send a pre-voting confirmation message to the first node after the blockchain system elects a new master node different from the node to be deleted through the master node election process.
  • the pre-voting message may include the identification and network address of the node to be deleted.
  • the pre-voting confirmation message may include the consensus status information, identification, and current master node identification of the node 300B.
  • the execution unit 304B may receive a transaction request sent by the first node when the blockchain system is not in the master node election process, where the transaction request is used to request execution of a transaction to delete the node to be deleted.
  • the execution unit 304B may execute the transaction after reaching a consensus to execute the transaction with each node in the blockchain system, so that the node to be deleted is deleted from the blockchain system.
  • the first node may be a node to be deleted.
  • the execution unit 304B may also receive another transaction request sent by the first node during or after the pre-voting interaction, where the other transaction request is used to request execution of another transaction, and the other transaction is different from the transaction for deleting the node to be deleted.
  • the execution unit 304B may refuse to execute another transaction after reaching a consensus not to execute another transaction with each node in the blockchain system.
  • the blockchain system may include a consortium chain system.
  • Each unit of the device 300B can execute the corresponding steps in the method embodiment of FIG. 1B and FIG.
  • the above-mentioned apparatus 300B may be implemented by hardware, software, or a combination of software and hardware.
  • the device 300B when the device 300B is implemented by software, it can be formed by reading the corresponding executable instructions in the memory (such as non-volatile memory) into the memory by the processor of the device where it is located and running it.
  • the memory such as non-volatile memory
  • Fig. 4A is a hardware structure diagram of a computing device for node management of a blockchain system according to an embodiment.
  • the computing device 400A may include at least one processor 402A, memory 404A, memory 406A, and communication interface 408A, and at least one processor 402A, memory 404A, memory 406A, and communication interface 408A are connected together via a bus 410A.
  • At least one processor 402A executes at least one executable instruction (that is, the above-mentioned element implemented in the form of software) stored or encoded in the memory 404A.
  • the executable instructions stored in the memory 404A when executed by the at least one processor 402A, enable the computing device to implement the various processes described above in conjunction with FIGS. 1A and 2.
  • the computing device 400A can be implemented in any suitable form in the art, for example, it includes, but is not limited to, a desktop computer, a laptop computer, a smart phone, a tablet computer, a consumer electronic device, a wearable smart device, and so on.
  • Fig. 4B is a hardware structure diagram of a computing device for node management of a blockchain system according to an embodiment.
  • the computing device 400B may include at least one processor 402B, memory 404B, memory 406B, and communication interface 408B, and at least one processor 402B, memory 404B, memory 406B, and communication interface 408B are connected together via a bus 410B.
  • At least one processor 402B executes at least one executable instruction (that is, the above-mentioned element implemented in the form of software) stored or encoded in the memory 404B.
  • the executable instructions stored in the memory 404B when executed by the at least one processor 402B, enable the computing device to implement the various processes described above in conjunction with FIGS. 1B and 2.
  • the computing device 400B can be implemented in any suitable form in the art, for example, it includes but is not limited to a desktop computer, a laptop computer, a smart phone, a tablet computer, a consumer electronic device, a wearable smart device, and so on.
  • the embodiments of this specification also provide a machine-readable storage medium.
  • the machine-readable storage medium may store executable instructions, and the executable instructions, when executed by the machine, enable the machine to implement the specific process of the method embodiment of the first node described above with reference to FIGS. 1A and 2.
  • the embodiments of this specification also provide a machine-readable storage medium.
  • the machine-readable storage medium may store executable instructions, and the executable instructions, when executed by the machine, enable the machine to implement the specific process of the method embodiment for the second node described above with reference to FIGS. 1B and 2.
  • the machine-readable storage medium may include, but is not limited to, random access memory (Random Access Memory, RAM), read-only memory (Read-Only Memory, ROM), and electrically erasable programmable read-only memory (Electrically-Erasable Programmable). Read-Only Memory, EEPROM), Static Random Access Memory (SRAM), hard disk, flash memory, etc.
  • RAM Random Access Memory
  • ROM read-only memory
  • EEPROM Electrically erasable programmable read-only memory
  • SRAM Static Random Access Memory
  • hard disk hard disk
  • flash memory etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

Embodiments of the present description provide a node management method for a block chain system, a node, and a computational device. The method comprises: a first node within a block chain system performs pre-voting interaction with each node in the block chain system, so as to determine whether the block chain system is in a main node election process; if the block chain system is not in a main node election process, the first node executes an operation that causes the deletion of a node to be deleted from within the block chain system; if the block chain system is in a main node election process, the first node determines not to execute an operation that causes the deletion of a node to be deleted from within the block chain system.

Description

用于区块链系统的节点管理的方法、节点和计算设备Method, node and computing equipment for node management of blockchain system 技术领域Technical field
本说明书的实施例涉及区块链技术领域,并且更具体地,涉及用于区块链系统的节点管理的方法、节点和计算设备。The embodiments of this specification relate to the field of blockchain technology, and more specifically, to a method, node, and computing device for node management of a blockchain system.
背景技术Background technique
区块链技术,也被称为分布式账本技术,是一种由若干个计算设备(在本文中也可以称为节点)共同参与“记账”,共同维护一份完整的分布式数据库的新兴技术。由于区块链技术具有去中心化,公开透明以及不可篡改等各种特性,使得区块链技术已经在众多的领域中得以广泛应用。Blockchain technology, also known as distributed ledger technology, is a kind of emerging that several computing devices (also called nodes in this article) participate in "bookkeeping" and jointly maintain a complete distributed database. technology. Due to the various characteristics of blockchain technology such as decentralization, openness, transparency, and non-tamperability, blockchain technology has been widely used in many fields.
发明内容Summary of the invention
考虑到上述问题,本说明书的实施例提供了用于区块链系统的节点管理的方法、节点和计算设备。In consideration of the above-mentioned problems, the embodiments of the present specification provide a method, a node, and a computing device for node management of a blockchain system.
一方面,本说明书的实施例提供了一种用于区块链系统的节点管理的方法,包括:区块链系统中的第一节点与所述区块链系统中的各个节点进行预投票交互,以确定所述区块链系统是否处于主节点选举过程中;在所述区块链系统没有处于主节点选举过程中的情况下,所述第一节点执行使得待删除节点从所述区块链系统中被删除的操作;在所述区块链系统处于主节点选举过程中的情况下,所述第一节点确定不执行使得所述待删除节点从所述区块链系统中被删除的操作。On the one hand, the embodiments of the present specification provide a method for node management of a blockchain system, including: a first node in the blockchain system performs pre-voting interaction with each node in the blockchain system To determine whether the blockchain system is in the master node election process; in the case that the blockchain system is not in the master node election process, the first node executes to make the node to be deleted from the block The operation that is deleted in the chain system; in the case that the blockchain system is in the process of master node election, the first node determines not to perform the operation that causes the node to be deleted to be deleted from the blockchain system operate.
另一方面,本说明书的实施例提供了一种用于区块链系统的节点管理的方法,包括:区块链系统中的第二节点与所述区块链系统中的第一节点进行预投票交互,以辅助所述第一节点确定所述区块链系统是否处于主节点选举过程中;如果所述第一节点在所述区块链系统没有处于主节点选举过程中的情况下请求从所述区块链系统中删除待删除节点,则所述第二节点执行使得所述待删除节点从所述区块链系统中被删除的操作;其中,如果所述区块链系统处于主节点选举过程中,则所述待删除节点无法从所述区块链系统中被删除。On the other hand, the embodiment of the present specification provides a method for node management of a blockchain system, including: the second node in the blockchain system and the first node in the blockchain system perform pre-processing. Voting interaction to assist the first node in determining whether the blockchain system is in the master node election process; if the first node requests the slave node when the blockchain system is not in the master node election process If the node to be deleted is deleted from the blockchain system, the second node performs an operation that causes the node to be deleted to be deleted from the blockchain system; wherein, if the blockchain system is at the master node During the election process, the node to be deleted cannot be deleted from the blockchain system.
另一方面,本说明书的实施例提供了一种区块链系统中的节点,包括:交互单元, 用于与所述区块链系统中的各个节点进行预投票交互,以确定所述区块链系统是否处于主节点选举过程中;执行单元,用于:在所述区块链系统没有处于主节点选举过程中的情况下,执行使得待删除节点从所述区块链系统中被删除的操作;在所述区块链系统处于主节点选举过程中的情况下,确定不执行使得所述待删除节点从所述区块链系统中被删除的操作。On the other hand, the embodiment of this specification provides a node in a blockchain system, including: an interaction unit, configured to perform pre-voting interaction with each node in the blockchain system to determine the block Whether the chain system is in the master node election process; the execution unit is used to execute the task of deleting the node to be deleted from the blockchain system when the blockchain system is not in the master node election process Operation; In the case that the blockchain system is in the process of master node election, it is determined not to perform the operation that causes the node to be deleted to be deleted from the blockchain system.
另一方面,本说明书的实施例提供了一种区块链系统中的节点,包括:交互单元,用于与所述区块链系统中的第一节点进行预投票交互,以辅助所述第一节点确定所述区块链系统是否处于主节点选举过程中;执行单元,用于:如果所述第一节点在所述区块链系统没有处于主节点选举过程中的情况下请求从所述区块链系统中删除待删除节点,则执行使得所述待删除节点从所述区块链系统中被删除的操作;其中,如果所述区块链系统处于主节点选举过程中,则所述待删除节点无法从所述区块链系统中被删除。On the other hand, the embodiment of the present specification provides a node in a blockchain system, including: an interaction unit for performing pre-voting interaction with the first node in the blockchain system to assist the first node A node determines whether the blockchain system is in the master node election process; the execution unit is configured to: if the first node is not in the master node election process in the blockchain system, request a slave If the node to be deleted is deleted from the blockchain system, an operation is performed to make the node to be deleted be deleted from the blockchain system; wherein, if the blockchain system is in the master node election process, the The node to be deleted cannot be deleted from the blockchain system.
可见,在该技术方案中,可以在区块链系统没有处于主节点选举过程中的情况下,执行使得待删除节点从区块链系统中被删除的操作,而在区块链系统处于主节点选举过程中的情况下,确定不执行相应的删除操作。这样,能够有效地避免区块链系统在主节点选举过程中由于删除节点而引起的混乱问题等,从而确保区块链系统在主节点选举过程中的稳定性和可靠性。It can be seen that in this technical solution, it is possible to perform operations that cause the node to be deleted to be deleted from the blockchain system when the blockchain system is not in the master node election process, and the blockchain system is at the master node In the case of the election process, it is determined not to perform the corresponding deletion operation. In this way, the block chain system can effectively avoid the confusion caused by the deletion of nodes in the master node election process, so as to ensure the stability and reliability of the blockchain system in the master node election process.
附图说明Description of the drawings
通过结合附图对本说明书的实施例的更详细的描述,本说明书的实施例的上述以及其它目的、特征和优势将变得更加明显,其中,在本说明书的实施例中,相同的附图标记通常代表相同的元素。Through a more detailed description of the embodiments of this specification in conjunction with the accompanying drawings, the above and other objectives, features and advantages of the embodiments of this specification will become more apparent. Among them, in the embodiments of this specification, the same reference numerals Usually represent the same element.
图1A是根据一个实施例的用于区块链系统的节点管理的方法的示意性流程图。Fig. 1A is a schematic flowchart of a method for node management of a blockchain system according to an embodiment.
图1B是根据一个实施例的用于区块链系统的节点管理的方法的示意性流程图。Fig. 1B is a schematic flowchart of a method for node management of a blockchain system according to an embodiment.
图2是用于区块链系统中的节点管理的一种场景的交互示意图。Figure 2 is an interactive schematic diagram of a scenario for node management in a blockchain system.
图3A是根据一个实施例的区块链系统中的节点的示意性框图。Fig. 3A is a schematic block diagram of a node in a blockchain system according to an embodiment.
图3B是根据一个实施例的区块链系统中的节点的示意性框图。Fig. 3B is a schematic block diagram of a node in a blockchain system according to an embodiment.
图4A是根据一个实施例的用于区块链系统的节点管理的计算设备的硬件结构图。Fig. 4A is a hardware structure diagram of a computing device for node management of a blockchain system according to an embodiment.
图4B是根据一个实施例的用于区块链系统的节点管理的计算设备的硬件结构图。Fig. 4B is a hardware structure diagram of a computing device for node management of a blockchain system according to an embodiment.
具体实施方式Detailed ways
现在将参考各实施例讨论本文描述的主题。应当理解的是,讨论这些实施例仅是为了使得本领域技术人员能够更好地理解并且实现本文描述的主题,并非是对权利要求书中所阐述的保护范围、适用性或者示例的限制。可以在不脱离权利要求书的保护范围的情况下,对所讨论的元素的功能和排列进行改变。各个实施例可以根据需要,省略、替换或者添加各种过程或组件。The subject described herein will now be discussed with reference to various embodiments. It should be understood that the discussion of these embodiments is only to enable those skilled in the art to better understand and implement the subject matter described herein, and is not to limit the scope of protection, applicability, or examples set forth in the claims. The function and arrangement of the discussed elements can be changed without departing from the scope of protection of the claims. Various embodiments may omit, replace, or add various processes or components as needed.
基于区块链技术形成的区块链系统可以包括多个节点。在这多个节点中,一个节点可以被选举为主节点,而其它节点可以作为从节点。主节点可以负责发起交易共识,并且可以负责基于共识通过的交易数据来为区块链创建最新的区块。A blockchain system based on blockchain technology can include multiple nodes. Among these multiple nodes, one node can be elected as the master node, and the other nodes can be the slave nodes. The master node can be responsible for initiating transaction consensus, and can be responsible for creating the latest block for the blockchain based on the transaction data passed by the consensus.
主节点可以是根据不同的情况来动态产生的。例如,在区块链系统在进行共识处理之前,可以首先从各个节点中选举产生主节点。再例如,当由于网络延迟、主节点故障等原因而导致主节点和从节点无法进行通信时,可以重新选举出新的主节点。再例如,当大多数节点认为主节点是作恶节点(例如,发送假数据或错误数据等)时,可以重新选举出新的主节点。The master node can be dynamically generated according to different situations. For example, before the blockchain system performs consensus processing, the master node can be elected from each node first. For another example, when the master node and the slave node cannot communicate due to network delays, failure of the master node, etc., a new master node can be re-elected. For another example, when most nodes think that the master node is a malicious node (for example, sending fake data or wrong data, etc.), a new master node can be re-elected.
基于区块链系统所采用的共识算法,选举主节点的机制可以是不同的。例如,在本说明书中,区块链系统可以采用RAFT算法、实用拜占庭容错(Practical Byzantine Fault Tolerance,PBFT)算法等各种适用的共识算法。Based on the consensus algorithm adopted by the blockchain system, the mechanism for electing the master node can be different. For example, in this specification, the blockchain system can adopt various applicable consensus algorithms such as the RAFT algorithm and the Practical Byzantine Fault Tolerance (PBFT) algorithm.
无论基于何种共识算法,主节点选举过程都需要一定的时间来完成。在该过程期间,如果同时进行其它操作,可能会占用带宽,造成超时等,从而可能影响整个区块链系统的稳定性。例如,如果在主节点选举过程中从区块链系统中删除某个节点,而该节点可能还在参与共识处理,这可能会引起区块链系统的消息机制混乱,从而严重影响整个区块链系统的可靠性和稳定性。No matter what consensus algorithm is based on, the master node election process takes a certain amount of time to complete. During this process, if other operations are performed at the same time, bandwidth may be occupied and timeout may be caused, which may affect the stability of the entire blockchain system. For example, if a node is deleted from the blockchain system during the election of the master node, and the node may still participate in consensus processing, this may cause confusion in the message mechanism of the blockchain system, which will seriously affect the entire blockchain The reliability and stability of the system.
鉴于此,在本说明书中,区块链系统中的第一节点可以与各个节点进行预投票交互,来确定区块链系统是否处于主节点选举过程中。在区块链系统没有处于主节点选举过程中的情况下,第一节点可以执行使得待删除节点从区块链系统中被删除的操作。而在区块链系统处于主节点选举过程中的情况下,第一节点可以确定不执行使得待删除节点从区块链系统中被删除的操作。In view of this, in this specification, the first node in the blockchain system can interact with each node in pre-voting to determine whether the blockchain system is in the process of master node election. In the case that the blockchain system is not in the master node election process, the first node may perform an operation that causes the node to be deleted to be deleted from the blockchain system. In the case where the blockchain system is in the master node election process, the first node may determine not to perform an operation that causes the node to be deleted to be deleted from the blockchain system.
可见,在该技术方案中,可以在区块链系统没有处于主节点选举过程中的情况下,执行使得待删除节点从区块链系统中被删除的操作,而在区块链系统处于主节点选举过 程中的情况下,确定不执行相应的删除操作。这样,能够有效地避免区块链系统在主节点选举过程中由于删除节点而引起的混乱问题等,从而确保区块链系统在主节点选举过程中的稳定性和可靠性。It can be seen that in this technical solution, it is possible to perform operations that cause the node to be deleted to be deleted from the blockchain system when the blockchain system is not in the master node election process, and the blockchain system is at the master node In the case of the election process, it is determined not to perform the corresponding deletion operation. In this way, the block chain system can effectively avoid the confusion caused by the deletion of nodes in the master node election process, so as to ensure the stability and reliability of the blockchain system in the master node election process.
在本说明书中,区块链系统可以包括公有链系统、私有链系统或联盟链系统。In this specification, the blockchain system can include a public chain system, a private chain system, or a consortium chain system.
例如,在一个场景中,区块链系统可以是由第三方支付平台的服务器、境内银行服务器、境外银行服务器、以及若干用户节点作为成员组成的一个联盟链系统。该联盟链的运营方可以依托于该联盟链,来在线部署诸如基于联盟链的跨境转账、资产转移等在线业务。For example, in a scenario, the blockchain system can be a consortium chain system composed of a third-party payment platform server, a domestic bank server, an overseas bank server, and several user nodes as members. The operator of the alliance chain can rely on the alliance chain to deploy online services such as cross-border transfers and asset transfers based on the alliance chain.
然而,考虑到公有链系统、私有链系统和联盟链系统部署的节点规模,本说明书的技术方案将在联盟链系统或私有链系统中产生更佳的效果,但是本说明书的技术方案同样适用于公有链系统。However, considering the scale of nodes deployed in the public chain system, private chain system, and consortium chain system, the technical solution in this specification will produce better results in the consortium chain system or private chain system, but the technical solution in this specification is also applicable to Public chain system.
下面将结合具体实施例来描述本说明书中的技术方案。The technical solutions in this specification will be described below in conjunction with specific embodiments.
图1A是根据一个实施例的用于区块链系统的节点管理的方法的示意性流程图。Fig. 1A is a schematic flowchart of a method for node management of a blockchain system according to an embodiment.
如图1A所示,在步骤102A中,区块链系统中的第一节点可以与区块链系统中的各个节点进行预投票交互,以确定区块链系统是否处于主节点选举过程中。As shown in FIG. 1A, in step 102A, the first node in the blockchain system can perform pre-voting interaction with each node in the blockchain system to determine whether the blockchain system is in the master node election process.
在步骤104A中,在区块链系统没有处于主节点选举过程中的情况下,第一节点可以执行使得待删除节点从区块链系统中被删除的操作。In step 104A, in the case that the blockchain system is not in the master node election process, the first node may perform an operation that causes the node to be deleted to be deleted from the blockchain system.
在步骤106A中,在区块链系统处于主节点选举过程中的情况下,第一节点可以确定不执行使得待删除节点从区块链系统中被删除的操作。In step 106A, when the blockchain system is in the master node election process, the first node may determine not to perform an operation that causes the node to be deleted to be deleted from the blockchain system.
可见,在该技术方案中,可以在区块链系统没有处于主节点选举过程中的情况下,执行使得待删除节点从区块链系统中被删除的操作,而在区块链系统处于主节点选举过程中的情况下,确定不执行相应的删除操作。这样,能够有效地避免区块链系统在主节点选举过程中由于删除节点而引起的混乱等问题,从而确保区块链系统在主节点选举过程中的稳定性和可靠性。It can be seen that in this technical solution, it is possible to perform operations that cause the node to be deleted to be deleted from the blockchain system when the blockchain system is not in the master node election process, and the blockchain system is at the master node In the case of the election process, it is determined not to perform the corresponding deletion operation. In this way, it is possible to effectively avoid problems such as confusion caused by the deletion of nodes in the master node election process of the blockchain system, thereby ensuring the stability and reliability of the blockchain system in the master node election process.
在本说明书中,待删除节点可以是区块链系统中的任一节点。可以出于各种原因而要从区块链系统中删除该节点。例如,如果该节点出于自身的原因(比如,资源限制、管理问题等等)需要退出区块链系统,则可以将该节点从区块链系统中删除。再例如,如果该节点由于某种故障而无法与其它节点进行通信,可以将该节点从区块链系统中删 除。再例如,如果该节点是作恶节点(例如,发送假消息或者错误消息),可以将该节点从区块链系统中删除。In this specification, the node to be deleted can be any node in the blockchain system. The node can be deleted from the blockchain system for various reasons. For example, if the node needs to exit the blockchain system for its own reasons (for example, resource restrictions, management issues, etc.), the node can be deleted from the blockchain system. For another example, if the node cannot communicate with other nodes due to a certain failure, the node can be deleted from the blockchain system. For another example, if the node is a malicious node (for example, sending a fake message or an error message), the node can be deleted from the blockchain system.
例如,删除节点操作可以由待删除节点本身发起。此时,上述第一节点可以是待删除节点,即第一节点和待删除节点指的是同一节点。For example, the operation of deleting a node may be initiated by the node to be deleted. At this time, the aforementioned first node may be a node to be deleted, that is, the first node and the node to be deleted refer to the same node.
此外,删除节点操作也可以由区块链系统中除了待删除节点之外的节点发起。例如,区块链系统中的大多数节点可以在线下针对需要删除某个节点达成一致。比如,大多数节点认为某个节点出现故障或者是作恶节点,因此需要删除该节点。然后,达成一致的节点可以将线下针对需要删除该节点的一致意见转换为区块链系统的线上合约。该过程可以利用公钥和私钥来完成。在这种情况下,第一节点可以是与待删除节点不同的节点。例如,第一节点可以是非拜占庭节点。In addition, the node deletion operation can also be initiated by nodes other than the node to be deleted in the blockchain system. For example, most nodes in the blockchain system can reach an agreement on the need to delete a node offline. For example, most nodes think that a certain node is faulty or a malicious node, so the node needs to be deleted. Then, the agreed nodes can convert the offline agreement on the need to delete the node into an online contract of the blockchain system. This process can be done using public and private keys. In this case, the first node may be a node different from the node to be deleted. For example, the first node may be a non-Byzantine node.
在一个实施例中,在步骤102A中,第一节点可以向各个节点发送预投票(pre-vote)消息。预投票消息可以包括用于识别待删除节点的信息。In one embodiment, in step 102A, the first node may send a pre-vote message to each node. The pre-voting message may include information for identifying the node to be deleted.
例如,第一节点可以向各个节点广播预投票消息。再例如,第一节点可以向相邻的节点发送预投票消息,然后相邻的节点可以将预投票消息转发至其它节点,这样通过转发机制使得区块链系统中的各个节点接收到预投票消息。第一节点还可以采用其它适用的通信方式来发送预投票消息,本说明书对此不作限定。For example, the first node may broadcast a pre-voting message to each node. For another example, the first node can send a pre-voting message to neighboring nodes, and then the neighboring nodes can forward the pre-voting message to other nodes, so that each node in the blockchain system receives the pre-voting message through the forwarding mechanism . The first node may also use other applicable communication methods to send the pre-voting message, which is not limited in this specification.
然后,第一节点可以接收各个节点针对预投票消息发送的预投票确认(pre-vote-ack)消息。例如,第一节点可能接收到M个节点发送的M个预投票确认消息。M为正整数。Then, the first node may receive a pre-vote-ack message sent by each node for the pre-vote message. For example, the first node may receive M pre-voting confirmation messages sent by M nodes. M is a positive integer.
在一种情况下,第一节点可能接收到区块链系统中的所有其它节点发送的预投票确认消息。此时,M等于区块链系统中的节点总数减去1得到的值。In one case, the first node may receive the pre-voting confirmation message sent by all other nodes in the blockchain system. At this time, M is equal to the value obtained by subtracting 1 from the total number of nodes in the blockchain system.
在另一种情况下,第一节点可以由于各种原因(例如,网络延迟、节点故障等等)而没有接收到所有其它节点发送的预投票确认消息。此时,M可以小于区块链系统中的节点总数减去1得到的值。In another case, the first node may not receive the pre-voting confirmation messages sent by all other nodes due to various reasons (for example, network delay, node failure, etc.). At this time, M can be less than the value obtained by subtracting 1 from the total number of nodes in the blockchain system.
预投票确认消息可以指示发送该预投票确认消息的节点的共识状态。例如,共识状态可以包括主节点选举状态、同步状态、正常处理状态、初始化状态等等。The pre-voting confirmation message may indicate the consensus state of the node that sent the pre-voting confirmation message. For example, the consensus state may include the master node election state, synchronization state, normal processing state, initialization state, and so on.
这样,第一节点基于接收到的M个预投票确认消息,可以确定区块链系统是否处于主节点选举过程中。In this way, the first node can determine whether the blockchain system is in the master node election process based on the received M pre-voting confirmation messages.
可见,在该实施例中,通过预投票消息和预投票确认消息的交互,可以高效地确 定区块链系统是否正在进行主节点选举,从而辅助第一节点判断是否能够执行删除节点的操作,由此能够避免影响区块链系统在主节点选举过程中的稳定性。It can be seen that in this embodiment, through the interaction of the pre-voting message and the pre-voting confirmation message, it is possible to efficiently determine whether the blockchain system is in the process of master node election, thereby assisting the first node to determine whether the operation of deleting the node can be performed. This can avoid affecting the stability of the blockchain system in the master node election process.
在一个实施例中,预投票消息可以包括待删除节点的标识和网络地址。例如,预投票消息的格式可以如下:pre-vote<i,address>,其中,i表示待删除节点的标识,address表示待删除节点的网络地址。比如,网络地址可以包括域名、互联网协议(Internet Protocol,IP)端口等。In one embodiment, the pre-voting message may include the identification and network address of the node to be deleted. For example, the format of the pre-voting message may be as follows: pre-vote<i,address>, where i represents the identification of the node to be deleted, and address represents the network address of the node to be deleted. For example, the network address may include a domain name, Internet Protocol (IP) port, and so on.
在一个实施例中,预投票确认消息可以包括发送该预投票确认消息的节点的共识状态信息、标识以及当前主节点标识。例如,预投票确认消息的格式可以如下:pre-vote-ack<consensus_status,leader_id,j>,其中,consensus_status可以表示对应节点的共识状态,j可以表示对应节点的标识,leader_id可以表示主节点标识。In an embodiment, the pre-voting confirmation message may include the consensus state information, identification, and the current master node identification of the node that sent the pre-voting confirmation message. For example, the format of the pre-vote confirmation message may be as follows: pre-vote-ack<consensus_status, leader_id, j>, where consensus_status may indicate the consensus status of the corresponding node, j may indicate the identity of the corresponding node, and leader_id may indicate the identity of the master node.
在一个实施例中,待删除节点可能是当前主节点。那么,上述M个预投票确认消息可以是M个节点在区块链系统通过主节点选举过程选举出与待删除节点不同的新主节点之后发送的。In one embodiment, the node to be deleted may be the current master node. Then, the foregoing M pre-voting confirmation messages may be sent by M nodes after the blockchain system elects a new master node different from the node to be deleted through the master node election process.
例如,其它节点接收到第一节点的预投票消息之后,发现待删除节点是当前主节点。这样,其它节点可以通过达成共识来发起主节点选举过程,从而选举与待删除节点不同的节点作为新主节点。在产生新主节点之后,这些节点可以返回针对预投票消息的预投票确认消息。由此,能够有效避免由于误删除主节点而导致的稳定性和可靠性问题。For example, after receiving the pre-voting message of the first node, other nodes find that the node to be deleted is the current master node. In this way, other nodes can initiate the master node election process by reaching a consensus, thereby electing a node different from the node to be deleted as the new master node. After generating new master nodes, these nodes can return a pre-voting confirmation message for the pre-voting message. As a result, it is possible to effectively avoid stability and reliability problems caused by accidentally deleting the master node.
在一个实施例中,如果大多数预投票确认消息都指示主节点选举状态,则第一节点可以确定区块链系统处于主节点选举过程中。此处的大多数预投票确认消息可以至少是法定数量的预投票确认消息。那么,应当理解的是,上述M可以大于法定数量。在一些场景中,法定数量可以称为quorum数量。在本文中,假设法定数量为K。法定数量K可以与区块链系统所使用的共识算法相关联。例如,在RAFT算法中,假设区块链系统中存在N个节点,而N个节点中最多存在f个故障节点,则法定数量可以是f+1。在PBFT算法中,假设N个节点中最多存在f个问题节点和f个故障节点,则法定数量可以是2f+1。In one embodiment, if most of the pre-voting confirmation messages indicate the master node election status, the first node can determine that the blockchain system is in the master node election process. The majority of pre-voting confirmation messages here can be at least a quorum of pre-voting confirmation messages. Then, it should be understood that the above-mentioned M may be greater than the legal number. In some scenarios, the quorum can be referred to as the quorum quantity. In this article, assume that the quorum is K. The quorum K can be associated with the consensus algorithm used by the blockchain system. For example, in the RAFT algorithm, assuming that there are N nodes in the blockchain system, and there are at most f faulty nodes in the N nodes, the quorum can be f+1. In the PBFT algorithm, assuming that there are at most f problem nodes and f fault nodes in N nodes, the quorum can be 2f+1.
这样,如果M个预投票确认消息中的至少K个预投票确认消息都指示主节点选举状态,则第一节点可以确定区块链系统处于主节点选举过程中;而如果M个预投票确认消息中的至少K个预投票确认消息都指示与主节点选举状态不同的另一共识状态,则第一节点可以确定区块链系统没有处于主节点选举过程中。In this way, if at least K of the M pre-voting confirmation messages all indicate the master node election status, the first node can determine that the blockchain system is in the master node election process; and if the M pre-voting confirmation messages The at least K pre-voting confirmation messages in all indicate another consensus state different from the master node election state, and the first node can determine that the blockchain system is not in the master node election process.
可见,通过基于预投票确认消息,可以高效地确定区块链系统是否正在进行主节点选举。It can be seen that by confirming the message based on the pre-voting, it is possible to efficiently determine whether the blockchain system is undergoing a master node election.
那么,在一个实施例中,在步骤104A中,在区块链系统没有处于主节点选举过程中的情况下,第一节点可以向各个节点发送交易请求。该交易请求可以用于请求执行删除待删除节点的交易。Then, in one embodiment, in step 104A, in the case that the blockchain system is not in the master node election process, the first node may send a transaction request to each node. The transaction request can be used to request the execution of a transaction to delete the node to be deleted.
区块链系统中的各个节点在达成执行该交易的共识之后执行该交易,从而使得待删除节点从区块链系统中被删除。例如,区块链系统中的至少法定数量的节点达成执行交易的共识之后,这些节点将执行该交易。比如,每个节点可以针对待删除节点来更新配置信息,例如,在配置信息中删除待删除节点的信息等等,从而使得待删除节点从区块链系统中被删除。Each node in the blockchain system executes the transaction after reaching a consensus to execute the transaction, so that the node to be deleted is deleted from the blockchain system. For example, after at least a quorum of nodes in the blockchain system reach a consensus to execute a transaction, these nodes will execute the transaction. For example, each node can update configuration information for the node to be deleted, for example, delete the information of the node to be deleted in the configuration information, etc., so that the node to be deleted is deleted from the blockchain system.
在一个实施例中,在步骤106A中,在区块链系统处于主节点选举过程中的情况下,第一节点可以确定不向各个节点发送用于请求执行删除待删除节点的交易的交易请求。这样,能够避免影响区块链系统在主节点选举过程中的稳定性。In one embodiment, in step 106A, when the blockchain system is in the master node election process, the first node may determine not to send a transaction request for requesting execution of a transaction to delete a node to be deleted to each node. In this way, it is possible to avoid affecting the stability of the blockchain system during the master node election process.
此外,可以理解的是,如果第一节点在确定区块链系统正在进行主节点选举之后,仍然发送了针对删除待删除节点的交易请求。此时,该交易请求将不会通过共识,由此不会被执行。也就是说,区块链系统中的各个节点将在达成共识中不会执行该交易,从而能够避免影响区块链系统在主节点选举过程中的稳定性。In addition, it can be understood that if the first node still sends a transaction request for deleting the node to be deleted after determining that the blockchain system is electing the master node. At this time, the transaction request will not pass the consensus and therefore will not be executed. In other words, each node in the blockchain system will not execute the transaction when reaching a consensus, so as to avoid affecting the stability of the blockchain system in the master node election process.
在一个实施例中,第一节点可以为待删除节点,也就是第一节点和待删除节点是同一节点。此时,图1A所示出的方法是由待删除节点执行的。In an embodiment, the first node may be a node to be deleted, that is, the first node and the node to be deleted are the same node. At this time, the method shown in FIG. 1A is executed by the node to be deleted.
待删除节点(此处也是第一节点)在进行预投票交互期间或之后(例如,在待删除节点发送预投票消息之后),向各个节点发送另一交易请求。该另一交易请求用于请求执行另一交易,该另一交易与删除该删除节点的交易是不同的。此时,各个节点可以在达成不执行该另一交易的共识之后,拒绝执行该另一交易。The node to be deleted (here also the first node) sends another transaction request to each node during or after the pre-voting interaction (for example, after the node to be deleted sends the pre-voting message). The other transaction request is used to request execution of another transaction, which is different from the transaction for deleting the deleted node. At this time, each node may refuse to execute the other transaction after reaching a consensus not to execute the other transaction.
由于待删除节点本身与各个节点进行了预投票交互,所以待删除节点将有可能被删除,那么除了针对删除待删除节点的交易请求之外,待删除节点发起的其它交易请求将不会被区块链系统中的节点接受。也就是说,如果待删除节点发起了与其它节点的预投票交互,区块链系统将仅接受待删除节点的删除自身的交易请求,而不接受其它类型的交易请求。这样,能够进一步确保区块链系统在删除某个节点时的稳定性和可靠性。Since the node to be deleted performs pre-voting interaction with each node, the node to be deleted may be deleted, so in addition to the transaction request for deleting the node to be deleted, other transaction requests initiated by the node to be deleted will not be discriminated Nodes in the blockchain system accept. In other words, if the node to be deleted initiates a pre-voting interaction with other nodes, the blockchain system will only accept the transaction request of the node to be deleted to delete itself, and will not accept other types of transaction requests. In this way, the stability and reliability of the blockchain system when a certain node is deleted can be further ensured.
图1B是根据一个实施例的用于区块链系统的节点管理的方法的示意性流程图。图 1B的方法可以由区块链系统中的任何正常节点来执行。为了便于描述,此处将该节点称为第二节点。例如,第二节点可以是非拜占庭节点。Fig. 1B is a schematic flowchart of a method for node management of a blockchain system according to an embodiment. The method in Figure 1B can be executed by any normal node in the blockchain system. For ease of description, this node is referred to as the second node here. For example, the second node may be a non-Byzantine node.
如图1B所示,在步骤102B中,区块链系统中的第二节点可以与区块链系统中的第一节点进行预投票交互,以辅助第一节点确定区块链系统是否处于主节点选举过程中。As shown in Figure 1B, in step 102B, the second node in the blockchain system can perform pre-voting interaction with the first node in the blockchain system to assist the first node in determining whether the blockchain system is the master node During the election process.
在步骤104B中,如果第一节点在区块链系统没有处于主节点选举过程中的情况下请求从区块链系统中删除待删除节点,则第二节点执行使得待删除节点从区块链系统中被删除的操作。In step 104B, if the first node requests to delete the node to be deleted from the blockchain system when the blockchain system is not in the master node election process, the second node executes to make the node to be deleted from the blockchain system The operation that was deleted in.
其中,如果区块链系统处于主节点选举过程中,则待删除节点无法从区块链系统中被删除。Among them, if the blockchain system is in the process of master node election, the node to be deleted cannot be deleted from the blockchain system.
可见,在该技术方案中,在区块链系统没有处于主节点选举过程中的情况下使得待删除节点从区块链系统中被删除,而在区块链系统处于主节点选举过程中的情况下待删除节点不会被删除,这样,能够有效地避免区块链系统在主节点选举过程中由于删除节点而引起的混乱等问题,从而确保区块链系统在主节点选举过程中的稳定性和可靠性。It can be seen that in this technical solution, the node to be deleted is deleted from the blockchain system when the blockchain system is not in the master node election process, while the blockchain system is in the master node election process. The nodes to be deleted will not be deleted. In this way, it can effectively avoid the confusion and other problems caused by the deletion of nodes in the master node election process of the blockchain system, thereby ensuring the stability of the blockchain system in the master node election process. And reliability.
在一个实施例中,在步骤102B中,第二节点可以从第一节点接收预投票消息。预投票消息可以包括用于识别待删除节点的信息。In one embodiment, in step 102B, the second node may receive a pre-voting message from the first node. The pre-voting message may include information for identifying the node to be deleted.
第二节点可以向第一节点发送针对预投票消息的预投票确认消息。预投票确认消息可以指示第二节点的共识状态。The second node may send a pre-voting confirmation message for the pre-voting message to the first node. The pre-voting confirmation message may indicate the consensus status of the second node.
在一个实施例中,预投票消息可以包括待删除节点的标识和网络地址。In one embodiment, the pre-voting message may include the identification and network address of the node to be deleted.
在一个实施例中,预投票确认消息可以包括第二节点的共识状态信息、标识以及当前主节点标识。In one embodiment, the pre-voting confirmation message may include the consensus status information, identification, and current master node identification of the second node.
上文已经在图1A的实施例中详细描述了预投票消息和预投票确认消息,此处将不再赘述。The pre-voting message and the pre-voting confirmation message have been described in detail in the embodiment of FIG. 1A above, and will not be repeated here.
在一个实施例中,待删除节点可以是当前主节点。这样,第二节点可以等待选举与待删除节点不同的新主节点。在产生新主节点之后,第二节点可以向第一节点发送预投票确认消息。例如,第二节点在接收到预投票消息之后,发现待删除节点是当前主节点。然后,第二节点可以与其它节点达成共识进行主节点选举,从而选举产生新主节点。之后,第二节点可以发送预投票确认消息。由此,能够有效地避免由于误删除主节点而导致的稳定性和可靠性问题。In one embodiment, the node to be deleted may be the current master node. In this way, the second node can wait to elect a new master node different from the node to be deleted. After the new master node is generated, the second node may send a pre-voting confirmation message to the first node. For example, after receiving the pre-voting message, the second node finds that the node to be deleted is the current master node. Then, the second node can reach a consensus with other nodes for master node election, thereby electing a new master node. After that, the second node can send a pre-voting confirmation message. As a result, it is possible to effectively avoid stability and reliability problems caused by accidentally deleting the master node.
在一个实施例中,在步骤104B中,第二节点接收第一节点在区块链系统没有处于主节点选举过程中的情况下发送的交易请求。该交易请求可以用于执行删除待删除节点的交易。In one embodiment, in step 104B, the second node receives the transaction request sent by the first node when the blockchain system is not in the master node election process. The transaction request can be used to execute a transaction to delete the node to be deleted.
第二节点可以在与其它节点达成执行该交易的共识之后执行该交易,使得待删除节点从区块链系统中被删除。例如,第二节点可以确定至少法定数量的节点达成执行该交易的共识。法定数量的节点可以包括第二节点本身。然后,第二节点可以执行该交易,比如针对待删除节点更新配置信息,从而使得待删除节点从区块链系统被删除。The second node can execute the transaction after reaching a consensus with other nodes to execute the transaction, so that the node to be deleted is deleted from the blockchain system. For example, the second node may determine that at least a quorum of nodes reach a consensus to execute the transaction. The quorum of nodes may include the second node itself. Then, the second node may execute the transaction, such as updating configuration information for the node to be deleted, so that the node to be deleted is deleted from the blockchain system.
此外,可以理解的是,第二节点可能接收到第一节点在区块链系统处于主节点选举过程中的情况下发送的交易请求,比如该交易请求用于请求执行删除待删除节点的交易。此时,第二节点与其它节点达成不执行该交易的共识,例如,至少法定数量的节点达成该共识。这样,这些节点都会拒绝执行该交易。由此,能够避免在主节点选举过程中删除节点,从而能够确保区块链系统的稳定性和可靠性。In addition, it is understandable that the second node may receive a transaction request sent by the first node when the blockchain system is in the master node election process. For example, the transaction request is used to request the execution of a transaction to delete the node to be deleted. At this time, the second node and other nodes reach a consensus not to execute the transaction, for example, at least a quorum of nodes reach the consensus. In this way, these nodes will refuse to execute the transaction. Thus, it is possible to avoid deleting nodes during the master node election process, thereby ensuring the stability and reliability of the blockchain system.
在一个实施例中,第一节点可以为待删除节点。第二节点可能接收到第一节点在进行预投票交互期间或者之后发送的另一交易请求。例如,第二节点接收第一节点在发送预投票消息之后发送的另一交易请求。该另一交易请求可以用于请求执行另一交易,该另一交易与删除待删除节点的交易不同。In an embodiment, the first node may be a node to be deleted. The second node may receive another transaction request sent by the first node during or after the pre-voting interaction. For example, the second node receives another transaction request sent by the first node after sending the pre-voting message. The another transaction request may be used to request the execution of another transaction, which is different from the transaction for deleting the node to be deleted.
此时,第二节点将与其它节点达成不执行该另一交易的共识,从而拒绝执行该另一交易。也就是说,如果待删除节点发起了与其它节点的预投票交互,区块链系统将仅接受待删除节点的删除自身的交易请求,而不接受其它类型的交易请求。这样,能够进一步确保区块链系统在删除某个节点时的稳定性和可靠性。At this time, the second node will reach a consensus with other nodes not to execute the other transaction, and thus refuse to execute the other transaction. In other words, if the node to be deleted initiates a pre-voting interaction with other nodes, the blockchain system will only accept the transaction request of the node to be deleted to delete itself, and will not accept other types of transaction requests. In this way, the stability and reliability of the blockchain system when a certain node is deleted can be further ensured.
为了便于理解,下面将结合具体例子进行描述。应当理解的是,以下例子仅是为了帮助本领域技术人员更好地理解本说明书中的技术方案,而并非限制其范围。In order to facilitate understanding, the following description will be combined with specific examples. It should be understood that the following examples are only intended to help those skilled in the art to better understand the technical solutions in this specification, and are not intended to limit their scope.
图2是用于区块链系统中的节点管理的一种场景的交互示意图。Figure 2 is an interactive schematic diagram of a scenario for node management in a blockchain system.
在图2中,假设区块链系统包括节点R0、R1、R2和R3,其中待删除节点为R0。另外,进一步假设待删除节点R0自身决定要退出区块链系统,由此,待删除节点R0可以发起预投票交互。In Figure 2, it is assumed that the blockchain system includes nodes R0, R1, R2, and R3, and the node to be deleted is R0. In addition, it is further assumed that the node R0 to be deleted decides to withdraw from the blockchain system. Therefore, the node R0 to be deleted can initiate a pre-voting interaction.
如图2所示,待删除节点R0可以向节点R1、R2和R3发送pre-vote消息。例如,pre-vote消息可以具有如下格式:pre-vote<R0的标识,R0的网络地址>。As shown in Figure 2, the node R0 to be deleted can send pre-vote messages to nodes R1, R2, and R3. For example, the pre-vote message may have the following format: pre-vote<identification of R0, network address of R0>.
节点R1、R2和R3在接收到pre-vote消息之后,可以向待删除节点返回pre-vote-ack 消息。例如,pre-vote-ack消息可以具有如下格式:pre-vote-ack<consensus_status,leader_id,j>。After the nodes R1, R2, and R3 receive the pre-vote message, they can return the pre-vote-ack message to the node to be deleted. For example, the pre-vote-ack message may have the following format: pre-vote-ack<consensus_status, leader_id, j>.
在一种情况下,如上所述,如果节点R1、R2和R3在接收到pre-vote消息之后,发现待删除节点R0是当前主节点,可以达成共识来进行主节点选举过程,从而选举产生新主节点。之后,节点R1、R2和R3可以发送pre-vote-ack消息。例如,图2中示出了该阶段。In one case, as described above, if nodes R1, R2, and R3, after receiving the pre-vote message, find that the node R0 to be deleted is the current master node, a consensus can be reached to conduct the master node election process, thereby electing new Master node. After that, nodes R1, R2, and R3 can send pre-vote-ack messages. For example, this stage is shown in FIG. 2.
如果待删除节点不是当前主节点,则节点R1、R2和R3在接收到pre-vote消息之后,可以直接返回pre-vote-ack消息。If the node to be deleted is not the current master node, the nodes R1, R2, and R3 can directly return the pre-vote-ack message after receiving the pre-vote message.
对于节点R1来说,consensus_status可以表示节点R1的共识状态,leader_id可以表示当前主节点标识,j可以表示节点R1的标识。For node R1, consensus_status can represent the consensus status of node R1, leader_id can represent the current master node ID, and j can represent the ID of node R1.
对于节点R2来说,consensus_status可以表示节点R2的共识状态,leader_id可以表示当前主节点标识,j可以表示节点R2的标识。For node R2, consensus_status can represent the consensus status of node R2, leader_id can represent the current master node ID, and j can represent the ID of node R2.
对于节点R3来说,consensus_status可以表示节点R3的共识状态,leader_id可以表示当前主节点标识,j可以表示节点R3的标识。For node R3, consensus_status can represent the consensus status of node R3, leader_id can represent the current master node ID, and j can represent the ID of node R3.
待删除节点在接收3个pre-vote-ack消息之后,确定区块链系统是否处于主节点选举过程中。After receiving 3 pre-vote-ack messages, the node to be deleted determines whether the blockchain system is in the process of master node election.
例如,如果3个pre-vote-ack消息中的2个消息或者3个消息都指示主节点选举状态,也就是说,节点R1、R2和R3正在选举主节点,则待删除节点R0可以确定区块链系统处于主节点选举状态。此时,待删除节点R0可以不发送用于请求执行删除节点R0的交易的交易请求。这样,在区块链系统处于主节点选举状态时,将不会从区块链系统中删除节点。For example, if two or three of the three pre-vote-ack messages indicate the master node election status, that is, nodes R1, R2, and R3 are electing master nodes, the node R0 to be deleted can determine the zone The blockchain system is in the state of election of the master node. At this time, the node R0 to be deleted may not send a transaction request for requesting execution of the transaction of deleting the node R0. In this way, when the blockchain system is in the master node election state, the node will not be deleted from the blockchain system.
再例如,如果3个pre-vote-ack消息中的2个消息或者3个消息都指示除了主节点选举状态之外的另一共识状态,也就是说,节点R1、R2和R3没有在选举主节点,则待删除节点R0可以确定区块链系统没有处于主节点选举状态。For another example, if two or three of the three pre-vote-ack messages indicate another consensus state in addition to the master node election state, that is, nodes R1, R2, and R3 are not electing the master node. Node, the node R0 to be deleted can determine that the blockchain system is not in the master node election state.
此时,如图2所示,待删除节点R0可以向节点R1、R2和R3发送交易请求,该交易请求用于请求执行删除节点R0的交易。At this time, as shown in Fig. 2, the node R0 to be deleted can send a transaction request to the nodes R1, R2, and R3, and the transaction request is used to request the execution of a transaction to delete the node R0.
接下来,节点R1、R2和R3可以在达成执行该交易的共识之后,都执行该交易,例如,针对节点R0来更新配置信息。由此,使得节点R0从区块链系统中删除。Next, the nodes R1, R2, and R3 can all execute the transaction after reaching a consensus to execute the transaction, for example, update configuration information for the node R0. As a result, the node R0 is deleted from the blockchain system.
应当理解的是,在图2的例子中,为了简化图示,仅描绘了预投票、预投票确认和交易请求三个阶段,而并未示出其它阶段,但是这并不表明不包括其它相关阶段。例如,如果区块链系统并未处于主节点选举过程中,在交易请求这个阶段之后,还存在对执行交易的共识阶段以及执行交易的阶段等等。It should be understood that in the example of Figure 2, in order to simplify the illustration, only three stages of pre-voting, pre-voting confirmation, and transaction request are depicted, and other stages are not shown, but this does not mean that other related stages are not included. stage. For example, if the blockchain system is not in the process of master node election, after the transaction request stage, there is a consensus stage for executing the transaction, a stage for executing the transaction, and so on.
应当理解的是,在本说明书的技术方案中,可以由与待删除节点不同的节点来发起删除待删除节点的交易。例如,假设待删除节点是R1。节点R0、R2和R3可以在线下达成删除节点R1的共识,然后通过公钥和私钥转换为区块链系统的线上合约。节点R0可以发送预投票消息,此时,预投票消息可以包括节点R1的标识和网络地址。其它节点可以返回预投票确认消息。其具体过程与上述图2的过程是类似的,此处不再赘述。It should be understood that in the technical solution of this specification, a node different from the node to be deleted may initiate the transaction of deleting the node to be deleted. For example, suppose the node to be deleted is R1. Nodes R0, R2, and R3 can reach a consensus to delete node R1 offline, and then convert them into an online contract of the blockchain system through the public key and private key. The node R0 may send a pre-voting message. At this time, the pre-voting message may include the identification and network address of the node R1. Other nodes can return a pre-voting confirmation message. The specific process is similar to the process in FIG. 2 described above, and will not be repeated here.
可见,在该技术方案中,可以在区块链系统没有处于主节点选举过程中的情况下,执行使得待删除节点从区块链系统中被删除的操作,而在区块链系统处于主节点选举过程中的情况下,确定不执行相应的删除操作。这样,能够有效地避免区块链系统在主节点选举过程中由于删除节点而引起的混乱等问题,从而确保区块链系统在主节点选举过程中的稳定性和可靠性。It can be seen that in this technical solution, it is possible to perform operations that cause the node to be deleted to be deleted from the blockchain system when the blockchain system is not in the master node election process, and the blockchain system is at the master node In the case of the election process, it is determined not to perform the corresponding deletion operation. In this way, it is possible to effectively avoid problems such as confusion caused by the deletion of nodes in the master node election process of the blockchain system, thereby ensuring the stability and reliability of the blockchain system in the master node election process.
图3A是根据一个实施例的区块链系统中的节点的示意性框图。Fig. 3A is a schematic block diagram of a node in a blockchain system according to an embodiment.
如图3A所示,节点300A可以包括交互单元302A和执行单元304A。As shown in FIG. 3A, the node 300A may include an interaction unit 302A and an execution unit 304A.
交互单元302A可以与区块链系统中的各个节点进行预投票交互,以确定区块链系统是否处于主节点选举过程中。在区块链系统没有处于主节点选举过程中的情况下,执行单元304A可以执行使得待删除节点从区块链系统中被删除的操作。在区块链系统处于主节点选举过程中的情况下,执行单元304A可以确定不执行使得待删除节点从区块链系统中被删除的操作。The interaction unit 302A can perform pre-voting interaction with each node in the blockchain system to determine whether the blockchain system is in the master node election process. In the case that the blockchain system is not in the process of master node election, the execution unit 304A may perform an operation that causes the node to be deleted to be deleted from the blockchain system. In the case that the blockchain system is in the process of master node election, the execution unit 304A may determine not to perform an operation that causes the node to be deleted to be deleted from the blockchain system.
可见,在该技术方案中,可以在区块链系统没有处于主节点选举过程中的情况下,执行使得待删除节点从区块链系统中被删除的操作,而在区块链系统处于主节点选举过程中的情况下,确定不执行相应的删除操作。这样,能够有效地避免区块链系统在主节点选举过程中由于删除节点而引起的混乱等问题,从而确保区块链系统在主节点选举过程中的稳定性和可靠性。It can be seen that in this technical solution, it is possible to perform operations that cause the node to be deleted to be deleted from the blockchain system when the blockchain system is not in the master node election process, and the blockchain system is at the master node In the case of the election process, it is determined not to perform the corresponding deletion operation. In this way, it is possible to effectively avoid problems such as confusion caused by the deletion of nodes in the master node election process of the blockchain system, thereby ensuring the stability and reliability of the blockchain system in the master node election process.
在一个实施例中,交互单元302A可以向各个节点发送预投票消息,其中,预投票消息包括用于识别待删除节点的信息。交互单元302A可以接收各个节点中的M个节点针对预投票消息发送的M个预投票确认消息,其中,每个预投票确认消息指示发送该 预投票确认消息的节点的共识状态,M为正整数。交互单元302A可以基于M个预投票确认消息,确定区块链系统是否处于主节点选举过程中。In an embodiment, the interaction unit 302A may send a pre-voting message to each node, where the pre-voting message includes information for identifying the node to be deleted. The interaction unit 302A can receive M pre-voting confirmation messages sent by M nodes in each node for the pre-voting message, where each pre-voting confirmation message indicates the consensus state of the node that sent the pre-voting confirmation message, and M is a positive integer . The interaction unit 302A may determine whether the blockchain system is in the master node election process based on the M pre-voting confirmation messages.
在另一实施例中,待删除节点可以是当前主节点。M个预投票确认消息可以是M个节点在区块链系统通过主节点选举过程选举出与待删除节点不同的新主节点之后发送的。In another embodiment, the node to be deleted may be the current master node. The M pre-voting confirmation messages may be sent by the M nodes after the blockchain system elects a new master node different from the node to be deleted through the master node election process.
在另一实施例中,如果M个预投票确认消息中的至少K个预投票确认消息都指示主节点选举状态,则交互单元302A可以确定区块链系统处于主节点选举过程中,其中,K是基于区块链系统所使用的共识算法确定的法定数量。In another embodiment, if at least K pre-voting confirmation messages in the M pre-voting confirmation messages all indicate the master node election status, the interaction unit 302A can determine that the blockchain system is in the master node election process, where K It is a quorum determined based on the consensus algorithm used by the blockchain system.
如果M个预投票确认消息中的至少K个预投票确认消息都指示与主节点选举状态不同的另一共识状态,则交互单元302A可以确定区块链系统没有处于主节点选举过程中。If at least K of the M pre-voting confirmation messages all indicate another consensus state different from the master node election state, the interaction unit 302A can determine that the blockchain system is not in the master node election process.
在另一实施例中,预投票消息可以包括待删除节点的标识和网络地址。In another embodiment, the pre-voting message may include the identification and network address of the node to be deleted.
在另一实施例中,每个预投票确认消息可以包括发送该预投票确认消息的节点的共识状态信息、标识以及当前主节点标识。In another embodiment, each pre-voting confirmation message may include consensus state information, identification, and current master node identification of the node that sent the pre-voting confirmation message.
在另一实施例中,在区块链系统没有处于主节点选举过程中的情况下,执行单元304A可以向各个节点发送交易请求,其中,交易请求用于请求执行删除待删除节点的交易。In another embodiment, when the blockchain system is not in the master node election process, the execution unit 304A may send a transaction request to each node, where the transaction request is used to request execution of a transaction to delete the node to be deleted.
其中,各个节点达成执行交易的共识之后执行交易,使得待删除节点从区块链系统中被删除。Among them, each node executes the transaction after reaching a consensus to execute the transaction, so that the node to be deleted is deleted from the blockchain system.
在另一实施例中,在区块链系统处于主节点选举过程中的情况下,执行单元304A可以确定不向各个节点发送交易请求,其中,交易请求用于请求执行删除待删除节点的交易。In another embodiment, when the blockchain system is in the master node election process, the execution unit 304A may determine not to send a transaction request to each node, where the transaction request is used to request execution of a transaction to delete the node to be deleted.
在另一实施例中,节点可以为待删除节点。In another embodiment, the node may be a node to be deleted.
执行单元304A还可以在进行预投票交互期间或者之后,向各个节点发送另一交易请求,其中,另一交易请求用于请求执行另一交易,另一交易与删除待删除节点的交易不同。其中,各个节点在达成不执行另一交易的共识之后拒绝执行另一交易。The execution unit 304A may also send another transaction request to each node during or after the pre-voting interaction, where the other transaction request is used to request the execution of another transaction, and the other transaction is different from the transaction for deleting the node to be deleted. Among them, each node refuses to execute another transaction after reaching a consensus not to execute another transaction.
在另一实施例中,区块链系统可以包括联盟链系统。In another embodiment, the blockchain system may include a consortium chain system.
装置300A的各个单元可以执行图1A和图2的方法实施例中的相应步骤,因此, 为了描述的简洁,装置300A的各个单元的具体操作和功能此处不再赘述。Each unit of the device 300A can execute the corresponding steps in the method embodiment of FIG. 1A and FIG.
上述装置300A可以采用硬件实现,也可以采用软件实现,或者可以通过软硬件的组合来实现。例如,装置300A在采用软件实现时,其可以通过其所在设备的处理器将存储器(比如非易失性存储器)中对应的可执行指令读取到内存中运行来形成。The foregoing apparatus 300A may be implemented by hardware, software, or a combination of software and hardware. For example, when the device 300A is implemented by software, it can be formed by reading the corresponding executable instructions in the memory (such as non-volatile memory) into the memory by the processor of the device where it is located and running it.
图3B是根据一个实施例的区块链系统中的节点的示意性框图。Fig. 3B is a schematic block diagram of a node in a blockchain system according to an embodiment.
如图3B所示,图3B的节点300B可以包括交互单元302B和执行单元304B。As shown in FIG. 3B, the node 300B in FIG. 3B may include an interaction unit 302B and an execution unit 304B.
交互单元302B可以与区块链系统中的第一节点进行预投票交互,以辅助第一节点确定区块链系统是否处于主节点选举过程中。The interaction unit 302B may perform pre-voting interaction with the first node in the blockchain system to assist the first node in determining whether the blockchain system is in the master node election process.
如果第一节点在区块链系统没有处于主节点选举过程中的情况下请求从区块链系统中删除待删除节点,则执行单元304B可以执行使得待删除节点从区块链系统中被删除的操作;其中,如果区块链系统处于主节点选举过程中,则待删除节点无法从区块链系统中被删除。If the first node requests to delete the node to be deleted from the blockchain system when the blockchain system is not in the master node election process, the execution unit 304B can execute the process of causing the node to be deleted to be deleted from the blockchain system Operation; Among them, if the blockchain system is in the process of master node election, the node to be deleted cannot be deleted from the blockchain system.
可见,在该技术方案中,在区块链系统没有处于主节点选举过程中的情况下使得待删除节点从区块链系统中被删除,而在区块链系统处于主节点选举过程中的情况下待删除节点不会被删除,这样,能够有效地避免区块链系统在主节点选举过程中由于删除节点而引起的混乱等问题,从而确保区块链系统在主节点选举过程中的稳定性和可靠性。It can be seen that in this technical solution, the node to be deleted is deleted from the blockchain system when the blockchain system is not in the master node election process, while the blockchain system is in the master node election process. The nodes to be deleted will not be deleted. In this way, it can effectively avoid the confusion and other problems caused by the deletion of nodes in the master node election process of the blockchain system, thereby ensuring the stability of the blockchain system in the master node election process. And reliability.
在一个实施例中,交互单元302B可以从第一节点接收预投票消息,其中,预投票消息包括用于识别待删除节点的信息。交互单元304B可以向第一节点发送针对预投票消息的预投票确认消息,其中,预投票确认消息指示节点300B的共识状态。In an embodiment, the interaction unit 302B may receive a pre-voting message from the first node, where the pre-voting message includes information for identifying the node to be deleted. The interaction unit 304B may send a pre-voting confirmation message for the pre-voting message to the first node, where the pre-voting confirmation message indicates the consensus status of the node 300B.
在另一实施例中,待删除节点可以是当前主节点。交互单元302B可以在区块链系统通过主节点选举过程选举出与待删除节点不同的新主节点之后,向第一节点发送预投票确认消息。In another embodiment, the node to be deleted may be the current master node. The interaction unit 302B may send a pre-voting confirmation message to the first node after the blockchain system elects a new master node different from the node to be deleted through the master node election process.
在另一实施例中,预投票消息可以包括待删除节点的标识和网络地址。In another embodiment, the pre-voting message may include the identification and network address of the node to be deleted.
在另一实施例中,预投票确认消息可以包括节点300B的共识状态信息、标识以及当前主节点标识。In another embodiment, the pre-voting confirmation message may include the consensus status information, identification, and current master node identification of the node 300B.
在另一实施例中,执行单元304B可以接收第一节点在区块链系统没有处于主节点选举过程中的情况下发送的交易请求,其中,交易请求用于请求执行删除待删除节点的交易。执行单元304B可以在与区块链系统中的各个节点达成执行交易的共识之后执行 交易,使得待删除节点从区块链系统中被删除。In another embodiment, the execution unit 304B may receive a transaction request sent by the first node when the blockchain system is not in the master node election process, where the transaction request is used to request execution of a transaction to delete the node to be deleted. The execution unit 304B may execute the transaction after reaching a consensus to execute the transaction with each node in the blockchain system, so that the node to be deleted is deleted from the blockchain system.
在另一实施例中,第一节点可以为待删除节点。In another embodiment, the first node may be a node to be deleted.
执行单元304B还可以接收第一节点在进行预投票交互期间或者之后发送的另一交易请求,其中,另一交易请求用于请求执行另一交易,另一交易与删除待删除节点的交易不同。执行单元304B可以在与区块链系统中的各个节点达成不执行另一交易的共识之后,拒绝执行另一交易。The execution unit 304B may also receive another transaction request sent by the first node during or after the pre-voting interaction, where the other transaction request is used to request execution of another transaction, and the other transaction is different from the transaction for deleting the node to be deleted. The execution unit 304B may refuse to execute another transaction after reaching a consensus not to execute another transaction with each node in the blockchain system.
在另一实施例中,区块链系统可以包括联盟链系统。In another embodiment, the blockchain system may include a consortium chain system.
装置300B的各个单元可以执行图1B和图2的方法实施例中的相应步骤,因此,为了描述的简洁,装置300B的各个单元的具体操作和功能此处不再赘述。Each unit of the device 300B can execute the corresponding steps in the method embodiment of FIG. 1B and FIG.
上述装置300B可以采用硬件实现,也可以采用软件实现,或者可以通过软硬件的组合来实现。例如,装置300B在采用软件实现时,其可以通过其所在设备的处理器将存储器(比如非易失性存储器)中对应的可执行指令读取到内存中运行来形成。The above-mentioned apparatus 300B may be implemented by hardware, software, or a combination of software and hardware. For example, when the device 300B is implemented by software, it can be formed by reading the corresponding executable instructions in the memory (such as non-volatile memory) into the memory by the processor of the device where it is located and running it.
图4A是根据一个实施例的用于区块链系统的节点管理的计算设备的硬件结构图。如图4A所示,计算设备400A可以包括至少一个处理器402A、存储器404A、内存406A和通信接口408A,并且至少一个处理器402A、存储器404A、内存406A和通信接口408A经由总线410A连接在一起。至少一个处理器402A执行在存储器404A中存储或编码的至少一个可执行指令(即,上述以软件形式实现的元素)。Fig. 4A is a hardware structure diagram of a computing device for node management of a blockchain system according to an embodiment. As shown in FIG. 4A, the computing device 400A may include at least one processor 402A, memory 404A, memory 406A, and communication interface 408A, and at least one processor 402A, memory 404A, memory 406A, and communication interface 408A are connected together via a bus 410A. At least one processor 402A executes at least one executable instruction (that is, the above-mentioned element implemented in the form of software) stored or encoded in the memory 404A.
在一个实施例中,在存储器404A中存储的可执行指令在被至少一个处理器402A执行时,使得计算设备实现以上结合图1A和2描述的各种过程。In one embodiment, the executable instructions stored in the memory 404A, when executed by the at least one processor 402A, enable the computing device to implement the various processes described above in conjunction with FIGS. 1A and 2.
计算设备400A可以采用本领域任何适用的形式来实现,例如,其包括但不限于台式计算机、膝上型计算机、智能电话、平板计算机、消费电子设备、可穿戴智能设备等等。The computing device 400A can be implemented in any suitable form in the art, for example, it includes, but is not limited to, a desktop computer, a laptop computer, a smart phone, a tablet computer, a consumer electronic device, a wearable smart device, and so on.
图4B是根据一个实施例的用于区块链系统的节点管理的计算设备的硬件结构图。如图4B所示,计算设备400B可以包括至少一个处理器402B、存储器404B、内存406B和通信接口408B,并且至少一个处理器402B、存储器404B、内存406B和通信接口408B经由总线410B连接在一起。至少一个处理器402B执行在存储器404B中存储或编码的至少一个可执行指令(即,上述以软件形式实现的元素)。Fig. 4B is a hardware structure diagram of a computing device for node management of a blockchain system according to an embodiment. As shown in FIG. 4B, the computing device 400B may include at least one processor 402B, memory 404B, memory 406B, and communication interface 408B, and at least one processor 402B, memory 404B, memory 406B, and communication interface 408B are connected together via a bus 410B. At least one processor 402B executes at least one executable instruction (that is, the above-mentioned element implemented in the form of software) stored or encoded in the memory 404B.
在一个实施例中,在存储器404B中存储的可执行指令在被至少一个处理器402B执行时,使得计算设备实现以上结合图1B和2描述的各种过程。In one embodiment, the executable instructions stored in the memory 404B, when executed by the at least one processor 402B, enable the computing device to implement the various processes described above in conjunction with FIGS. 1B and 2.
计算设备400B可以采用本领域任何适用的形式来实现,例如,其包括但不限于台式计算机、膝上型计算机、智能电话、平板计算机、消费电子设备、可穿戴智能设备等等。The computing device 400B can be implemented in any suitable form in the art, for example, it includes but is not limited to a desktop computer, a laptop computer, a smart phone, a tablet computer, a consumer electronic device, a wearable smart device, and so on.
本说明书的实施例还提供了一种机器可读存储介质。该机器可读存储介质可以存储有可执行指令,可执行指令在被机器执行时使得机器实现上面参照图1A和图2描述的关于第一节点的方法实施例的具体过程。The embodiments of this specification also provide a machine-readable storage medium. The machine-readable storage medium may store executable instructions, and the executable instructions, when executed by the machine, enable the machine to implement the specific process of the method embodiment of the first node described above with reference to FIGS. 1A and 2.
本说明书的实施例还提供了一种机器可读存储介质。该机器可读存储介质可以存储有可执行指令,可执行指令在被机器执行时使得机器实现上面参照图1B和图2描述的关于第二节点的方法实施例的具体过程。The embodiments of this specification also provide a machine-readable storage medium. The machine-readable storage medium may store executable instructions, and the executable instructions, when executed by the machine, enable the machine to implement the specific process of the method embodiment for the second node described above with reference to FIGS. 1B and 2.
例如,机器可读存储介质可以包括但不限于随机存取存储器(Random Access Memory,RAM)、只读存储器(Read-Only Memory,ROM)、电可擦除可编程只读存储器(Electrically-Erasable Programmable Read-Only Memory,EEPROM)、静态随机存取存储器(Static Random Access Memory,SRAM)、硬盘、闪存等等。For example, the machine-readable storage medium may include, but is not limited to, random access memory (Random Access Memory, RAM), read-only memory (Read-Only Memory, ROM), and electrically erasable programmable read-only memory (Electrically-Erasable Programmable). Read-Only Memory, EEPROM), Static Random Access Memory (SRAM), hard disk, flash memory, etc.
应当理解的是,本说明书中的各个实施例均采用递进的方式来描述,各个实施例之间相同或相似的部分相互参见即可,每个实施例重点说明的都是与其它实施例的不同之处。例如,对于上述关于装置的实施例、关于计算设备的实施例以及关于机器可读存储介质的实施例而言,由于它们基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。It should be understood that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on descriptions that are similar to other embodiments. the difference. For example, for the above-mentioned embodiments about the device, the embodiment about the computing device, and the embodiment about the machine-readable storage medium, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant details can be found in the method implementation. Part of the example can be explained.
上文对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。The specific embodiments of this specification have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than in the embodiments and still achieve desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or sequential order shown in order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
应当理解的是,对于本领域普通技术人员来说,对本说明书中的实施例进行的各种修改将是显而易见的,并且可以在不脱离权利要求书的保护范围的情况下,将本文所定义的一般性原理应用于其它变型。It should be understood that various modifications to the embodiments in this specification will be obvious to those of ordinary skill in the art, and the definitions defined herein can be changed without departing from the scope of protection of the claims. The general principles apply to other variants.

Claims (38)

  1. 一种用于区块链系统的节点管理的方法,包括:A method for node management of a blockchain system includes:
    区块链系统中的第一节点与所述区块链系统中的各个节点进行预投票交互,以确定所述区块链系统是否处于主节点选举过程中;The first node in the blockchain system performs pre-voting interaction with each node in the blockchain system to determine whether the blockchain system is in the master node election process;
    在所述区块链系统没有处于主节点选举过程中的情况下,所述第一节点执行使得待删除节点从所述区块链系统中被删除的操作;In the case that the blockchain system is not in the master node election process, the first node performs an operation that causes the node to be deleted to be deleted from the blockchain system;
    在所述区块链系统处于主节点选举过程中的情况下,所述第一节点确定不执行使得所述待删除节点从所述区块链系统中被删除的操作。In the case that the blockchain system is in the master node election process, the first node determines not to perform an operation that causes the node to be deleted to be deleted from the blockchain system.
  2. 根据权利要求1所述的方法,其中,所述区块链系统中的第一节点与所述区块链系统中的各个节点进行预投票交互,包括:The method according to claim 1, wherein the pre-voting interaction between the first node in the blockchain system and each node in the blockchain system comprises:
    所述第一节点向所述各个节点发送预投票消息,其中,所述预投票消息包括用于识别所述待删除节点的信息;Sending, by the first node, a pre-voting message to each node, where the pre-voting message includes information for identifying the node to be deleted;
    所述第一节点接收所述各个节点中的M个节点针对所述预投票消息发送的M个预投票确认消息,其中,每个预投票确认消息指示发送该预投票确认消息的节点的共识状态,M为正整数;The first node receives M pre-voting confirmation messages sent by the M nodes of the respective nodes for the pre-voting message, wherein each pre-voting confirmation message indicates the consensus state of the node that sent the pre-voting confirmation message , M is a positive integer;
    所述第一节点基于所述M个预投票确认消息,确定所述区块链系统是否处于主节点选举过程中。The first node determines whether the blockchain system is in the master node election process based on the M pre-voting confirmation messages.
  3. 根据权利要求2所述的方法,其中,所述待删除节点是当前主节点;The method according to claim 2, wherein the node to be deleted is the current master node;
    所述M个预投票确认消息是所述M个节点在所述区块链系统通过主节点选举过程选举出与所述待删除节点不同的新主节点之后发送的。The M pre-voting confirmation messages are sent by the M nodes after the blockchain system elects a new master node different from the node to be deleted through a master node election process.
  4. 根据权利要求2或3所述的方法,其中,所述第一节点基于所述M个预投票确认消息,确定所述区块链系统是否处于主节点选举过程中,包括:The method according to claim 2 or 3, wherein the first node determines whether the blockchain system is in the master node election process based on the M pre-voting confirmation messages, comprising:
    如果所述M个预投票确认消息中的至少K个预投票确认消息都指示主节点选举状态,则所述第一节点确定所述区块链系统处于主节点选举过程中,其中,K是基于所述区块链系统所使用的共识算法确定的法定数量;If at least K of the M pre-voting confirmation messages all indicate the master node election status, the first node determines that the blockchain system is in the master node election process, where K is based on The quorum determined by the consensus algorithm used by the blockchain system;
    如果所述M个预投票确认消息中的至少K个预投票确认消息都指示与主节点选举状态不同的另一共识状态,则所述第一节点确定所述区块链系统没有处于主节点选举过程中。If at least K of the M pre-voting confirmation messages all indicate another consensus state different from the master node election state, the first node determines that the blockchain system is not in the master node election In the process.
  5. 根据权利要求2或3所述的方法,其中,所述预投票消息包括所述待删除节点的标识和网络地址。The method according to claim 2 or 3, wherein the pre-voting message includes the identification and network address of the node to be deleted.
  6. 根据权利要求2或3所述的方法,其中,所述每个预投票确认消息包括发送该 预投票确认消息的节点的共识状态信息、标识以及当前主节点标识。The method according to claim 2 or 3, wherein each pre-voting confirmation message includes consensus state information, identification, and current master node identification of the node that sent the pre-voting confirmation message.
  7. 根据权利要求1至3中任一项所述的方法,其中,在所述区块链系统没有处于主节点选举过程中的情况下,所述第一节点执行使得所述待删除节点从所述区块链系统中被删除的操作,包括:The method according to any one of claims 1 to 3, wherein, in the case that the blockchain system is not in the master node election process, the first node executes to make the node to be deleted from the The deleted operations in the blockchain system include:
    在所述区块链系统没有处于主节点选举过程中的情况下,所述第一节点向所述各个节点发送交易请求,其中,所述交易请求用于请求执行删除所述待删除节点的交易;In the case that the blockchain system is not in the master node election process, the first node sends a transaction request to each node, wherein the transaction request is used to request execution of a transaction to delete the node to be deleted ;
    其中,所述各个节点达成执行所述交易的共识之后执行所述交易,使得所述待删除节点从所述区块链系统中被删除。Wherein, each node executes the transaction after reaching a consensus to execute the transaction, so that the node to be deleted is deleted from the blockchain system.
  8. 根据权利要求1至3中任一项所述的方法,其中,在所述区块链系统处于主节点选举过程中的情况下,所述第一节点确定不执行使得所述待删除节点从所述区块链系统中被删除的操作,包括:The method according to any one of claims 1 to 3, wherein when the blockchain system is in the master node election process, the first node determines not to execute so that the node to be deleted will be The operations that are deleted in the blockchain system include:
    在所述区块链系统处于主节点选举过程中的情况下,所述第一节点确定不向所述各个节点发送交易请求,其中,所述交易请求用于请求执行删除所述待删除节点的交易。In the case that the blockchain system is in the master node election process, the first node determines not to send a transaction request to each node, wherein the transaction request is used to request the execution of the deletion of the node to be deleted trade.
  9. 根据权利要求1至3中任一项所述的方法,其中,所述第一节点为所述待删除节点;The method according to any one of claims 1 to 3, wherein the first node is the node to be deleted;
    所述方法还包括:The method also includes:
    所述第一节点在进行预投票交互期间或者之后,向所述各个节点发送另一交易请求,其中,所述另一交易请求用于请求执行另一交易,所述另一交易与删除所述待删除节点的交易不同;During or after the pre-voting interaction, the first node sends another transaction request to each node, wherein the another transaction request is used to request the execution of another transaction, and the other transaction corresponds to deleting the The transaction of the node to be deleted is different;
    其中,所述各个节点在达成不执行所述另一交易的共识之后拒绝执行所述另一交易。Wherein, the respective nodes refuse to execute the another transaction after reaching a consensus not to execute the another transaction.
  10. 根据权利要求1至3中任一项所述的方法,其中,所述区块链系统包括联盟链系统。The method according to any one of claims 1 to 3, wherein the blockchain system includes a consortium chain system.
  11. 一种用于区块链系统的节点管理的方法,包括:A method for node management of a blockchain system includes:
    区块链系统中的第二节点与所述区块链系统中的第一节点进行预投票交互,以辅助所述第一节点确定所述区块链系统是否处于主节点选举过程中;The second node in the blockchain system performs pre-voting interaction with the first node in the blockchain system to assist the first node in determining whether the blockchain system is in the master node election process;
    如果所述第一节点在所述区块链系统没有处于主节点选举过程中的情况下请求从所述区块链系统中删除待删除节点,则所述第二节点执行使得所述待删除节点从所述区块链系统中被删除的操作;其中,如果所述区块链系统处于主节点选举过程中,则所述待删除节点无法从所述区块链系统中被删除。If the first node requests to delete the node to be deleted from the blockchain system when the blockchain system is not in the master node election process, then the second node executes to make the node to be deleted The operation of being deleted from the blockchain system; wherein, if the blockchain system is in the master node election process, the node to be deleted cannot be deleted from the blockchain system.
  12. 根据权利要求11所述的方法,其中,所述区块链系统中的第二节点与所述区块链系统中的第一节点进行预投票交互,包括:The method according to claim 11, wherein the pre-voting interaction between the second node in the blockchain system and the first node in the blockchain system comprises:
    所述第二节点从所述第一节点接收预投票消息,其中,所述预投票消息包括用于识别所述待删除节点的信息;The second node receives a pre-voting message from the first node, where the pre-voting message includes information for identifying the node to be deleted;
    所述第二节点向所述第一节点发送针对所述预投票消息的预投票确认消息,其中,所述预投票确认消息指示所述第二节点的共识状态。The second node sends a pre-voting confirmation message for the pre-voting message to the first node, wherein the pre-voting confirmation message indicates the consensus state of the second node.
  13. 根据权利要求12所述的方法,其中,所述待删除节点是当前主节点;The method according to claim 12, wherein the node to be deleted is the current master node;
    所述第二节点向所述第一节点发送针对所述预投票消息的预投票确认消息,包括:The sending by the second node to the first node a pre-voting confirmation message for the pre-voting message includes:
    所述第二节点在所述区块链系统通过主节点选举过程选举出与所述待删除节点不同的新主节点之后,向所述第一节点发送所述预投票确认消息。The second node sends the pre-voting confirmation message to the first node after the blockchain system elects a new master node different from the node to be deleted through a master node election process.
  14. 根据权利要求12或13所述的方法,其中,所述预投票消息包括所述待删除节点的标识和网络地址。The method according to claim 12 or 13, wherein the pre-voting message includes the identification and network address of the node to be deleted.
  15. 根据权利要求12或13所述的方法,其中,所述预投票确认消息包括所述第二节点的共识状态信息、标识以及当前主节点标识。The method according to claim 12 or 13, wherein the pre-voting confirmation message includes the consensus state information, identification and the current master node identification of the second node.
  16. 根据权利要求11至13中任一项所述的方法,其中,所述第二节点执行使得所述待删除节点从所述区块链系统中被删除的操作,包括:The method according to any one of claims 11 to 13, wherein the operation performed by the second node to cause the node to be deleted to be deleted from the blockchain system includes:
    所述第二节点接收所述第一节点在所述区块链系统没有处于主节点选举过程中的情况下发送的交易请求,其中,所述交易请求用于请求执行删除所述待删除节点的交易;The second node receives the transaction request sent by the first node when the blockchain system is not in the master node election process, wherein the transaction request is used to request the execution of deleting the node to be deleted trade;
    所述第二节点在与所述区块链系统中的各个节点达成执行所述交易的共识之后执行所述交易,使得所述待删除节点从所述区块链系统中被删除。The second node executes the transaction after reaching a consensus to execute the transaction with each node in the blockchain system, so that the node to be deleted is deleted from the blockchain system.
  17. 根据权利要求11至13中任一项所述的方法,其中,所述第一节点为所述待删除节点;The method according to any one of claims 11 to 13, wherein the first node is the node to be deleted;
    所述方法还包括:The method also includes:
    所述第二节点接收所述第一节点在进行预投票交互期间或者之后发送的另一交易请求,其中,所述另一交易请求用于请求执行另一交易,所述另一交易与删除所述待删除节点的交易不同;The second node receives another transaction request sent by the first node during or after the pre-voting interaction, wherein the another transaction request is used to request execution of another transaction, and the other transaction The transaction of the node to be deleted is different;
    所述第二节点在与所述区块链系统中的各个节点达成不执行所述另一交易的共识之后,拒绝执行所述另一交易。The second node refuses to execute the another transaction after reaching a consensus with each node in the blockchain system not to execute the another transaction.
  18. 根据权利要求11至13中任一项所述的方法,其中,所述区块链系统包括联盟链系统。The method according to any one of claims 11 to 13, wherein the blockchain system includes a consortium chain system.
  19. 一种区块链系统中的节点,包括:A node in a blockchain system, including:
    交互单元,用于与所述区块链系统中的各个节点进行预投票交互,以确定所述区块链系统是否处于主节点选举过程中;The interaction unit is used for pre-voting interaction with each node in the blockchain system to determine whether the blockchain system is in the master node election process;
    执行单元,用于:Execution unit for:
    在所述区块链系统没有处于主节点选举过程中的情况下,执行使得待删除节点从所述区块链系统中被删除的操作;In the case that the blockchain system is not in the master node election process, perform an operation that causes the node to be deleted to be deleted from the blockchain system;
    在所述区块链系统处于主节点选举过程中的情况下,确定不执行使得所述待删除节点从所述区块链系统中被删除的操作。In the case that the blockchain system is in the master node election process, it is determined not to perform an operation that causes the node to be deleted to be deleted from the blockchain system.
  20. 根据权利要求19所述的节点,其中,所述交互单元具体用于:The node according to claim 19, wherein the interaction unit is specifically configured to:
    向所述各个节点发送预投票消息,其中,所述预投票消息包括用于识别所述待删除节点的信息;Sending a pre-voting message to each node, where the pre-voting message includes information for identifying the node to be deleted;
    接收所述各个节点中的M个节点针对所述预投票消息发送的M个预投票确认消息,其中,每个预投票确认消息指示发送该预投票确认消息的节点的共识状态,M为正整数;Receive M pre-voting confirmation messages sent by M nodes in the respective nodes for the pre-voting message, where each pre-voting confirmation message indicates the consensus state of the node that sent the pre-voting confirmation message, and M is a positive integer ;
    基于所述M个预投票确认消息,确定所述区块链系统是否处于主节点选举过程中。Based on the M pre-voting confirmation messages, it is determined whether the blockchain system is in the master node election process.
  21. 根据权利要求20所述的节点,其中,所述待删除节点是当前主节点;The node according to claim 20, wherein the node to be deleted is the current master node;
    所述M个预投票确认消息是所述M个节点在所述区块链系统通过主节点选举过程选举出与所述待删除节点不同的新主节点之后发送的。The M pre-voting confirmation messages are sent by the M nodes after the blockchain system elects a new master node different from the node to be deleted through a master node election process.
  22. 根据权利要求20或21所述的节点,其中,所述交互单元具体用于:The node according to claim 20 or 21, wherein the interaction unit is specifically configured to:
    如果所述M个预投票确认消息中的至少K个预投票确认消息都指示主节点选举状态,则确定所述区块链系统处于主节点选举过程中,其中,K是基于所述区块链系统所使用的共识算法确定的法定数量;If at least K of the M pre-voting confirmation messages all indicate the master node election status, it is determined that the blockchain system is in the master node election process, where K is based on the blockchain A quorum determined by the consensus algorithm used by the system;
    如果所述M个预投票确认消息中的至少K个预投票确认消息都指示与主节点选举状态不同的另一共识状态,则确定所述区块链系统没有处于主节点选举过程中。If at least K of the M pre-voting confirmation messages all indicate another consensus state different from the master node election state, it is determined that the blockchain system is not in the master node election process.
  23. 根据权利要求20或21所述的节点,其中,所述预投票消息包括所述待删除节点的标识和网络地址。The node according to claim 20 or 21, wherein the pre-voting message includes the identification and network address of the node to be deleted.
  24. 根据权利要求20或21所述的节点,其中,所述每个预投票确认消息包括发送该预投票确认消息的节点的共识状态信息、标识以及当前主节点标识。The node according to claim 20 or 21, wherein each pre-voting confirmation message includes consensus state information, identification, and current master node identification of the node that sent the pre-voting confirmation message.
  25. 根据权利要求19至21中任一项所述的节点,其中,所述执行单元具体用于:The node according to any one of claims 19 to 21, wherein the execution unit is specifically configured to:
    在所述区块链系统没有处于主节点选举过程中的情况下,向所述各个节点发送交易请求,其中,所述交易请求用于请求执行删除所述待删除节点的交易;In the case that the blockchain system is not in the master node election process, sending a transaction request to each node, where the transaction request is used to request execution of a transaction to delete the node to be deleted;
    其中,所述各个节点达成执行所述交易的共识之后执行所述交易,使得所述待删除节点从所述区块链系统中被删除。Wherein, each node executes the transaction after reaching a consensus to execute the transaction, so that the node to be deleted is deleted from the blockchain system.
  26. 根据权利要求19至21中任一项所述的节点,其中,所述执行单元具体用于:The node according to any one of claims 19 to 21, wherein the execution unit is specifically configured to:
    在所述区块链系统处于主节点选举过程中的情况下,确定不向所述各个节点发送交 易请求,其中,所述交易请求用于请求执行删除所述待删除节点的交易。In the case that the blockchain system is in the master node election process, it is determined not to send a transaction request to each node, wherein the transaction request is used to request execution of a transaction to delete the node to be deleted.
  27. 根据权利要求19至21中任一项所述的节点,其中,所述节点为所述待删除节点;The node according to any one of claims 19 to 21, wherein the node is the node to be deleted;
    所述执行单元还用于:The execution unit is also used for:
    在进行预投票交互期间或者之后,向所述各个节点发送另一交易请求,其中,所述另一交易请求用于请求执行另一交易,所述另一交易与删除所述待删除节点的交易不同;During or after the pre-voting interaction, another transaction request is sent to each node, wherein the another transaction request is used to request the execution of another transaction, and the other transaction is the same as the transaction for deleting the node to be deleted different;
    其中,所述各个节点在达成不执行所述另一交易的共识之后拒绝执行所述另一交易。Wherein, the respective nodes refuse to execute the another transaction after reaching a consensus not to execute the another transaction.
  28. 根据权利要求19至21中任一项所述的节点,其中,所述区块链系统包括联盟链系统。The node according to any one of claims 19 to 21, wherein the blockchain system includes a consortium chain system.
  29. 一种区块链系统中的节点,包括:A node in a blockchain system, including:
    交互单元,用于与所述区块链系统中的第一节点进行预投票交互,以辅助所述第一节点确定所述区块链系统是否处于主节点选举过程中;The interaction unit is configured to perform pre-voting interaction with the first node in the blockchain system to assist the first node in determining whether the blockchain system is in the master node election process;
    执行单元,用于:如果所述第一节点在所述区块链系统没有处于主节点选举过程中的情况下请求从所述区块链系统中删除待删除节点,则执行使得所述待删除节点从所述区块链系统中被删除的操作;其中,如果所述区块链系统处于主节点选举过程中,则所述待删除节点无法从所述区块链系统中被删除。The execution unit is configured to: if the first node requests the deletion of the node to be deleted from the blockchain system when the blockchain system is not in the master node election process, execute so that the to-be-deleted node The operation of deleting a node from the blockchain system; wherein, if the blockchain system is in the master node election process, the node to be deleted cannot be deleted from the blockchain system.
  30. 根据权利要求29所述的节点,其中,所述交互单元具体用于:The node according to claim 29, wherein the interaction unit is specifically configured to:
    从所述第一节点接收预投票消息,其中,所述预投票消息包括用于识别所述待删除节点的信息;Receiving a pre-voting message from the first node, where the pre-voting message includes information for identifying the node to be deleted;
    向所述第一节点发送针对所述预投票消息的预投票确认消息,其中,所述预投票确认消息指示所述节点的共识状态。Sending a pre-voting confirmation message for the pre-voting message to the first node, wherein the pre-voting confirmation message indicates the consensus state of the node.
  31. 根据权利要求30所述的节点,其中,所述待删除节点是当前主节点;The node according to claim 30, wherein the node to be deleted is the current master node;
    所述交互单元具体用于:The interaction unit is specifically used for:
    在所述区块链系统通过主节点选举过程选举出与所述待删除节点不同的新主节点之后,向所述第一节点发送所述预投票确认消息。After the blockchain system elects a new master node different from the node to be deleted through a master node election process, the blockchain system sends the pre-voting confirmation message to the first node.
  32. 根据权利要求30或31所述的节点,其中,所述预投票消息包括所述待删除节点的标识和网络地址。The node according to claim 30 or 31, wherein the pre-voting message includes the identification and network address of the node to be deleted.
  33. 根据权利要求30或31所述的节点,其中,所述预投票确认消息包括所述节点的共识状态信息、标识以及当前主节点标识。The node according to claim 30 or 31, wherein the pre-voting confirmation message includes consensus state information, identification, and current master node identification of the node.
  34. 根据权利要求29至31中任一项所述的节点,其中,所述执行单元具体用于:The node according to any one of claims 29 to 31, wherein the execution unit is specifically configured to:
    接收所述第一节点在所述区块链系统没有处于主节点选举过程中的情况下发送的 交易请求,其中,所述交易请求用于请求执行删除所述待删除节点的交易;Receiving a transaction request sent by the first node when the blockchain system is not in the master node election process, where the transaction request is used to request execution of a transaction to delete the node to be deleted;
    在与所述区块链系统中的各个节点达成执行所述交易的共识之后执行所述交易,使得所述待删除节点从所述区块链系统中被删除。The transaction is executed after reaching a consensus to execute the transaction with each node in the blockchain system, so that the node to be deleted is deleted from the blockchain system.
  35. 根据权利要求29至31中任一项所述的节点,其中,所述第一节点为所述待删除节点;The node according to any one of claims 29 to 31, wherein the first node is the node to be deleted;
    所述执行单元还用于:The execution unit is also used for:
    接收所述第一节点在进行预投票交互期间或者之后发送的另一交易请求,其中,所述另一交易请求用于请求执行另一交易,所述另一交易与删除所述待删除节点的交易不同;Receive another transaction request sent by the first node during or after the pre-voting interaction, wherein the another transaction request is used to request the execution of another transaction, and the other transaction is related to the deletion of the node to be deleted The transaction is different;
    在与所述区块链系统中的各个节点达成不执行所述另一交易的共识之后,拒绝执行所述另一交易。After reaching a consensus not to execute the other transaction with each node in the blockchain system, refuse to execute the other transaction.
  36. 根据权利要求29至31中任一项所述的节点,其中,所述区块链系统包括联盟链系统。The node according to any one of claims 29 to 31, wherein the blockchain system includes a consortium chain system.
  37. 一种计算设备,包括:A computing device including:
    至少一个处理器;At least one processor;
    与所述至少一个处理器进行通信的存储器,其上存储有可执行指令,所述可执行指令在被所述至少一个处理器执行时使得所述至少一个处理器实现根据权利要求1至10中任一项所述的方法。The memory in communication with the at least one processor has executable instructions stored thereon, and when the executable instructions are executed by the at least one processor, the at least one processor realizes the Any of the methods.
  38. 一种计算设备,包括:A computing device including:
    至少一个处理器;At least one processor;
    与所述至少一个处理器进行通信的存储器,其上存储有可执行指令,所述可执行指令在被所述至少一个处理器执行时使得所述至少一个处理器实现根据权利要求11至18中任一项所述的方法。The memory in communication with the at least one processor has executable instructions stored thereon, and when the executable instructions are executed by the at least one processor, the at least one processor realizes the Any of the methods.
PCT/CN2020/139713 2020-03-16 2020-12-26 Node management method for block chain system, node, and computational device WO2021184878A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010181765.5 2020-03-16
CN202010181765.5A CN111049696B (en) 2020-03-16 2020-03-16 Method, node and computing device for node management of blockchain system

Publications (1)

Publication Number Publication Date
WO2021184878A1 true WO2021184878A1 (en) 2021-09-23

Family

ID=70231082

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/139713 WO2021184878A1 (en) 2020-03-16 2020-12-26 Node management method for block chain system, node, and computational device

Country Status (2)

Country Link
CN (1) CN111049696B (en)
WO (1) WO2021184878A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023056958A1 (en) * 2021-10-09 2023-04-13 支付宝(杭州)信息技术有限公司 Consensus method, blockchain system, and consensus node

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111049696B (en) * 2020-03-16 2020-06-12 支付宝(杭州)信息技术有限公司 Method, node and computing device for node management of blockchain system
CN112087521B (en) * 2020-09-17 2021-12-17 山东诺蓝信息科技有限公司 Block chain link point authority control method based on big data and block chain system
CN112671761B (en) * 2020-12-22 2022-08-05 网易(杭州)网络有限公司 Node processing method and device for block chain, node equipment and storage medium
CN113645074A (en) * 2021-08-11 2021-11-12 永旗(北京)科技有限公司 Consensus method based on block chain
CN114448769B (en) * 2022-04-02 2022-07-01 支付宝(杭州)信息技术有限公司 Node election voting method and device based on consensus system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106331046A (en) * 2015-07-02 2017-01-11 中兴通讯股份有限公司 Cluster main node voting method and device
CN108134706A (en) * 2018-01-02 2018-06-08 中国工商银行股份有限公司 Block chain high-availability system mostly living, computer equipment and method
CN109426567A (en) * 2017-08-22 2019-03-05 汇链丰(北京)科技有限公司 A kind of node deployment and electoral machinery of block chain
US20190327084A1 (en) * 2018-04-19 2019-10-24 Electronics And Telecommunications Research Institute Method for selecting consensus node using nonce and method and apparatus for generating blockchain using the same
CN111049696A (en) * 2020-03-16 2020-04-21 支付宝(杭州)信息技术有限公司 Method, node and computing device for node management of blockchain system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10686590B2 (en) * 2016-12-23 2020-06-16 Joseph Santilli Methods and systems for crowdsourcing an outcome to an issue
CN110300167B (en) * 2019-06-28 2020-07-31 京东数字科技控股有限公司 Service information processing method and device based on block chain and readable storage medium
CN110569675B (en) * 2019-09-18 2021-07-09 上海海事大学 Multi-Agent transaction information protection method based on block chain technology

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106331046A (en) * 2015-07-02 2017-01-11 中兴通讯股份有限公司 Cluster main node voting method and device
CN109426567A (en) * 2017-08-22 2019-03-05 汇链丰(北京)科技有限公司 A kind of node deployment and electoral machinery of block chain
CN108134706A (en) * 2018-01-02 2018-06-08 中国工商银行股份有限公司 Block chain high-availability system mostly living, computer equipment and method
US20190327084A1 (en) * 2018-04-19 2019-10-24 Electronics And Telecommunications Research Institute Method for selecting consensus node using nonce and method and apparatus for generating blockchain using the same
CN111049696A (en) * 2020-03-16 2020-04-21 支付宝(杭州)信息技术有限公司 Method, node and computing device for node management of blockchain system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023056958A1 (en) * 2021-10-09 2023-04-13 支付宝(杭州)信息技术有限公司 Consensus method, blockchain system, and consensus node

Also Published As

Publication number Publication date
CN111049696B (en) 2020-06-12
CN111049696A (en) 2020-04-21

Similar Documents

Publication Publication Date Title
WO2021184878A1 (en) Node management method for block chain system, node, and computational device
WO2021184877A1 (en) Node management method for blockchain system, nodes and computing device
EP3559891B1 (en) Executing multi-party transactions using smart contracts
US20210256007A1 (en) Blockchain system and blockchain transaction data processing method based on ethereum
JP2022508247A (en) High-performance distributed recording system with reliability-based consensus
TWI719797B (en) Storage and execution method and device of smart contract in blockchain and electronic equipment
KR20220006623A (en) Blockchain consensus method, device and system
CN110597918A (en) Account management method and device and computer readable storage medium
CN113067897B (en) Cross-chain interaction method and device
CN112929225B (en) Session exception handling method and device, computer equipment and storage medium
WO2023165226A1 (en) Application resource backup method and apparatus, electronic device, and storage medium
CN111857978A (en) Distributed transaction processing method and device, computer equipment and storage medium
CN113326272A (en) Distributed transaction processing method, device and system
CN113645251B (en) Data transmission method and device suitable for cross-regional service
JP2020204898A (en) Method, system, and program for managing operation of distributed ledger system
WO2024103854A1 (en) Cross-chain transaction method and system, electronic device, and storage medium
CN113609231A (en) Method and device for maintaining network architecture information of block chain system
US11899654B2 (en) Linear byzantine agreement
CN111291063B (en) Master and backup copy election method, system, computer equipment and storage medium
CN110908801B (en) Data processing method and device based on block chain, computer equipment and storage medium
CN116414628A (en) Transaction request processing method and device in new and old system switching process
CN114866560A (en) Migration method and device for block chain nodes
CN112579343B (en) Block chain node data recovery method and device
CN111596953B (en) Version management system, development data transmission control method and related device
US20200358597A1 (en) Blockchain-based data processing

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20925199

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20925199

Country of ref document: EP

Kind code of ref document: A1