Configuration change method, system, device and medium based on PBFT algorithm
By consensus processing configuration transactions between master and slave nodes in the blockchain system, the problem of inefficiency in modifying system configurations is solved, and an efficient configuration modification process is realized.
Patent Information
- Application Number
- CN202010996265.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-21
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2040-09-21
AI Technical Summary
Blockchain systems that achieve consensus based on PBFT algorithm are inefficient when modifying system configurations, and need to shut down and restart nodes one by one, affecting data processing.
The configuration packet is generated through the master node receiving and packaging configuration transactions, setting the master node to the configuration state, and sending the configuration packet to the slave node. The slave node is set to the configuration state after the consensus is passed, and the configuration transaction is executed to modify the system configuration. The master node also performs configuration transactions to modify its system configuration.
The efficiency of blockchain system modifying node system configuration is improved, avoiding the process of shutdown and restarting one by one, and reducing the impact on data processing.
Smart Images

Figure CN112286945B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a configuration change method, system, device and medium based on a PBFT algorithm. Background Art
[0002] Blockchain is a distributed database that can securely store transaction information or other data. With the popularization of blockchain technology, business models based on blockchain (especially consortium blockchain) are becoming more common. In order to maintain the consistency of data stored in each node in the blockchain system, the Practical Byzantine Fault Tolerance (PBFT) algorithm is often used to achieve consensus to ensure data consistency.
[0003] In actual use, blockchain systems often need to modify the system configuration of each node in the system according to business needs. In related technologies, when modifying the system configuration of a blockchain system that achieves consensus based on the PBFT algorithm, all nodes in the blockchain system need to be shut down, and the operation and maintenance personnel need to modify the system configuration of each node in the blockchain system one by one, and then restart all nodes after the system configuration of all nodes has been modified. This one-by-one modification method is inefficient, and the shutdown and restart will seriously affect the data processing of the blockchain system.
[0004] Regarding the related technologies, the blockchain system that achieves consensus based on the PBFT algorithm has the problem of low efficiency in modifying the system configuration of each node, and no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present application provide a configuration change method, system, electronic device and storage medium based on the PBFT algorithm, so as to at least solve the problem of low efficiency in modifying the system configuration of each node in the blockchain system based on the PBFT algorithm to achieve consensus in the related art.
[0006] In a first aspect, an embodiment of the present application provides a configuration change method based on a PBFT algorithm, the method comprising:
[0007] The master node in the blockchain system receives and packages the configuration transaction to obtain a configuration package, and sets the state of the master node to the configuration state, wherein the configuration transaction includes operation information of the configuration modification;
[0008] The master node sends the configuration package to the slave node in the blockchain system, so that the slave node sets the state of the slave node to the configuration state after consensus is passed, 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;
[0009] The master node executes the configuration transaction in the configuration package to modify the system configuration of the master node according to the operation information in the configuration transaction.
[0010] In some embodiments, when each node in the blockchain system is configured with a generation number, wherein the generation number is a sequence number of the configuration transaction, after executing the configuration transaction in the configuration package, the method further includes:
[0011] A generation check process is performed to confirm that the own node enters a stable generation, wherein the own node includes the master node and the slave node.
[0012] In some embodiments, before the master node in the blockchain system receives and packages the configuration transaction to obtain a configuration package and sets the state of the master node to the configuration state, the method further includes:
[0013] Determine whether the own node is a backward node or the first node newly added to the blockchain system, wherein the own node includes the master node and the slave node;
[0014] If so, generation synchronization processing is performed to ensure that the node itself is in the same generation as other nodes in the blockchain system.
[0015] In some embodiments, the generation synchronization process includes:
[0016] The own node sends a generation synchronization request message to other nodes in the blockchain system, so that a first response node among the other nodes returns first feedback information according to the generation synchronization request message, wherein the generation synchronization request message includes a first generation number of the own node, a second generation number of the first response node is greater than the first generation number, and the first feedback message includes the second generation number and a generation start state, the second generation number is a sequence number of a first configuration transaction, and the generation start state is a block hash value of a block where the first configuration transaction is located;
[0017] When receiving 2f+1 pieces of the first feedback information with the same second generation number and the same generation start state, record the same second generation number as the target generation number, and record the same generation start state as the target block hash value, where f is the maximum number of nodes that may have problems in the blockchain system;
[0018] Recover the target block based on the PBFT algorithm, and execute the configuration transaction in the target block to update the system configuration of the own 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 target block hash value.
[0019] In some embodiments, before sending the generation synchronization request information to other nodes in the blockchain system, the generation synchronization process further includes:
[0020] Check whether the own node is executing a generation synchronization process or a configuration transaction, and if not, turn on a generation synchronization status bit, wherein the generation synchronization status bit is turned off after executing the configuration transaction in the target block.
[0021] In some embodiments, before or simultaneously with sending the generation synchronization request information to other nodes in the blockchain system, the generation synchronization process further includes:
[0022] The self node starts a generation synchronization timer. If the configuration transaction in the target block is not executed within the specified time of the generation synchronization timer, the started generation synchronization timer is re-executed.
[0023] In some embodiments, after executing the configuration transaction in the target block, the generation synchronization process further includes:
[0024] The own node updates the first generation number to the target generation number, and performs a generation check process to confirm that the own node has entered a stable generation.
[0025] In some embodiments, the generation check process includes:
[0026] The node sends a generation check request message to all nodes in the blockchain system, so that a second response node among all nodes returns second feedback information upon receiving the generation check request message, wherein the second feedback information includes a third generation number of the second response node;
[0027] When the third generation number in the received 2f+1 second feedback information is the same as the generation number of the own node, the own node enters a stable generation, where f is the maximum number of nodes that may have problems in the blockchain system.
[0028] In some embodiments, before or while sending the generation check request information to all nodes in the blockchain system, the generation check process further includes:
[0029] The node starts a generation check timer. If, within the specified time of the generation check timer, 2f+1 pieces of the second feedback information are received and the third generation number is the same as and smaller than the generation number of the node itself, the generation check timer is started again.
[0030] In some embodiments, after sending the generation check request information to all nodes in the blockchain system, the generation check process further includes:
[0031] When the third generation number in the received 2f+1 second feedback information is the same as and greater than the generation number of the own node, a generation synchronization process is performed to ensure that the own node is in the same generation as other nodes in the blockchain system.
[0032] In some embodiments, when each node in the blockchain system is configured with a generation number, determining whether the node itself is a backward node includes:
[0033] The own node receives a consensus message, wherein the consensus message includes a fourth generation number of a sending node;
[0034] When the fourth generation number in the received 2f+1 consensus messages is the same as and greater than the generation number of the own node, the own node is determined to be the backward node, where f is the maximum number of nodes that may have problems in the blockchain system.
[0035] In a second aspect, an embodiment of the present application provides a configuration change system based on the PBFT algorithm, wherein the system includes a packaging module, a consensus module, and a transaction execution module deployed on a blockchain:
[0036] The packaging module is used for the master node in the blockchain system to receive and package the configuration transaction to obtain a configuration package, and set the state of the master node to the configuration state, wherein the configuration transaction includes operation information of the configuration modification;
[0037] 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 the configuration state after the consensus is passed, 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;
[0038] The transaction execution module is used for the master node to execute the configuration transaction in the configuration package to modify the system configuration of the master node according to the operation information in the configuration transaction.
[0039] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the configuration change method based on the PBFT algorithm as described in the first aspect above is implemented.
[0040] In a fourth aspect, an embodiment of the present application provides a storage medium on which a computer program is stored. When the program is executed by a processor, the configuration change method based on the PBFT algorithm as described in the first aspect above is implemented.
[0041] Compared with the related art, the configuration change method based on the PBFT algorithm provided in the embodiment of the present application receives and packages the configuration transaction through the master node in the blockchain system to obtain the configuration package, and sets the state of the master node to the configuration state, wherein the configuration transaction includes the operation information of the configuration modification. The master node sends the configuration package to the slave node in the blockchain system, so that the slave node sets the state of the slave node to the configuration state after the consensus is passed, 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. The master node executes the configuration transaction in the configuration package to modify the system configuration of the master node according to the operation information in the configuration transaction, which solves the problem of low efficiency in modifying the system configuration of each node in the blockchain system that realizes consensus based on the PBFT algorithm, and improves the efficiency of the blockchain system in modifying the node system configuration. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0043] Figure 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;
[0044] Figure 2 is a flowchart of a configuration change method based on the PBFT algorithm according to an embodiment of the present application;
[0045] Figure 3 is a flow chart of generation synchronization processing according to an embodiment of the present application;
[0046] Figure 4 is a flow chart of a generation check process according to an embodiment of the present application;
[0047] Figure 5 is a flowchart of a method for changing the configuration of a first node according to an embodiment of the present application;
[0048] Figure 6 is a flowchart of a method for changing the configuration of an original node according to an embodiment of the present application;
[0049] Figure 7 is a flowchart of another generation inspection process according to an embodiment of the present application;
[0050] Figure 8is a schematic diagram of another process of generation synchronization processing according to an embodiment of the present application;
[0051] Fig. 9 is a structural diagram of a configuration change system based on a PBFT algorithm according to an embodiment of the present application;
[0052] Fig.10 It is a schematic diagram of the internal structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0054] Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in this field, the present application can also be applied to other similar scenarios based on these drawings without creative work. In addition, it can also be understood that although the efforts made in this development process may be complicated and lengthy, for ordinary technicians in this field related to the content disclosed in this application, some changes in design, manufacturing or production based on the technical content disclosed in this application are just conventional technical means, and should not be understood as insufficient content disclosed in this application.
[0055] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0056] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantitative limitation, and may represent the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects before and after are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0057] In order for a blockchain system to become a decentralized, honest and trustworthy system that is difficult to break, public, and cannot tamper with data records, it is necessary to make distributed data records secure, clear and irreversible in the shortest possible time. In different types of blockchain networks, in order to maintain the consistency of the ledger in each node that records the ledger, a consensus algorithm is usually used to ensure it. After a node (such as a unique node) generates a block, if the generated block is recognized by other nodes, the other nodes record the same block. The process of the generated block being recognized by other nodes is the consensus mechanism. The consensus mechanism is a mechanism for blockchain nodes to reach a consensus on block information across the entire network, which can ensure that the latest block is accurately added to the blockchain system. Alliance chain technology mainly targets the blockchain technology needs of large companies, government agencies and industrial alliances, and provides enterprise-level blockchain system solutions. The PBFT algorithm is the most commonly used consensus algorithm for alliance chains. The algorithm assumes that when there may be a maximum of 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 requirements and fault tolerance requirements of all nodes can be guaranteed.
[0058] Figure 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. The configuration change method based on a PBFT algorithm provided in the present application can be applied to Figure 1 In the application environment shown, the blockchain system includes a master node 11 and a slave node 12. Figure 1 The number of master nodes 11 and slave nodes 12 shown is schematic, and the actual number is determined by the business requirements of the blockchain system. The master node 11 and the slave node 12 communicate with each other through the network. When the master node 11 receives a configuration transaction, it directly packages the configuration transaction to generate a configuration package, which includes the operation information of the configuration modification, and sets the state of the master node 11 to the configuration state. The master node 11 sends the configuration package to the slave node 12. After the configuration package passes the consensus through the general PBFT consensus algorithm, the slave node 12 sets the state of the slave node 12 to the configuration state when it determines that the current transaction to be executed is the configuration transaction in the configuration package, and executes the configuration transaction in the configuration package, 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, thereby modifying the system configuration of the master node 11 according to the operation information in the configuration transaction.
[0059] This embodiment provides a configuration change method based on the PBFT algorithm. Figure 2 is a flowchart of a configuration change method based on a PBFT algorithm according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0060] S210, the master node in the blockchain system receives and packages the configuration transaction to obtain a configuration package, and sets the state of the master node to the configuration state. The configuration transaction includes the operation information of the configuration modification. The master node is usually always online and provides much more memory than ordinary slave nodes. In addition to verifying, saving and transmitting transactions, the master node sometimes promotes other events in the blockchain system according to its nature, such as voting events, execution of protocol operations and compliance with blockchain laws. In the general case where the master node does not receive a configuration transaction, it receives the consensus message and performs consensus message packaging processing. When the master node receives a configuration transaction, it directly packages the configuration transaction to generate a configuration package. The configuration package only contains one transaction and the transaction is a configuration transaction. The master node sets its own state to the configuration state. The master node cannot actively package transactions in this configuration state, and the master node suspends consensus message packaging processing.
[0061] S220, the master node sends a configuration package to the slave node in the blockchain system, so that the slave node sets the state of the slave node to the configuration state after the consensus is passed, 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.
[0062] The consensus process of the configuration package is the same as the general process of the PBFT algorithm, which specifically includes the pre-preparation phase, the preparation phase, the submission phase, and the response phase. In the pre-preparation phase, the master node sends a pre-preparation message to the slave node through broadcasting. The pre-preparation message includes the configuration package. In the preparation phase, after receiving the pre-preparation message, the slave node verifies that the configuration package is legal, broadcasts the preparation message to other nodes in the blockchain system, and receives the preparation messages broadcast by other nodes. After receiving 2f+1 preparation messages, the master node or slave node changes from the pre-preparation state to the preparation state. In the submission phase, the master node or slave node that enters the preparation state sends a submission message to other nodes and receives the submission messages broadcast by other nodes. After receiving 2f+1 submission messages, the master node or slave node changes from the preparation state to the submission state. In the response phase, the master node or slave node that enters the submission state returns a response message to the client that initiated the configuration transaction, that is, the node that initiated the configuration transaction in the blockchain system. When the client receives 2f+1 response messages, it means that the nodes in the blockchain system have reached a consensus on the configuration package.
[0063] After the configuration package consensus is passed, the transaction currently to be executed by the slave node is the configuration transaction in the configuration package. The slave node records the sequence number of the configuration transaction, sets the state of the slave node to the configuration state, requests to execute the configuration transaction, and waits for the configuration transaction in the configuration package to be completed, so that the system configuration of the slave node is modified according to the operation information in the configuration transaction.
[0064] S230, the master node executes the configuration transaction in the configuration package to modify the system configuration of the master node according to the operation information in the configuration transaction. After the configuration package consensus is passed, the transaction currently to be executed by the master node is the configuration transaction in the configuration package. The master node records the sequence number of the configuration transaction, requests to execute the configuration transaction, and waits for the completion of the execution of the configuration transaction, so that the system configuration of the master node is modified according to the operation information in the configuration transaction.
[0065] Based on the message interaction in the PBFT algorithm, each node in the blockchain system achieves a consensus on the configuration transaction in the configuration package, and then completes the operation of modifying the system configuration by executing the configuration transaction. There is no need for the operation and maintenance personnel to shut down all nodes and then modify the system configuration of each node one by one. This solves the problem of low efficiency in modifying the system configuration of each node in the blockchain system that achieves consensus based on the PBFT algorithm, improves the efficiency of modifying the system configuration of each node in the blockchain system, and will not affect the normal data processing of the blockchain system.
[0066] In some embodiments, when each node in the blockchain system is configured with a generation number, after executing the configuration transaction in the configuration package, the node itself performs a generation check process to confirm that the node itself has entered a new stable generation that can reach a consensus. The node itself includes a master node or a slave node. The generation number is the sequence 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. Multiple nodes with the same generation number indicate that these nodes have the same set of system configurations. Only nodes in the same generation can interact with consensus messages, and nodes in different generations only receive consensus messages but do not process them. In the PBFT consensus algorithm, when the total number of nodes in the blockchain system is 3f+1, since nodes in different generations cannot interact with each other with consensus messages, at least 2f+1 nodes in the same generation are required to complete the consensus, that is, it is necessary to ensure that the number of nodes entering the new generation is more than 2f+1 to ensure that they enter a stable generation that can reach a consensus.
[0067] After executing the configuration transaction in the configuration package, the master node performs a generation check process according to the generation number of the master node to confirm that the master node has entered a stable generation. The master node then enters a new generation and can interact with other nodes in the blockchain system for consensus messages and restart the consensus message packaging process. After executing the configuration transaction in the configuration package, the slave node performs a generation check process according to the generation number of the slave node to confirm that the slave node has entered a stable generation. The slave node then enters a new generation and can interact with other nodes in the blockchain system for consensus messages. By performing the generation check process, the entry of the own node into a stable generation is confirmed, which means that the own node can interact with other nodes in the blockchain for consensus messages in a new stable generation, thereby ensuring the data consistency between the own node and other nodes.
[0068] In some embodiments, before the master node in the blockchain system receives and packages the configuration transaction to obtain the configuration package and sets the state of the master node to the configuration state, the master node and the slave node respectively determine whether their own node is a lagging node or the first node newly added to the blockchain system. The lagging node is an existing node in the blockchain system, and the generation number of the lagging node is less than the generation number corresponding to the node entering the stable generation. At this time, the blockchain system can achieve consensus based on the PBFT algorithm, but the lagging node cannot interact with the node entering the stable generation for consensus messages. If the own node is a lagging node or the first node, then the own node performs generation synchronization processing to ensure that the own node is in the same generation as other nodes in the blockchain system, even if the lagging node or the first node can be in the same generation as other nodes in the blockchain system.
[0069] 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 consensus messages, thereby maintaining data consistency with other nodes. By executing the generation synchronization process, the generation number of the lagging node can be updated, so that the lagging node can interact with other nodes in the blockchain system through consensus messages, thereby maintaining data consistency with other nodes.
[0070] In some of these embodiments, Figure 3 is a flowchart of generation synchronization processing according to an embodiment of the present application, such as Figure 3 As shown, the process includes the following steps:
[0071] S310, the node itself sends a generation synchronization request message to other nodes in the blockchain system, so that the first response node among the other nodes returns the first feedback message according to the generation synchronization request message. The node itself is a node that is determined to be a lagging node or a first node in the blockchain system. The generation synchronization request message includes the first generation number of the node itself, the second generation number of the first response node is greater than the first generation number, and the first feedback message includes the second generation number and the generation start state. The second generation number is the sequence number of the first configuration transaction, and the generation start state is the block hash value of the block where the first configuration transaction is located. Each generation (i.e., each set of system configurations) corresponds to a generation start state, and nodes with the same system configuration have the same generation start state.
[0072] S320: When the node receives 2f+1 pieces of first feedback information with the same second generation number and the same generation start state, it records the same second generation number as the target generation number and the same generation start state as the target block hash value. f is the maximum number of nodes that may have problems in the blockchain system.
[0073] 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 target block hash value. The configuration transaction in the target block includes the first configuration transaction. The self-node recovers the missing blocks of the self-node locally with the help of other nodes in the blockchain system through the state transfer process in the PBFT algorithm, and executes the transactions in these blocks until the target block is recovered. The specific process of this state transfer process is the same as the state transfer process in the paper "Practical Byzantine faulttolerance and proactive recovery" published by Miguel Castro and Barbara Liskov in 2002. When executing the configuration transaction in the target block, the system configuration of the self-node can be modified to be consistent with the system configuration of 2f+1 first response nodes according to the operation information in the first configuration transaction.
[0074] Through this generation synchronization processing, the lagging node or the first node newly added in the blockchain system can modify the system configuration according to the operation information contained in the first configuration transaction in the target block, without the need for the operation and maintenance personnel to shut down all nodes and then modify the system configuration of the lagging node or the first node, thereby improving the efficiency of modifying the system configuration of the lagging node and the first node newly added in the blockchain system.
[0075] In some embodiments, before the self-node sends a generation synchronization request message to other nodes in the blockchain system, it checks whether the self-node is performing a generation synchronization process or performing a configuration transaction. The self-node is a node that is determined to be a lagging node or the first node in the blockchain system. If the self-node is not performing a generation synchronization process or performing a configuration transaction, the generation synchronization status bit is turned on, and the generation synchronization status bit is turned off after the configuration transaction in the target block is executed. If the self-node is performing a generation synchronization process or performing a configuration transaction, it means that the generation number of the self-node is temporarily behind. After the generation synchronization process is completed or the configuration transaction is completed, the system configuration of the self-node may be modified to be consistent with the system configuration of other nodes, and then be in the same generation as other nodes. Therefore, the self-node does not temporarily turn on the generation synchronization status bit at this time, nor does it send a generation synchronization request message, which reduces the execution steps of the generation synchronization process and improves the efficiency of modifying the system configuration of each node in the blockchain system as a whole.
[0076] In some embodiments, since each node may not be synchronized in the steps of completing consensus based on the PBFT algorithm, the execution of configuration transactions may be asynchronous, making the node temporarily unable to obtain 2f+1 first feedback information with the same second generation number and the same generation start state, which may cause the node to fail to complete the generation synchronization process. Therefore, before sending the generation synchronization request information to other nodes in the blockchain system or while sending the generation synchronization request information, the node starts the generation synchronization timer. If the 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 node completes the execution of the configuration transaction in the target block within the specified time of the generation synchronization timer.
[0077] In some of the embodiments, after executing 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 has entered a stable generation. The self-node is a node that is determined to be a lagging node or a first node in the blockchain system. The self-node sends a generation check request message to all nodes in the blockchain system so that the second response node among all nodes returns the second feedback message upon receiving the generation check request message. The second feedback message includes the third generation number of the second response node. When the self-node receives 2f+1 pieces of the second feedback message and the third generation number is the same as the generation number of the self-node, it means that the self-node has entered a stable generation. f is the maximum number of nodes that may have problems in the blockchain system.
[0078] By executing the generation check process, the lagging node or the first node updates and checks the identifier of the corresponding generation of the system configuration (i.e., the generation number) while completing the system configuration modification, to confirm that the generation number of the lagging node or the first node and other nodes in the blockchain system are in a new round of stable generations that can reach consensus, thereby ensuring the consistency of data on the lagging node or the first node and other nodes.
[0079] In some of these embodiments, Figure 4 is a flowchart of the generation inspection process according to an embodiment of the present application, such as Figure 4 As shown, the process includes the following steps:
[0080] S410, the node sends a generation check request message to all nodes in the blockchain system, so that the second response node among all nodes returns the second feedback message when receiving the generation check request message. The node includes a master node and a slave node, and the master node and the slave node can be the original nodes in the blockchain system or the first nodes newly added in the blockchain system. The second feedback message includes the third generation number of the second response node.
[0081] S420: When the third generation number in the received 2f+1 second feedback information is the same as the generation number of the own node, it means that the own node has entered a stable generation. f is the maximum number of nodes that may have problems in the blockchain system. The 2f+1 second feedback information includes the second feedback information sent by the own node.
[0082] By receiving the 2f+1 second feedback information, the generation number of each node in the blockchain system can be verified, further ensuring that the system configuration of each node is modified and that the blockchain system can reach a consensus to ensure the consistency of data in the blockchain system.
[0083] In some embodiments, since the steps of completing consensus based on the PBFT algorithm may not be synchronized among the nodes, the execution of configuration transactions may be asynchronous. When the node enters a new generation before other nodes, it is impossible to confirm whether the node has entered a new stable generation. The node includes a master node and a slave node. The master node and the slave node may be existing nodes in the blockchain system or the first node newly added to the blockchain system. Therefore, before sending a generation check request message to all nodes in the blockchain system or while sending a generation check request message, the node starts a generation check timer. If the third generation number in the second feedback message received in 2f+1 pieces is the same and smaller than the generation number of the node within the specified time of the generation check timer, it means that the node has entered a new generation before other nodes. The node restarts the generation check timer until other nodes have also entered a new generation, and then it can be confirmed that the node has entered a new stable generation.
[0084] In some embodiments, after sending a generation check request message to all nodes in the blockchain system, if the node receives 2f+1 pieces of second feedback information with the third generation number being the same as and greater than the generation number of the node itself, the node itself may have an exception when executing the configuration transaction, resulting in the node itself being in a backward generation. The node itself needs to perform generation synchronization processing to ensure that the node itself is in the same generation as other nodes in the blockchain system, so as to ensure that the node itself can interact with other nodes for consensus messages. The node itself includes a master node and a slave node, which can be an existing node in the blockchain system or a first node newly added to the blockchain system.
[0085] In some embodiments, the self-node receives a consensus message sent from the sending node, the self-node includes a master node and a slave node, and the consensus message includes the 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 fourth generation number 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 there are two situations here: if the fourth generation number in the consensus message is less than the generation number of the self-node, the self-node does not process the consensus message; if the fourth generation number in the 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 when the fourth generation number in the 2f+1 consensus messages is the same and greater than the generation number of the self-node, it is determined that the self-node is a backward node, and 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 blockchain system are in the same generation. The backward node is the original node of the blockchain system.
[0086] In some embodiments, before the master node packages the configuration transaction to obtain the configuration package, the master node or the slave node in the blockchain system stores the configuration transaction in the transaction pool when receiving the configuration transaction, and broadcasts the configuration transaction to other nodes in the blockchain system. The configuration transaction can be removed from the transaction pool after execution. When an exception occurs in the execution of the configuration transaction, the configuration transaction can be obtained from the transaction pool and executed again, which is conducive to solving the problem of abnormal execution of the configuration transaction.
[0087] In some of the embodiments, the present invention is described in detail in combination with the dynamic management of nodes in the alliance chain system that realizes consensus based on the PBFT algorithm. Assuming that there may be a maximum of f problem nodes in the alliance chain system, correspondingly, the total number of nodes in the alliance chain system is 3f+1, and the number of normal nodes is 2f+1. The nodes in the alliance chain system are distinguished by generations. A generation corresponds to a set of system configurations, and only nodes in the same generation can interact with consensus messages. Between nodes of different generations, in addition to receiving and processing related messages for generation inspection processing and related messages for generation synchronization processing, only consensus messages are received and not processed. Each generation corresponds to a generation number and a generation start state. The generation is identified by the generation number, and the generation number is the sequence number corresponding to the configuration transaction that caused this configuration change. Each configuration transaction will correspond to a sequence number. Each generation corresponds to a generation start state, and the generation start state is the block hash value of the block in which the configuration transaction that caused this configuration change is located.
[0088] The self-nodes in the alliance chain system include master nodes and slave nodes. In the general stage, the self-node receives the consensus message sent by the self-sending node, and the consensus message includes the 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 fourth generation number 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. There are two situations here: if the fourth generation number in the consensus message is less than the generation number of the self-node, the self-node does not process the consensus message; if the fourth generation number in the 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 when the fourth generation number in the 2f+1 consensus messages received is the same and greater than the generation number of the self-node, it is considered that the generation of the self-node may be behind, and enters the generation synchronization processing flow. Figure 5 is a flow chart of a configuration change method of a first node according to an embodiment of the present application, such as Figure 5 As shown, the first node is a newly added node in the alliance chain system. The first node directly enters the generation synchronization processing flow. After completing the generation synchronization processing, the first node is started.
[0089] Figure 6 1 is a flow chart of a method for changing the configuration of an existing node according to an embodiment of the present application. The existing node includes a master node and a slave node. Figure 6 As shown, in the configuration transaction receiving phase, when the original node in the alliance chain system receives a configuration transaction, it stores the configuration transaction in the transaction pool and broadcasts the configuration transaction to the remaining original nodes in the alliance chain system, so that the configuration transaction can be transmitted to each original node.
[0090] In the configuration transaction receiving phase, determine whether the original node is the master node in the alliance chain system. If so, directly package the configuration transaction to generate a configuration package. At the same time, set the state of the master node to the configuration state and suspend the subsequent consensus packaging process. If the original node is a slave node, set the configuration state of the slave node after detecting the configuration transaction in the transaction execution phase. The configuration package contains only one transaction and this transaction is a configuration transaction. The configuration state indicates a state in which the node is processing and executing the proposed configuration transaction. Nodes in this state cannot actively package transactions.
[0091] During the configuration transaction consensus phase, the configuration package completes the consensus phase through the general PBFT consensus algorithm.
[0092] In the configuration transaction execution phase, after the transaction consensus is completed, the transaction currently to be executed by the original node is the configuration transaction in the configuration package. If the original node is a slave node, the original node records the sequence number of the configuration transaction, enters the configuration state, and then executes the configuration transaction, and waits for the configuration transaction to be completed. If the original node is a master node, it requests to execute the configuration transaction and waits for the configuration transaction to be completed. When executing the configuration transaction, the original node will update the local system configuration according to the operation information contained therein.
[0093] In the generation switching phase, after waiting for the configuration transaction to be executed, the original node switches generations according to the configuration change items involved in the configuration transaction and updates the configuration of the synchronization consensus cluster. The original node sets its own generation number to the sequence number corresponding to the configuration transaction, triggering the generation check process. The original node that passes the check and verification enters a new round of generations, completes the generation switch of the original node, and restarts the consensus packaging process. The original node that fails the check and verification enters the generation check process for exception handling.
[0094] Through the above configuration change process, the newly added first node in the alliance chain system can execute the configuration transaction through generation synchronization processing to complete the system configuration of the first node. After the original master node and slave node in the alliance chain system reach a consensus on the configuration transaction in the configuration package, they execute the configuration transaction to complete the operation of modifying their respective system configurations. There is no need to shut down each original node in the alliance chain system and then modify the system configuration of each original node and the newly added first node one by one, which improves the efficiency of the alliance chain system in modifying the system configuration of each node, and will not affect the normal data processing of the alliance chain system.
[0095] Figure 7 2 is a flow chart of another generation check process according to an embodiment of the present application. The node that performs the generation check process may be an existing node in the alliance chain system or a newly added first node. Figure 7 As shown, in the request phase of the generation check processing flow, the node itself enters the generation check processing flow, turns on the generation check status bit of its own node for initialization, and broadcasts a generation check request message to all nodes in the alliance chain system.
[0096] Because the execution of each node in the PBFT consensus algorithm may not be synchronized, there may be a situation where a node enters a new generation before other nodes, resulting in the inability of the node to complete the generation check. Therefore, in the request phase of the generation check processing, the node starts a generation check timer. If the generation check is not completed within the specified time and causes a timeout, the node restarts the generation check processing process.
[0097] In the response phase of the generation check processing flow, after the second response node receives the generation check request information, it unicasts a second feedback message to its own node, and the own node contains the third generation number of the second response node.
[0098] In the check phase of the generation check processing flow, when the own node receives the second feedback messages from 2f + 1 different second response nodes, these 2f + 1 second feedback messages include the second feedback message sent by the own node, and the third generation numbers contained in these 2f + 1 second feedback messages are the same. Denote this same third generation number as the stable generation number e'. Then, according to the relationship between the generation number of the own node (denoted as e) and e', it is determined whether the own node has entered the stable generation.
[0099] In the PBFT consensus algorithm, when the total number of nodes is 3f + 1, at least 2f + 1 nodes need to reach an agreement to complete the consensus. Nodes in different generations cannot perform general consensus message interactions. Therefore, it is necessary to ensure that more than 2f + 1 nodes enter the new generation to ensure entering the stable generation where consensus can be performed. In the check phase of the generation check processing, comparing whether e and e' are the same includes the following situations: a. If they are the same, that is, e = e', it is considered that the own node has entered the stable generation, the generation check timer is turned off, and the generation check processing is completed; b. If the generation number of the own node is greater than the stable generation number, that is, e > e', it is considered that the own node has entered the new generation earlier than other nodes, waits for the generation check timer to time out, and the own node restarts the generation check processing flow; c. If the generation number of the own node is less than the stable generation number, that is, e < e', it is considered that the generation of the own node has lagged behind, and the generation check processing flow ends, and the own node enters the generation synchronization processing flow.
[0100] Figure 8 It is a schematic diagram of another generation synchronization processing flow according to an embodiment of the present application. The own node that executes this generation check processing can be the original lagging node in the consortium chain system or the newly added first node. As Figure 8 shown, in the preparation phase of the generation synchronization processing flow, when the own node is not in a round of generation synchronization processing and no configuration transaction processing is being performed, the own node starts the generation synchronization processing flow, exits the current generation, and initializes by turning on the one-round generation synchronization status bit of the own node.
[0101] In the request phase of the generation synchronization processing flow, the own node broadcasts a generation synchronization request message to other nodes in the consortium chain system. The generation synchronization request message contains the node information of the own node and the first generation number of the own node.
[0102] Because the execution of each node in the PBFT consensus algorithm may not be synchronized, there may be a situation where stable generation information cannot be obtained temporarily, resulting in the node itself being unable to complete generation synchronization. Therefore, during the request phase of generation synchronization processing, the node itself can start a generation synchronization timer. If the generation synchronization processing is not completed within the specified time and causes a timeout, the node itself restarts the generation synchronization processing process.
[0103] In the response phase of the generation synchronization process, the second generation number of the first response node is greater than the first generation number in the generation synchronization request message. After receiving the generation synchronization request message, the first response node unicasts a first feedback message to its own node. The first feedback message includes the second generation number and the generation start state of the first response node. The second generation number is the sequence number of the first configuration transaction, and the generation start state is the block hash value of the block where the first configuration transaction is located.
[0104] In the recovery phase of the generation synchronization process, when the self-node receives the first feedback information from 2f+1 different first response nodes, if the second generation numbers contained in these 2f+1 first feedback information are the same and the generation start state is the same, the same second generation number is recorded as the target generation number e1, and the generation number of the self-node is updated to e1. According to the state transfer process requirements in the PBFT algorithm, the value of e1 is used as the target block height h, and the consistent generation start state is used as the target block hash value d, and the self-node requests a state transfer process. Through the state transfer process in the PBFT algorithm, the self-node recovers the local missing blocks of the self-node with the help of other nodes in the alliance chain system, and executes the transactions in these blocks until it recovers to the target block with a height of h and a hash value of d.
[0105] At the end stage of the generation synchronization process, the node turns off the generation check timer and turns off a round of generation synchronization status bit, the generation synchronization process of the node ends, and enters the generation check process to check the generation number of the node.
[0106] The embodiment of the present application provides a configuration change system based on the PBFT algorithm. Fig. 9 is a structural diagram of a configuration change system based on a PBFT algorithm according to an embodiment of the present application, such as Fig. 9As shown, the system includes a packaging module 910, a consensus module 920 and a transaction execution module 930 deployed on the blockchain: the packaging module 910 is used for the master node in the blockchain system to receive and package the configuration transaction to obtain the configuration package, and set the state of the master node to the configuration state, wherein the configuration transaction includes the operation information of the configuration modification; the consensus module 920 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 the configuration state after the consensus is passed, 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; the transaction execution module 930 is used for the master node to execute the configuration transaction in the configuration package to modify the system configuration of the master node according to the operation information in the configuration transaction.
[0107] For the specific limitations of the configuration change system based on the PBFT algorithm, please refer to the limitations of the configuration change method based on the PBFT algorithm above, which will not be repeated here. Each module in the above-mentioned configuration change system based on the PBFT algorithm can be implemented in whole or in part through software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0108] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0109] 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.
[0110] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0111] In addition, in combination with the configuration change method based on the PBFT algorithm in the above embodiment, the embodiment of the present application can provide a storage medium for implementation. The storage medium stores a computer program; when the computer program is executed by the processor, any one of the configuration change methods based on the PBFT algorithm in the above embodiment is implemented.
[0112] In one embodiment, Fig.10 is a schematic diagram of the internal structure of an electronic device according to an embodiment of the present application, such as Fig.10 As shown, an electronic device is provided, which may be a server, and its internal structure diagram may be as shown in Fig.10As shown. The electronic device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile 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 the operating system and the computer program in the non-volatile storage medium. The database of the electronic device is used to store data. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a configuration change method based on the PBFT algorithm is implemented.
[0113] Those skilled in the art will understand that Fig.10 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0114] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchl ink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0115] Those skilled in the art should understand that the technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0116] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A configuration change method based on the PBFT algorithm, characterized in that: The method comprises: Determine whether the own node is a backward node or the first node newly added to the blockchain system, wherein the own node includes a master node and a slave node; If the node itself is a backward node or the first node newly added to the blockchain system, the node itself sends a generation synchronization request message to other nodes in the blockchain system, so that a first response node among the other nodes returns first feedback information according to the generation synchronization request message, wherein the generation synchronization request message includes the first generation number of the node itself, the second generation number of the first response node is greater than the first generation number, and the first feedback information includes the second generation number and a generation start state, the second generation number is the sequence number of the first configuration transaction, and the generation start state is the block hash value of the block where the first configuration transaction is located; When receiving 2f+1 pieces of the first feedback information with the same second generation number and the same generation start state, record the same second generation number as the target generation number, and record the same generation start state as the target block hash value, where f is the maximum number of nodes that may have problems in the blockchain system; Recover the target block based on the PBFT algorithm, and execute the configuration transaction in the target block to update the system configuration of the own 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 target block hash value, so as to ensure that the own node is in the same generation as other nodes in the blockchain system; The master node in the blockchain system receives and packages the configuration transaction to obtain a configuration package, and sets the state of the master node to the configuration state, wherein the configuration transaction includes operation information of the configuration modification; The master node sends the configuration package to the slave node in the blockchain system, so that the slave node sets the state of the slave node to the configuration state after consensus is passed, 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; The master node executes the configuration transaction in the configuration package to modify the system configuration of the master node according to the operation information in the configuration transaction.
2. The method according to claim 1, characterized in that In the case where each node in the blockchain system is configured with a generation number, wherein the generation number is a sequence number of the configuration transaction, after executing the configuration transaction in the configuration package, the method further includes: A generation check process is performed to confirm that the own node enters a stable generation, wherein the own node includes the master node and the slave node.
3. The method according to claim 1, characterized in that Before sending the generation synchronization request information to other nodes in the blockchain system, the generation synchronization process further includes: Check whether the own node is executing a generation synchronization process or a configuration transaction, and if not, turn on a generation synchronization status bit, wherein the generation synchronization status bit is turned off after executing the configuration transaction in the target block.
4. The method according to claim 1, characterized in that: Before or simultaneously with sending the generation synchronization request information to other nodes in the blockchain system, the generation synchronization process further includes: The self node starts a generation synchronization timer. If the configuration transaction in the target block is not executed within the specified time of the generation synchronization timer, the started generation synchronization timer is re-executed.
5. The method according to claim 1, characterized in that After executing the configuration transaction in the target block, the generation synchronization process further includes: The own node updates the first generation number to the target generation number, and performs a generation check process to confirm that the own node has entered a stable generation.
6. The method according to claim 2, characterized in that The generation check process includes: The node sends a generation check request message to all nodes in the blockchain system, so that a second response node among all nodes returns second feedback information upon receiving the generation check request message, wherein the second feedback information includes a third generation number of the second response node; When the third generation number in the received 2f+1 second feedback information is the same as the generation number of the own node, the own node enters a stable generation, where f is the maximum number of nodes that may have problems in the blockchain system.
7. The method according to claim 6, characterized in that Before or simultaneously with sending the generation check request information to all nodes in the blockchain system, the generation check process further includes: The node starts a generation check timer. If, within the specified time of the generation check timer, 2f+1 pieces of the second feedback information are received and the third generation number is the same as and smaller than the generation number of the node itself, the generation check timer is started again.
8. The method according to claim 6, characterized in that After sending the generation check request information to all nodes in the blockchain system, the generation check process further includes: When the third generation number in the received 2f+1 second feedback information is the same as and greater than the generation number of the own node, a generation synchronization process is performed to ensure that the own node is in the same generation as other nodes in the blockchain system.
9. The method according to claim 1, characterized in that: In the case where each node in the blockchain system is configured with a generation number, the step of determining whether the node itself is a backward node includes: The own node receives a consensus message, wherein the consensus message includes a fourth generation number of a sending node; When the fourth generation number in the received 2f+1 consensus messages is the same as and greater than the generation number of the own node, the own node is determined to be the backward node, where f is the maximum number of nodes that may have problems in the blockchain system.
10. A configuration change system based on the PBFT algorithm, characterized in that: The system includes a judgment module, a sending module, a marking module, an execution module, a packaging module, a consensus module and a transaction execution module deployed on the blockchain: The judgment module is used to judge whether the own node is a backward node or the first node newly added to the blockchain system, wherein the own node includes a master node and a slave node; The sending module is used for, if the node itself is a backward node or the first node newly added to the blockchain system, the node itself sends a generation synchronization request message to other nodes in the blockchain system, so that a first response node among the other nodes returns first feedback information according to the generation synchronization request message, wherein the generation synchronization request message includes a first generation number of the node itself, a second generation number of the first response node is greater than the first generation number, and the first feedback information includes the second generation number and a generation start state, the second generation number is a sequence number of a first configuration transaction, and the generation start state is a block hash value of a block where the first configuration transaction is located; The marking module is configured to record the same second generation number as the target generation number and the same generation start state as the target block hash value when receiving 2f+1 pieces of the first feedback information with the same second generation number and the same generation start state, wherein f is the maximum number of nodes that may have problems in the blockchain system; The execution module is used to restore the target block based on the PBFT algorithm, and execute the configuration transaction in the target block to update the system configuration of the own 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 target block hash value, so as to ensure that the own node and other nodes in the blockchain system are in the same generation; The packaging module is used for the master node in the blockchain system to receive and package the configuration transaction to obtain a configuration package, and set the state of the master node to the configuration state, wherein the configuration transaction includes operation information of the configuration modification; 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 the configuration state after the consensus is passed, 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; The transaction execution module is used for the master node to execute the configuration transaction in the configuration package to modify the system configuration of the master node according to the operation information in the configuration transaction.
11. An electronic device comprising a processor, a storage medium and a computer program, wherein the computer program is stored in the storage medium, wherein: When the computer program is executed by a processor, the configuration change method based on the PBFT algorithm according to any one of claims 1 to 9 is performed.
12. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the configuration change method based on the PBFT algorithm described in any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Consensus method and device based on blockchain, master node equipment and slave node equipment
CN111683118A