A secure CPBFT consensus method for large-scale manufacturing supply chains

By adopting the clustering algorithm MRCA grouping and conducting multiple rounds of CPBFT consensus in large-scale manufacturing supply chains, the security and efficiency issues of the CPBFT consensus method are solved, the security is improved and the impact of malicious nodes is reduced, which is suitable for large-scale manufacturing supply chains.

CN118944857BActive Publication Date: 2025-09-16NORTHEASTERN UNIV CHINA +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411264053.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2025-09-16
Estimated Expiration
2044-09-10

AI Technical Summary

Technical Problem

In existing technologies, the CPBFT consensus method has security risks in large-scale manufacturing supply chains, malicious nodes can easily succeed, and it is inefficient.

Method used

The clustering algorithm MRCA is used to group nodes, select the master nodes within the group and the master nodes between groups, and determine the final consensus result through multiple rounds of CPBFT consensus combined with the ratio of successful rounds of malicious nodes to reduce the impact of malicious nodes.

Benefits of technology

The security of CPBFT consensus in large-scale manufacturing supply chains is improved. Although the efficiency is slightly reduced, it is more suitable for large-scale manufacturing supply chains than CPBFT and PBFT.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118944857B_ABST
    Figure CN118944857B_ABST
Patent Text Reader

Abstract

This invention provides a secure CPBFT consensus method for large-scale manufacturing supply chains, relating to the field of blockchain technology. Nodes are first grouped using MRCA based on inter-node communication time, ensuring that each round of grouping results is distinct. CPBFT consensus is then performed based on the grouping results, determining the outcome of each round. Finally, consensus is determined based on the proportion of rounds in which malicious nodes successfully perform malicious actions, thereby reducing the impact of malicious nodes. While efficiency is slightly reduced, it is still significantly improved compared to PBFT. This invention improves the security of CPBFT at the expense of CPBFT's efficiency, and improves the efficiency of PBFT at the expense of its security. It is therefore more suitable for large-scale manufacturing supply chains than both CPBFT and PBFT.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and more specifically to a secure CPBFT consensus method in large-scale manufacturing supply chains. Background Art

[0002] Blockchain, with its advantages of decentralization, immutability, and transparency, facilitates collaboration among members in large-scale supply chains. Supply chain members collectively upload product-related data and vote on the consensus through a consensus method. This consensus data is then stored on the blockchain. Finding an efficient blockchain consensus method to improve system performance is crucial for ensuring security. Currently, PBFT (Practical Byzantine Fault Tolerance) is widely used, but its efficiency is significantly reduced in large-scale manufacturing supply chains with a large number of nodes. CPBFT was proposed to address these issues, but it carries security risks, making it easier for malicious nodes to successfully carry out malicious operations. Therefore, a secure and efficient CPBFT consensus method suitable for large-scale manufacturing supply chains is needed.

[0003] Chinese patent "CN117560379A: Improved PBFT Algorithm Based on Reputation Synchronization and Grouped Consensus" proposes an improved PBFT algorithm based on reputation synchronization and grouped consensus. Based on node behavior, nodes are classified into four categories: high-reputation nodes, normal nodes, faulty nodes, and malicious nodes. Node management is elected through voting, and grouped consensus is introduced. This method improves consensus efficiency. However, the described technical solution, which classifies nodes based on reputation, relies on historical transactions. This reliability can be reduced if historical transactions are limited or if malicious nodes are disguised. Furthermore, elections cannot address the problem of malicious nodes colluding to vote for "accomplices." Therefore, this method poses security risks.

[0004] Chinese patent application "CN118069733A: Environmental Monitoring Data Storage Method Based on an Improved PBFT Algorithm" provides an environmental monitoring data storage method based on an improved PBFT algorithm. This method uses an improved AP clustering algorithm to group nodes in an environmental monitoring blockchain network. The PBFT consensus algorithm is then used to achieve intra-group consensus on data storage requests and inter-group consensus on the intra-group consensus results. This method addresses the existing issues of low functionality and low data value in electronic evidence data management. However, the described technical solution may increase the influence of malicious nodes. If the proportion of malicious nodes in a group is no less than 1 / 3, this will affect the group's intra-group consensus results. Furthermore, if the affected groups account for no less than 1 / 3, the inter-group consensus results will be affected, resulting in reduced security of the method. Summary of the Invention

[0005] In view of the shortcomings of the existing technology, the purpose of this invention is to propose a secure CPBFT consensus method in large-scale manufacturing supply chains, including:

[0006] Step 1: Determine the number of node groups k of the blockchain, calculate the total number of rounds r based on the number of node groups k, set the initial round number 1, and use the initial round number 1 as the current round number i;

[0007] Step 2: In the current round number i, according to the number of node groups k, all nodes of the blockchain are grouped using the MRCA (Multi-Rounds Clustering Algorithm) clustering algorithm to obtain k groups of nodes. In each group, the cluster center of the group is selected as the in-group master node, resulting in k in-group master nodes. Among all nodes except the k in-group master nodes, all nodes are ordinary nodes. Among the k in-group master nodes, one in-group master node is selected as the inter-group master node.

[0008] Step 3: Based on the inter-group master nodes, intra-group master nodes, and ordinary nodes in each group, CPBFT consensus is performed on the received transaction consensus request to obtain a consensus result. The consensus request includes the content of the transaction, and the consensus result indicates whether the malicious node has successfully performed the malicious operation or the consensus has passed.

[0009] Step 4: Determine whether the current round number i has reached the total number of rounds r. If the current round number i has reached the total number of rounds r, execute step 5. If the current round number i has not reached the total number of rounds r, increase the current round number i by one and return to step 2 until the current round number i has reached the total number of rounds r.

[0010] Step 5: Determine the number of consensus results indicating successful malicious behavior by malicious nodes among all rounds of consensus results, and determine the final consensus result based on the ratio of the number of consensus results indicating successful malicious behavior by malicious nodes to the number of consensus results in all rounds. If the ratio of the number of consensus results indicating successful malicious behavior by malicious nodes to the number of consensus results in all rounds is greater than one-half, the final consensus result indicates that the malicious node has finally succeeded in its malicious behavior. If the ratio of the number of consensus results indicating successful malicious behavior by malicious nodes to the number of consensus results in all rounds is less than one-half, the final consensus result indicates that a final consensus has been reached.

[0011] Step 6: Send the final consensus result to all nodes.

[0012] Optionally, in step 2, all nodes of the blockchain are grouped using the Multi-Rounds Clustering Algorithm (MRCA) to obtain k groups of nodes. In each group, the cluster center of the group is selected as the master node within the group, and k master nodes within the group are obtained. Specifically, the following steps are included:

[0013] Step 2.1: Select initial cluster centers from all nodes to obtain k initial cluster centers, and use the k initial cluster centers as k current cluster centers;

[0014] Step 2.2: In the current iteration, for each node except the k current cluster centers, determine the current cluster center with the minimum communication duration based on the communication duration between the node and each current cluster center, and add the node to the group corresponding to the current cluster center with the minimum communication duration to obtain k groups of nodes;

[0015] Step 2.3: For each of the k groups of nodes, for each node in the group, obtain the communication duration between the node and every other node in the group except the node itself. Add the communication duration between the node and all other nodes in the group except the node itself to obtain the total communication duration of the node. Among the total communication durations of all nodes, obtain the node with the shortest total communication duration as the cluster center, and obtain k cluster centers.

[0016] Step 2.4: Determine whether the k cluster centers of the current iteration are the same as the k cluster centers of the previous iteration. If the k cluster centers of the current iteration are the same as the k cluster centers of the previous iteration, use the k cluster centers of the current iteration as the final k cluster centers, and use the final k cluster centers as the k master nodes within the group; if the k cluster centers of the current iteration are different from the k cluster centers of the previous iteration, use the k cluster centers of the current iteration as the k current cluster centers, and return to step 2.2 until the k cluster centers of the current iteration are the same as the k cluster centers of the previous iteration.

[0017] Optionally, the initial cluster centers selected in step 2.1 include:

[0018] All the nodes are configured with numbers, and the numbers start from 0, so the initial cluster centers are the nodes corresponding to the numbers from (i-1)*k to i*k-1.

[0019] Optionally, step 3 specifically includes:

[0020] The inter-group master node receives the consensus request and sends the consensus request to all the master nodes in the group. After each master node in the group receives the consensus request, it sends the consensus request to the ordinary nodes in the group. For each group, all nodes in the group reach a consensus on the consensus request. Then, all the master nodes in the group reach a consensus between the groups based on the consensus result in the group. There are malicious nodes in the group. The malicious nodes are ordinary nodes or master nodes in the group. When reaching a consensus on the consensus request, for each group, the number of malicious nodes in the group is determined. It is judged whether the ratio of the number of malicious nodes in the group to the total number of nodes in the group is less than one-third. If the ratio of the number of node groups that have successfully committed malicious acts to the total number of nodes in the group is not less than one-third, the group is regarded as a node group where the malicious node has successfully committed malicious acts. Then, among all node groups, the number of node groups where the malicious node has successfully committed malicious acts is determined, and it is judged whether the ratio of the number of node groups where the malicious node has successfully committed malicious acts to the total number of node groups is less than one-third, so as to obtain a consensus result. If the ratio of the number of node groups where the malicious node has successfully committed malicious acts to the total number of node groups is not less than one-third, the consensus result indicates that the malicious node has successfully committed malicious acts. If the ratio of the number of node groups where the malicious node has successfully committed malicious acts to the total number of node groups is less than one-third, the consensus result indicates that the consensus has been passed.

[0021] Optionally, the total number of rounds calculated according to the number of node groups k in step 1 is implemented by the following formula:

[0022]

[0023] Where r is the total number of rounds, and k%2 is the formula for calculating the remainder.

[0024] Optionally, the total number of rounds is not greater than the number k of node groups.

[0025] Optionally, the difference between the number of all nodes in each group and the number of node groups k is less than a preset threshold.

[0026] The beneficial effects of adopting the above technical solution are:

[0027] This paper proposes a secure CPBFT consensus method for large-scale manufacturing supply chains. This method first uses the MRCA clustering algorithm to group nodes based on inter-node communication time, ensuring that each round of grouping results is distinct. CPBFT (Concurrent Practical Byzantine Fault Tolerance) consensus is then performed based on the grouping results. The results of each consensus round are then determined. Finally, the proportion of rounds in which malicious nodes successfully perform malicious actions is considered to determine whether consensus has been reached, thereby reducing the impact of malicious nodes. While this method achieves slightly lower efficiency, it is still more efficient than PBFT. This method improves the security of CPBFT at the expense of CPBFT's efficiency, and improves the efficiency of PBFT at the expense of its security. This method is more suitable for large-scale manufacturing supply chains than both CPBFT and PBFT. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 This is a flowchart of a secure CPBFT consensus method in a large-scale manufacturing supply chain according to an embodiment of the present invention;

[0029] Figure 2 This is an example diagram of the MRCA grouping results for each round in an embodiment of the present invention;

[0030] Figure 3 An example diagram of the process of each round of CPBFT consensus in an embodiment of the present invention;

[0031] Figure 4 Schematic diagram comparing the security of the embodiment of the present invention and CPBFT under 16 nodes;

[0032] Figure 5 Schematic diagram comparing the security of the embodiment of the present invention and CPBFT under 49 nodes;

[0033] Figure 6 Schematic diagram comparing the security of the embodiment of the present invention and CPBFT under 100 nodes;

[0034] Figure 7 Schematic diagram comparing the efficiency of the embodiment of the present invention and CPBFT under 16 nodes;

[0035] Figure 8 Schematic diagram comparing the efficiency of the embodiment of the present invention and CPBFT under 49 nodes;

[0036] Figure 9 Schematic diagram comparing the efficiency of the embodiment of the present invention and CPBFT under 100 nodes. DETAILED DESCRIPTION

[0037] The following embodiments of the present invention are described in further detail with reference to the accompanying drawings and examples. The following examples are used to illustrate the present invention but are not intended to limit the scope of the present invention.

[0038] In view of the problems existing in the prior art, the present invention provides a secure CPBFT consensus method in a large-scale manufacturing supply chain. Specifically, the CPBFT consensus method is improved by using the clustering algorithm MRCA and performing multi-round consensus. Therefore, the method of the present invention can also be called MRRCPBFT (Multi-Rounds Regrouping Concurrent PracticalByzantine Fault Tolerance), which can be understood as multi-round regrouping CPBFT, and then combined with Figure 1 , the present invention may include the following steps:

[0039] Step 1: Determine the number of node groups k of the blockchain, and calculate the total number of rounds based on the number of node groups k; set the initial round number, and use the initial round number 1 as the current round number i;

[0040] The total number of rounds is calculated based on the number of node groups k using the following formula:

[0041]

[0042] Where r is the total number of rounds, and k%2 is the formula for calculating the remainder.

[0043] The total number of rounds is not greater than the number of node groups k. Where n is the number of nodes.

[0044] Step 2: In the current round number i, according to the number of node groups k, all nodes of the blockchain are grouped by the clustering algorithm MRCA to obtain k groups of nodes. In each group, the cluster center of the group is selected as the in-group master node to obtain k in-group master nodes. Among all the nodes except the k in-group master nodes, the nodes are ordinary nodes. One in-group master node is selected from the k in-group master nodes as the inter-group master node. In a specific implementation, the inter-group master node can be a default, or a certain in-group master node can be designated as the inter-group master node. The present invention defaults to or designates the in-group master node of the first group as the inter-group master node.

[0045] The difference between the number of all nodes in each group and the number of node groups k is less than a preset threshold, which can also be understood as the number of node groups k being close to the number of all nodes in each group.

[0046] Among them, all nodes of the blockchain are grouped by the clustering algorithm MRCA to obtain k groups of nodes. In each group, the cluster center of the group is selected as the master node in the group, and k master nodes in the group are obtained. The specific steps include:

[0047] Step 2.1: Select initial cluster centers from all nodes to obtain k initial cluster centers, and use the k initial cluster centers as k current cluster centers;

[0048] When selecting the initial cluster center, it can specifically include: all nodes are configured with numbers, and the numbers start from 0, then the initial cluster center is the node corresponding to the number from (i-1)*k to i*k-1, for example, when k is 4 and i is 1, the nodes in the initial group are numbered from 0 to 3.

[0049] Step 2.2: In the current iteration, for each node except the k current cluster centers, determine the current cluster center with the minimum communication duration based on the communication duration between the node and each current cluster center, and add the node to the group corresponding to the current cluster center with the minimum communication duration to obtain k groups of nodes;

[0050] It should be noted that the communication duration is obtained before step 1. Specifically, before step 1, the two nodes communicate with each other, and the communication duration between the two nodes can be obtained. From this, the communication duration of a node with all other nodes can be obtained. Based on this, step 2.2 can divide the node groups according to the communication duration.

[0051] Step 2.3: For each of the k groups of nodes, for each node in the group, obtain the communication duration between the node and every other node in the group except the node itself. Add the communication duration between the node and all other nodes in the group except the node itself to obtain the total communication duration of the node. Among the total communication durations of all nodes, obtain the node with the shortest total communication duration as the cluster center, and obtain k cluster centers.

[0052] For example, the nodes in the group are node 0, node 4, node 5 and node 7, among which node 0 is the main node in the group. Then, the communication duration between node 0 and node 4, the communication duration between node 0 and node 5, and the communication duration between node 0 and node 7 are obtained, and these three communication durations are added together to obtain the total communication duration of node 0; for node 4, the communication duration between node 4 and node 0, the communication duration between node 4 and node 5, and the communication duration between node 4 and node 7 are obtained, and the total communication duration of node 4 is added together; the same is true for nodes 5 and 7; among the total communication duration of node 0, the total communication duration of node 4, the total communication duration of node 5 and the total communication duration of node 7, the node with the shortest total communication duration is obtained as the cluster center, and the same is true for other groups. Each group obtains a cluster center, and k cluster centers can be obtained.

[0053] Step 2.4: Determine whether the k cluster centers of the current iteration are the same as the k cluster centers of the previous iteration. If the k cluster centers of the current iteration are the same as the k cluster centers of the previous iteration, use the k cluster centers of the current iteration as the final k cluster centers, and use the final k cluster centers as the k master nodes within the group; if the k cluster centers of the current iteration are different from the k cluster centers of the previous iteration, use the k cluster centers of the current iteration as the k current cluster centers, and return to step 2.2 until the k cluster centers of the current iteration are the same as the k cluster centers of the previous iteration.

[0054] It should be noted that when the computer program is executed, it can also be determined whether to terminate the process based on whether the number of iterations reaches a preset number of iterations.

[0055] Combine Figure 2 The above process is demonstrated by taking 16 nodes grouped in 4×4 format as an example to show the grouping results of each round of MRCA. In the figure, pj represents the node numbered j. For example, p1 is the node numbered 1. Group 0 represents the 0th node group, and group 1 represents the 1st node group. The grouped node groups are used to achieve intra-group consensus and inter-group consensus.

[0056] Step 3: Based on the inter-group master nodes, intra-group master nodes, and ordinary nodes in each group, CPBFT consensus is performed on the consensus request of the received transaction to obtain the consensus result.

[0057] Wherein, the consensus request includes the content of the transaction;

[0058] Step 3 specifically includes: the inter-group master node receives the consensus request, sends the consensus request to all the master nodes in the group, and after each master node in the group receives the consensus request, sends the consensus request to the ordinary nodes in the group. For each group, all nodes in the group reach a consensus on the consensus request. Then, all the master nodes in the group reach a consensus between the groups based on the consensus result in the group. There are malicious nodes in the group. The malicious nodes are ordinary nodes or master nodes in the group. When reaching a consensus on the consensus request, for each group, the number of malicious nodes in the group is determined, and whether the ratio of the number of malicious nodes in the group to the total number of nodes in the group is less than one-third, and the number of malicious nodes in the group is determined. If the ratio of the number of malicious nodes to the total number of nodes in the group is not less than one-third, the group will be regarded as a node group where malicious nodes have successfully committed malicious acts. Then, among all node groups, the number of node groups where malicious nodes have successfully committed malicious acts will be determined, and it will be judged whether the ratio of the number of node groups where malicious nodes have successfully committed malicious acts to the total number of node groups is less than one-third, so as to obtain a consensus result. If the ratio of the number of node groups where malicious nodes have successfully committed malicious acts to the total number of node groups is not less than one-third, the consensus result indicates that the malicious node has successfully committed malicious acts. If the ratio of the number of node groups where malicious nodes have successfully committed malicious acts to the total number of node groups is less than one-third, the consensus result indicates that the consensus has been passed.

[0059] In practice, each round of CPBFT consensus can be achieved through the following steps:

[0060] In each round of CPBFT consensus, each group executes PBFT consensus at the same time. The master node in each group then executes PBFT consensus based on the consensus result of the group. Figure 3 , the specific implementation steps are:

[0061] Step A1: Request - The client sends a request to the inter-group master node;

[0062] Step A2: Intra-group broadcast - the inter-group master node forwards the request to other master nodes in the group;

[0063] Step A3: Pre-preparation within the group - each master node in the group forwards the request to the ordinary nodes of its group;

[0064] Step A4: Intra-group preparation - each ordinary node in the group sends the received intra-group preparation message to other nodes in the group;

[0065] Step A5: Intra-group commit—each node sends an intra-group commit message to other nodes in the group;

[0066] Step A6: Inter-group pre-preparation - the inter-group master node forwards the inter-group request to the inter-group common nodes;

[0067] Step A7: Inter-group preparation - each other node in the group sends the inter-group pre-prepare message it receives to other master nodes in the group;

[0068] Step A8: Inter-group commit—each master node in the group sends an inter-group commit message to the master nodes in other groups;

[0069] Step A9: Inter-group Response - The master node in each group sends the response result of the request to the client. If the client receives responses from at least 1 / 3 of the node groups that meet the requirement of "the number of malicious nodes in the group is at least 1 / 3", it means that the malicious node has succeeded. Otherwise, it means that consensus has been reached.

[0070] Step 4: Determine whether the current round number i has reached the total number of rounds r. If the current round number i has reached the total number of rounds r, execute step 5. If the current round number i has not reached the total number of rounds r, increase the current round number i by one and return to step 2 until the current round number i has reached the total number of rounds r.

[0071] Step 5: Determine the number of consensus results that indicate successful malicious behavior of malicious nodes among all rounds of consensus results, and determine the final consensus result based on the ratio of the number of consensus results that indicate successful malicious behavior of malicious nodes to the number of consensus results of all rounds. If the ratio of the number of consensus results that indicate successful malicious behavior of malicious nodes to the number of consensus results of all rounds is greater than one-half, the final consensus result indicates that the malicious nodes have finally succeeded in their malicious behavior. If the ratio of the number of consensus results that indicate successful malicious behavior of malicious nodes to the number of consensus results of all rounds is less than one-half, the final consensus result indicates that the final consensus has been reached.

[0072] Step 6: Send the final consensus result to all nodes.

[0073] This paper uses the Hyperledger Fabric platform to build consortium chains with 16, 49, and 100 nodes on an Ubuntu virtual machine system. MRRCPBFT, CPBFT, and PBFT are deployed on these consortium chains, respectively. Three sets of randomly generated raw data are used: the first set is 0.67MB in size and contains 1,000 transactions; the second set is 6.71MB in size and contains 10,000 transactions; and the third set is 67.14MB in size and contains 100,000 transactions.

[0074] Among them, PBFT reaches consensus when the number of malicious nodes does not exceed (n-1) / 3 (where n is the total number of blockchain nodes).

[0075] (1) Security experiment: When the number of nodes and the original data are the same, the proportion of malicious nodes that successfully perform malicious operations in MRRCPBFT is significantly lower than that in CPBFT. As the number of nodes increases, the probability of malicious nodes successfully performing malicious operations in MRRCPBFT and CPBFT decreases, especially for 100 nodes, the probability of MRRCPBFT is negligible. However, since the number of malicious nodes is less than 1 / 3 of the total number of nodes, the proportion of malicious nodes that successfully perform malicious operations in PBFT is always 0, which is always lower than that in MRRCPBFT and CPBFT. Specifically, MRRCPBFT improves security by about 90.1% compared to CPBFT and reduces security by about 1.3% compared to PBFT. The security comparison of MRRCPBFT and CPBFT under 16, 49 and 100 nodes is as follows: Figure 4 、 Figure 5 and Figure 6 As shown;

[0076] (2) Efficiency experiment: When the number of nodes is the same and the original data is the same, the average execution time of MRRCPBFT is between CPBFT and PBFT, but the efficiency disadvantage of MRRCPBFT relative to CPBFT is significantly smaller than the efficiency advantage of PBFT. Specifically, MRRCPBFT is about 82% less efficient than CPBFT and about 385% more efficient than PBFT; in addition, as the number of nodes increases, the average consensus time of MRRCPBFT, CPBFT, and PBFT all increases, among which the increase of MRRCPBFT is greater than that of CPBFT and less than that of PBFT. The efficiency comparison of MRRCPBFT and CPBFT under 16, 49, and 100 nodes is as follows: Figure 7 、 Figure 8 and Figure 9 As shown;

[0077] In summary, MRRCPBFT improves the security of CPBFT at the expense of CPBFT's efficiency, and improves the efficiency of PBFT at the expense of PBFT's security. Therefore, the MRRCPBFT consensus method is more suitable for large-scale manufacturing supply chains than CPBFT and PBFT.

[0078] The above description is merely a preferred embodiment of the present disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also encompass other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned inventive concept. For example, a technical solution formed by mutually replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure.

Claims

1. A secure CPBFT consensus method for large-scale manufacturing supply chains, characterized by: include: Step 1: Determine the number of node groups k of the blockchain, calculate the total number of rounds r based on the number of node groups k, set the initial round number 1, and use the initial round number 1 as the current round number i; Step 2: In the current round number i, according to the number of node groups k, all nodes of the blockchain are grouped using the MRCA (Multi-Rounds Clustering Algorithm) clustering algorithm to obtain k groups of nodes. In each group, the cluster center of the group is selected as the in-group master node, resulting in k in-group master nodes. Among all nodes except the k in-group master nodes, all nodes are ordinary nodes. Among the k in-group master nodes, one in-group master node is selected as the inter-group master node. Step 3: Based on the inter-group master nodes, intra-group master nodes, and ordinary nodes in each group, the received transaction consensus request is subjected to CPBFT consensus to obtain the consensus result, which specifically includes: The inter-group master node receives a consensus request, which includes the content of the transaction, and sends the consensus request to all the master nodes in the group. After receiving the consensus request, each master node in the group sends the consensus request to the ordinary nodes in the group. For each group, all nodes in the group reach a consensus on the consensus request. Then, all the master nodes in the group reach a consensus between the groups based on the consensus result in the group. If there are malicious nodes in the group, the malicious nodes are ordinary nodes or master nodes in the group. When reaching a consensus on the consensus request, for each group, the number of malicious nodes in the group is determined, and it is determined whether the ratio of the number of malicious nodes in the group to the total number of nodes in the group is less than one-third. If the ratio of the number of malicious nodes in a group to the total number of nodes in the group is not less than one-third, the group is regarded as a node group where the malicious node has successfully committed malicious acts. Then, among all node groups, the number of node groups where the malicious node has successfully committed malicious acts is determined, and it is judged whether the ratio of the number of node groups where the malicious node has successfully committed malicious acts to the total number of node groups is less than one-third, so as to obtain a consensus result. If the ratio of the number of node groups where the malicious node has successfully committed malicious acts to the total number of node groups is not less than one-third, the consensus result indicates that the malicious node has successfully committed malicious acts. If the ratio of the number of node groups where the malicious node has successfully committed malicious acts to the total number of node groups is less than one-third, the consensus result indicates that the consensus has been passed. Step 4: Determine whether the current round number i has reached the total number of rounds r. If the current round number i has reached the total number of rounds r, execute step 5. If the current round number i has not reached the total number of rounds r, increase the current round number i by one and return to step 2 until the current round number i has reached the total number of rounds r. Step 5: Determine the number of consensus results indicating successful malicious behavior by malicious nodes among all rounds of consensus results, and determine the final consensus result based on the ratio of the number of consensus results indicating successful malicious behavior by malicious nodes to the number of consensus results in all rounds. If the ratio of the number of consensus results indicating successful malicious behavior by malicious nodes to the number of consensus results in all rounds is greater than one-half, the final consensus result indicates that the malicious node has finally succeeded in its malicious behavior. If the ratio of the number of consensus results indicating successful malicious behavior by malicious nodes to the number of consensus results in all rounds is less than one-half, the final consensus result indicates that a final consensus has been reached. Step 6: Send the final consensus result to all nodes.

2. The secure CPBFT consensus method in large-scale manufacturing supply chains according to claim 1 is characterized by: In step 2, all nodes of the blockchain are grouped using the Multi-Rounds Clustering Algorithm (MRCA) algorithm to obtain k groups of nodes. In each group, the cluster center of the group is selected as the master node within the group, and k master nodes within the group are obtained. The specific steps include: Step 2.1: Select initial cluster centers from all nodes to obtain k initial cluster centers, and use the k initial cluster centers as k current cluster centers; Step 2.2: In the current iteration, for each node except the k current cluster centers, determine the current cluster center with the minimum communication duration based on the communication duration between the node and each current cluster center, and add the node to the group corresponding to the current cluster center with the minimum communication duration to obtain k groups of nodes; Step 2.3: For each of the k groups of nodes, for each node in the group, obtain the communication duration between the node and every other node in the group except the node itself. Add the communication duration between the node and all other nodes in the group except the node itself to obtain the total communication duration of the node. Among the total communication durations of all nodes, obtain the node with the shortest total communication duration as the cluster center, and obtain k cluster centers. Step 2.4: Determine whether the k cluster centers of the current iteration are the same as the k cluster centers of the previous iteration. If the k cluster centers of the current iteration are the same as the k cluster centers of the previous iteration, use the k cluster centers of the current iteration as the final k cluster centers, and use the final k cluster centers as the k master nodes within the group; if the k cluster centers of the current iteration are different from the k cluster centers of the previous iteration, use the k cluster centers of the current iteration as the k current cluster centers, and return to step 2.2 until the k cluster centers of the current iteration are the same as the k cluster centers of the previous iteration.

3. The secure CPBFT consensus method in large-scale manufacturing supply chains according to claim 2 is characterized by: The selection of initial cluster centers in step 2.1 includes: All the nodes are configured with numbers, and the numbers start from 0, so the initial cluster centers are the nodes corresponding to the numbers from (i-1)*k to i*k-1.

4. The secure CPBFT consensus method in large-scale manufacturing supply chains according to claim 1 is characterized by: The total number of rounds calculated based on the number of node groups k in step 1 is achieved by the following formula: ; Where r is the total number of rounds and k%2 is the formula for calculating the remainder.

5. The secure CPBFT consensus method in large-scale manufacturing supply chains according to claim 1 is characterized by: The total number of rounds is not greater than the number k of node groups.

6. The secure CPBFT consensus method in large-scale manufacturing supply chains according to claim 1 is characterized by: The difference between the number of all nodes in each group and the number of node groups k is less than a preset threshold.

Citation Information

Patent Citations

  • Environment monitoring data storage method based on improved PBFT algorithm

    CN118069733A

  • Improved PBFT block chain consensus method

    CN111414420A

  • PBFT algorithm improvement based on reputation synchronization and grouping consensus

    CN117560379A