A weak-centralized distributed environment consensus method based on ordering grouping

By employing a weakly centralized consensus mechanism of sorted grouping in the blockchain system, and by setting static and dynamic attributes for nodes to construct a complete binary tree grouping, high-score nodes are selected for consensus, thus solving the problems of large communication volume, slow transactions, and poor node scalability, and achieving more efficient transaction confirmation and system robustness.

CN116192865BActive Publication Date: 2025-11-18SHANXI UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202211618300.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-15
Publication Date
2025-11-18
Estimated Expiration
2042-12-15

Smart Images

  • Figure CN116192865B_ABST
    Figure CN116192865B_ABST
Patent Text Reader

Abstract

The application relates to a weak-centralized distributed environment consensus mechanism based on sorting grouping, which comprises the following steps: constructing a weak-centralized distributed system environment; setting static attributes and dynamic attributes for each node in the distributed environment respectively, obtaining static attribute values and dynamic attribute values of each node; respectively giving different weights to the static attribute values and the dynamic attribute values of each node, and calculating node scores; selecting nodes with the top K node scores as nodes participating in consensus; and arranging the obtained K nodes according to a standard data structure of a complete binary tree, and grouping based on the complete binary tree structure. The application reduces the number of nodes participating in consensus through sorting, improves the reliability of nodes in the system as a whole, can significantly reduce the communication volume in the whole system, reduces the system load, improves the confirmation speed of transactions, and effectively improves the node expansion capacity of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of blockchain technology, and specifically relates to a weakly centralized distributed consensus mechanism based on sorting and grouping. Background Technology

[0002] Consensus algorithms, one of the core underlying technologies of blockchain, originated from consensus protocols, or distributed consensus mechanisms, in the distributed domain. Their main function is to determine who among the distributed nodes is responsible for recording transactions and to ensure the completion of transactions, thus maintaining a consistent set of data throughout the system. Currently, consensus mechanisms in the blockchain field are generally divided into algorithms with Byzantine fault tolerance and those without. Based on the degree of centralization among the distributed nodes, system environments are categorized as fully centralized, partially decentralized (weakly centralized), and fully centralized. In any system environment, the execution efficiency of the consensus mechanism significantly impacts the operational efficiency of the blockchain system. Therefore, improving, optimizing, and innovating consensus mechanisms has always been a hot topic for blockchain technology researchers.

[0003] Currently, mainstream consensus algorithms include Proof-of-Work (PoW), Proof-of-Stake (PoS), RAFT, and Practical Byzantine Fault Tolerance (PBFT). PoW and PoS are Byzantine fault-tolerant algorithms applicable to public blockchains. They involve competing to solve mathematical problems through computational power to determine the right to record transactions. With the continuous accumulation of valid blocks, malicious nodes would need to expend enormous computational power to overturn existing blocks to launch an attack, which is mathematically impossible. Both PoW and PoS require significant computational power. While PoW has improved energy consumption by introducing the concept of coin age, both PoW and PoS blockchain systems suffer from slow transaction efficiency, typically only confirming a dozen or so transactions per hour, far below the requirements of the modern internet. The RAFT algorithm is suitable for systems without Byzantine faults. Based on state machine replication, it makes strong assumptions to reduce the number of states to consider, making it easier to understand and implement. However, it cannot handle Byzantine faults. Although it improves execution efficiency, a Byzantine attack will directly cause the system to crash, resulting in extremely poor robustness for blockchain systems based on this algorithm, making it unsuitable for broader practical applications. The PBFT algorithm combines the advantages of the aforementioned centralized algorithms: it does not consume resources, has fast transaction confirmation speed and low latency, and also has Byzantine fault tolerance. It is widely used in the industry, such as in the well-known Hyperledger Fabric platform. However, PBFT also has its drawbacks. It does not clearly distinguish between system nodes, applying an indiscriminate node algorithm. In real-world applications, although in a distributed environment, there are still significant differences between nodes, which PBFT does not utilize, resulting in poor node scalability. Furthermore, the consensus protocol of the PBFT algorithm is based on two pairwise interactions between full nodes, and its execution protocol complexity is O(n log n). When the number of system nodes is small, it has good efficiency, but once the number of nodes increases slightly, the communication volume of the entire system will increase dramatically, and the system's transaction confirmation rate will decrease significantly. Summary of the Invention

[0004] The purpose of this invention is to provide a weakly centralized distributed consensus mechanism based on sorting and grouping, which can significantly reduce the amount of communication in the entire system, reduce the system load, and improve the transaction confirmation speed.

[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0006] A consensus mechanism for a weakly centralized distributed environment based on sorted grouping includes the following steps:

[0007] Construct a weakly centralized distributed system environment;

[0008] Node consensus is achieved based on the established weakly centralized distributed system environment;

[0009] The construction of a weakly centralized distributed system environment includes the following steps:

[0010] Set static and dynamic attributes for each node in the distributed environment, and obtain the static and dynamic attribute values ​​for each node;

[0011] Different weights are assigned to the static and dynamic attribute values ​​of each node, and the node score is calculated.

[0012] Select the K nodes with the highest node scores as the nodes participating in the consensus.

[0013] The obtained K nodes are arranged according to the standard data structure of a complete binary tree to construct a complete binary tree. Based on the complete binary tree structure, the nodes are grouped to form a weakly centralized distributed system environment.

[0014] Preferably, the static attributes are obtained by initially scoring the node based on its storage capacity, processor capacity, and clock frequency capacity, respectively, to obtain static parameters.

[0015] Preferably, the dynamic attribute is a value that is reassigned to each node as the weakly centralized distributed system environment operates.

[0016] Preferably, obtaining the static attribute value includes the following steps:

[0017] The static parameters are standardized using the deviation standardization method, and the static attribute values ​​are:

[0018]

[0019] in, This represents the standardized parameters, where N is the number of nodes; for:

[0020]

[0021] Where X is the initial score of the node, and MAX and MIN are the maximum and minimum values ​​of all nodes.

[0022] Preferably, obtaining the dynamic attribute value includes the following steps:

[0023] The dynamic attribute value is adjusted after each running cycle based on the node's performance.

[0024]

[0025] in, Feedback from the client.

[0026] Preferably, the node score is

[0027]

[0028] in, and The weights of static and dynamic attribute values.

[0029] Preferably, the grouping based on a complete binary tree structure includes the following steps:

[0030] The node with the highest score is set as the master node. The remaining nodes, excluding leaf nodes, are each used as a basic element. Combined with their parent node and left and right child nodes, they form basic groups. Each basic group contains four nodes.

[0031] Preferably, the node consensus includes the following steps:

[0032] Client construction <request>The message type is broadcast to the entire network, and all nodes in the system accept the transaction, verify it, and put it into their local transaction pool.

[0033] The master node retrieves the transactions to be uploaded to the blockchain from its local transaction pool and constructs the block. <precheck>And broadcast it to all nodes;

[0034] In a weakly centralized distributed system environment, each group's meta-node forwards block information within its group after receiving it and collects message receipts within the group. <checkresult>The message is returned to the master node;

[0035] Master node collection <checkresult>After the message, it was sent to the entire network. <commit>The message notifies all nodes to permanently save the transaction on the blockchain;

[0036] After the consensus node records the transaction on the blockchain, it sends it to the client. <reply>information;

[0037] Client collection <reply>After receiving the message, I confirmed that my transaction had been successfully recorded on the blockchain.

[0038] This invention reduces the number of nodes participating in the consensus process by sorting the nodes, thereby improving the overall reliability of the nodes within the system. It can significantly reduce the communication volume within the entire system, reduce the system load, increase the transaction confirmation speed, and effectively improve the system's node scalability. Attached Figure Description

[0039] Figure 1 This is a schematic diagram of the sorting and grouping method;

[0040] Figure 2 This is a node consensus simulation information forwarding diagram for the present invention. Detailed Implementation

[0041] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.

[0042] like Figure 1 As shown, the present invention provides a weakly centralized distributed consensus mechanism based on sorted grouping, comprising the following steps:

[0043] S1. Construct a weakly centralized distributed system environment;

[0044] The construction of a weakly centralized distributed system environment includes the following steps:

[0045] S11. Set static and dynamic attributes for each node in the distributed environment, and obtain the static and dynamic attribute values ​​for each node.

[0046] Specifically, in a distributed environment, there are n nodes, represented by a set. ,in Let be the i-th node. For each node, set a static attribute value s and a dynamic attribute value d to form a node set. , and This represents the static and dynamic attributes of node i.

[0047] Specifically, the static attributes are obtained by initially scoring the nodes based on their storage capacity, processor capacity, and clock frequency capacity; the dynamic attributes are values ​​that are reassigned to each node as the weakly centralized distributed system environment operates.

[0048] The process of obtaining static attribute values ​​includes the following steps:

[0049] S111. Using the deviation standardization method, linear transformation is applied to scores of different magnitudes. Weights are distributed evenly according to the static parameters, and the static attribute value s is standardized as follows:

[0050]

[0051] in, This represents the standardized parameters, where N is the number of nodes; for:

[0052]

[0053] Where X is the initial score of the node, and MAX and MIN are the maximum and minimum values ​​of all nodes.

[0054] The process of obtaining dynamic attribute values ​​includes the following steps:

[0055] S112. Based on the node's performance, adjustments are made after each running cycle. The dynamic attribute value d is:

[0056]

[0057] in, Feedback from the client.

[0058] S12. Assign different weights to the static and dynamic attribute values ​​of each node and calculate the node score.

[0059] Specifically, the static attribute value s and dynamic attribute value d obtained in steps S111 and S112 are assigned different weights. The node scores are calculated using a weighted formula. The node set at this point can be represented as

[0060] The node score is

[0061]

[0062] S13. Select the K nodes with the highest node scores as nodes participating in the consensus.

[0063] Specifically, the vectors in the node set obtained in step S12 are determined according to... The nodes are sorted, and the K nodes with the highest scores are selected as the nodes to participate in the consensus. These nodes are called consensus nodes. By sorting and comparing, the original global nodes are adjusted to be represented by local nodes.

[0064] S14. Arrange the obtained K nodes according to the standard data structure of a complete binary tree to construct a complete binary tree. Group the nodes based on the complete binary tree structure to form a weakly centralized distributed system environment.

[0065] Specifically, such as Figure 1 As shown, the K nodes obtained in step S13 are arranged according to the standard data structure of a complete binary tree, and the node set is represented as follows. , Let H represent the i-th node in a complete binary tree, and let H be the height of the tree. Then the following quantitative relationship is satisfied:

[0066]

[0067] The grouping based on a complete binary tree structure includes the following steps:

[0068] S141. Set the node with the highest node score as the master node. The remaining nodes, except for the leaf nodes, are each used as a basic element. Combined with its parent node and left and right child nodes, they form basic groups. Each basic group contains four nodes.

[0069] Specifically, based on the binary tree obtained in step S14, the root node... Set the node as the master node. All remaining nodes, except leaf nodes, are treated as basic elements. Combined with their parent node and left and right child nodes, they form basic groups. According to the complete binary tree structure, each basic group contains four nodes. At the same time, based on the number of elements in a complete binary tree, each group will then... With the binary tree as its core, the nodes in the binary tree logically form groups. In essence, it is still a distributed structure, but the binary tree structure is used to construct connections between the nodes, forming a weakly centralized environment. At this point, the weakly centralized environment based on sorted grouping has been constructed.

[0070] S2. Achieve node consensus based on the established weakly centralized distributed system environment.

[0071] like Figure 2 As shown, the node consensus includes the following steps:

[0072] Client construction <request>The message type is broadcast to the entire network, and all nodes in the system accept the transaction, verify it, and put it into their local transaction pool.

[0073] The master node retrieves the transactions to be uploaded to the blockchain from its local transaction pool and constructs the block. <precheck>And broadcast it to all nodes;

[0074] In a weakly centralized distributed system environment, each group's meta-node forwards block information within its group after receiving it and collects message receipts within the group. <checkresult>The message is returned to the master node;

[0075] The master node collects enough <checkresult>After the message, it was sent to the entire network. <commit>The message notifies all nodes to permanently save the transaction on the blockchain;

[0076] After the consensus node records the transaction on the blockchain, it sends it to the client. <reply>information;

[0077] The client collects enough <reply>After receiving the message, you can confirm that your transaction has been completed and uploaded to the blockchain, and you can initiate the next transaction.

[0078] Specifically, based on the constructed weakly centralized environment, a consistency protocol as shown in Table 1 is adopted to control the consistency of the system with the outside world.

[0079] < / reply> < / reply> < / commit> < / checkresult> < / checkresult> < / precheck> < / request> < / reply> < / reply> < / commit> < / checkresult> < / checkresult> < / precheck> < / request>

Claims

1. A consensus method for a weakly centralized distributed environment based on sorted grouping, characterized in that, Includes the following steps: Construct a weakly centralized distributed system environment; Node consensus is achieved based on the established weakly centralized distributed system environment; The construction of a weakly centralized distributed system environment includes the following steps: Set static and dynamic attributes for each node in the distributed environment, and obtain the static and dynamic attribute values ​​for each node; Different weights are assigned to the static and dynamic attribute values ​​of each node, and the node score is calculated. Select the K nodes with the highest node scores as the nodes participating in the consensus. The obtained K nodes are arranged according to the standard data structure of a complete binary tree to construct a complete binary tree. Based on the complete binary tree structure, the nodes are grouped to form a weakly centralized distributed system environment. The grouping based on a complete binary tree structure includes the following steps: The node with the highest score is set as the master node. The remaining nodes, except for the leaf nodes, are each used as a basic element. Combined with its parent node and left and right child nodes, they form basic groups. Each basic group contains four nodes. The node consensus mechanism includes the following steps: The client constructs a REQUEST message type and broadcasts it to the entire network. All nodes in the system accept the transaction, verify it, and put it into their local transaction pool. The master node retrieves the transactions ready to be uploaded to the blockchain from the local transaction pool, constructs a block PRECHECK, and broadcasts it to all nodes. In a weakly centralized distributed system environment, after each group's meta node receives the block information, it forwards it within the group and collects the acknowledgments of messages within the group to form a CHECKRESULT message, which is then returned to the master node. After the master node collects the CHECKRESULT message, it sends a COMMIT message to the entire network, notifying all nodes to permanently save the transaction on the blockchain. After the consensus node records the transaction on the blockchain, it sends a REPLY message to the client. After collecting the REPLY message, the client confirms that its transaction has been successfully recorded on the blockchain.

2. The consensus method for a weakly centralized distributed environment based on sorting and grouping as described in claim 1, characterized in that, The static attributes are obtained by initially scoring the node based on its storage capacity, processor capacity, and clock frequency capacity, respectively, to obtain static parameters.

3. The consensus method for a weakly centralized distributed environment based on sorting and grouping as described in claim 1, characterized in that, The dynamic attribute is a value that is reassigned to each node as the weakly centralized distributed system environment operates.

4. A consensus method for a weakly centralized distributed environment based on sorting and grouping as described in claim 2, characterized in that, Obtaining static property values ​​involves the following steps: The static parameters are standardized using the deviation standardization method, and the static attribute values ​​are: , in, This represents the standardized parameters, where N is the number of nodes; for: , Where X is the initial score of the node, and MAX and MIN are the maximum and minimum values ​​of all nodes.

5. A consensus method for a weakly centralized distributed environment based on sorting and grouping as described in claim 3, characterized in that, Obtaining dynamic attribute values ​​involves the following steps: The dynamic attribute value is adjusted after each running cycle based on the node's performance. , in, Feedback from the client.

6. A consensus method for a weakly centralized distributed environment based on sorting and grouping, as described in claim 4 or 5, characterized in that, The node score is , in, and The weights of static and dynamic attribute values.

Citation Information

Patent Citations

  • Vehicle network data consensus optimization storage method and storage system

    CN114449000A

  • Multilevel optimization PBFT consensus method based on node credibility

    CN114938292A

  • Packet Byzantine fault-tolerant algorithm based on dynamic trust model

    CN115271724A

  • DR-PBFT improved algorithm based on reputation value model

    CN115277722A