Safe CPBFT consensus method in large-scale manufacturing industry supply chain

Through the Multi-Rounds Clustering Algorithm, the security and efficiency issues of CPBFT in large-scale manufacturing supply chains are solved, and higher security and efficiency are achieved.

CN118944857AActive Publication Date: 2024-11-12NORTHEASTERN UNIV CHINA +1
View PDF 3 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the large-scale manufacturing supply chain, the existing CPBFT consensus method poses security risks, malicious nodes are prone to commit evil and are inefficient, and the existing improved methods affect security when the proportion of malicious nodes is high.

Method used

Multi-Rounds Clustering Algorithm (MRCA) is used to group blockchain nodes, and the clustering center is selected as the main node in the group. The final consensus result is determined through CPBFT consensus and the round results are combined to reduce the impact of malicious nodes.

Benefits of technology

It improves the security of CPBFT and the efficiency of PBFT, reduces the impact of malicious nodes, and is suitable for large-scale manufacturing supply chains.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118944857A_ABST
    Figure CN118944857A_ABST
Patent Text Reader

Abstract

The invention provides a secure CPBFT consensus method in a large-scale manufacturing industry supply chain, and relates to the technical field of block chains, the method comprises the steps of firstly grouping nodes according to communication time among the nodes by using MRCA, ensuring that grouping results of each round are different, then performing CPBFT consensus according to the grouping results, and further determining the result of each round of consensus; finally, whether a consensus is achieved or not is determined according to the round proportion of successful dismissal of the malicious nodes, so that the influence of the malicious nodes is reduced, and although the efficiency is slightly reduced, the efficiency is improved compared with PBFT. According to the method, the safety of the CPBFT is improved at the cost of reducing the efficiency of the CPBFT, the efficiency of the PBFT is improved at the cost of reducing the safety of the PBFT, and the method is more suitable for large-scale manufacturing of supply chains than the CPBFT and the 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 in particular to a secure CPBFT consensus method in a large-scale manufacturing supply chain. Background Art

[0002] Blockchain has the advantages of decentralization, immutability and transparency, which promotes cooperation among members in large-scale supply chains. Supply chain members jointly upload product-related data, vote to accept through consensus methods, and then store the consensus data on the blockchain. Finding an efficient blockchain consensus method to improve system performance is an important guarantee for security. At present, PBFT (Practical Byzantine Fault Tolerance) is widely used, however, its efficiency is greatly reduced in large-scale manufacturing supply chains with a large number of nodes. In order to solve the above problems, CPBFT was proposed, but it has security risks and malicious nodes are more likely to succeed. Therefore, a safe and efficient CPBFT consensus method suitable for large-scale manufacturing supply chains is needed.

[0003] The Chinese patent "CN117560379A PBFT algorithm improvement based on reputation synchronization and group consensus" proposes an improvement to the PBFT algorithm based on reputation synchronization and group consensus. According to the node behavior, the nodes are divided into four categories: high reputation nodes, ordinary nodes, faulty nodes and malicious nodes; nodes are managed by voting and group consensus is introduced. This method improves the efficiency of consensus. However, the technical solution described therein is classified according to the reputation value, which is based on historical transactions. If there are few historical transactions or malicious nodes are disguised, the reliability of the reputation value will be reduced; at the same time, elections cannot solve the problem of joint evil, that is, the problem of malicious nodes cooperating to vote for "accomplices". Therefore, this method has security risks.

[0004] The Chinese patent "CN118069733A Environmental Monitoring Data Storage Method Based on Improved PBFT Algorithm" provides an environmental monitoring data storage method based on an improved PBFT algorithm. It uses an improved AP clustering algorithm to group several nodes in the environmental monitoring blockchain network; uses the PBFT consensus algorithm to perform intra-group consensus on data storage requests, and inter-group consensus on intra-group consensus results. This method solves the problems of low functionality and low data value of electronic evidence data management in the prior art. However, the technical solution described therein may lead to an increase in the influence of malicious nodes. If the proportion of malicious nodes in a group is not less than 1 / 3, it will affect the intra-group consensus result of the group; then, if the proportion of affected groups is not less than 1 / 3, the inter-group consensus result will be affected, resulting in a reduction in the security of the method. Summary of the invention

[0005] In view of the shortcomings of the prior art, the purpose of the present invention is to propose a secure CPBFT consensus method in a large-scale manufacturing supply chain, including:

[0006] Step 1: Determine the number of node groups k of the blockchain, calculate the total number of rounds r according to 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 by the clustering algorithm MRCA, i.e. Multi-RoundsClustering Algorithm, 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. Among all the nodes except the k master nodes in the group, the nodes are ordinary nodes. One master node in the group is selected from the k master nodes in the group as the inter-group master node;

[0008] Step 3: According to the inter-group master nodes, the intra-group master nodes, and the ordinary nodes in each group, the received transaction consensus request is subjected to CPBFT consensus to obtain a consensus result. The consensus request includes the content of the transaction, and the consensus result indicates that the malicious node has succeeded in its malicious behavior or the consensus has been passed;

[0009] Step 4: Determine whether the current round number i reaches the total number of rounds r. If the current round number i reaches the total number of rounds r, execute step 5. If the current round number i does not reach the total number of rounds r, add one to the current round number i and return to execute step 2 until the current round number i reaches the total number of rounds r.

[0010] Step 5: among all the consensus results of the rounds, determine the number of consensus results that indicate that the malicious node has successfully performed malicious operations, and determine the final consensus result according to the ratio of the number of consensus results that indicate that the malicious node has successfully performed malicious operations to the number of consensus results of all the rounds. When the ratio of the number of consensus results that indicate that the malicious node has successfully performed malicious operations to the number of consensus results of all the rounds is greater than one-half, the final consensus result indicates that the malicious node has finally successfully performed malicious operations. When the ratio of the number of consensus results that indicate that the malicious node has successfully performed malicious operations to the number of consensus results of all the rounds is less than one-half, the final consensus result indicates that the 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 by using a clustering algorithm MRCA, i.e., Multi-Rounds Clustering Algorithm, to obtain k groups of nodes. In each group, the cluster center of the group is selected as the master node in the group to obtain k master nodes in the group, which specifically includes the following steps:

[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 number, for each node except the k current cluster centers among all nodes, determine the current cluster center corresponding to the minimum communication duration according to the communication duration between the node and each current cluster center, and add the node to the group corresponding to the current cluster center corresponding to 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 each other node in the group except the node, add the communication duration between the node and all other nodes in the group except the node to obtain the total communication duration of the node, and obtain the node with the shortest total communication duration as the cluster center among the total communication durations of all nodes, so as to 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 they are the same, 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 not the same as 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 execute 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, 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 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, and then the number of node groups where the malicious node has successfully committed malicious acts is determined among all node groups, 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 of node groups k.

[0025] Optionally, a 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] The present invention proposes a secure CPBFT consensus method in a large-scale manufacturing supply chain. First, the clustering algorithm MRCA is used to group nodes according to the communication time between nodes, and the grouping results of each round are guaranteed to be different. Then, CPBFT (Concurrent Practical Byzantine Fault Tolerance) consensus is performed based on the grouping results, and the results of each round of consensus are determined. Finally, the proportion of rounds in which malicious nodes successfully commit malicious acts is combined to determine whether a consensus is reached to reduce the influence of malicious nodes. Although the efficiency is slightly reduced, it is improved compared with PBFT. The present invention improves the security of CPBFT at the cost of reducing the efficiency of CPBFT, and improves the efficiency of PBFT at the cost of reducing the security of PBFT. It is more suitable for large-scale manufacturing supply chains than CPBFT and PBFT. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0029] Figure 2 This is an example diagram of the result of each round of MRCA grouping 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 A schematic diagram showing the security comparison between the embodiment of the present invention and CPBFT under 16 nodes;

[0032] Figure 5 A schematic diagram showing the security comparison between the embodiment of the present invention and CPBFT under 49 nodes;

[0033] Figure 6 A schematic diagram showing the security comparison between the embodiment of the present invention and CPBFT under 100 nodes;

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

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

[0036] Fig. 9 A schematic diagram showing the efficiency comparison between the embodiment of the present invention and CPBFT under 100 nodes. DETAILED DESCRIPTION

[0037] The specific implementation of the present invention is further described in detail below in conjunction with 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 executing multiple rounds of 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 according to 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, 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 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 to obtain k master nodes in the group, which specifically includes the following steps:

[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 the 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 number, for each node except the k current cluster centers among all nodes, determine the current cluster center corresponding to the minimum communication duration according to the communication duration between the node and each current cluster center, and add the node to the group corresponding to the current cluster center corresponding to 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 each other node in the group except the node, add the communication duration between the node and all other nodes in the group except the node to obtain the total communication duration of the node, and obtain the node with the shortest total communication duration as the cluster center among the total communication durations of all nodes, so as to 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 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; 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 they are the same, 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 not the same as 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 execute 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] Combination Figure 2 The above process is demonstrated by taking 16 nodes grouped in 4×4 as an example for each round of MRCA grouping results. 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 a consensus result.

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

[0058] Step 3 specifically includes: the master node between groups 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 common 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 common 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 to the total number of nodes in the group is not less than one-third, the group is regarded as a node group where malicious nodes have successfully performed malicious acts. Then, among all node groups, the number of node groups where malicious nodes have successfully performed malicious acts is determined, and it is judged whether the ratio of the number of node groups where malicious nodes have successfully performed 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 performed 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 performed malicious acts. If the ratio of the number of node groups where malicious nodes have successfully performed 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 specific implementation, 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 common node in the group sends the received intra-group pre-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 node;

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

[0068] Step A8: Inter-group submission - each master node in the group sends an inter-group submission 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. When the number of node groups that the client receives that satisfies "the number of malicious nodes in the group is not less than 1 / 3" is not less than 1 / 3 of the total number of groups, it means that "the malicious node succeeds in doing evil"; otherwise, it means "consensus is reached";

[0070] Step 4: Determine whether the current round number i reaches the total number of rounds r. If the current round number i reaches the total number of rounds r, execute step 5. If the current round number i does not reach the total number of rounds r, add one to the current round number i and return to execute step 2 until the current round number i reaches the total number of rounds r.

[0071] Step 5: Among all the consensus results of the rounds, determine the number of consensus results that indicate that the malicious node has successfully performed malicious operations, and determine the final consensus result based on the ratio of the number of consensus results that indicate that the malicious node has successfully performed malicious operations to the number of consensus results of all the rounds. When the ratio of the number of consensus results that indicate that the malicious node has successfully performed malicious operations to the number of consensus results of all the rounds is greater than one-half, the final consensus result indicates that the malicious node has finally succeeded in performing malicious operations. When the ratio of the number of consensus results that indicate that the malicious node has successfully performed malicious operations to the number of consensus results of all the 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] The present invention builds alliance chains of 16, 49 and 100 nodes on the Ubuntu virtual machine system with the help of the Hyperledger Fabric platform. MRRCPBFT, CPBFT and PBFT are deployed on these alliance chains respectively. There are three groups of original data, all of which are randomly generated and have the same structure: the first group is 0.67MB in size and contains 1,000 transactions; the second group is 6.71MB in size and contains 10,000 transactions; the third group 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 successful malicious node implementation 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 at 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 at 16, 49, and 100 nodes is as follows: Figure 7 , Figure 8 and Fig. 9 As shown;

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

[0078] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. 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 cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) to form a technical solution.

Claims

1. A secure CPBFT consensus method in a large-scale manufacturing supply chain, characterized by: include: Step 1: Determine the number of node groups k of the blockchain, calculate the total number of rounds r according to 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 by the clustering algorithm MRCA, i.e. Multi-RoundsClustering Algorithm, 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. Among all the nodes except the k master nodes in the group, the nodes are ordinary nodes. One master node in the group is selected from the k master nodes in the group as the inter-group master node; Step 3: According to the inter-group master nodes, the intra-group master nodes, and the ordinary nodes in each group, the received transaction consensus request is subjected to CPBFT consensus to obtain a consensus result. The consensus request includes the content of the transaction, and the consensus result indicates that the malicious node has succeeded in its malicious behavior or the consensus has been passed; Step 4: Determine whether the current round number i reaches the total number of rounds r. If the current round number i reaches the total number of rounds r, execute step 5. If the current round number i does not reach the total number of rounds r, add one to the current round number i and return to execute step 2 until the current round number i reaches the total number of rounds r. Step 5: among all the consensus results of the rounds, determine the number of consensus results that indicate that the malicious node has successfully performed malicious operations, and determine the final consensus result according to the ratio of the number of consensus results that indicate that the malicious node has successfully performed malicious operations to the number of consensus results of all the rounds. When the ratio of the number of consensus results that indicate that the malicious node has successfully performed malicious operations to the number of consensus results of all the rounds is greater than one-half, the final consensus result indicates that the malicious node has finally successfully performed malicious operations. When the ratio of the number of consensus results that indicate that the malicious node has successfully performed malicious operations to the number of consensus results of all the rounds is less than one-half, the final consensus result indicates that the final consensus has been reached. Step 6: Send the final consensus result to all nodes.

2. The secure CPBFT consensus method in a large-scale manufacturing supply chain according to claim 1 is characterized in that: In step 2, all nodes of the blockchain are grouped by using the clustering algorithm MRCA, i.e. Multi-Rounds Clustering Algorithm, to obtain k groups of nodes. In each group, the cluster center of the group is selected as the master node in the group to obtain k master nodes in the group. Specifically, the following steps are included: 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 number, for each node except the k current cluster centers among all nodes, determine the current cluster center corresponding to the minimum communication duration according to the communication duration between the node and each current cluster center, and add the node to the group corresponding to the current cluster center corresponding to 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 each other node in the group except the node, add the communication duration between the node and all other nodes in the group except the node to obtain the total communication duration of the node, and obtain the node with the shortest total communication duration as the cluster center among the total communication durations of all nodes, so as to 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 they are the same, 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 not the same as 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 execute 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 a large-scale manufacturing supply chain according to claim 2 is characterized in that: The initial cluster centers selected in step 2.1 include: 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 a large-scale manufacturing supply chain according to claim 1 is characterized in that: Step 3 specifically includes: 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, 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 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, and then the number of node groups where the malicious node has successfully committed malicious acts is determined among all node groups, 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.

5. The secure CPBFT consensus method in a large-scale manufacturing supply chain according to claim 1 is characterized in that: The total number of rounds calculated according to the number of node groups k in step 1 is implemented by the following formula: Where r is the total number of rounds, and k%2 is the formula for calculating the remainder.

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

7. The secure CPBFT consensus method in a large-scale manufacturing supply chain according to claim 1 is characterized in that: 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

  • PBFT algorithm improvement based on reputation synchronization and grouping consensus

    CN117560379A

  • Environment monitoring data storage method based on improved PBFT algorithm

    CN118069733A

  • Improved PBFT block chain consensus method

    CN111414420A