CN112286945A - Configuration changing method, system, equipment and medium based on PBFT algorithm - Google Patents

Configuration changing method, system, equipment and medium based on PBFT algorithm Download PDF

Info

Publication number
CN112286945A
CN112286945A CN202010996265.7A CN202010996265A CN112286945A CN 112286945 A CN112286945 A CN 112286945A CN 202010996265 A CN202010996265 A CN 202010996265A CN 112286945 A CN112286945 A CN 112286945A
Authority
CN
China
Prior art keywords
node
generation
configuration
nodes
transaction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010996265.7A
Other languages
Chinese (zh)
Inventor
李伟
邱炜伟
黄方蕾
蔡亮
张帅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Qulian Technology Co Ltd
Original Assignee
Hangzhou Qulian Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Qulian Technology Co Ltd filed Critical Hangzhou Qulian Technology Co Ltd
Priority to CN202010996265.7A priority Critical patent/CN112286945A/en
Publication of CN112286945A publication Critical patent/CN112286945A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Finance (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Accounting & Taxation (AREA)
  • Development Economics (AREA)
  • Computer Security & Cryptography (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a configuration changing method, a system, electronic equipment and a computer storage medium based on a PBFT algorithm, wherein a configuration package is obtained by receiving and packaging configuration transactions through a master node in a blockchain system, and the state of the master node is set to be a configuration state, the configuration transactions comprise configuration modified operation information, the master node sends the configuration package to slave nodes in the blockchain system so that the slave nodes can set the state of the slave nodes to be the configuration state after common identification is passed, the configuration transactions in the configuration package are executed so as to modify the system configuration of the slave nodes according to the operation information in the configuration transactions, the master node executes the configuration transactions in the configuration package so as to modify the system configuration of the master node according to the operation information in the configuration transactions, the problem that the system configuration efficiency of modifying each node is low due to the realization of the common identification based on the PBFT algorithm is solved, the efficiency of modifying the node system configuration by the block chain system is improved.

Description

Configuration changing method, system, equipment and medium based on PBFT algorithm
Technical Field
The invention relates to the technical field of block chains, in particular to a configuration change method, system, equipment and medium based on a PBFT algorithm.
Background
The blockchain is a distributed database capable of securely storing transaction information or other data. With the popularization of blockchain technology, service modes based on blockchains (especially alliance chains) are becoming more common. In order to maintain the consistency of data stored in each node in the block chain system, a Practical Byzantine Fault Tolerance (PBFT) algorithm is often used to achieve consensus to ensure the consistency of data.
In practical use, the blockchain system often needs to modify the system configuration of each node in the system according to business requirements. In the related art, when the PBFT algorithm-based consensus block chain system modifies the system configuration, after all nodes in the block chain system need to be shut down, operation and maintenance personnel modify the system configuration of each node in the block chain system one by one, and then restart all nodes after the system configuration of all nodes is modified, which is inefficient in a one-by-one modification manner, and the data processing of the block chain system is seriously affected by the shutdown and restart.
Aiming at the problem that in the related art, a common block chain system realized based on a PBFT algorithm has low system configuration efficiency of modifying each node, an effective solution is not provided at present.
Disclosure of Invention
The embodiment of the application provides a configuration changing method, a configuration changing system, electronic equipment and a storage medium based on a PBFT algorithm, and aims to at least solve the problem that in the related art, a block chain system realizing consensus based on the PBFT algorithm has low system configuration efficiency of modifying each node.
In a first aspect, an embodiment of the present application provides a configuration change method based on a PBFT algorithm, where the method includes:
a main node in a block chain system receives and packages configuration transactions to obtain a configuration package, and sets the state of the main node to be a configuration state, wherein the configuration transactions comprise configuration modified operation information;
the master node sends the configuration package to a slave node in the blockchain system, so that the slave node sets the state of the slave node to be a configuration state after the slave node passes the consensus, and executes the configuration transaction in the configuration package to modify the system configuration of the slave node according to the operation information in the configuration transaction;
and the main node executes the configuration transaction in the configuration package so as to modify the system configuration of the main node according to the operation information in the configuration transaction.
In some embodiments, in a case where each node in the blockchain system is configured with a generation number, where the generation number is a serial number of the configuration transaction, after the configuration transaction in the configuration packet is executed, the method further includes:
performing a generation checking process to confirm that a self node enters a stable generation, wherein the self node includes the master node and the slave node.
In some embodiments, before the master node in the blockchain system receives and packages a configuration transaction to obtain a configuration package and sets the state of the master node to the configuration state, the method further includes:
judging whether a self node is a laggard node or a first node newly added to the block chain system, wherein the self node comprises the main node and the slave node;
if yes, executing generation synchronization processing to ensure that the self node and other nodes in the block chain system are in the same generation.
In some of these embodiments, the generation synchronization process comprises:
the self node sends generation synchronization request information to other nodes in the block chain system, so that a first response node in the other nodes returns first feedback information according to the generation synchronization request information, wherein the generation synchronization request information comprises a first generation number of the self node, a second generation number of the first response node is larger than the first generation number, the first feedback information comprises the second generation number and a generation starting state, the second generation number is a serial number of a first configuration transaction, and the generation starting state is a block hash value of a block where the first configuration transaction is located;
when 2f +1 pieces of first feedback information are received, and second generation numbers in the first feedback information are the same and generation starting states are the same, recording the same second generation number as a target generation number and recording the same generation starting state as a target block hash value, wherein f is the maximum number of nodes which may have problems in the block chain system;
and recovering a target block based on a PBFT algorithm, and executing configuration transaction in the target block to update the system configuration of the self node, wherein the height of the target block is the value of the target generation number, and the hash value of the target block is the hash value of the target block.
In some embodiments, before sending the generation synchronization request message to other nodes in the block chain system, the generation synchronization process further includes:
checking whether the self node is executing generation synchronization processing or configuration transaction, if not, starting a generation synchronization status bit, wherein the generation synchronization status bit is closed after the configuration transaction in the target block is executed.
In some embodiments, before or while sending the generation synchronization request message to other nodes in the blockchain system, the generation synchronization process further includes:
and the self node starts a generation synchronous timer, and if the configuration transaction in the target block is not executed within the specified time of the generation synchronous timer, the started generation synchronous timer is executed again.
In some embodiments, after the performing the configuration transaction in the target block, the generation synchronization process further comprises:
and the self node updates the first generation number to the target generation number and executes generation checking processing to confirm that the self node enters a stable generation.
In some of these embodiments, the generation check process includes:
the self node sends generation check request information to all nodes in the block chain system, so that a second response node in all the nodes returns second feedback information when receiving the generation check request information, wherein the second feedback information comprises a third generation number of the second response node;
and under the condition that the third generation number in the 2f +1 pieces of second feedback information is the same as the generation number of the self node, the self node enters a stable generation, wherein f is the maximum number of the nodes which possibly have problems in the block chain system.
In some embodiments, before or while sending the generation check request message to all nodes in the blockchain system, the generation check process further comprises:
and starting a generation check timer by the self node, and if the third generation number in the 2f +1 pieces of second feedback information is the same and is less than the generation number of the self node within the specified time of the generation check timer, executing the started generation check timer again.
In some embodiments, after sending the generation check request message to all nodes in the blockchain system, the generation check process further includes:
and under the condition that the third generation number in the 2f +1 pieces of second feedback information is the same and is greater than the generation number of the self node, executing generation synchronization processing to ensure that the self node and other nodes in the block chain system are in the same generation.
In some embodiments, in the case that each node in the blockchain system is configured with a generation number, the determining whether the self node is a laggard node includes:
the self node receives a consensus message, wherein the consensus message comprises a fourth generation number of the sending node;
and under the condition that the fourth generation number in the 2f +1 pieces of consensus information is the same and is larger than the generation number of the self node, determining that the self node is the laggard node, wherein f is the maximum number of the nodes which possibly have problems in the block chain system.
In a second aspect, an embodiment of the present application provides a configuration change system based on a PBFT algorithm, where the system includes a packaging module, a consensus module, and a transaction execution module, which are deployed on a blockchain:
the packaging module is used for receiving and packaging configuration transactions by a main node in the blockchain system to obtain a configuration package, and setting the state of the main node as a configuration state, wherein the configuration transactions comprise configuration modified operation information;
the consensus module is used for the master node to send the configuration package to the slave node in the blockchain system, so that the slave node sets the state of the slave node to be a configuration state after the consensus passes, and executes the configuration transaction in the configuration package to modify the system configuration of the slave node according to the operation information in the configuration transaction;
and the transaction execution module is used for executing the configuration transaction in the configuration package by the main node so as to modify the system configuration of the main node according to the operation information in the configuration transaction.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the processor implements the configuration change method based on the PBFT algorithm as described in the first aspect.
In a fourth aspect, the present application provides a storage medium, on which a computer program is stored, where the program is executed by a processor to implement the configuration change method based on the PBFT algorithm as described in the first aspect.
Compared with the related art, the configuration change method based on the PBFT algorithm provided by the embodiment of the application, receiving and packaging configuration transaction by a main node in the blockchain system to obtain a configuration package, setting the state of the main node as a configuration state, wherein the configuration transaction includes configuration modified operation information, the master node sends a configuration packet to the slave nodes in the blockchain system, for the slave node to set the slave node state to the configuration state after the consensus passes and to execute the configuration transaction in the configuration package, to modify the system configuration of the slave node in accordance with the operational information in the configuration transaction, the master node performs the configuration transaction in the configuration package, the system configuration of the main node is modified according to the operation information in the configuration transaction, the problem that the system configuration efficiency of modifying each node is low in a block chain system based on the PBFT algorithm to realize consensus is solved, and the efficiency of modifying the node system configuration by the block chain system is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a schematic diagram of an application environment of a configuration change method based on a PBFT algorithm according to an embodiment of the present application;
FIG. 2 is a flow chart of a configuration change method based on a PBFT algorithm according to an embodiment of the present application;
FIG. 3 is a flow diagram of a generation synchronization process according to an embodiment of the present application;
FIG. 4 is a flow diagram of a generation checking process according to an embodiment of the present application;
fig. 5 is a flowchart illustrating a configuration change method of a first node according to an embodiment of the present application;
FIG. 6 is a flowchart illustrating a method for changing a configuration of a legacy node according to an embodiment of the present application;
FIG. 7 is a flow diagram illustrating another generation checking process according to an embodiment of the present application;
FIG. 8 is a schematic flow chart illustrating another generation synchronization process according to an embodiment of the present application;
FIG. 9 is a schematic structural diagram of a configuration change system based on a PBFT algorithm according to an embodiment of the present application;
fig. 10 is an internal structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments provided in the present application without any inventive step are within the scope of protection of the present application.
It is obvious that the drawings in the following description are only examples or embodiments of the present application, and that it is also possible for a person skilled in the art to apply the present application to other similar contexts on the basis of these drawings without inventive effort. Moreover, it should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one implementation to another.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the specification. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of ordinary skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments without conflict.
Unless defined otherwise, technical or scientific terms referred to herein shall have the ordinary meaning as understood by those of ordinary skill in the art to which this application belongs. Reference to "a," "an," "the," and similar words throughout this application are not to be construed as limiting in number, and may refer to the singular or the plural. The present application is directed to the use of the terms "including," "comprising," "having," and any variations thereof, which are intended to cover non-exclusive inclusions; for example, a process, method, system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to the listed steps or elements, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. Reference to "connected," "coupled," and the like in this application is not intended to be limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The term "plurality" as referred to herein means two or more. "and/or" describes an association relationship of associated objects, meaning that three relationships may exist, for example, "A and/or B" may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. Reference herein to the terms "first," "second," "third," and the like, are merely to distinguish similar objects and do not denote a particular ordering for the objects.
To be a difficult-to-defeat, open, non-falsifiable data record decentralized honest and trusted system, the blockchain system needs to be secure, unambiguous, and irreversible in the shortest possible time for distributed data records. In different types of blockchain networks, in order to keep the ledger consistent among nodes recording the ledger, a consensus algorithm is generally adopted to ensure the consistency. After a node (e.g., a unique node) creates a block, other nodes record the same block if the created block is recognized by other nodes. The process of the generated block gaining acceptance by other nodes is a consensus mechanism. The consensus mechanism is a mechanism for the blockchain nodes to achieve the global consensus on the blockchain information, which can ensure that the latest block is accurately added to the blockchain system. Alliance chain technology provides enterprise-level blockchain system solutions to the blockchain technology needs of large corporations, government agencies, and industry alliances. The PBFT algorithm is the most commonly used consensus algorithm in the federation chain, and it is assumed in the algorithm that, when there may be at most f problem nodes in the blockchain system, if the total number of nodes in the blockchain system is 3f +1, that is, the number of normal nodes is 2f +1, the data consistency requirement and fault tolerance requirement of all nodes can be ensured.
Fig. 1 is a schematic application environment diagram of a configuration change method based on a PBFT algorithm according to an embodiment of the present application, and the configuration change method based on the PBFT algorithm provided by the present application may be applied to the application environment shown in fig. 1. The blockchain system includes a master node 11 and a slave node 12. The number of master nodes 11 and slave nodes 12 shown in figure 1 is schematic, the actual number being determined by the traffic demands of the blockchain system, the master nodes 11 and slave nodes 12 communicating with each other over the network. When receiving a configuration transaction, the master node 11 directly packages the configuration transaction to generate a configuration package, where the configuration transaction includes operation information for configuration modification, and sets the state of the master node 11 to a configuration state. The master node 11 sends the configuration packet to the slave node 12, after the configuration packet is identified by a general PBFT identification algorithm, the slave node 12 sets the state of the slave node 12 to the configuration state and executes the configuration transaction in the configuration packet when it is determined that the current transaction to be executed is the configuration transaction in the configuration packet, thereby modifying the system configuration of the slave node 12 according to the operation information in the configuration transaction. The master node 11 executes the configuration transaction in the configuration package to modify the system configuration of the master node 11 according to the operational information in the configuration transaction.
The embodiment provides a configuration change method based on a PBFT algorithm. Fig. 2 is a flowchart of a configuration change method based on a PBFT algorithm according to an embodiment of the present application, and as shown in fig. 2, the flowchart includes the following steps:
s210, the main node in the block chain system receives and packages the configuration transaction to obtain a configuration package, and the state of the main node is set to be a configuration state. The configuration transaction includes configuration modified operational information. The master node is typically always online and provides much more memory than ordinary slave nodes. In addition to validating, saving and transferring transactions, sometimes master nodes also facilitate other events in the blockchain system depending on their nature, such as voting events, execution of protocol operations and compliance with blockchain laws. And the main node receives the consensus information and packages the consensus information under the general condition that the configuration transaction is not received. When receiving a configuration transaction, the host node directly packages the configuration transaction to generate a configuration package, wherein the configuration package only contains one transaction and the transaction is the configuration transaction. The master node sets the state of the master node to be a configuration state, the master node cannot actively package transactions in the configuration state, and the master node suspends the package processing of the consensus messages.
S220, the master node sends a configuration package to the slave nodes in the blockchain system, so that the slave nodes set the states of the slave nodes to be configuration states after the common identification is passed, and the configuration transaction in the configuration package is executed, so that the system configuration of the slave nodes is modified according to the operation information in the configuration transaction.
The consensus process of the configuration package is the same as the general process of the PBFT algorithm, and specifically comprises a pre-preparation stage, a submission stage and a response stage. In the pre-preparation phase, the master node sends a pre-preparation message to the slave nodes by broadcasting, wherein the pre-preparation message comprises a configuration packet. In the preparation stage, after receiving the pre-preparation message from the node, the slave node checks that the configuration packet is legal, and broadcasts the preparation message to other nodes in the block chain system respectively, and receives the preparation message broadcast by other nodes at the same time. The master node or the slave node is changed from the pre-preparation state to the preparation state after receiving 2f +1 preparation messages. In the submission stage, the master node or the slave node entering the preparation state sends a submission message to other nodes, and receives the submission message broadcast by other nodes. The master node or the slave node transitions from the ready state to the commit state after receiving 2f +1 commit messages. In the response phase, the master node or the slave node entering the commit state returns a response message to the client initiating the configuration transaction, that is, the node initiating the configuration transaction in the blockchain system, and when the client receives 2f +1 response messages, it indicates that each node in the blockchain system has agreed with the configuration package.
After the configuration package is identified, the current transaction to be executed by the slave node is the configuration transaction in the configuration package, the slave node records the serial number of the configuration transaction, sets the state of the slave node to be the configuration state, requests to execute the configuration transaction, and waits for the completion of the execution of the configuration transaction in the configuration package, so that the system configuration of the slave node is modified according to the operation information in the configuration transaction.
And S230, the main node executes the configuration transaction in the configuration package so as to modify the system configuration of the main node according to the operation information in the configuration transaction. After the configuration package is identified, the transaction to be executed by the main node is the configuration transaction in the configuration package, the main node records the serial number of the configuration transaction, requests to execute the configuration transaction, and waits for the completion of executing the configuration transaction, so that the system configuration of the main node is modified according to the operation information in the configuration transaction.
The nodes in the block chain system realize the consensus of the configuration transaction in the configuration package based on the message interaction in the PBFT algorithm, then the operation of modifying the system configuration is completed by executing the configuration transaction, operation and maintenance personnel do not need to stop all the nodes and then modify the system configuration of each node one by one, the problem that the system configuration efficiency of modifying each node is low in the block chain system based on the PBFT algorithm to realize the consensus is solved, the efficiency of modifying the system configuration of each node in the block chain system is improved, and the normal data processing of the block chain system cannot be influenced.
In some of these embodiments, after performing the configuration transaction in the configuration packet in the case where each node in the blockchain system is configured with a generation number, the self node performs a generation check process to confirm that the self node enters a new stable generation that can be identified. The self node includes a master node or a slave node. The generation number is a serial number of the configuration transaction, the generation number of a node identifies the generation of the node, a generation corresponds to a set of system configurations, and a plurality of nodes with the same generation number indicate that the nodes have the same set of system configurations. The mutual interaction of the consensus messages can be carried out only on the nodes of the same generation, and the nodes of different generations only receive the consensus messages and do not process the consensus messages. In the PBFT consensus algorithm, when the total number of nodes in the block chain system is 3f +1, since the consensus messages cannot be exchanged between nodes in different generations, it is only possible to complete consensus when at least 2f +1 nodes are in the same generation, that is, it is only possible to ensure that nodes entering a new generation enter a stable generation capable of consensus when more than 2f +1 nodes enter the new generation.
After executing the configuration transaction in the configuration packet, the master node executes generation check processing according to the generation number of the master node to confirm that the master node enters a stable generation, and then the master node enters a new generation, can interact with other nodes in the blockchain system for consensus messages, and restarts the consensus message packing processing. After the slave node executes the configuration transaction in the configuration packet, the slave node executes generation checking processing according to the generation number of the slave node to confirm that the slave node enters a stable generation, and the slave node enters a new generation and can interact with other nodes in the blockchain system through consensus messages. By executing generation checking processing, the self node is confirmed when entering a stable generation, namely, the self node can interact with other nodes in the block chain in a new round of stable generation through consensus information, and then the data consistency of the self node and other nodes can be ensured.
In some embodiments, the master node in the blockchain system receives and packages the configuration transaction to obtain the configuration package, and before setting the state of the master node as the configuration state, the master node and the slave node respectively determine whether the own node is a laggard node or a first node newly added to the blockchain system. The backward node is an original node in the block chain system, the generation number of the backward node is smaller than the generation number corresponding to the node entering the stable generation, and at the moment, the block chain system can realize consensus based on the PBFT algorithm, but the backward node cannot perform interaction of consensus information with the node entering the stable generation. If the self node is a lagging node or a first node, the self node performs generation synchronization to ensure that the self node is in the same generation as other nodes in the blockchain system, even though the lagging node or the first node may be in the same generation as other nodes in the blockchain system.
By executing the generation synchronization process, the generation number of the first node is updated, so that the first node can interact with other nodes in the blockchain system through the consensus messages, and the data consistency with other nodes is maintained. By executing generation synchronization processing, the generation number of the laggard node can be updated, so that the laggard node can interact with other nodes in the block chain system through consensus messages, and consistency with data on other nodes is kept.
In some embodiments, fig. 3 is a flowchart of a generation synchronization process according to an embodiment of the present application, and as shown in fig. 3, the flowchart includes the following steps:
s310, the self node sends the generation synchronization request information to other nodes in the block chain system, so that the first response node in the other nodes returns the first feedback information according to the generation synchronization request information. The self node is a node determined to be a laggard node or a first node in the blockchain system. The generation synchronization request information comprises a first generation number of the self node, a second generation number of the first response node is larger than the first generation number, the first feedback information comprises a second generation number and a generation starting state, the second generation number is a serial number of the first configuration transaction, and the generation starting state is a block hash value of a block where the first configuration transaction is located. Each generation (i.e., each set of system configuration) corresponds to a generation start status, and nodes with the same system configuration have the same generation start status.
S320, when the second generation numbers in the 2f +1 pieces of first feedback information are the same and the generation starting states are the same, the node marks the same second generation number as the target generation number and the same generation starting state as the target block hash value. f is the maximum number of nodes that may have problems in the blockchain system.
S330, the self node recovers the target block based on the PBFT algorithm and executes the configuration transaction in the target block to update the system configuration of the self node. The height of the target block is the value of the target generation number, and the hash value of the target block is the hash value of the target block. The allocation transaction in the target block includes a first allocation transaction. And the self node restores the local missing blocks of the self node under the help of other nodes in the block chain system through a state transfer process in the PBFT algorithm and executes transactions in the blocks until the target block is restored. The specific process of the state transition process is the same as that in the "Practical Byzantine fault tolerant and reactive recovery" paper published in 2002 by Miguel Castro (Carlsterol) and Barbara Liskov (Rickov). When executing the configuration transaction in the target block, the system configuration of the self node may be modified to be consistent with the system configuration of the 2f +1 first response nodes according to the operation information in the first configuration transaction.
Through the generation synchronous processing, the laggard nodes or the newly added first nodes in the block chain system can finish modifying the system configuration according to the operation information contained in the first configuration transaction in the target block, operation and maintenance personnel do not need to modify the system configuration of the laggard nodes or the first nodes after stopping all the nodes, and the efficiency of modifying the system configuration of the laggard nodes and the newly added first nodes in the block chain system is improved.
In some embodiments, before sending the generation synchronization request message to other nodes in the blockchain system, the self node, which is a node determined to be a lagging node or a first node in the blockchain system, checks whether the self node is performing generation synchronization processing or configuration transaction. If the self node is not executing the generation synchronization process or executing the configuration transaction, the generation synchronization status bit is turned on and turned off after the configuration transaction in the target block is executed. If the self node is executing generation synchronization processing or executing configuration transaction, it indicates that the generation number of the self node is temporarily lagged, and after the generation synchronization processing or the configuration transaction is executed, the system configuration of the self node may be modified to be consistent with the system configuration of other nodes and further to be in the same generation with other nodes, so that the self node does not temporarily start a generation synchronization status bit at the moment, and does not send generation synchronization request information, thereby reducing the execution steps of generation synchronization processing and improving the efficiency of modifying the system configuration of each node in the block chain system as a whole.
In some embodiments, since the nodes may not be synchronized in the step of completing the consensus based on the PBFT algorithm, the configuration transaction may not be executed synchronously, so that the self node may not obtain 2f +1 pieces of first feedback information with the same second generation number and the same generation starting state temporarily, thereby failing to complete the generation synchronization process. Therefore, before or while sending the generation synchronization request message to other nodes in the blockchain system, the self node starts the generation synchronization timer, and if the self node does not execute the configuration transaction in the target block within the specified time of the generation synchronization timer, the generation synchronization timer is restarted until the self node completes the execution of the configuration transaction in the target block within the specified time of the generation synchronization timer.
In some embodiments, after performing the configuration transaction in the target block, the self node updates the first generation number to the target generation number and performs a generation check process to confirm that the self node enters a stable generation. The self node is a node determined to be a laggard node or a first node in the blockchain system. The self node sends generation check request information to all nodes in the block chain system, so that a second response node in all nodes returns second feedback information when receiving the generation check request information. The second feedback information includes a third generation number of the second responding node. And when the third generation number in the 2f +1 pieces of second feedback information is the same as the generation number of the self node, the self node indicates that the self node enters a stable generation. f is the maximum number of nodes that may have problems in the blockchain system.
By executing generation checking processing, the mark (i.e. generation number) of the generation corresponding to the system configuration is updated and checked while the system configuration modification is completed by the laggard node or the first node, so as to confirm that the generation number of the laggard node or the first node and other nodes in the block chain system are in a new round of stable generation which can be identified, thereby ensuring the consistency of data on the laggard node or the first node and other nodes.
In some embodiments, fig. 4 is a flowchart of a generation checking process according to an embodiment of the present application, and as shown in fig. 4, the flowchart includes the following steps:
s410, the self node sends a generation check request message to all nodes in the blockchain system, so that a second response node in all nodes returns a second feedback message when receiving the generation check request message. The self node comprises a master node and a slave node, and the master node and the slave node can be original nodes in the blockchain system or first nodes newly added in the blockchain system. The second feedback information includes a third generation number of the second responding node.
S420, if the third generation number in the 2f +1 pieces of second feedback information is the same as the generation number of the self node, the self node enters a stable generation. f is the maximum number of nodes that may have problems in the blockchain system. The 2f +1 pieces of second feedback information include second feedback information sent by the self node.
Through the received 2f +1 pieces of second feedback information, the generation number of each node in the block chain system can be verified, the system configuration of each node is further ensured to be modified, and the block chain system can be ensured to be identified in common so as to ensure the consistency of data in the block chain system.
In some embodiments, since the nodes may not be synchronized in the step of completing the consensus based on the PBFT algorithm, the configuration transaction may not be performed synchronously, and if the self node enters a new generation before other nodes, it may not be confirmed whether the self node enters a new stable generation. The self node comprises a master node and a slave node, and the master node and the slave node can be original nodes in the blockchain system or first nodes newly added in the blockchain system. Therefore, before the generation check request message is sent to all nodes in the block chain system or at the same time of sending the generation check request message, the self node starts the generation check timer, and if the third generation number in the 2f +1 pieces of second feedback information is the same and is smaller than the generation number of the self node within the specified time of the generation check timer, it indicates that the self node enters a new generation before other nodes, the self node restarts the starting of the generation check timer until other nodes also enter the new generation, and thus the self node can be confirmed to enter a new stable generation.
In some embodiments, after the generation check request message is sent to all nodes in the blockchain system, when the self node receives the 2f +1 second feedback messages, where the third generation numbers of the second feedback messages are the same and greater than the generation number of the self node, an exception may occur when the self node performs a configuration transaction, so that the generation where the self node is located falls behind, the self node needs to perform generation synchronization processing to ensure that the self node and other nodes in the blockchain system are in the same generation, thereby ensuring that the self node and other nodes can perform interaction of common identification messages. The self node comprises a master node and a slave node, and the master node and the slave node can be original nodes in the blockchain system or first nodes newly added in the blockchain system.
In some embodiments, the self node receives a consensus message sent from a sending node, the self node comprising a master node and a slave node, the consensus message comprising a fourth generation number of the sending node. If the fourth generation number in the consensus message received by the self node is the same as the generation number of the self node, the self node and the sending node are in the same generation, and the configuration transaction in the consensus message is directly executed. If the generation number of the fourth generation in the consensus message received by the self node is different from the generation number of the self node, the self node and the sending node are in different generations, and two situations may occur here: if the fourth generation number in the piece of consensus information is smaller than the generation number of the self node, the self node does not process the piece of consensus information; if the fourth generation number in the piece of consensus message is greater than the generation number of the self node, the self node records the node ID information of the sending node, and determines that the self node is a lagging node when receiving that the fourth generation number in the 2f +1 pieces of consensus message is the same and greater than the generation number of the self node, the self node sends a generation synchronization request, and further performs generation synchronization processing to ensure that the self node and other nodes in the block chain system are in the same generation. The laggard node is the original node of the blockchain system.
In some embodiments, before the master node packages the configuration transaction to obtain the configuration package, when the master node or the slave node in the blockchain system receives the configuration transaction, the configuration transaction is stored in the transaction pool, and the configuration transaction is broadcasted to other nodes in the blockchain system, and the configuration transaction can be removed from the transaction pool after being executed. When the execution of the configuration transaction is abnormal, the configuration transaction can be acquired from the transaction pool to be executed again, and the problem of abnormal execution of the configuration transaction is solved.
In some embodiments, the present invention is described in detail in connection with dynamic management of nodes in a federation chain system that implements consensus based on the PBFT algorithm. Assuming that there may be a maximum of f problem nodes in the federation chain system, correspondingly, the total number of nodes in the federation chain system is 3f +1, and the number of normal nodes is 2f + 1. Nodes in the federation chain system are differentiated by generation. One generation corresponds to a set of system configurations, and the interaction of consensus messages can only be performed on nodes of the same generation. Except that the nodes of different generations can receive and process the related messages of the generation check process and the related messages of the generation synchronization process, only the received common message does not process the common message. Each generation has a generation number and a generation start state. The generation is identified by a generation number, which is the serial number corresponding to the configuration transaction that caused the configuration change, and each configuration transaction corresponds to a serial number. Each generation corresponds to a generation start state, which is the block hash value of the block in which the allocation transaction causing the allocation change is located.
The self node in the alliance chain system comprises a main node and a slave node. In a general phase, the self node receives a consensus message sent from the sending node, wherein the consensus message comprises a fourth generation number of the sending node. If the fourth generation number in the consensus message received by the self node is the same as the generation number of the self node, the self node and the sending node are in the same generation, and the configuration transaction in the consensus message is directly executed. If the generation number of the fourth generation in the consensus message received by the self node is different from the generation number of the self node, the self node and the sending node are in different generations, and two situations may occur here: if the fourth generation number in the piece of consensus information is smaller than the generation number of the self node, the self node does not process the piece of consensus information; if the fourth generation number in the piece of consensus information is greater than the generation number of the self node, the self node records the node ID information of the sending node, and when the fourth generation number in the received 2f +1 pieces of consensus information is the same and is greater than the generation number of the self node, the generation of the self node is considered to possibly lag behind, and the generation synchronization processing flow is started. Fig. 5 is a schematic flow chart of a configuration change method of a first node according to an embodiment of the present application, where as shown in fig. 5, the first node is a newly added node in the federation chain system, and the first node directly enters a generation synchronization processing flow, and after the generation synchronization processing is completed, the start of the first node is implemented.
Fig. 6 is a flowchart illustrating a configuration changing method of an original node according to an embodiment of the present application. The original nodes comprise a master node and a slave node. As shown in fig. 6, in the configuration transaction receiving stage, when an original node in the federation chain system receives a configuration transaction, the configuration transaction is stored in the transaction pool, and the configuration transaction is broadcasted to other original nodes in the federation chain system, so that the configuration transaction can be sent to each original node.
And in the configuration transaction receiving stage, judging whether the original node is a main node in the alliance chain system, if so, directly packaging the configuration transaction to generate a configuration packet, and meanwhile, setting the state of the main node as the configuration state and suspending the subsequent consensus packaging process. If the original node is the slave node, the configuration state of the slave node is set after the configuration transaction is detected in the transaction execution stage. The configuration package contains only one transaction and this transaction is the configuration transaction. The configuration state represents a state in which the node is processing a transaction to perform a proposed configuration. Nodes in this state cannot actively package transactions.
In the configuration transaction consensus phase, the configuration package completes the consensus phase through a general PBFT consensus algorithm.
In the configuration transaction execution stage, after the transaction consensus is completed, the transaction to be executed currently by the original node is the configuration transaction in the configuration package. If the original node is the slave node, the original node records the serial number of the configuration transaction, enters the configuration state, then executes the configuration transaction, and waits for the completion of the execution of the configuration transaction. And if the original node is the main node, requesting to execute the configuration transaction, and waiting for the completion of the execution of the configuration transaction. When the configuration transaction is executed, the original node updates the local system configuration according to the operation information contained in the original node.
In the generation switching stage, after the original node waits for the completion of the execution of the configuration transaction, the generation switching is performed according to the configuration change item related to the configuration transaction, and the configuration of the synchronous consensus cluster is updated. The original node sets the generation number of the original node as a serial number corresponding to the configuration transaction, a generation checking processing flow is triggered, the original node passing the checking and verification enters a new generation, the generation switching of the original node is completed, and the common identification packaging flow is restarted. And the original node with the error in the checking and verification enters a generation checking and processing flow to perform exception handling.
Through the configuration change process, the newly added first node in the alliance chain system can execute configuration transaction through generation synchronization processing, and system configuration of the first node is completed. After the master node and the slave node in the original alliance chain system agree on the configuration transaction in the configuration package, the configuration transaction is executed to complete the operation of modifying the configuration of the respective system. The original nodes in the alliance chain system do not need to be stopped and then the system configuration of each original node and the newly added first node is modified one by one, so that the efficiency of modifying the system configuration of each node by the alliance chain system is improved, and the normal data processing of the alliance chain system is not influenced.
Fig. 7 is a flowchart illustrating another generation checking process according to an embodiment of the present disclosure. The self node performing the generation check process may be an original node in the federation chain system or a newly added first node. As shown in fig. 7, in the request phase of the generation check process flow, the self node enters the generation check process flow, opens the generation check status bit of the self node, initializes, and broadcasts a piece of generation check request information to all nodes in the federation chain system.
Since the execution of each node in the PBFT consensus algorithm may not be synchronous, the existing node may enter a new generation before other nodes, and the self node may not complete the generation check. Therefore, in the request phase of the generation check process, the self node starts a generation check timer, and if the generation check is not completed within a specified time and the timeout is caused, the self node restarts the generation check process flow.
In a response stage in the generation check processing flow, after receiving the generation check request information, the second response node unicasts a piece of second feedback information to the self node, and the self node contains a third generation number of the second response node.
In the checking stage of the generation checking process flow, when the self node receives the second feedback information from 2f +1 different second responding nodes, where the 2f +1 pieces of second feedback information include the second feedback information sent by the self node, and the third generation numbers included in the 2f +1 pieces of second feedback information are identical, and the identical third generation number is marked as a stable generation number e ', it is determined whether the self node enters a stable generation according to the relationship between the generation number (marked as e) of the self node and e'.
In the PBFT consensus algorithm, when the total number of nodes is 3f +1, consensus can be completed only by requiring at least 2f +1 nodes to agree, and common consensus message interaction cannot be performed between nodes in different generations, so that it is required to ensure that nodes entering a new generation are more than 2f +1 nodes, and it is ensured that a stable generation capable of consensus is entered. In the checking stage of the generation checking process, comparing whether e is consistent with e' includes the following cases: a. if the two nodes are consistent, namely e is equal to e', the self node is considered to enter a stable generation, the generation check timer is closed, and the generation check processing is finished; b. if the generation number of the self node is greater than the stable generation number, namely e > e', the self node is considered to enter a new generation before other nodes, and the self node restarts a generation check processing flow after the generation check timer is overtime; c. if the generation number of the self node is smaller than the stable generation number, i.e. e < e', the generation of the self node is considered to be lagged behind, the generation checking process flow is ended, and the self node enters the generation synchronization process flow.
FIG. 8 is a flowchart illustrating another generation synchronization process according to an embodiment of the present application. The self node performing the generation check process may be an original laggard node in the federation chain system or a newly added first node. As shown in fig. 8, in the preparation stage of the generation synchronization processing flow, when the self node is not in a generation synchronization processing procedure and is not performing the configuration transaction processing, the self node starts the generation synchronization processing flow, exits the current generation, and opens a generation synchronization status bit of the self node for initialization.
In a request phase of the generation synchronization process, the self node broadcasts a generation synchronization request message to other nodes in the federation chain system, wherein the generation synchronization request message includes node information of the self node and a first generation number of the self node.
Since the execution of each node in the PBFT consensus algorithm may not be synchronous, there is a case where stable generation information cannot be obtained temporarily, so that the self node itself cannot complete generation synchronization. Therefore, in the request phase of the generation synchronization process, the self node can start a generation synchronization timer, and if the generation synchronization process is not completed within the specified time and the timeout is caused, the self node restarts the generation synchronization process flow.
In a response stage in the generation synchronization processing flow, a second generation number of the first response node is greater than a first generation number in the generation synchronization request message, the first response node receives the generation synchronization request message and then unicasts a piece of first feedback information to the self node, and the first feedback information comprises the second generation number and the generation starting state of the first response node. The second generation number is the serial number of the first allocation transaction, and the generation starting state is the block hash value of the block where the first allocation transaction is located.
In the recovery stage of the generation synchronization process, when the self node receives the first feedback information from 2f +1 different first responding nodes, if the second generation numbers included in the 2f +1 pieces of first feedback information are the same and the generation starting states are the same, the same second generation number is marked as the target generation number e1, and the generation number of the self node is updated to e 1. According to the state transfer flow requirement in the PBFT algorithm, the value of e1 is used as the target block height h, the consistent generation starting state is used as the target block hash value d, and the self node requests to perform the state transfer flow. Through the state transition process in the PBFT algorithm, the self node restores the blocks that the self node locally misses with the help of other nodes in the federation chain system, and performs transactions in the blocks until the target block with the height h and the hash value d is restored.
At the end stage of the generation synchronization processing flow, the self node closes the generation check timer and closes a round of generation synchronization status bit, the generation synchronization processing flow of the self node is ended, and the generation check processing flow enters the generation check processing flow to check the generation number of the self node.
The embodiment of the application provides a configuration change system based on a PBFT algorithm. Fig. 9 is a schematic structural diagram of a configuration change system based on a PBFT algorithm according to an embodiment of the present application, and as shown in fig. 9, the system includes a packing module 910, a consensus module 920 and a transaction execution module 930 deployed on a blockchain: the packaging module 910 is configured to receive and package a configuration transaction by a master node in the blockchain system to obtain a configuration package, and set a state of the master node to a configuration state, where the configuration transaction includes configuration-modified operation information; the consensus module 920 is configured to send, by the master node, a configuration packet to a slave node in the blockchain system, so that the slave node sets the state of the slave node to a configuration state after the consensus passes, and executes a configuration transaction in the configuration packet to modify the system configuration of the slave node according to operation information in the configuration transaction; the transaction execution module 930 is configured to execute the configuration transaction in the configuration package by the master node to modify the system configuration of the master node according to the operation information in the configuration transaction.
For specific limitations of the configuration change system based on the PBFT algorithm, reference may be made to the above limitations of the configuration change method based on the PBFT algorithm, and details are not described here. The modules in the configuration change system based on the PBFT algorithm may be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
An embodiment of the present application further provides an electronic device, which includes a memory and a processor, where the memory stores a computer program, and the processor is configured to execute the computer program to perform the steps in any of the method embodiments described above.
Optionally, the electronic device may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
It should be noted that, for specific examples in this embodiment, reference may be made to examples described in the foregoing embodiments and optional implementations, and details of this embodiment are not described herein again.
In addition, in combination with the configuration change method based on the PBFT algorithm in the foregoing embodiments, the embodiments of the present application may provide a storage medium to implement. The storage medium having stored thereon a computer program; the computer program when executed by a processor implements any of the above embodiments of the PBFT algorithm based configuration change method.
In one embodiment, fig. 10 is a schematic diagram of an internal structure of an electronic device according to an embodiment of the present application, and as shown in fig. 10, there is provided an electronic device, which may be a server, and its internal structure diagram may be as shown in fig. 10. The electronic device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic equipment comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the electronic device is used for storing data. The network interface of the electronic device is used for connecting and communicating with an external terminal through a network. The computer program is executed by a processor to implement a configuration change method based on the PBFT algorithm.
Those skilled in the art will appreciate that the architecture shown in fig. 10 is merely a block diagram of some of the structures associated with the present solution and does not constitute a limitation on the electronic devices to which the present solution applies, and that a particular electronic device may include more or less components than those shown, or combine certain components, or have a different arrangement of components.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It should be understood by those skilled in the art that various features of the above-described embodiments can be combined in any combination, and for the sake of brevity, all possible combinations of features in the above-described embodiments are not described in detail, but rather, all combinations of features which are not inconsistent with each other should be construed as being within the scope of the present disclosure.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (14)

1. A configuration change method based on a PBFT algorithm is characterized by comprising the following steps:
a main node in a block chain system receives and packages configuration transactions to obtain a configuration package, and sets the state of the main node to be a configuration state, wherein the configuration transactions comprise configuration modified operation information;
the master node sends the configuration package to a slave node in the blockchain system, so that the slave node sets the state of the slave node to be a configuration state after the slave node passes the consensus, and executes the configuration transaction in the configuration package to modify the system configuration of the slave node according to the operation information in the configuration transaction;
and the main node executes the configuration transaction in the configuration package so as to modify the system configuration of the main node according to the operation information in the configuration transaction.
2. The method of claim 1, wherein in the case that each node in the blockchain system is configured with a generation number, wherein the generation number is a serial number of the configuration transaction, after the performing the configuration transaction in the configuration packet, the method further comprises:
performing a generation checking process to confirm that a self node enters a stable generation, wherein the self node includes the master node and the slave node.
3. The method of claim 1, wherein before the master node in the blockchain system receives and packages a configuration transaction into a configuration package and sets the state of the master node to the configuration state, the method further comprises:
judging whether a self node is a laggard node or a first node newly added to the block chain system, wherein the self node comprises the main node and the slave node;
if yes, executing generation synchronization processing to ensure that the self node and other nodes in the block chain system are in the same generation.
4. The method of claim 3, wherein the generation synchronization process comprises:
the self node sends generation synchronization request information to other nodes in the block chain system, so that a first response node in the other nodes returns first feedback information according to the generation synchronization request information, wherein the generation synchronization request information comprises a first generation number of the self node, a second generation number of the first response node is larger than the first generation number, the first feedback information comprises the second generation number and a generation starting state, the second generation number is a serial number of a first configuration transaction, and the generation starting state is a block hash value of a block where the first configuration transaction is located;
when 2f +1 pieces of first feedback information are received, and second generation numbers in the first feedback information are the same and generation starting states are the same, recording the same second generation number as a target generation number and recording the same generation starting state as a target block hash value, wherein f is the maximum number of nodes which may have problems in the block chain system;
and recovering a target block based on a PBFT algorithm, and executing configuration transaction in the target block to update the system configuration of the self node, wherein the height of the target block is the value of the target generation number, and the hash value of the target block is the hash value of the target block.
5. The method of claim 4, wherein before sending the generation synchronization request message to other nodes in the blockchain system, the generation synchronization process further comprises:
checking whether the self node is executing generation synchronization processing or configuration transaction, if not, starting a generation synchronization status bit, wherein the generation synchronization status bit is closed after the configuration transaction in the target block is executed.
6. The method of claim 4, wherein before or while sending the generation synchronization request message to other nodes in the blockchain system, the generation synchronization process further comprises:
and the self node starts a generation synchronous timer, and if the configuration transaction in the target block is not executed within the specified time of the generation synchronous timer, the started generation synchronous timer is executed again.
7. The method of claim 4, wherein after the performing the configuration transaction in the target block, the generation synchronization process further comprises:
and the self node updates the first generation number to the target generation number and executes generation checking processing to confirm that the self node enters a stable generation.
8. The method of claim 2, wherein the generation checking process comprises:
the self node sends generation check request information to all nodes in the block chain system, so that a second response node in all the nodes returns second feedback information when receiving the generation check request information, wherein the second feedback information comprises a third generation number of the second response node;
and under the condition that the third generation number in the 2f +1 pieces of second feedback information is the same as the generation number of the self node, the self node enters a stable generation, wherein f is the maximum number of the nodes which possibly have problems in the block chain system.
9. The method of claim 8, wherein before or while sending the generation check request message to all nodes in the blockchain system, the generation check process further comprises:
and starting a generation check timer by the self node, and if the third generation number in the 2f +1 pieces of second feedback information is the same and is less than the generation number of the self node within the specified time of the generation check timer, executing the started generation check timer again.
10. The method of claim 8, wherein after sending the generation check request message to all nodes in the blockchain system, the generation check process further comprises:
and under the condition that the third generation number in the 2f +1 pieces of second feedback information is the same and is greater than the generation number of the self node, executing generation synchronization processing to ensure that the self node and other nodes in the block chain system are in the same generation.
11. The method according to claim 3, wherein in the case that each node in the blockchain system is configured with a generation number, the determining whether the self node is a lagging node comprises:
the self node receives a consensus message, wherein the consensus message comprises a fourth generation number of the sending node;
and under the condition that the fourth generation number in the 2f +1 pieces of consensus information is the same and is larger than the generation number of the self node, determining that the self node is the laggard node, wherein f is the maximum number of the nodes which possibly have problems in the block chain system.
12. A configuration change system based on a PBFT algorithm is characterized by comprising a packaging module, a consensus module and a transaction execution module which are deployed on a block chain:
the packaging module is used for receiving and packaging configuration transactions by a main node in the blockchain system to obtain a configuration package, and setting the state of the main node as a configuration state, wherein the configuration transactions comprise configuration modified operation information;
the consensus module is used for the master node to send the configuration package to the slave node in the blockchain system, so that the slave node sets the state of the slave node to be a configuration state after the consensus passes, and executes the configuration transaction in the configuration package to modify the system configuration of the slave node according to the operation information in the configuration transaction;
and the transaction execution module is used for executing the configuration transaction in the configuration package by the main node so as to modify the system configuration of the main node according to the operation information in the configuration transaction.
13. An electronic device comprising a processor, a storage medium, and a computer program, the computer program being stored in the storage medium, wherein the computer program, when executed by the processor, performs the PBFT algorithm based configuration change method of any of claims 1-11.
14. A computer storage medium having a computer program stored thereon, characterized in that: the computer program when executed by a processor implements the PBFT algorithm based configuration change method of any of claims 1 to 11.
CN202010996265.7A 2020-09-21 2020-09-21 Configuration changing method, system, equipment and medium based on PBFT algorithm Pending CN112286945A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010996265.7A CN112286945A (en) 2020-09-21 2020-09-21 Configuration changing method, system, equipment and medium based on PBFT algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010996265.7A CN112286945A (en) 2020-09-21 2020-09-21 Configuration changing method, system, equipment and medium based on PBFT algorithm

Publications (1)

Publication Number Publication Date
CN112286945A true CN112286945A (en) 2021-01-29

Family

ID=74420129

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010996265.7A Pending CN112286945A (en) 2020-09-21 2020-09-21 Configuration changing method, system, equipment and medium based on PBFT algorithm

Country Status (1)

Country Link
CN (1) CN112286945A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113746635A (en) * 2021-08-18 2021-12-03 湖北文理学院 Method and device for improving PBFT (provider-based data transfer) consensus expandability, computing equipment and storage medium
CN114760198A (en) * 2022-01-17 2022-07-15 清华大学 Consensus method, device and system based on block chain network
CN116760703A (en) * 2023-08-16 2023-09-15 新华三技术有限公司 Configuration smoothing method, system, device and readable storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113746635A (en) * 2021-08-18 2021-12-03 湖北文理学院 Method and device for improving PBFT (provider-based data transfer) consensus expandability, computing equipment and storage medium
CN114760198A (en) * 2022-01-17 2022-07-15 清华大学 Consensus method, device and system based on block chain network
CN116760703A (en) * 2023-08-16 2023-09-15 新华三技术有限公司 Configuration smoothing method, system, device and readable storage medium
CN116760703B (en) * 2023-08-16 2023-11-21 新华三技术有限公司 Configuration smoothing method, system, device and readable storage medium

Similar Documents

Publication Publication Date Title
CN112286945A (en) Configuration changing method, system, equipment and medium based on PBFT algorithm
CN110730204B (en) Method for deleting nodes in block chain network and block chain system
TWI743881B (en) System and method for adding node in blockchain network
CN111080449B (en) Cross-chain transaction method of blockchain, management node and blockchain network
CN107040594A (en) The method and device of license block chain node access based on PBFT
CN111614468B (en) Block chain consensus method and system
Guerraoui et al. Dynamic byzantine reliable broadcast [technical report]
CN111767347B (en) Switching method and device of consensus algorithm, node equipment and storage medium
CN110784495B (en) Block chain-based discovery and configuration information management method for big data cluster system
JP2020522725A (en) Recovery of consensus system downtime
WO2017152860A1 (en) Heartbeat information sending method and device, and heartbeat sending node
CN111163148B (en) Synchronization method and related equipment for consensus state of block chain system
WO2020024615A1 (en) Consensus process recovery method and related nodes
CN110597918A (en) Account management method and device and computer readable storage medium
CN115632933A (en) PBFT algorithm-based cluster exception recovery method
CN111555858B (en) Practical Byzantine fault-tolerant consensus method based on block chain type storage
CN113923232B (en) Information synchronization method and device for block chain subnetwork
CN114363162A (en) Block chain log generation method and device, electronic equipment and storage medium
US20240054054A1 (en) Data Backup Method and System, and Related Device
CN111813606A (en) Fault-tolerant method, system, equipment and medium for double-node virtual machine
CN113630445B (en) Data storage method and device based on block chain network
CN110908801A (en) Data processing method and device based on block chain, computer equipment and storage medium
CN103780433B (en) Self-healing type virtual resource configuration management data architecture
CN116232893A (en) Consensus method and device of distributed system, electronic equipment and storage medium
CN113259466B (en) Block chain subnet operation state control method and block chain system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Li Wei

Inventor after: Qiu Weiwei

Inventor after: Huang Fanglei

Inventor after: Cai Liang

Inventor after: Zhang Shuai

Inventor after: Wang Guangren

Inventor before: Li Wei

Inventor before: Qiu Weiwei

Inventor before: Huang Fanglei

Inventor before: Cai Liang

Inventor before: Zhang Shuai