A method for byzantine fault tolerance of a replacement node
By using the Byzantine fault tolerance method for backup nodes in industrial network systems, the performance degradation and state inconsistency caused by node failures and malicious attacks are resolved, achieving rapid recovery and consistency of node states.
Patent Information
- Application Number
- CN202411349462.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2044-09-26
AI Technical Summary
Existing Byzantine fault tolerance methods may experience performance degradation and inconsistent node states when facing continuous node failures or malicious node attacks.
The Byzantine fault tolerance method with substitute nodes is adopted. By acquiring all nodes in the system, the current computing state node set and the candidate node set are divided. The bad nodes in the master node are replaced with substitute nodes until the master node is full of good nodes, ensuring that the system can quickly recover and maintain the consistency of node state after an error occurs.
It enables rapid recovery after errors occur, improves the performance of industrial network systems, maintains the consistency of node states, and avoids the occurrence of similar errors.
Smart Images

Figure CN119276689B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of industrial network technology, and in particular to a substitute node Byzantine fault tolerance method. Background Art
[0002] With the widespread adoption of distributed industrial network systems and blockchain technology, ensuring the system can operate normally despite the presence of Byzantine nodes has become an important research topic. Currently, Byzantine fault-tolerant algorithms are used, which ensure that the system can reach a consistent decision through multiple information exchanges and verifications when the majority of nodes are functioning properly.
[0003] However, traditional Byzantine fault tolerance methods can suffer from performance degradation and inconsistent node states when facing continuous node failures or malicious node attacks. Therefore, it is necessary to propose a replacement node Byzantine fault tolerance method that improves performance and maintains node state consistency. Summary of the Invention
[0004] The purpose of the present invention is to provide a replacement node Byzantine fault tolerance method, which aims to solve the technical problems of the Byzantine fault tolerance method in the prior art, which may cause performance degradation and inconsistent node status when facing continuous node failures or malicious node attacks.
[0005] To achieve the above objectives, the present invention adopts a replacement node Byzantine fault tolerance method, comprising the following steps:
[0006] Preparation phase: Get all nodes in the system, including master nodes and backup nodes, and divide them into the current computing state node set and the candidate node set;
[0007] Execute command: obtain a message set received by the client, and determine the node status of the master node according to the message set; the node status includes whether all nodes are good or there are bad nodes;
[0008] Status change: The substitute node is used to replace the bad node in the main node until all nodes in the main node are good nodes.
[0009] Among them, in the preparation stage: all nodes in the system are obtained, all nodes include main nodes and substitute nodes, and the current computing state node set and the candidate node set are divided into the steps:
[0010] The nodes in the current computing state node set are the main nodes that receive client commands, and the nodes in the candidate node set are the substitute nodes that do not participate in computing.
[0011] Among them, in the step of executing the command: obtaining a message set received by the client, and determining the node status of the master node according to the message set; wherein the node status includes whether all nodes are good nodes or there are bad nodes:
[0012] Suppose the current computing state node set is set A, which has 3f+1 nodes, one of which is the primary node p; the candidate node set is set B, which has at most f nodes; the message set is set E;
[0013] Determine the node status and trigger a status change when a bad node exists.
[0014] Among them, in the step of judging the node status and triggering the state change when there is a bad node:
[0015] When |E|=3f+1, it is determined that there is no error node in set A;
[0016] When |E|=2f+1, it is determined that there are f error nodes in the set E, and no error node is the master node;
[0017] When 2f+1<|E|<3f+1, it is determined that there are (0, f) error nodes in the set E, and no error node is a master node.
[0018] Among them, in the step of judging the node status and triggering the state change when there is a bad node:
[0019] When |E|<2f+1, the primary node p is judged to be a bad node, triggering a state change.
[0020] The present invention provides a Byzantine fault-tolerant method for substitute nodes. The method comprises the following steps: a preparation phase: obtaining all nodes in the system, including master nodes and substitute nodes, and dividing the nodes into a set of nodes in the current computing state and a set of candidate nodes; executing a command: obtaining a set of messages received by a client, and determining the node status of the master node according to the set of messages; wherein the node status includes all good nodes and some bad nodes; changing the state: replacing the bad nodes in the master node with the substitute nodes until the nodes in the master node are all good nodes; making most nodes in the industrial network system participate in computing, and a small number of nodes serve as substitutes; calling the node that receives the client command the master node; when the master node has a Byzantine error, considering using a substitute node that does not participate in computing to replace the master node, and excluding the master node that has exhibited Byzantine behavior from the industrial network system so that the master node will not participate in subsequent computing. By pre-setting a portion of nodes as substitutes, the method enables the industrial network system to quickly recover after an error occurs, and can ensure that similar errors will not occur after a certain number of master node Byzantine errors occur, thereby improving performance and maintaining node state consistency. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0022] Figure 1 It is a schematic diagram of the steps of the substitute node Byzantine fault tolerance method of the present invention.
[0023] Figure 2 It is a flowchart of the substitute node Byzantine fault tolerance method of the present invention.
[0024] Figure 3 It is a program diagram of Algorithm 1 of the present invention.
[0025] Figure 4 It is a program diagram of Algorithm 2 of the present invention.
[0026] Figure 5 It is a program diagram of Algorithm 3 of the present invention. DETAILED DESCRIPTION
[0027] Exemplary embodiments are described in detail herein, with examples illustrated in the accompanying drawings. When the following description refers to the drawings, identical numerals in different drawings represent identical or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with this application.
[0028] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. As used in this application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0029] It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0030] See also Figures 1 to 5 ,in Figure 1 This is a schematic diagram of the steps of the substitute node Byzantine fault tolerance method. Figure 2 This is a flowchart of the substitute node Byzantine fault tolerance method. Figure 3 This is the program diagram of Algorithm 1. Figure 4 This is the program diagram of Algorithm 2. Figure 5 This is the program diagram of Algorithm 3.
[0031] The present invention has the following definitions:
[0032] The client requests the industrial network system to execute a command. There are at most f nodes in the system that may have errors. Assume that there are n = 4f + 1 nodes in the system. Consider f nodes as substitutes and do not participate in the calculation.
[0033] Signature: Node i sends a message msg(x)i with a signed content x. Good nodes will not accept unsigned messages.
[0034] State: The current computational state of the system, S, consists of 3f+1 nodes, one of which is the master node, p. A state change is triggered when the master node becomes a Byzantine node.
[0035] Request: For example, the request Request(c, t) sent by client u to the primary node p u , where c is the command that client u wants the system to execute and t is a timestamp.
[0036] Record: Record R is a sequence of commands c1, c2, .... If the last command is c k , then the record is recorded as R k The record of node r is represented by R r .
[0037] Candidate: Candidate B is a set of candidate nodes in the current state, and there are at most f nodes. When the state change is triggered, B[0] will be selected as the main node. At the same time, this node will no longer exist in the new candidate set B', and B'[0]=B[1].
[0038] The present invention provides a Byzantine fault tolerance method for a substitute node, comprising the following steps:
[0039] S100: Preparation phase: Acquire all nodes in the industrial network system, including master nodes and backup nodes, and divide the nodes into a current computing state node set and a standby node set.
[0040] In this embodiment, all nodes in the industrial network system are obtained, all nodes include main nodes and substitute nodes, and are divided into a current computing state node set and a candidate node set; wherein the nodes in the current computing state node set are the main nodes that receive client commands, and the nodes in the candidate node set are the substitute nodes that do not participate in the calculation.
[0041] The specific procedure of step S100 is: Figure 3 The algorithm shown in 1:
[0042] Set A is the set of nodes participating in the current computation. The first node in Set A is considered the initial master node p. Set B is the candidate node, with a maximum of f nodes. Nodes that the client does not receive a reply from will not participate in this access.
[0043] S200: Execute command: obtain a message set received by the client, and determine the node status of the master node according to the message set; the node status includes whether all nodes are good or there are bad nodes.
[0044] In this embodiment, let the current computing state node set be set A, which contains 3f+1 nodes, one of which is the primary node p; the candidate node set be set B, which contains at most f nodes; the message set be set E; the node status is determined, and if a bad node is found, a state change is triggered;
[0045] When |E|=3f+1, it is determined that there is no error node in set A;
[0046] When |E|=2f+1, it is determined that there are f error nodes in the set E, and no error node is the master node;
[0047] When 2f+1<|E|<3f+1, it is determined that there are (0, f) error nodes in the set E, and no error node is the master node;
[0048] When |E|<2f+1, the primary node p is judged to be a bad node, triggering a state change.
[0049] The specific procedure of step S200 is: Figure 4 Algorithm 2 shown in:
[0050] In this step, the Response(d, PR) received in E r If they come from the correct node, they must be consistent, that is, R u , R p , R rIt is consistent. When |E|=3f+1, it means there is no error node in A; when |E|=2f+1, there are f error nodes in E, and no error node is the main node; when 2f+1<|E|<3f+1, it means there are (0, f) error nodes in E, and no error node is the main node.
[0051] In the above three cases, both the client and the system can assume that the command is completed correctly, because the client will receive at least 2f+1 replies of correctly executed commands, which must be greater than That is, more than half of the nodes in the system have run the command correctly.
[0052] When |E| < 2f+1, it indicates that the master node p has an error. The master node p may be down, resulting in the failure to forward the client's command to the node A. It may also be a Byzantine behavior, such as broadcasting different tampered commands to different nodes. In this case, the client uses INeedBackup(p) u The message informs the system that there is a bad node p and it is hoped that this node will be replaced. At this time, the system state change is triggered.
[0053] S300: Status change: The bad node in the master node is replaced by the substitute node until all nodes in the master node are good nodes.
[0054] In this embodiment, after determining that there is a bad node, the substitute node is used to replace the bad node in the main node until all nodes in the main node are good nodes.
[0055] The specific procedure of step S300 is: Figure 5 The algorithm shown in 3:
[0056] Since in Algorithm 1, each time the algorithm is successfully executed, the client will send the latest R u Inform the replacement node. Therefore, the good nodes in the replacement node must have the same R u So for the newly elected master node p', R p’ , it must be R u and R r The prefix of R u and R r The extra content may be the command that was not completed successfully and triggered the state change c k Therefore, after the state change is completed, the client re-initiates the execution of this command. If the command is successfully completed, the state change is considered successful; if it cannot be completed, the state change is considered failed, the master node is still an error node, and the state change will be triggered again.
[0057] For each if condition in Algorithm 3, a timeout mechanism can be set. If the timeout is not completed, the current state change can be considered a failure. For example, in line 3 of Algorithm 3, if |H| ≤ f after a certain period of time, this may be a Byzantine node attempting to cause a state change.
[0058] In the present invention, three steps are adopted: preparation stage, command execution, and state change, among which: preparation stage: obtain all nodes in the system, all nodes include main nodes and substitute nodes, and divide the current computing state node set and the standby node set.
[0059] Execute command: obtain the message set received by the client, and determine the node status of the master node according to the message set; the node status includes whether all nodes are good nodes or there are bad nodes.
[0060] Status change: The substitute node is used to replace the bad node in the main node until all nodes in the main node are good nodes.
[0061] In the preparation state, the node that first responds to the client u participates in the calculation, which to a certain extent ensures that the nodes participating in the calculation are relatively fast in response and have faster network communication.
[0062] When the system is in an error-free state, only three communication rounds are required to complete the command: u→p, p→r, r→u. When there is a Byzantine fault in a non-master node, five communication rounds are required to complete the command.
[0063] When there is a Byzantine node in the initial state of the computation, and that node happens to be the primary node, there are f-1 Byzantine nodes in the backup set. In this case, the system will generate at most f state changes, after which the system can exclude all Byzantine nodes so that they will never participate in the computation again.
[0064] Since the good nodes among the substitute nodes will definitely receive the latest R broadcast by the client u , this can also be used to exclude possible Byzantine nodes from the substitute nodes.
[0065] Through the above process, most nodes in the industrial network system participate in computations, while a small number of nodes serve as backups. The node that receives client commands is called the master node. When a master node experiences a Byzantine fault, a backup node that is not participating in the computation is considered to replace the master node. The master node exhibiting Byzantine behavior is then excluded from the industrial network system, preventing it from participating in future computations. By preemptively using a portion of nodes as backups, this method enables the industrial network system to quickly recover after an error occurs. Furthermore, after a certain number of master node Byzantine faults occur, similar errors will not occur again, thereby improving performance and maintaining node state consistency.
[0066] Those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the contents disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of this application and include common knowledge or customary techniques in the art that are not disclosed in this application.
[0067] It will be understood that the present application is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof.
Claims
1. A Byzantine fault tolerance method for a substitute node, characterized in that: The steps include: Preparation phase: Get all nodes in the system, including master nodes and backup nodes, and divide them into the current computing state node set and the candidate node set; Execute command: obtain a message set received by the client, and determine the node status of the master node according to the message set; the node status includes whether all nodes are good or there are bad nodes; State change: using the substitute node to replace the bad node in the master node until all nodes in the master node are good nodes; in the preparation stage: obtaining all nodes in the system, all nodes including master nodes and substitute nodes, and dividing the current computing state node set and the candidate node set: The nodes in the current computing state node set are the main nodes that receive client commands, and the nodes in the candidate node set are the substitute nodes that do not participate in computing.
2. The substitute node Byzantine fault tolerance method according to claim 1, characterized in that: In the step of executing the command: obtaining a message set received by the client, and determining the node status of the master node according to the message set; wherein the node status includes whether all nodes are good or there are bad nodes: Assume that the current computing state node set is set A, and there are nodes, one of which is the master node ; The candidate node set is set B, and there is at most Node; message collection is a collection ; Determine the node status and trigger a status change when a bad node exists.
3. The substitute node Byzantine fault tolerance method according to claim 2, characterized in that: When judging the node status, when there is a bad node, the step of triggering the status change: when When , it is determined that there is no error node in set A; when When , the judgment set Existence Error nodes, and no error node is the master node; when When , the judgment set Existence There are error nodes, and no error node is the master node.
4. The substitute node Byzantine fault tolerance method according to claim 3, characterized in that: When judging the node status, when there is a bad node, the step of triggering the status change: when When the master node A bad node triggers a state change.
Citation Information
Patent Citations
A method to enhance the reliability of the cluster and a high reliability communication node
CN101217402A
Collection of state information by nodes in a cluster to handle cluster management after master-node failover
US12066907B1